├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── CMakeLists.txt ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── esay │ │ └── ffmtool │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── cpp │ │ ├── cmdutils.c │ │ ├── cmdutils.h │ │ ├── cmdutils_common_opts.h │ │ ├── com_esay_ffmtool_FfmpegTool.h │ │ ├── com_mabeijianxi_jianxiffmpegcmd_Test.h │ │ ├── config.h │ │ ├── ffmpeg.c │ │ ├── ffmpeg.h │ │ ├── ffmpeg_filter.c │ │ ├── ffmpeg_opt.c │ │ ├── fram_rotate.c │ │ ├── fram_rotate.h │ │ ├── include │ │ │ ├── compat │ │ │ │ ├── aix │ │ │ │ │ └── math.h │ │ │ │ ├── atomics │ │ │ │ │ ├── dummy │ │ │ │ │ │ └── stdatomic.h │ │ │ │ │ ├── gcc │ │ │ │ │ │ └── stdatomic.h │ │ │ │ │ ├── pthread │ │ │ │ │ │ ├── stdatomic.c │ │ │ │ │ │ └── stdatomic.h │ │ │ │ │ ├── suncc │ │ │ │ │ │ └── stdatomic.h │ │ │ │ │ └── win32 │ │ │ │ │ │ └── stdatomic.h │ │ │ │ ├── avisynth │ │ │ │ │ ├── avisynth_c.h │ │ │ │ │ ├── avs │ │ │ │ │ │ ├── capi.h │ │ │ │ │ │ ├── config.h │ │ │ │ │ │ └── types.h │ │ │ │ │ ├── avxsynth_c.h │ │ │ │ │ └── windowsPorts │ │ │ │ │ │ ├── basicDataTypeConversions.h │ │ │ │ │ │ └── windows2linux.h │ │ │ │ ├── cuda │ │ │ │ │ ├── dynlink_cuda.h │ │ │ │ │ ├── dynlink_cuviddec.h │ │ │ │ │ ├── dynlink_loader.h │ │ │ │ │ └── dynlink_nvcuvid.h │ │ │ │ ├── dispatch_semaphore │ │ │ │ │ └── semaphore.h │ │ │ │ ├── float │ │ │ │ │ ├── float.h │ │ │ │ │ └── limits.h │ │ │ │ ├── getopt.c │ │ │ │ ├── msvcrt │ │ │ │ │ ├── snprintf.c │ │ │ │ │ └── snprintf.h │ │ │ │ ├── nvenc │ │ │ │ │ └── nvEncodeAPI.h │ │ │ │ ├── os2threads.h │ │ │ │ ├── plan9 │ │ │ │ │ ├── head │ │ │ │ │ ├── main.c │ │ │ │ │ └── printf │ │ │ │ ├── solaris │ │ │ │ │ └── make_sunver.pl │ │ │ │ ├── strtod.c │ │ │ │ ├── strtod.d │ │ │ │ ├── strtod.o │ │ │ │ ├── tms470 │ │ │ │ │ └── math.h │ │ │ │ ├── va_copy.h │ │ │ │ ├── w32dlfcn.h │ │ │ │ ├── w32pthreads.h │ │ │ │ └── windows │ │ │ │ │ ├── makedef │ │ │ │ │ └── mslink │ │ │ ├── libavcodec │ │ │ │ ├── avcodec.h │ │ │ │ ├── avdct.h │ │ │ │ ├── avfft.h │ │ │ │ ├── d3d11va.h │ │ │ │ ├── dirac.h │ │ │ │ ├── dv_profile.h │ │ │ │ ├── dxva2.h │ │ │ │ ├── jni.h │ │ │ │ ├── mediacodec.h │ │ │ │ ├── qsv.h │ │ │ │ ├── vaapi.h │ │ │ │ ├── vda.h │ │ │ │ ├── vdpau.h │ │ │ │ ├── version.h │ │ │ │ ├── videotoolbox.h │ │ │ │ ├── vorbis_parser.h │ │ │ │ └── xvmc.h │ │ │ ├── libavdevice │ │ │ │ ├── avdevice.h │ │ │ │ └── version.h │ │ │ ├── libavfilter │ │ │ │ ├── avfilter.h │ │ │ │ ├── avfiltergraph.h │ │ │ │ ├── buffersink.h │ │ │ │ ├── buffersrc.h │ │ │ │ └── version.h │ │ │ ├── libavformat │ │ │ │ ├── avformat.h │ │ │ │ ├── avio.h │ │ │ │ └── version.h │ │ │ ├── libavresample │ │ │ │ ├── Makefile │ │ │ │ ├── aarch64 │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── asm-offsets.h │ │ │ │ │ ├── audio_convert_init.c │ │ │ │ │ ├── audio_convert_neon.S │ │ │ │ │ ├── neontest.c │ │ │ │ │ ├── resample_init.c │ │ │ │ │ └── resample_neon.S │ │ │ │ ├── arm │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── asm-offsets.h │ │ │ │ │ ├── audio_convert_init.c │ │ │ │ │ ├── audio_convert_neon.S │ │ │ │ │ ├── neontest.c │ │ │ │ │ ├── resample_init.c │ │ │ │ │ └── resample_neon.S │ │ │ │ ├── audio_convert.c │ │ │ │ ├── audio_convert.h │ │ │ │ ├── audio_data.c │ │ │ │ ├── audio_data.h │ │ │ │ ├── audio_mix.c │ │ │ │ ├── audio_mix.h │ │ │ │ ├── audio_mix_matrix.c │ │ │ │ ├── avresample.h │ │ │ │ ├── avresampleres.rc │ │ │ │ ├── dither.c │ │ │ │ ├── dither.h │ │ │ │ ├── internal.h │ │ │ │ ├── libavresample.v │ │ │ │ ├── options.c │ │ │ │ ├── resample.c │ │ │ │ ├── resample.h │ │ │ │ ├── resample_template.c │ │ │ │ ├── tests │ │ │ │ │ └── avresample.c │ │ │ │ ├── utils.c │ │ │ │ ├── version.h │ │ │ │ └── x86 │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── audio_convert.asm │ │ │ │ │ ├── audio_convert_init.c │ │ │ │ │ ├── audio_mix.asm │ │ │ │ │ ├── audio_mix_init.c │ │ │ │ │ ├── dither.asm │ │ │ │ │ ├── dither_init.c │ │ │ │ │ ├── util.asm │ │ │ │ │ └── w64xmmtest.c │ │ │ ├── libavutil │ │ │ │ ├── adler32.h │ │ │ │ ├── aes.h │ │ │ │ ├── aes_ctr.h │ │ │ │ ├── attributes.h │ │ │ │ ├── audio_fifo.h │ │ │ │ ├── avassert.h │ │ │ │ ├── avconfig.h │ │ │ │ ├── avstring.h │ │ │ │ ├── avutil.h │ │ │ │ ├── base64.h │ │ │ │ ├── blowfish.h │ │ │ │ ├── bprint.h │ │ │ │ ├── bswap.h │ │ │ │ ├── buffer.h │ │ │ │ ├── camellia.h │ │ │ │ ├── cast5.h │ │ │ │ ├── channel_layout.h │ │ │ │ ├── common.h │ │ │ │ ├── cpu.h │ │ │ │ ├── crc.h │ │ │ │ ├── des.h │ │ │ │ ├── dict.h │ │ │ │ ├── display.h │ │ │ │ ├── downmix_info.h │ │ │ │ ├── error.h │ │ │ │ ├── eval.h │ │ │ │ ├── ffversion.h │ │ │ │ ├── fifo.h │ │ │ │ ├── file.h │ │ │ │ ├── frame.h │ │ │ │ ├── hash.h │ │ │ │ ├── hmac.h │ │ │ │ ├── hwcontext.h │ │ │ │ ├── hwcontext_cuda.h │ │ │ │ ├── hwcontext_dxva2.h │ │ │ │ ├── hwcontext_qsv.h │ │ │ │ ├── hwcontext_vaapi.h │ │ │ │ ├── hwcontext_vdpau.h │ │ │ │ ├── imgutils.h │ │ │ │ ├── intfloat.h │ │ │ │ ├── intreadwrite.h │ │ │ │ ├── lfg.h │ │ │ │ ├── log.h │ │ │ │ ├── macros.h │ │ │ │ ├── mastering_display_metadata.h │ │ │ │ ├── mathematics.h │ │ │ │ ├── md5.h │ │ │ │ ├── mem.h │ │ │ │ ├── motion_vector.h │ │ │ │ ├── murmur3.h │ │ │ │ ├── opt.h │ │ │ │ ├── parseutils.h │ │ │ │ ├── pixdesc.h │ │ │ │ ├── pixelutils.h │ │ │ │ ├── pixfmt.h │ │ │ │ ├── random_seed.h │ │ │ │ ├── rational.h │ │ │ │ ├── rc4.h │ │ │ │ ├── replaygain.h │ │ │ │ ├── ripemd.h │ │ │ │ ├── samplefmt.h │ │ │ │ ├── sha.h │ │ │ │ ├── sha512.h │ │ │ │ ├── stereo3d.h │ │ │ │ ├── tea.h │ │ │ │ ├── threadmessage.h │ │ │ │ ├── time.h │ │ │ │ ├── timecode.h │ │ │ │ ├── timestamp.h │ │ │ │ ├── tree.h │ │ │ │ ├── twofish.h │ │ │ │ ├── version.h │ │ │ │ └── xtea.h │ │ │ ├── libswresample │ │ │ │ ├── swresample.h │ │ │ │ └── version.h │ │ │ └── libswscale │ │ │ │ ├── swscale.h │ │ │ │ └── version.h │ │ └── jx_ffmpeg_cmd_run.c │ ├── java │ │ └── com │ │ │ └── esay │ │ │ └── ffmtool │ │ │ ├── FfmpegTool.java │ │ │ ├── MainActivity.java │ │ │ └── MyAplication.java │ ├── jniLibs │ │ ├── arm64-v8a │ │ │ ├── libavcodec.so │ │ │ ├── libavfilter.so │ │ │ ├── libavformat.so │ │ │ ├── libavutil.so │ │ │ ├── libfdk-aac.so │ │ │ ├── libswresample.so │ │ │ └── libswscale.so │ │ ├── armeabi-v7a │ │ │ ├── libavcodec.so │ │ │ ├── libavfilter.so │ │ │ ├── libavformat.so │ │ │ ├── libavutil.so │ │ │ ├── libfdk-aac.so │ │ │ ├── libswresample.so │ │ │ └── libswscale.so │ │ └── armeabi │ │ │ ├── libavcodec.so │ │ │ ├── libavfilter.so │ │ │ ├── libavformat.so │ │ │ ├── libavutil.so │ │ │ ├── libfdk-aac.so │ │ │ ├── libswresample.so │ │ │ └── libswscale.so │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── esay │ └── ffmtool │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 | 39 | 40 | 1.8 41 | 42 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FfmpegTool 2 | 将视频解码为一帧一帧的图片,并能执行FFmpeg命令。 3 | 在Android手机上用FFmpeg可以很方便的处理视频,裁剪、压缩、转码等。 4 | 5 | 6 | 之前遇到一个需求是将视频一秒一秒解码成一帧一帧的图片,用户滑动选择时间节点(微信朋友圈发10秒视频的编辑界面)。开始我是用的MediaMetadataRetriever类 7 | 来获取图片,但是对于分辨率比较大的视频(1920*1080)获取一个图片要0.7/0.8秒,太慢了。后来又用FFmpeg的命令来批量的解码视频成一帧一帧的图片,速度依然不快 8 | 每张图片得耗费0.5秒左右的时间。最后还是用FFmpeg,不过不是用命令行,而是用NDK,发现c解码视频再转换为图片保存起来效率大大挺高,一秒钟能解码4、5张图片,c就是快啊。 9 | 10 | 11 | 工程很简单,主要的就FfmpegTool类,里面两个方法cmdRun执行FFmpeg命令,decodToImage一秒一秒的解码图片。两个方法都是阻塞的。 12 | 13 | 14 | 15 | cmdRun用法 16 | 17 | 18 | String basePath = Environment.getExternalStorageDirectory().getPath(); 19 | 20 | String cmd = String.format("ffmpeg -ss 00:00:10 -i "+ basePath+"/test/"+"c.mp4" 21 | +" -f image2 -y "+basePath+"/test"+"/"+"aaaa.jpg"); 22 | 23 | String dir=basePath+File.separator+"test"+File.separator; 24 | 25 | String videoPath=dir+"c.mp4"; 26 | 27 | String out=dir+"out.mp4"; 28 | 29 | String cmd2=String.format("ffmpeg -ss 10"+" -t 15 -i "+videoPath 30 | +" -vcodec copy -acodec copy "+out); 31 | 32 | String regulation="[ \\t]+"; 33 | 34 | Log.i("MainActivity","cmd:"+cmd); 35 | 36 | Log.i("MainActivity","cmd2:"+cmd2); 37 | 38 | final String[] split = cmd.split(regulation); 39 | final String[] split2 = cmd2.split(regulation); 40 | int result=FfmpegTool.cmdRun(split2); 41 | 42 | 43 | decodToImage用法 44 | 45 | 46 | String path= Environment.getExternalStorageDirectory().getPath()+ File.separator+"test"+File.separator; 47 | 48 | String video=path+"c.mp4"; 49 | 50 | FfmpegTool.decodToImage(video.replaceAll(File.separator,"/"),path.replaceAll(File.separator,"/"),0,60); 51 | 52 | //新加方法 53 | public native int decodToImageWithCall(String srcPath,String savePath,int startTime,int count); 54 | 该方法与decodToImage功能相同,不过该方法添加了jni回调,每当有一幅图片解码保存完成后都会调用public void decodToImageCall(String path,int index)(类FfmpegTool中的方法),用户可根据该方法监听进度。 55 | 用法: 56 | 57 | FfmpegTool ffmpegTool=new FfmpegTool() ; 58 | 59 | new Thread(){ 60 | @Override 61 | public void run() { 62 | String path= Environment.getExternalStorageDirectory().getPath()+ File.separator+"test"+File.separator; 63 | String video=path+"c.mp4"; 64 | ffmpegTool.decodToImageWithCall(video.replaceAll(File.separator,"/") 65 | ,Environment.getExternalStorageDirectory().getPath() 66 | + File.separator+"test2"+File.separator,0,10); 67 | } 68 | }.start(); 69 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | defaultConfig { 7 | applicationId "com.esay.ffmtool" 8 | minSdkVersion 19 9 | targetSdkVersion 21 10 | versionCode 1 11 | versionName "1.0" 12 | externalNativeBuild { 13 | cmake { 14 | cppFlags "" 15 | } 16 | ndk { 17 | abiFilters "armeabi", "armeabi-v7a", "arm64-v8a" 18 | } 19 | } 20 | } 21 | buildTypes { 22 | release { 23 | minifyEnabled false 24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 25 | } 26 | debug { 27 | jniDebuggable true 28 | renderscriptDebuggable true 29 | } 30 | } 31 | externalNativeBuild { 32 | cmake { 33 | path "CMakeLists.txt" 34 | } 35 | } 36 | productFlavors { 37 | } 38 | } 39 | 40 | dependencies { 41 | compile fileTree(include: ['*.jar'], dir: 'libs') 42 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 43 | exclude group: 'com.android.support', module: 'support-annotations' 44 | }) 45 | compile 'com.android.support:appcompat-v7:25.3.1' 46 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 47 | testCompile 'junit:junit:4.12' 48 | debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5' 49 | } 50 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\studio\standard\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/esay/ffmtool/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.esay.ffmtool; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.esay.ffmtool", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/cpp/cmdutils_common_opts.h: -------------------------------------------------------------------------------- 1 | { "L" , OPT_EXIT, {.func_arg = show_license}, "show license" }, 2 | { "h" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" }, 3 | { "?" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" }, 4 | { "help" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" }, 5 | { "-help" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" }, 6 | { "version" , OPT_EXIT, {.func_arg = show_version}, "show version" }, 7 | { "buildconf" , OPT_EXIT, {.func_arg = show_buildconf}, "show build configuration" }, 8 | { "formats" , OPT_EXIT, {.func_arg = show_formats }, "show available formats" }, 9 | { "devices" , OPT_EXIT, {.func_arg = show_devices }, "show available devices" }, 10 | { "codecs" , OPT_EXIT, {.func_arg = show_codecs }, "show available codecs" }, 11 | { "decoders" , OPT_EXIT, {.func_arg = show_decoders }, "show available decoders" }, 12 | { "encoders" , OPT_EXIT, {.func_arg = show_encoders }, "show available encoders" }, 13 | { "bsfs" , OPT_EXIT, {.func_arg = show_bsfs }, "show available bit stream filters" }, 14 | { "protocols" , OPT_EXIT, {.func_arg = show_protocols}, "show available protocols" }, 15 | { "filters" , OPT_EXIT, {.func_arg = show_filters }, "show available filters" }, 16 | { "pix_fmts" , OPT_EXIT, {.func_arg = show_pix_fmts }, "show available pixel formats" }, 17 | { "layouts" , OPT_EXIT, {.func_arg = show_layouts }, "show standard channel layouts" }, 18 | { "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" }, 19 | { "colors" , OPT_EXIT, {.func_arg = show_colors }, "show available color names" }, 20 | { "loglevel" , HAS_ARG, {.func_arg = opt_loglevel}, "set logging level", "loglevel" }, 21 | { "v", HAS_ARG, {.func_arg = opt_loglevel}, "set logging level", "loglevel" }, 22 | { "report" , 0, {(void*)opt_report}, "generate a report" }, 23 | { "max_alloc" , HAS_ARG, {.func_arg = opt_max_alloc}, "set maximum size of a single allocated block", "bytes" }, 24 | { "cpuflags" , HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags }, "force specific cpu flags", "flags" }, 25 | { "hide_banner", OPT_BOOL | OPT_EXPERT, {&hide_banner}, "do not show program banner", "hide_banner" }, 26 | #if CONFIG_OPENCL 27 | { "opencl_bench", OPT_EXIT, {.func_arg = opt_opencl_bench}, "run benchmark on all OpenCL devices and show results" }, 28 | { "opencl_options", HAS_ARG, {.func_arg = opt_opencl}, "set OpenCL environment options" }, 29 | #endif 30 | #if CONFIG_AVDEVICE 31 | { "sources" , OPT_EXIT | HAS_ARG, { .func_arg = show_sources }, 32 | "list sources of the input device", "device" }, 33 | { "sinks" , OPT_EXIT | HAS_ARG, { .func_arg = show_sinks }, 34 | "list sinks of the output device", "device" }, 35 | #endif 36 | -------------------------------------------------------------------------------- /app/src/main/cpp/com_esay_ffmtool_FfmpegTool.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_esay_ffmtool_FfmpegTool */ 4 | 5 | #ifndef _Included_com_esay_ffmtool_FfmpegTool 6 | #define _Included_com_esay_ffmtool_FfmpegTool 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_esay_ffmtool_FfmpegTool 12 | * Method: cmdRun 13 | * Signature: ([Ljava/lang/String;)I 14 | */ 15 | JNIEXPORT jint JNICALL Java_com_esay_ffmtool_FfmpegTool_cmdRun 16 | (JNIEnv *, jclass, jobjectArray); 17 | 18 | /* 19 | * Class: com_esay_ffmtool_FfmpegTool 20 | * Method: decodToImage 21 | * Signature: (Ljava/lang/String;Ljava/lang/String;II)I 22 | */ 23 | JNIEXPORT jint JNICALL Java_com_esay_ffmtool_FfmpegTool_decodToImage 24 | (JNIEnv *, jclass, jstring, jstring, jint, jint); 25 | /* 26 | * Class: com_esay_ffmtool_FfmpegTool 27 | * Method: decodToImageWithCall 28 | * Signature: (Ljava/lang/String;Ljava/lang/String;II)I 29 | */ 30 | JNIEXPORT jint JNICALL Java_com_esay_ffmtool_FfmpegTool_decodToImageWithCall 31 | (JNIEnv *, jobject, jstring, jstring, jint, jint); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif 37 | -------------------------------------------------------------------------------- /app/src/main/cpp/com_mabeijianxi_jianxiffmpegcmd_Test.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_mabeijianxi_jianxiffmpegcmd_Test */ 4 | 5 | #ifndef _Included_com_mabeijianxi_jianxiffmpegcmd_Test 6 | #define _Included_com_mabeijianxi_jianxiffmpegcmd_Test 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | int MyWriteJPEG(AVFrame *pFrame,char *path, int width, int height, int iIndex); 11 | char * MyWriteJPEG2(AVFrame *pFrame,char *path, int width, int height,int iIndex); 12 | char *jstringTostring(JNIEnv *env, jstring jstr); 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /app/src/main/cpp/fram_rotate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by ESAY on 2017/10/18. 3 | // 4 | 5 | #include 6 | 7 | #ifndef FFMTOOL_FRAM_ROTATE_H 8 | #define FFMTOOL_FRAM_ROTATE_H 9 | 10 | #endif //FFMTOOL_FRAM_ROTATE_H 11 | void frame_rotate_90(AVFrame *src, AVFrame *des); 12 | void frame_rotate_270(AVFrame *src, AVFrame *des); 13 | void frame_rotate_180(AVFrame *src, AVFrame *des); -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/aix/math.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Work around the class() function in AIX math.h clashing with 3 | * identifiers named "class". 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef COMPAT_AIX_MATH_H 23 | #define COMPAT_AIX_MATH_H 24 | 25 | #define class class_in_math_h_causes_problems 26 | 27 | #include_next 28 | 29 | #undef class 30 | 31 | #endif /* COMPAT_AIX_MATH_H */ 32 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/atomics/pthread/stdatomic.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /* 20 | * based on vlc_atomic.h from VLC 21 | * Copyright (C) 2010 Rémi Denis-Courmont 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | #include "stdatomic.h" 28 | 29 | static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER; 30 | 31 | void avpriv_atomic_lock(void) 32 | { 33 | pthread_mutex_lock(&atomic_lock); 34 | } 35 | 36 | void avpriv_atomic_unlock(void) 37 | { 38 | pthread_mutex_unlock(&atomic_lock); 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/avisynth/avs/capi.h: -------------------------------------------------------------------------------- 1 | // Avisynth C Interface Version 0.20 2 | // Copyright 2003 Kevin Atkinson 3 | 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit 17 | // http://www.gnu.org/copyleft/gpl.html . 18 | // 19 | // As a special exception, I give you permission to link to the 20 | // Avisynth C interface with independent modules that communicate with 21 | // the Avisynth C interface solely through the interfaces defined in 22 | // avisynth_c.h, regardless of the license terms of these independent 23 | // modules, and to copy and distribute the resulting combined work 24 | // under terms of your choice, provided that every copy of the 25 | // combined work is accompanied by a complete copy of the source code 26 | // of the Avisynth C interface and Avisynth itself (with the version 27 | // used to produce the combined work), being distributed under the 28 | // terms of the GNU General Public License plus this exception. An 29 | // independent module is a module which is not derived from or based 30 | // on Avisynth C Interface, such as 3rd-party filters, import and 31 | // export plugins, or graphical user interfaces. 32 | 33 | #ifndef AVS_CAPI_H 34 | #define AVS_CAPI_H 35 | 36 | #ifdef __cplusplus 37 | # define EXTERN_C extern "C" 38 | #else 39 | # define EXTERN_C 40 | #endif 41 | 42 | #ifndef AVSC_USE_STDCALL 43 | # define AVSC_CC __cdecl 44 | #else 45 | # define AVSC_CC __stdcall 46 | #endif 47 | 48 | #define AVSC_INLINE static __inline 49 | 50 | #ifdef BUILDING_AVSCORE 51 | # define AVSC_EXPORT EXTERN_C 52 | # define AVSC_API(ret, name) EXTERN_C __declspec(dllexport) ret AVSC_CC name 53 | #else 54 | # define AVSC_EXPORT EXTERN_C __declspec(dllexport) 55 | # ifndef AVSC_NO_DECLSPEC 56 | # define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name 57 | # else 58 | # define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func) 59 | # endif 60 | #endif 61 | 62 | #endif //AVS_CAPI_H 63 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/avisynth/avs/config.h: -------------------------------------------------------------------------------- 1 | // Avisynth C Interface Version 0.20 2 | // Copyright 2003 Kevin Atkinson 3 | 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit 17 | // http://www.gnu.org/copyleft/gpl.html . 18 | // 19 | // As a special exception, I give you permission to link to the 20 | // Avisynth C interface with independent modules that communicate with 21 | // the Avisynth C interface solely through the interfaces defined in 22 | // avisynth_c.h, regardless of the license terms of these independent 23 | // modules, and to copy and distribute the resulting combined work 24 | // under terms of your choice, provided that every copy of the 25 | // combined work is accompanied by a complete copy of the source code 26 | // of the Avisynth C interface and Avisynth itself (with the version 27 | // used to produce the combined work), being distributed under the 28 | // terms of the GNU General Public License plus this exception. An 29 | // independent module is a module which is not derived from or based 30 | // on Avisynth C Interface, such as 3rd-party filters, import and 31 | // export plugins, or graphical user interfaces. 32 | 33 | #ifndef AVS_CONFIG_H 34 | #define AVS_CONFIG_H 35 | 36 | // Undefine this to get cdecl calling convention 37 | #define AVSC_USE_STDCALL 1 38 | 39 | // NOTE TO PLUGIN AUTHORS: 40 | // Because FRAME_ALIGN can be substantially higher than the alignment 41 | // a plugin actually needs, plugins should not use FRAME_ALIGN to check for 42 | // alignment. They should always request the exact alignment value they need. 43 | // This is to make sure that plugins work over the widest range of AviSynth 44 | // builds possible. 45 | #define FRAME_ALIGN 32 46 | 47 | #if defined(_M_AMD64) || defined(__x86_64) 48 | # define X86_64 49 | #elif defined(_M_IX86) || defined(__i386__) 50 | # define X86_32 51 | #else 52 | # error Unsupported CPU architecture. 53 | #endif 54 | 55 | #endif //AVS_CONFIG_H 56 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/avisynth/avs/types.h: -------------------------------------------------------------------------------- 1 | // Avisynth C Interface Version 0.20 2 | // Copyright 2003 Kevin Atkinson 3 | 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit 17 | // http://www.gnu.org/copyleft/gpl.html . 18 | // 19 | // As a special exception, I give you permission to link to the 20 | // Avisynth C interface with independent modules that communicate with 21 | // the Avisynth C interface solely through the interfaces defined in 22 | // avisynth_c.h, regardless of the license terms of these independent 23 | // modules, and to copy and distribute the resulting combined work 24 | // under terms of your choice, provided that every copy of the 25 | // combined work is accompanied by a complete copy of the source code 26 | // of the Avisynth C interface and Avisynth itself (with the version 27 | // used to produce the combined work), being distributed under the 28 | // terms of the GNU General Public License plus this exception. An 29 | // independent module is a module which is not derived from or based 30 | // on Avisynth C Interface, such as 3rd-party filters, import and 31 | // export plugins, or graphical user interfaces. 32 | 33 | #ifndef AVS_TYPES_H 34 | #define AVS_TYPES_H 35 | 36 | // Define all types necessary for interfacing with avisynth.dll 37 | 38 | // Raster types used by VirtualDub & Avisynth 39 | typedef unsigned int Pixel32; 40 | typedef unsigned char BYTE; 41 | 42 | // Audio Sample information 43 | typedef float SFLOAT; 44 | 45 | #ifdef __GNUC__ 46 | typedef long long int INT64; 47 | #else 48 | typedef __int64 INT64; 49 | #endif 50 | 51 | #endif //AVS_TYPES_H 52 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/avisynth/windowsPorts/basicDataTypeConversions.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_TYPE_CONVERSIONS_H__ 2 | #define __DATA_TYPE_CONVERSIONS_H__ 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | namespace avxsynth { 9 | #endif // __cplusplus 10 | 11 | typedef int64_t __int64; 12 | typedef int32_t __int32; 13 | #ifdef __cplusplus 14 | typedef bool BOOL; 15 | #else 16 | typedef uint32_t BOOL; 17 | #endif // __cplusplus 18 | typedef void* HMODULE; 19 | typedef void* LPVOID; 20 | typedef void* PVOID; 21 | typedef PVOID HANDLE; 22 | typedef HANDLE HWND; 23 | typedef HANDLE HINSTANCE; 24 | typedef void* HDC; 25 | typedef void* HBITMAP; 26 | typedef void* HICON; 27 | typedef void* HFONT; 28 | typedef void* HGDIOBJ; 29 | typedef void* HBRUSH; 30 | typedef void* HMMIO; 31 | typedef void* HACMSTREAM; 32 | typedef void* HACMDRIVER; 33 | typedef void* HIC; 34 | typedef void* HACMOBJ; 35 | typedef HACMSTREAM* LPHACMSTREAM; 36 | typedef void* HACMDRIVERID; 37 | typedef void* LPHACMDRIVER; 38 | typedef unsigned char BYTE; 39 | typedef BYTE* LPBYTE; 40 | typedef char TCHAR; 41 | typedef TCHAR* LPTSTR; 42 | typedef const TCHAR* LPCTSTR; 43 | typedef char* LPSTR; 44 | typedef LPSTR LPOLESTR; 45 | typedef const char* LPCSTR; 46 | typedef LPCSTR LPCOLESTR; 47 | typedef wchar_t WCHAR; 48 | typedef unsigned short WORD; 49 | typedef unsigned int UINT; 50 | typedef UINT MMRESULT; 51 | typedef uint32_t DWORD; 52 | typedef DWORD COLORREF; 53 | typedef DWORD FOURCC; 54 | typedef DWORD HRESULT; 55 | typedef DWORD* LPDWORD; 56 | typedef DWORD* DWORD_PTR; 57 | typedef int32_t LONG; 58 | typedef int32_t* LONG_PTR; 59 | typedef LONG_PTR LRESULT; 60 | typedef uint32_t ULONG; 61 | typedef uint32_t* ULONG_PTR; 62 | //typedef __int64_t intptr_t; 63 | typedef uint64_t _fsize_t; 64 | 65 | 66 | // 67 | // Structures 68 | // 69 | 70 | typedef struct _GUID { 71 | DWORD Data1; 72 | WORD Data2; 73 | WORD Data3; 74 | BYTE Data4[8]; 75 | } GUID; 76 | 77 | typedef GUID REFIID; 78 | typedef GUID CLSID; 79 | typedef CLSID* LPCLSID; 80 | typedef GUID IID; 81 | 82 | #ifdef __cplusplus 83 | }; // namespace avxsynth 84 | #endif // __cplusplus 85 | #endif // __DATA_TYPE_CONVERSIONS_H__ 86 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/avisynth/windowsPorts/windows2linux.h: -------------------------------------------------------------------------------- 1 | #ifndef __WINDOWS2LINUX_H__ 2 | #define __WINDOWS2LINUX_H__ 3 | 4 | /* 5 | * LINUX SPECIFIC DEFINITIONS 6 | */ 7 | // 8 | // Data types conversions 9 | // 10 | #include 11 | #include 12 | #include "basicDataTypeConversions.h" 13 | 14 | #ifdef __cplusplus 15 | namespace avxsynth { 16 | #endif // __cplusplus 17 | // 18 | // purposefully define the following MSFT definitions 19 | // to mean nothing (as they do not mean anything on Linux) 20 | // 21 | #define __stdcall 22 | #define __cdecl 23 | #define noreturn 24 | #define __declspec(x) 25 | #define STDAPI extern "C" HRESULT 26 | #define STDMETHODIMP HRESULT __stdcall 27 | #define STDMETHODIMP_(x) x __stdcall 28 | 29 | #define STDMETHOD(x) virtual HRESULT x 30 | #define STDMETHOD_(a, x) virtual a x 31 | 32 | #ifndef TRUE 33 | #define TRUE true 34 | #endif 35 | 36 | #ifndef FALSE 37 | #define FALSE false 38 | #endif 39 | 40 | #define S_OK (0x00000000) 41 | #define S_FALSE (0x00000001) 42 | #define E_NOINTERFACE (0X80004002) 43 | #define E_POINTER (0x80004003) 44 | #define E_FAIL (0x80004005) 45 | #define E_OUTOFMEMORY (0x8007000E) 46 | 47 | #define INVALID_HANDLE_VALUE ((HANDLE)((LONG_PTR)-1)) 48 | #define FAILED(hr) ((hr) & 0x80000000) 49 | #define SUCCEEDED(hr) (!FAILED(hr)) 50 | 51 | 52 | // 53 | // Functions 54 | // 55 | #define MAKEDWORD(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) 56 | #define MAKEWORD(a,b) (((a) << 8) | (b)) 57 | 58 | #define lstrlen strlen 59 | #define lstrcpy strcpy 60 | #define lstrcmpi strcasecmp 61 | #define _stricmp strcasecmp 62 | #define InterlockedIncrement(x) __sync_fetch_and_add((x), 1) 63 | #define InterlockedDecrement(x) __sync_fetch_and_sub((x), 1) 64 | // Windows uses (new, old) ordering but GCC has (old, new) 65 | #define InterlockedCompareExchange(x,y,z) __sync_val_compare_and_swap(x,z,y) 66 | 67 | #define UInt32x32To64(a, b) ( (uint64_t) ( ((uint64_t)((uint32_t)(a))) * ((uint32_t)(b)) ) ) 68 | #define Int64ShrlMod32(a, b) ( (uint64_t) ( (uint64_t)(a) >> (b) ) ) 69 | #define Int32x32To64(a, b) ((__int64)(((__int64)((long)(a))) * ((long)(b)))) 70 | 71 | #define MulDiv(nNumber, nNumerator, nDenominator) (int32_t) (((int64_t) (nNumber) * (int64_t) (nNumerator) + (int64_t) ((nDenominator)/2)) / (int64_t) (nDenominator)) 72 | 73 | #ifdef __cplusplus 74 | }; // namespace avxsynth 75 | #endif // __cplusplus 76 | 77 | #endif // __WINDOWS2LINUX_H__ 78 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/dispatch_semaphore/semaphore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H 20 | #define COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H 21 | 22 | #include 23 | #include 24 | 25 | #define sem_t dispatch_semaphore_t 26 | #define sem_post(psem) dispatch_semaphore_signal(*psem) 27 | #define sem_wait(psem) dispatch_semaphore_wait(*psem, DISPATCH_TIME_FOREVER) 28 | #define sem_timedwait(psem, val) dispatch_semaphore_wait(*psem, dispatch_walltime(val, 0)) 29 | #define sem_destroy(psem) dispatch_release(*psem) 30 | 31 | static inline int compat_sem_init(dispatch_semaphore_t *psem, 32 | int unused, int val) 33 | { 34 | int ret = !!(*psem = dispatch_semaphore_create(val)) - 1; 35 | if (ret < 0) 36 | errno = ENOMEM; 37 | return ret; 38 | } 39 | 40 | #define sem_init compat_sem_init 41 | 42 | #endif /* COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H */ 43 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/float/float.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Work around broken floating point limits on some systems. 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include_next 22 | 23 | #ifdef FLT_MAX 24 | #undef FLT_MAX 25 | #define FLT_MAX 3.40282346638528859812e+38F 26 | 27 | #undef FLT_MIN 28 | #define FLT_MIN 1.17549435082228750797e-38F 29 | 30 | #undef DBL_MAX 31 | #define DBL_MAX ((double)1.79769313486231570815e+308L) 32 | 33 | #undef DBL_MIN 34 | #define DBL_MIN ((double)2.22507385850720138309e-308L) 35 | #endif 36 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/float/limits.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Work around broken floating point limits on some systems. 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include_next 22 | #include 23 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/getopt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /* 20 | * This file was copied from the following newsgroup posting: 21 | * 22 | * Newsgroups: mod.std.unix 23 | * Subject: public domain AT&T getopt source 24 | * Date: 3 Nov 85 19:34:15 GMT 25 | * 26 | * Here's something you've all been waiting for: the AT&T public domain 27 | * source for getopt(3). It is the code which was given out at the 1985 28 | * UNIFORUM conference in Dallas. I obtained it by electronic mail 29 | * directly from AT&T. The people there assure me that it is indeed 30 | * in the public domain. 31 | */ 32 | 33 | #include 34 | #include 35 | 36 | static int opterr = 1; 37 | static int optind = 1; 38 | static int optopt; 39 | static char *optarg; 40 | 41 | static int getopt(int argc, char *argv[], char *opts) 42 | { 43 | static int sp = 1; 44 | int c; 45 | char *cp; 46 | 47 | if (sp == 1) { 48 | if (optind >= argc || 49 | argv[optind][0] != '-' || argv[optind][1] == '\0') 50 | return EOF; 51 | else if (!strcmp(argv[optind], "--")) { 52 | optind++; 53 | return EOF; 54 | } 55 | } 56 | optopt = c = argv[optind][sp]; 57 | if (c == ':' || !(cp = strchr(opts, c))) { 58 | fprintf(stderr, ": illegal option -- %c\n", c); 59 | if (argv[optind][++sp] == '\0') { 60 | optind++; 61 | sp = 1; 62 | } 63 | return '?'; 64 | } 65 | if (*++cp == ':') { 66 | if (argv[optind][sp+1] != '\0') 67 | optarg = &argv[optind++][sp+1]; 68 | else if(++optind >= argc) { 69 | fprintf(stderr, ": option requires an argument -- %c\n", c); 70 | sp = 1; 71 | return '?'; 72 | } else 73 | optarg = argv[optind++]; 74 | sp = 1; 75 | } else { 76 | if (argv[optind][++sp] == '\0') { 77 | sp = 1; 78 | optind++; 79 | } 80 | optarg = NULL; 81 | } 82 | 83 | return c; 84 | } 85 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/msvcrt/snprintf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * C99-compatible snprintf() and vsnprintf() implementations 3 | * Copyright (c) 2012 Ronald S. Bultje 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include "compat/va_copy.h" 28 | #include "libavutil/error.h" 29 | 30 | #if defined(__MINGW32__) 31 | #define EOVERFLOW EFBIG 32 | #endif 33 | 34 | int avpriv_snprintf(char *s, size_t n, const char *fmt, ...) 35 | { 36 | va_list ap; 37 | int ret; 38 | 39 | va_start(ap, fmt); 40 | ret = avpriv_vsnprintf(s, n, fmt, ap); 41 | va_end(ap); 42 | 43 | return ret; 44 | } 45 | 46 | int avpriv_vsnprintf(char *s, size_t n, const char *fmt, 47 | va_list ap) 48 | { 49 | int ret; 50 | va_list ap_copy; 51 | 52 | if (n == 0) 53 | return _vscprintf(fmt, ap); 54 | else if (n > INT_MAX) 55 | return AVERROR(EOVERFLOW); 56 | 57 | /* we use n - 1 here because if the buffer is not big enough, the MS 58 | * runtime libraries don't add a terminating zero at the end. MSDN 59 | * recommends to provide _snprintf/_vsnprintf() a buffer size that 60 | * is one less than the actual buffer, and zero it before calling 61 | * _snprintf/_vsnprintf() to workaround this problem. 62 | * See http://msdn.microsoft.com/en-us/library/1kt27hek(v=vs.80).aspx */ 63 | memset(s, 0, n); 64 | va_copy(ap_copy, ap); 65 | ret = _vsnprintf(s, n - 1, fmt, ap_copy); 66 | va_end(ap_copy); 67 | if (ret == -1) 68 | ret = _vscprintf(fmt, ap); 69 | 70 | return ret; 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/msvcrt/snprintf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C99-compatible snprintf() and vsnprintf() implementations 3 | * Copyright (c) 2012 Ronald S. Bultje 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef COMPAT_MSVCRT_SNPRINTF_H 23 | #define COMPAT_MSVCRT_SNPRINTF_H 24 | 25 | #include 26 | #include 27 | 28 | int avpriv_snprintf(char *s, size_t n, const char *fmt, ...); 29 | int avpriv_vsnprintf(char *s, size_t n, const char *fmt, va_list ap); 30 | 31 | #undef snprintf 32 | #undef _snprintf 33 | #undef vsnprintf 34 | #define snprintf avpriv_snprintf 35 | #define _snprintf avpriv_snprintf 36 | #define vsnprintf avpriv_vsnprintf 37 | 38 | #endif /* COMPAT_MSVCRT_SNPRINTF_H */ 39 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/plan9/head: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | n=10 4 | 5 | case "$1" in 6 | -n) n=$2; shift 2 ;; 7 | -n*) n=${1#-n}; shift ;; 8 | esac 9 | 10 | exec sed ${n}q "$@" 11 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/plan9/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | int plan9_main(int argc, char **argv); 20 | 21 | #undef main 22 | int main(int argc, char **argv) 23 | { 24 | /* The setfcr() function in lib9 is broken, must use asm. */ 25 | #ifdef __i386 26 | short fcr; 27 | __asm__ volatile ("fstcw %0 \n" 28 | "or $63, %0 \n" 29 | "fldcw %0 \n" 30 | : "=m"(fcr)); 31 | #endif 32 | 33 | return plan9_main(argc, argv); 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/plan9/printf: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec awk "BEGIN { for (i = 2; i < ARGC; i++) printf \"$1\", ARGV[i] }" "$@" 3 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/strtod.c: -------------------------------------------------------------------------------- 1 | /* 2 | * C99-compatible strtod() implementation 3 | * Copyright (c) 2012 Ronald S. Bultje 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #include 23 | #include 24 | 25 | #include "libavutil/avstring.h" 26 | #include "libavutil/mathematics.h" 27 | 28 | static char *check_nan_suffix(char *s) 29 | { 30 | char *start = s; 31 | 32 | if (*s++ != '(') 33 | return start; 34 | 35 | while ((*s >= 'a' && *s <= 'z') || (*s >= 'A' && *s <= 'Z') || 36 | (*s >= '0' && *s <= '9') || *s == '_') 37 | s++; 38 | 39 | return *s == ')' ? s + 1 : start; 40 | } 41 | 42 | #undef strtod 43 | double strtod(const char *, char **); 44 | 45 | double avpriv_strtod(const char *nptr, char **endptr) 46 | { 47 | char *end; 48 | double res; 49 | 50 | /* Skip leading spaces */ 51 | while (av_isspace(*nptr)) 52 | nptr++; 53 | 54 | if (!av_strncasecmp(nptr, "infinity", 8)) { 55 | end = nptr + 8; 56 | res = INFINITY; 57 | } else if (!av_strncasecmp(nptr, "inf", 3)) { 58 | end = nptr + 3; 59 | res = INFINITY; 60 | } else if (!av_strncasecmp(nptr, "+infinity", 9)) { 61 | end = nptr + 9; 62 | res = INFINITY; 63 | } else if (!av_strncasecmp(nptr, "+inf", 4)) { 64 | end = nptr + 4; 65 | res = INFINITY; 66 | } else if (!av_strncasecmp(nptr, "-infinity", 9)) { 67 | end = nptr + 9; 68 | res = -INFINITY; 69 | } else if (!av_strncasecmp(nptr, "-inf", 4)) { 70 | end = nptr + 4; 71 | res = -INFINITY; 72 | } else if (!av_strncasecmp(nptr, "nan", 3)) { 73 | end = check_nan_suffix(nptr + 3); 74 | res = NAN; 75 | } else if (!av_strncasecmp(nptr, "+nan", 4) || 76 | !av_strncasecmp(nptr, "-nan", 4)) { 77 | end = check_nan_suffix(nptr + 4); 78 | res = NAN; 79 | } else if (!av_strncasecmp(nptr, "0x", 2) || 80 | !av_strncasecmp(nptr, "-0x", 3) || 81 | !av_strncasecmp(nptr, "+0x", 3)) { 82 | /* FIXME this doesn't handle exponents, non-integers (float/double) 83 | * and numbers too large for long long */ 84 | res = strtoll(nptr, &end, 16); 85 | } else { 86 | res = strtod(nptr, &end); 87 | } 88 | 89 | if (endptr) 90 | *endptr = end; 91 | 92 | return res; 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/strtod.d: -------------------------------------------------------------------------------- 1 | libavutil/../compat/strtod.o: libavutil/../compat/strtod.c \ 2 | libavutil/avstring.h libavutil/attributes.h libavutil/mathematics.h \ 3 | libavutil/rational.h libavutil/intfloat.h 4 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/strtod.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/cpp/include/compat/strtod.o -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/tms470/math.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef COMPAT_TMS470_MATH_H 20 | #define COMPAT_TMS470_MATH_H 21 | 22 | #include_next 23 | 24 | #undef INFINITY 25 | #undef NAN 26 | 27 | #define INFINITY (*(const float*)((const unsigned []){ 0x7f800000 })) 28 | #define NAN (*(const float*)((const unsigned []){ 0x7fc00000 })) 29 | 30 | #endif /* COMPAT_TMS470_MATH_H */ 31 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/va_copy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MSVC Compatible va_copy macro 3 | * Copyright (c) 2012 Derek Buitenhuis 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef COMPAT_VA_COPY_H 23 | #define COMPAT_VA_COPY_H 24 | 25 | #include 26 | 27 | #if !defined(va_copy) && defined(_MSC_VER) 28 | #define va_copy(dst, src) ((dst) = (src)) 29 | #endif 30 | #if !defined(va_copy) && defined(__GNUC__) && __GNUC__ < 3 31 | #define va_copy(dst, src) __va_copy(dst, src) 32 | #endif 33 | 34 | #endif /* COMPAT_VA_COPY_H */ 35 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/w32dlfcn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef COMPAT_W32DLFCN_H 20 | #define COMPAT_W32DLFCN_H 21 | 22 | #ifdef _WIN32 23 | #include 24 | #if _WIN32_WINNT < 0x0602 25 | #include "libavutil/wchar_filename.h" 26 | #endif 27 | /** 28 | * Safe function used to open dynamic libs. This attempts to improve program security 29 | * by removing the current directory from the dll search path. Only dll's found in the 30 | * executable or system directory are allowed to be loaded. 31 | * @param name The dynamic lib name. 32 | * @return A handle to the opened lib. 33 | */ 34 | static inline HMODULE win32_dlopen(const char *name) 35 | { 36 | #if _WIN32_WINNT < 0x0602 37 | // Need to check if KB2533623 is available 38 | if (!GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "SetDefaultDllDirectories")) { 39 | HMODULE module = NULL; 40 | wchar_t *path = NULL, *name_w = NULL; 41 | DWORD pathlen; 42 | if (utf8towchar(name, &name_w)) 43 | goto exit; 44 | path = (wchar_t *)av_mallocz_array(MAX_PATH, sizeof(wchar_t)); 45 | // Try local directory first 46 | pathlen = GetModuleFileNameW(NULL, path, MAX_PATH); 47 | pathlen = wcsrchr(path, '\\') - path; 48 | if (pathlen == 0 || pathlen + wcslen(name_w) + 2 > MAX_PATH) 49 | goto exit; 50 | path[pathlen] = '\\'; 51 | wcscpy(path + pathlen + 1, name_w); 52 | module = LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); 53 | if (module == NULL) { 54 | // Next try System32 directory 55 | pathlen = GetSystemDirectoryW(path, MAX_PATH); 56 | if (pathlen == 0 || pathlen + wcslen(name_w) + 2 > MAX_PATH) 57 | goto exit; 58 | path[pathlen] = '\\'; 59 | wcscpy(path + pathlen + 1, name_w); 60 | module = LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); 61 | } 62 | exit: 63 | av_free(path); 64 | av_free(name_w); 65 | return module; 66 | } 67 | #endif 68 | #ifndef LOAD_LIBRARY_SEARCH_APPLICATION_DIR 69 | # define LOAD_LIBRARY_SEARCH_APPLICATION_DIR 0x00000200 70 | #endif 71 | #ifndef LOAD_LIBRARY_SEARCH_SYSTEM32 72 | # define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800 73 | #endif 74 | return LoadLibraryExA(name, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32); 75 | } 76 | #define dlopen(name, flags) win32_dlopen(name) 77 | #define dlclose FreeLibrary 78 | #define dlsym GetProcAddress 79 | #else 80 | #include 81 | #endif 82 | 83 | #endif /* COMPAT_W32DLFCN_H */ 84 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/compat/windows/mslink: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | LINK_EXE_PATH=$(dirname "$(command -v cl)")/link 4 | if [ -x "$LINK_EXE_PATH" ]; then 5 | "$LINK_EXE_PATH" $@ 6 | else 7 | link $@ 8 | fi 9 | exit $? 10 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavcodec/avdct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVCODEC_AVDCT_H 20 | #define AVCODEC_AVDCT_H 21 | 22 | #include "libavutil/opt.h" 23 | 24 | /** 25 | * AVDCT context. 26 | * @note function pointers can be NULL if the specific features have been 27 | * disabled at build time. 28 | */ 29 | typedef struct AVDCT { 30 | const AVClass *av_class; 31 | 32 | void (*idct)(int16_t *block /* align 16 */); 33 | 34 | /** 35 | * IDCT input permutation. 36 | * Several optimized IDCTs need a permutated input (relative to the 37 | * normal order of the reference IDCT). 38 | * This permutation must be performed before the idct_put/add. 39 | * Note, normally this can be merged with the zigzag/alternate scan
40 | * An example to avoid confusion: 41 | * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...) 42 | * - (x -> reference DCT -> reference IDCT -> x) 43 | * - (x -> reference DCT -> simple_mmx_perm = idct_permutation 44 | * -> simple_idct_mmx -> x) 45 | * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant 46 | * -> simple_idct_mmx -> ...) 47 | */ 48 | uint8_t idct_permutation[64]; 49 | 50 | void (*fdct)(int16_t *block /* align 16 */); 51 | 52 | 53 | /** 54 | * DCT algorithm. 55 | * must use AVOptions to set this field. 56 | */ 57 | int dct_algo; 58 | 59 | /** 60 | * IDCT algorithm. 61 | * must use AVOptions to set this field. 62 | */ 63 | int idct_algo; 64 | 65 | void (*get_pixels)(int16_t *block /* align 16 */, 66 | const uint8_t *pixels /* align 8 */, 67 | ptrdiff_t line_size); 68 | 69 | int bits_per_sample; 70 | } AVDCT; 71 | 72 | /** 73 | * Allocates a AVDCT context. 74 | * This needs to be initialized with avcodec_dct_init() after optionally 75 | * configuring it with AVOptions. 76 | * 77 | * To free it use av_free() 78 | */ 79 | AVDCT *avcodec_dct_alloc(void); 80 | int avcodec_dct_init(AVDCT *); 81 | 82 | const AVClass *avcodec_dct_get_class(void); 83 | 84 | #endif /* AVCODEC_AVDCT_H */ 85 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavcodec/d3d11va.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Direct3D11 HW acceleration 3 | * 4 | * copyright (c) 2009 Laurent Aimar 5 | * copyright (c) 2015 Steve Lhomme 6 | * 7 | * This file is part of FFmpeg. 8 | * 9 | * FFmpeg is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 2.1 of the License, or (at your option) any later version. 13 | * 14 | * FFmpeg is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with FFmpeg; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef AVCODEC_D3D11VA_H 25 | #define AVCODEC_D3D11VA_H 26 | 27 | /** 28 | * @file 29 | * @ingroup lavc_codec_hwaccel_d3d11va 30 | * Public libavcodec D3D11VA header. 31 | */ 32 | 33 | #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602 34 | #undef _WIN32_WINNT 35 | #define _WIN32_WINNT 0x0602 36 | #endif 37 | 38 | #include 39 | #include 40 | 41 | /** 42 | * @defgroup lavc_codec_hwaccel_d3d11va Direct3D11 43 | * @ingroup lavc_codec_hwaccel 44 | * 45 | * @{ 46 | */ 47 | 48 | #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for Direct3D11 and old UVD/UVD+ ATI video cards 49 | #define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for Direct3D11 and old Intel GPUs with ClearVideo interface 50 | 51 | /** 52 | * This structure is used to provides the necessary configurations and data 53 | * to the Direct3D11 FFmpeg HWAccel implementation. 54 | * 55 | * The application must make it available as AVCodecContext.hwaccel_context. 56 | * 57 | * Use av_d3d11va_alloc_context() exclusively to allocate an AVD3D11VAContext. 58 | */ 59 | typedef struct AVD3D11VAContext { 60 | /** 61 | * D3D11 decoder object 62 | */ 63 | ID3D11VideoDecoder *decoder; 64 | 65 | /** 66 | * D3D11 VideoContext 67 | */ 68 | ID3D11VideoContext *video_context; 69 | 70 | /** 71 | * D3D11 configuration used to create the decoder 72 | */ 73 | D3D11_VIDEO_DECODER_CONFIG *cfg; 74 | 75 | /** 76 | * The number of surface in the surface array 77 | */ 78 | unsigned surface_count; 79 | 80 | /** 81 | * The array of Direct3D surfaces used to create the decoder 82 | */ 83 | ID3D11VideoDecoderOutputView **surface; 84 | 85 | /** 86 | * A bit field configuring the workarounds needed for using the decoder 87 | */ 88 | uint64_t workaround; 89 | 90 | /** 91 | * Private to the FFmpeg AVHWAccel implementation 92 | */ 93 | unsigned report_id; 94 | 95 | /** 96 | * Mutex to access video_context 97 | */ 98 | HANDLE context_mutex; 99 | } AVD3D11VAContext; 100 | 101 | /** 102 | * Allocate an AVD3D11VAContext. 103 | * 104 | * @return Newly-allocated AVD3D11VAContext or NULL on failure. 105 | */ 106 | AVD3D11VAContext *av_d3d11va_alloc_context(void); 107 | 108 | /** 109 | * @} 110 | */ 111 | 112 | #endif /* AVCODEC_D3D11VA_H */ 113 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavcodec/dxva2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DXVA2 HW acceleration 3 | * 4 | * copyright (c) 2009 Laurent Aimar 5 | * 6 | * This file is part of FFmpeg. 7 | * 8 | * FFmpeg is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * FFmpeg is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with FFmpeg; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef AVCODEC_DXVA2_H 24 | #define AVCODEC_DXVA2_H 25 | 26 | /** 27 | * @file 28 | * @ingroup lavc_codec_hwaccel_dxva2 29 | * Public libavcodec DXVA2 header. 30 | */ 31 | 32 | #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602 33 | #undef _WIN32_WINNT 34 | #define _WIN32_WINNT 0x0602 35 | #endif 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | /** 42 | * @defgroup lavc_codec_hwaccel_dxva2 DXVA2 43 | * @ingroup lavc_codec_hwaccel 44 | * 45 | * @{ 46 | */ 47 | 48 | #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards 49 | #define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface 50 | 51 | /** 52 | * This structure is used to provides the necessary configurations and data 53 | * to the DXVA2 FFmpeg HWAccel implementation. 54 | * 55 | * The application must make it available as AVCodecContext.hwaccel_context. 56 | */ 57 | struct dxva_context { 58 | /** 59 | * DXVA2 decoder object 60 | */ 61 | IDirectXVideoDecoder *decoder; 62 | 63 | /** 64 | * DXVA2 configuration used to create the decoder 65 | */ 66 | const DXVA2_ConfigPictureDecode *cfg; 67 | 68 | /** 69 | * The number of surface in the surface array 70 | */ 71 | unsigned surface_count; 72 | 73 | /** 74 | * The array of Direct3D surfaces used to create the decoder 75 | */ 76 | LPDIRECT3DSURFACE9 *surface; 77 | 78 | /** 79 | * A bit field configuring the workarounds needed for using the decoder 80 | */ 81 | uint64_t workaround; 82 | 83 | /** 84 | * Private to the FFmpeg AVHWAccel implementation 85 | */ 86 | unsigned report_id; 87 | }; 88 | 89 | /** 90 | * @} 91 | */ 92 | 93 | #endif /* AVCODEC_DXVA2_H */ 94 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavcodec/jni.h: -------------------------------------------------------------------------------- 1 | /* 2 | * JNI public API functions 3 | * 4 | * Copyright (c) 2015-2016 Matthieu Bouron 5 | * 6 | * This file is part of FFmpeg. 7 | * 8 | * FFmpeg is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * FFmpeg is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with FFmpeg; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef AVCODEC_JNI_H 24 | #define AVCODEC_JNI_H 25 | 26 | /* 27 | * Manually set a Java virtual machine which will be used to retrieve the JNI 28 | * environment. Once a Java VM is set it cannot be changed afterwards, meaning 29 | * you can call multiple times av_jni_set_java_vm with the same Java VM pointer 30 | * however it will error out if you try to set a different Java VM. 31 | * 32 | * @param vm Java virtual machine 33 | * @param log_ctx context used for logging, can be NULL 34 | * @return 0 on success, < 0 otherwise 35 | */ 36 | int av_jni_set_java_vm(void *vm, void *log_ctx); 37 | 38 | /* 39 | * Get the Java virtual machine which has been set with av_jni_set_java_vm. 40 | * 41 | * @param vm Java virtual machine 42 | * @return a pointer to the Java virtual machine 43 | */ 44 | void *av_jni_get_java_vm(void *log_ctx); 45 | 46 | #endif /* AVCODEC_JNI_H */ 47 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavcodec/mediacodec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Android MediaCodec public API 3 | * 4 | * Copyright (c) 2016 Matthieu Bouron 5 | * 6 | * This file is part of FFmpeg. 7 | * 8 | * FFmpeg is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * FFmpeg is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with FFmpeg; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef AVCODEC_MEDIACODEC_H 24 | #define AVCODEC_MEDIACODEC_H 25 | 26 | #include "libavcodec/avcodec.h" 27 | 28 | /** 29 | * This structure holds a reference to a android/view/Surface object that will 30 | * be used as output by the decoder. 31 | * 32 | */ 33 | typedef struct AVMediaCodecContext { 34 | 35 | /** 36 | * android/view/Surface object reference. 37 | */ 38 | void *surface; 39 | 40 | } AVMediaCodecContext; 41 | 42 | /** 43 | * Allocate and initialize a MediaCodec context. 44 | * 45 | * When decoding with MediaCodec is finished, the caller must free the 46 | * MediaCodec context with av_mediacodec_default_free. 47 | * 48 | * @return a pointer to a newly allocated AVMediaCodecContext on success, NULL otherwise 49 | */ 50 | AVMediaCodecContext *av_mediacodec_alloc_context(void); 51 | 52 | /** 53 | * Convenience function that sets up the MediaCodec context. 54 | * 55 | * @param avctx codec context 56 | * @param ctx MediaCodec context to initialize 57 | * @param surface reference to an android/view/Surface 58 | * @return 0 on success, < 0 otherwise 59 | */ 60 | int av_mediacodec_default_init(AVCodecContext *avctx, AVMediaCodecContext *ctx, void *surface); 61 | 62 | /** 63 | * This function must be called to free the MediaCodec context initialized with 64 | * av_mediacodec_default_init(). 65 | * 66 | * @param avctx codec context 67 | */ 68 | void av_mediacodec_default_free(AVCodecContext *avctx); 69 | 70 | /** 71 | * Opaque structure representing a MediaCodec buffer to render. 72 | */ 73 | typedef struct MediaCodecBuffer AVMediaCodecBuffer; 74 | 75 | /** 76 | * Release a MediaCodec buffer and render it to the surface that is associated 77 | * with the decoder. This function should only be called once on a given 78 | * buffer, once released the underlying buffer returns to the codec, thus 79 | * subsequent calls to this function will have no effect. 80 | * 81 | * @param buffer the buffer to render 82 | * @param render 1 to release and render the buffer to the surface or 0 to 83 | * discard the buffer 84 | * @return 0 on success, < 0 otherwise 85 | */ 86 | int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render); 87 | 88 | #endif /* AVCODEC_MEDIACODEC_H */ 89 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavcodec/vorbis_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * A public API for Vorbis parsing 22 | * 23 | * Determines the duration for each packet. 24 | */ 25 | 26 | #ifndef AVCODEC_VORBIS_PARSER_H 27 | #define AVCODEC_VORBIS_PARSER_H 28 | 29 | #include 30 | 31 | typedef struct AVVorbisParseContext AVVorbisParseContext; 32 | 33 | /** 34 | * Allocate and initialize the Vorbis parser using headers in the extradata. 35 | * 36 | * @param avctx codec context 37 | * @param s Vorbis parser context 38 | */ 39 | AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata, 40 | int extradata_size); 41 | 42 | /** 43 | * Free the parser and everything associated with it. 44 | */ 45 | void av_vorbis_parse_free(AVVorbisParseContext **s); 46 | 47 | #define VORBIS_FLAG_HEADER 0x00000001 48 | #define VORBIS_FLAG_COMMENT 0x00000002 49 | #define VORBIS_FLAG_SETUP 0x00000004 50 | 51 | /** 52 | * Get the duration for a Vorbis packet. 53 | * 54 | * If @p flags is @c NULL, 55 | * special frames are considered invalid. 56 | * 57 | * @param s Vorbis parser context 58 | * @param buf buffer containing a Vorbis frame 59 | * @param buf_size size of the buffer 60 | * @param flags flags for special frames 61 | */ 62 | int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf, 63 | int buf_size, int *flags); 64 | 65 | /** 66 | * Get the duration for a Vorbis packet. 67 | * 68 | * @param s Vorbis parser context 69 | * @param buf buffer containing a Vorbis frame 70 | * @param buf_size size of the buffer 71 | */ 72 | int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf, 73 | int buf_size); 74 | 75 | void av_vorbis_parse_reset(AVVorbisParseContext *s); 76 | 77 | #endif /* AVCODEC_VORBIS_PARSER_H */ 78 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavdevice/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVDEVICE_VERSION_H 20 | #define AVDEVICE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * @ingroup lavd 25 | * Libavdevice version macros 26 | */ 27 | 28 | #include "libavutil/version.h" 29 | 30 | #define LIBAVDEVICE_VERSION_MAJOR 57 31 | #define LIBAVDEVICE_VERSION_MINOR 0 32 | #define LIBAVDEVICE_VERSION_MICRO 101 33 | 34 | #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ 35 | LIBAVDEVICE_VERSION_MINOR, \ 36 | LIBAVDEVICE_VERSION_MICRO) 37 | #define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \ 38 | LIBAVDEVICE_VERSION_MINOR, \ 39 | LIBAVDEVICE_VERSION_MICRO) 40 | #define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT 41 | 42 | #define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) 43 | 44 | /** 45 | * FF_API_* defines may be placed below to indicate public API that will be 46 | * dropped at a future version bump. The defines themselves are not part of 47 | * the public API and may change, break or disappear at any time. 48 | */ 49 | 50 | #endif /* AVDEVICE_VERSION_H */ 51 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavfilter/avfiltergraph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Filter graphs 3 | * copyright (c) 2007 Bobby Bingham 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVFILTER_AVFILTERGRAPH_H 23 | #define AVFILTER_AVFILTERGRAPH_H 24 | 25 | #include "avfilter.h" 26 | #include "libavutil/log.h" 27 | 28 | #endif /* AVFILTER_AVFILTERGRAPH_H */ 29 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavfilter/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVFILTER_VERSION_H 22 | #define AVFILTER_VERSION_H 23 | 24 | /** 25 | * @file 26 | * @ingroup lavfi 27 | * Libavfilter version macros 28 | */ 29 | 30 | #include "libavutil/version.h" 31 | 32 | #define LIBAVFILTER_VERSION_MAJOR 6 33 | #define LIBAVFILTER_VERSION_MINOR 65 34 | #define LIBAVFILTER_VERSION_MICRO 100 35 | 36 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ 37 | LIBAVFILTER_VERSION_MINOR, \ 38 | LIBAVFILTER_VERSION_MICRO) 39 | #define LIBAVFILTER_VERSION AV_VERSION(LIBAVFILTER_VERSION_MAJOR, \ 40 | LIBAVFILTER_VERSION_MINOR, \ 41 | LIBAVFILTER_VERSION_MICRO) 42 | #define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT 43 | 44 | #define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION) 45 | 46 | /** 47 | * FF_API_* defines may be placed below to indicate public API that will be 48 | * dropped at a future version bump. The defines themselves are not part of 49 | * the public API and may change, break or disappear at any time. 50 | */ 51 | 52 | #ifndef FF_API_OLD_FILTER_OPTS 53 | #define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 7) 54 | #endif 55 | #ifndef FF_API_OLD_FILTER_OPTS_ERROR 56 | #define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 7) 57 | #endif 58 | #ifndef FF_API_AVFILTER_OPEN 59 | #define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 7) 60 | #endif 61 | #ifndef FF_API_AVFILTER_INIT_FILTER 62 | #define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 7) 63 | #endif 64 | #ifndef FF_API_OLD_FILTER_REGISTER 65 | #define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 7) 66 | #endif 67 | #ifndef FF_API_NOCONST_GET_NAME 68 | #define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 7) 69 | #endif 70 | 71 | #endif /* AVFILTER_VERSION_H */ 72 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/Makefile: -------------------------------------------------------------------------------- 1 | NAME = avresample 2 | 3 | HEADERS = avresample.h \ 4 | version.h \ 5 | 6 | OBJS = audio_convert.o \ 7 | audio_data.o \ 8 | audio_mix.o \ 9 | audio_mix_matrix.o \ 10 | dither.o \ 11 | options.o \ 12 | resample.o \ 13 | utils.o \ 14 | 15 | # Windows resource file 16 | SLIBOBJS-$(HAVE_GNU_WINDRES) += avresampleres.o 17 | 18 | TESTPROGS = avresample 19 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/aarch64/Makefile: -------------------------------------------------------------------------------- 1 | OBJS += aarch64/audio_convert_init.o \ 2 | aarch64/resample_init.o \ 3 | 4 | OBJS-$(CONFIG_NEON_CLOBBER_TEST) += aarch64/neontest.o 5 | 6 | NEON-OBJS += aarch64/audio_convert_neon.o \ 7 | aarch64/resample_neon.o \ 8 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/aarch64/asm-offsets.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVRESAMPLE_AARCH64_ASM_OFFSETS_H 20 | #define AVRESAMPLE_AARCH64_ASM_OFFSETS_H 21 | 22 | /* struct ResampleContext */ 23 | #define FILTER_BANK 0x10 24 | #define FILTER_LENGTH 0x18 25 | #define PHASE_SHIFT 0x34 26 | #define PHASE_MASK (PHASE_SHIFT + 0x04) // loaded as pair 27 | 28 | #endif /* AVRESAMPLE_AARCH64_ASM_OFFSETS_H */ 29 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/aarch64/audio_convert_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include 20 | 21 | #include "config.h" 22 | #include "libavutil/attributes.h" 23 | #include "libavutil/cpu.h" 24 | #include "libavutil/aarch64/cpu.h" 25 | #include "libavutil/samplefmt.h" 26 | #include "libavresample/audio_convert.h" 27 | 28 | void ff_conv_flt_to_s16_neon(int16_t *dst, const float *src, int len); 29 | void ff_conv_fltp_to_s16_neon(int16_t *dst, float *const *src, 30 | int len, int channels); 31 | void ff_conv_fltp_to_s16_2ch_neon(int16_t *dst, float *const *src, 32 | int len, int channels); 33 | 34 | av_cold void ff_audio_convert_init_aarch64(AudioConvert *ac) 35 | { 36 | int cpu_flags = av_get_cpu_flags(); 37 | 38 | if (have_neon(cpu_flags)) { 39 | ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT, 40 | 0, 16, 8, "NEON", 41 | ff_conv_flt_to_s16_neon); 42 | ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP, 43 | 2, 16, 8, "NEON", 44 | ff_conv_fltp_to_s16_2ch_neon); 45 | ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP, 46 | 0, 16, 8, "NEON", 47 | ff_conv_fltp_to_s16_neon); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/aarch64/neontest.c: -------------------------------------------------------------------------------- 1 | /* 2 | * check NEON registers for clobbers 3 | * Copyright (c) 2013 Martin Storsjo 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #include "libavresample/avresample.h" 23 | #include "libavutil/aarch64/neontest.h" 24 | 25 | wrap(avresample_convert(AVAudioResampleContext *avr, uint8_t **output, 26 | int out_plane_size, int out_samples, uint8_t **input, 27 | int in_plane_size, int in_samples)) 28 | { 29 | testneonclobbers(avresample_convert, avr, output, out_plane_size, 30 | out_samples, input, in_plane_size, in_samples); 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/aarch64/resample_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include 20 | 21 | #include "config.h" 22 | #include "libavutil/cpu.h" 23 | #include "libavutil/aarch64/cpu.h" 24 | #include "libavutil/internal.h" 25 | #include "libavutil/samplefmt.h" 26 | #include "libavresample/resample.h" 27 | 28 | #include "asm-offsets.h" 29 | 30 | AV_CHECK_OFFSET(struct ResampleContext, filter_bank, FILTER_BANK); 31 | AV_CHECK_OFFSET(struct ResampleContext, filter_length, FILTER_LENGTH); 32 | AV_CHECK_OFFSET(struct ResampleContext, phase_shift, PHASE_SHIFT); 33 | AV_CHECK_OFFSET(struct ResampleContext, phase_mask, PHASE_MASK); 34 | 35 | void ff_resample_one_dbl_neon(struct ResampleContext *c, void *dst0, 36 | int dst_index, const void *src0, 37 | unsigned int index, int frac); 38 | void ff_resample_one_flt_neon(struct ResampleContext *c, void *dst0, 39 | int dst_index, const void *src0, 40 | unsigned int index, int frac); 41 | void ff_resample_one_s16_neon(struct ResampleContext *c, void *dst0, 42 | int dst_index, const void *src0, 43 | unsigned int index, int frac); 44 | void ff_resample_one_s32_neon(struct ResampleContext *c, void *dst0, 45 | int dst_index, const void *src0, 46 | unsigned int index, int frac); 47 | 48 | av_cold void ff_audio_resample_init_aarch64(ResampleContext *c, 49 | enum AVSampleFormat sample_fmt) 50 | { 51 | int cpu_flags = av_get_cpu_flags(); 52 | 53 | if (have_neon(cpu_flags)) { 54 | if (!c->linear) { 55 | switch (sample_fmt) { 56 | case AV_SAMPLE_FMT_DBLP: 57 | c->resample_one = ff_resample_one_dbl_neon; 58 | break; 59 | case AV_SAMPLE_FMT_FLTP: 60 | c->resample_one = ff_resample_one_flt_neon; 61 | break; 62 | case AV_SAMPLE_FMT_S16P: 63 | c->resample_one = ff_resample_one_s16_neon; 64 | break; 65 | case AV_SAMPLE_FMT_S32P: 66 | c->resample_one = ff_resample_one_s32_neon; 67 | break; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/arm/Makefile: -------------------------------------------------------------------------------- 1 | OBJS += arm/audio_convert_init.o \ 2 | arm/resample_init.o 3 | 4 | OBJS-$(CONFIG_NEON_CLOBBER_TEST) += arm/neontest.o 5 | 6 | NEON-OBJS += arm/audio_convert_neon.o \ 7 | arm/resample_neon.o 8 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/arm/asm-offsets.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVRESAMPLE_ARM_ASM_OFFSETS_H 20 | #define AVRESAMPLE_ARM_ASM_OFFSETS_H 21 | 22 | /* struct ResampleContext */ 23 | #define FILTER_BANK 0x08 24 | #define FILTER_LENGTH 0x0c 25 | #define SRC_INCR 0x20 26 | #define PHASE_SHIFT 0x28 27 | #define PHASE_MASK (PHASE_SHIFT + 0x04) 28 | 29 | #endif /* AVRESAMPLE_ARM_ASM_OFFSETS_H */ 30 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/arm/audio_convert_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include 20 | 21 | #include "config.h" 22 | #include "libavutil/attributes.h" 23 | #include "libavutil/cpu.h" 24 | #include "libavutil/arm/cpu.h" 25 | #include "libavutil/samplefmt.h" 26 | #include "libavresample/audio_convert.h" 27 | 28 | void ff_conv_flt_to_s16_neon(int16_t *dst, const float *src, int len); 29 | void ff_conv_fltp_to_s16_neon(int16_t *dst, float *const *src, 30 | int len, int channels); 31 | void ff_conv_fltp_to_s16_2ch_neon(int16_t *dst, float *const *src, 32 | int len, int channels); 33 | 34 | av_cold void ff_audio_convert_init_arm(AudioConvert *ac) 35 | { 36 | int cpu_flags = av_get_cpu_flags(); 37 | 38 | if (have_neon(cpu_flags)) { 39 | ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT, 40 | 0, 16, 8, "NEON", 41 | ff_conv_flt_to_s16_neon); 42 | ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP, 43 | 0, 16, 8, "NEON", 44 | ff_conv_fltp_to_s16_neon); 45 | ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP, 46 | 2, 16, 8, "NEON", 47 | ff_conv_fltp_to_s16_2ch_neon); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/arm/neontest.c: -------------------------------------------------------------------------------- 1 | /* 2 | * check NEON registers for clobbers 3 | * Copyright (c) 2013 Martin Storsjo 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #include "libavresample/avresample.h" 23 | #include "libavutil/arm/neontest.h" 24 | 25 | wrap(avresample_convert(AVAudioResampleContext *avr, uint8_t **output, 26 | int out_plane_size, int out_samples, uint8_t **input, 27 | int in_plane_size, int in_samples)) 28 | { 29 | testneonclobbers(avresample_convert, avr, output, out_plane_size, 30 | out_samples, input, in_plane_size, in_samples); 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/arm/resample_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Peter Meerwald 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "config.h" 22 | 23 | #include "libavutil/cpu.h" 24 | #include "libavutil/arm/cpu.h" 25 | #include "libavutil/internal.h" 26 | #include "libavutil/samplefmt.h" 27 | 28 | #include "libavresample/resample.h" 29 | 30 | #include "asm-offsets.h" 31 | 32 | AV_CHECK_OFFSET(struct ResampleContext, filter_bank, FILTER_BANK); 33 | AV_CHECK_OFFSET(struct ResampleContext, filter_length, FILTER_LENGTH); 34 | AV_CHECK_OFFSET(struct ResampleContext, src_incr, SRC_INCR); 35 | AV_CHECK_OFFSET(struct ResampleContext, phase_shift, PHASE_SHIFT); 36 | AV_CHECK_OFFSET(struct ResampleContext, phase_mask, PHASE_MASK); 37 | 38 | void ff_resample_one_flt_neon(struct ResampleContext *c, void *dst0, 39 | int dst_index, const void *src0, 40 | unsigned int index, int frac); 41 | void ff_resample_one_s16_neon(struct ResampleContext *c, void *dst0, 42 | int dst_index, const void *src0, 43 | unsigned int index, int frac); 44 | void ff_resample_one_s32_neon(struct ResampleContext *c, void *dst0, 45 | int dst_index, const void *src0, 46 | unsigned int index, int frac); 47 | 48 | void ff_resample_linear_flt_neon(struct ResampleContext *c, void *dst0, 49 | int dst_index, const void *src0, 50 | unsigned int index, int frac); 51 | 52 | av_cold void ff_audio_resample_init_arm(ResampleContext *c, 53 | enum AVSampleFormat sample_fmt) 54 | { 55 | int cpu_flags = av_get_cpu_flags(); 56 | if (have_neon(cpu_flags)) { 57 | switch (sample_fmt) { 58 | case AV_SAMPLE_FMT_FLTP: 59 | if (c->linear) 60 | c->resample_one = ff_resample_linear_flt_neon; 61 | else 62 | c->resample_one = ff_resample_one_flt_neon; 63 | break; 64 | case AV_SAMPLE_FMT_S16P: 65 | if (!c->linear) 66 | c->resample_one = ff_resample_one_s16_neon; 67 | break; 68 | case AV_SAMPLE_FMT_S32P: 69 | if (!c->linear) 70 | c->resample_one = ff_resample_one_s32_neon; 71 | break; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/avresampleres.rc: -------------------------------------------------------------------------------- 1 | /* 2 | * Windows resource file for libavresample 3 | * 4 | * Copyright (C) 2012 James Almer 5 | * Copyright (C) 2013 Tiancheng "Timothy" Gu 6 | * 7 | * This file is part of FFmpeg. 8 | * 9 | * FFmpeg is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 2.1 of the License, or (at your option) any later version. 13 | * 14 | * FFmpeg is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with FFmpeg; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #include 25 | #include "libavresample/version.h" 26 | #include "libavutil/ffversion.h" 27 | #include "config.h" 28 | 29 | 1 VERSIONINFO 30 | FILEVERSION LIBAVRESAMPLE_VERSION_MAJOR, LIBAVRESAMPLE_VERSION_MINOR, LIBAVRESAMPLE_VERSION_MICRO, 0 31 | PRODUCTVERSION LIBAVRESAMPLE_VERSION_MAJOR, LIBAVRESAMPLE_VERSION_MINOR, LIBAVRESAMPLE_VERSION_MICRO, 0 32 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 33 | FILEOS VOS_NT_WINDOWS32 34 | FILETYPE VFT_DLL 35 | { 36 | BLOCK "StringFileInfo" 37 | { 38 | BLOCK "040904B0" 39 | { 40 | VALUE "CompanyName", "FFmpeg Project" 41 | VALUE "FileDescription", "Libav audio resampling library" 42 | VALUE "FileVersion", AV_STRINGIFY(LIBAVRESAMPLE_VERSION) 43 | VALUE "InternalName", "libavresample" 44 | VALUE "LegalCopyright", "Copyright (C) 2000-" AV_STRINGIFY(CONFIG_THIS_YEAR) " FFmpeg Project" 45 | VALUE "OriginalFilename", "avresample" BUILDSUF "-" AV_STRINGIFY(LIBAVRESAMPLE_VERSION_MAJOR) SLIBSUF 46 | VALUE "ProductName", "FFmpeg" 47 | VALUE "ProductVersion", FFMPEG_VERSION 48 | } 49 | } 50 | 51 | BLOCK "VarFileInfo" 52 | { 53 | VALUE "Translation", 0x0409, 0x04B0 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/dither.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Justin Ruggles 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVRESAMPLE_DITHER_H 22 | #define AVRESAMPLE_DITHER_H 23 | 24 | #include "avresample.h" 25 | #include "audio_data.h" 26 | 27 | typedef struct DitherContext DitherContext; 28 | 29 | typedef struct DitherDSPContext { 30 | /** 31 | * Convert samples from flt to s16 with added dither noise. 32 | * 33 | * @param dst destination float array, range -0.5 to 0.5 34 | * @param src source int array, range INT_MIN to INT_MAX. 35 | * @param dither float dither noise array 36 | * @param len number of samples 37 | */ 38 | void (*quantize)(int16_t *dst, const float *src, float *dither, int len); 39 | 40 | int ptr_align; ///< src and dst constraints for quantize() 41 | int samples_align; ///< len constraints for quantize() 42 | 43 | /** 44 | * Convert dither noise from int to float with triangular distribution. 45 | * 46 | * @param dst destination float array, range -0.5 to 0.5 47 | * constraints: 32-byte aligned 48 | * @param src0 source int array, range INT_MIN to INT_MAX. 49 | * the array size is len * 2 50 | * constraints: 32-byte aligned 51 | * @param len number of output noise samples 52 | * constraints: multiple of 16 53 | */ 54 | void (*dither_int_to_float)(float *dst, int *src0, int len); 55 | } DitherDSPContext; 56 | 57 | /** 58 | * Allocate and initialize a DitherContext. 59 | * 60 | * The parameters in the AVAudioResampleContext are used to initialize the 61 | * DitherContext. 62 | * 63 | * @param avr AVAudioResampleContext 64 | * @return newly-allocated DitherContext 65 | */ 66 | DitherContext *ff_dither_alloc(AVAudioResampleContext *avr, 67 | enum AVSampleFormat out_fmt, 68 | enum AVSampleFormat in_fmt, 69 | int channels, int sample_rate, int apply_map); 70 | 71 | /** 72 | * Free a DitherContext. 73 | * 74 | * @param c DitherContext 75 | */ 76 | void ff_dither_free(DitherContext **c); 77 | 78 | /** 79 | * Convert audio sample format with dithering. 80 | * 81 | * @param c DitherContext 82 | * @param dst destination audio data 83 | * @param src source audio data 84 | * @return 0 if ok, negative AVERROR code on failure 85 | */ 86 | int ff_convert_dither(DitherContext *c, AudioData *dst, AudioData *src); 87 | 88 | /* arch-specific initialization functions */ 89 | 90 | void ff_dither_init_x86(DitherDSPContext *ddsp, 91 | enum AVResampleDitherMethod method); 92 | 93 | #endif /* AVRESAMPLE_DITHER_H */ 94 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/libavresample.v: -------------------------------------------------------------------------------- 1 | LIBAVRESAMPLE_MAJOR { 2 | global: 3 | av*; 4 | local: 5 | *; 6 | }; 7 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVRESAMPLE_VERSION_H 20 | #define AVRESAMPLE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * @ingroup lavr 25 | * Libavresample version macros. 26 | */ 27 | 28 | #include "libavutil/version.h" 29 | 30 | #define LIBAVRESAMPLE_VERSION_MAJOR 3 31 | #define LIBAVRESAMPLE_VERSION_MINOR 5 32 | #define LIBAVRESAMPLE_VERSION_MICRO 0 33 | 34 | #define LIBAVRESAMPLE_VERSION_INT AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \ 35 | LIBAVRESAMPLE_VERSION_MINOR, \ 36 | LIBAVRESAMPLE_VERSION_MICRO) 37 | #define LIBAVRESAMPLE_VERSION AV_VERSION(LIBAVRESAMPLE_VERSION_MAJOR, \ 38 | LIBAVRESAMPLE_VERSION_MINOR, \ 39 | LIBAVRESAMPLE_VERSION_MICRO) 40 | #define LIBAVRESAMPLE_BUILD LIBAVRESAMPLE_VERSION_INT 41 | 42 | #define LIBAVRESAMPLE_IDENT "Lavr" AV_STRINGIFY(LIBAVRESAMPLE_VERSION) 43 | 44 | /** 45 | * FF_API_* defines may be placed below to indicate public API that will be 46 | * dropped at a future version bump. The defines themselves are not part of 47 | * the public API and may change, break or disappear at any time. 48 | */ 49 | 50 | #endif /* AVRESAMPLE_VERSION_H */ 51 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/x86/Makefile: -------------------------------------------------------------------------------- 1 | OBJS += x86/audio_convert_init.o \ 2 | x86/audio_mix_init.o \ 3 | x86/dither_init.o \ 4 | 5 | OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o 6 | 7 | YASM-OBJS += x86/audio_convert.o \ 8 | x86/audio_mix.o \ 9 | x86/dither.o \ 10 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/x86/dither_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Justin Ruggles 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "config.h" 22 | #include "libavutil/cpu.h" 23 | #include "libavutil/x86/cpu.h" 24 | #include "libavresample/dither.h" 25 | 26 | void ff_quantize_sse2(int16_t *dst, const float *src, float *dither, int len); 27 | 28 | void ff_dither_int_to_float_rectangular_sse2(float *dst, int *src, int len); 29 | void ff_dither_int_to_float_rectangular_avx(float *dst, int *src, int len); 30 | 31 | void ff_dither_int_to_float_triangular_sse2(float *dst, int *src0, int len); 32 | void ff_dither_int_to_float_triangular_avx(float *dst, int *src0, int len); 33 | 34 | av_cold void ff_dither_init_x86(DitherDSPContext *ddsp, 35 | enum AVResampleDitherMethod method) 36 | { 37 | int cpu_flags = av_get_cpu_flags(); 38 | 39 | if (EXTERNAL_SSE2(cpu_flags)) { 40 | ddsp->quantize = ff_quantize_sse2; 41 | ddsp->ptr_align = 16; 42 | ddsp->samples_align = 8; 43 | } 44 | 45 | if (method == AV_RESAMPLE_DITHER_RECTANGULAR) { 46 | if (EXTERNAL_SSE2(cpu_flags)) { 47 | ddsp->dither_int_to_float = ff_dither_int_to_float_rectangular_sse2; 48 | } 49 | if (EXTERNAL_AVX_FAST(cpu_flags)) { 50 | ddsp->dither_int_to_float = ff_dither_int_to_float_rectangular_avx; 51 | } 52 | } else { 53 | if (EXTERNAL_SSE2(cpu_flags)) { 54 | ddsp->dither_int_to_float = ff_dither_int_to_float_triangular_sse2; 55 | } 56 | if (EXTERNAL_AVX_FAST(cpu_flags)) { 57 | ddsp->dither_int_to_float = ff_dither_int_to_float_triangular_avx; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/x86/util.asm: -------------------------------------------------------------------------------- 1 | ;****************************************************************************** 2 | ;* x86 utility macros for libavresample 3 | ;* Copyright (c) 2012 Justin Ruggles 4 | ;* 5 | ;* This file is part of FFmpeg. 6 | ;* 7 | ;* FFmpeg is free software; you can redistribute it and/or 8 | ;* modify it under the terms of the GNU Lesser General Public 9 | ;* License as published by the Free Software Foundation; either 10 | ;* version 2.1 of the License, or (at your option) any later version. 11 | ;* 12 | ;* FFmpeg is distributed in the hope that it will be useful, 13 | ;* but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | ;* Lesser General Public License for more details. 16 | ;* 17 | ;* You should have received a copy of the GNU Lesser General Public 18 | ;* License along with FFmpeg; if not, write to the Free Software 19 | ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ;****************************************************************************** 21 | 22 | %macro S16_TO_S32_SX 2 ; src/low dst, high dst 23 | %if cpuflag(sse4) 24 | pmovsxwd m%2, m%1 25 | psrldq m%1, 8 26 | pmovsxwd m%1, m%1 27 | SWAP %1, %2 28 | %else 29 | mova m%2, m%1 30 | punpckhwd m%2, m%2 31 | punpcklwd m%1, m%1 32 | psrad m%2, 16 33 | psrad m%1, 16 34 | %endif 35 | %endmacro 36 | 37 | %macro DEINT2_PS 3 ; src0/even dst, src1/odd dst, temp 38 | shufps m%3, m%1, m%2, q3131 39 | shufps m%1, m%2, q2020 40 | SWAP %2,%3 41 | %endmacro 42 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavresample/x86/w64xmmtest.c: -------------------------------------------------------------------------------- 1 | /* 2 | * check XMM registers for clobbers on Win64 3 | * Copyright (c) 2013 Martin Storsjo 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #include "libavresample/avresample.h" 23 | #include "libavutil/x86/w64xmmtest.h" 24 | 25 | wrap(avresample_convert(AVAudioResampleContext *avr, uint8_t **output, 26 | int out_plane_size, int out_samples, uint8_t **input, 27 | int in_plane_size, int in_samples)) 28 | { 29 | testxmmclobbers(avresample_convert, avr, output, out_plane_size, 30 | out_samples, input, in_plane_size, in_samples); 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/adler32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Mans Rullgard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * @ingroup lavu_adler32 24 | * Public header for Adler-32 hash function implementation. 25 | */ 26 | 27 | #ifndef AVUTIL_ADLER32_H 28 | #define AVUTIL_ADLER32_H 29 | 30 | #include 31 | #include "attributes.h" 32 | 33 | /** 34 | * @defgroup lavu_adler32 Adler-32 35 | * @ingroup lavu_hash 36 | * Adler-32 hash function implementation. 37 | * 38 | * @{ 39 | */ 40 | 41 | /** 42 | * Calculate the Adler32 checksum of a buffer. 43 | * 44 | * Passing the return value to a subsequent av_adler32_update() call 45 | * allows the checksum of multiple buffers to be calculated as though 46 | * they were concatenated. 47 | * 48 | * @param adler initial checksum value 49 | * @param buf pointer to input buffer 50 | * @param len size of input buffer 51 | * @return updated checksum 52 | */ 53 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, 54 | unsigned int len) av_pure; 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | #endif /* AVUTIL_ADLER32_H */ 61 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/aes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2007 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_AES_H 22 | #define AVUTIL_AES_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_aes AES 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_aes_size; 36 | 37 | struct AVAES; 38 | 39 | /** 40 | * Allocate an AVAES context. 41 | */ 42 | struct AVAES *av_aes_alloc(void); 43 | 44 | /** 45 | * Initialize an AVAES context. 46 | * @param key_bits 128, 192 or 256 47 | * @param decrypt 0 for encryption, 1 for decryption 48 | */ 49 | int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt); 50 | 51 | /** 52 | * Encrypt or decrypt a buffer using a previously initialized context. 53 | * @param count number of 16 byte blocks 54 | * @param dst destination array, can be equal to src 55 | * @param src source array, can be equal to dst 56 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 57 | * @param decrypt 0 for encryption, 1 for decryption 58 | */ 59 | void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 60 | 61 | /** 62 | * @} 63 | */ 64 | 65 | #endif /* AVUTIL_AES_H */ 66 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/aes_ctr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * AES-CTR cipher 3 | * Copyright (c) 2015 Eran Kornblau 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_AES_CTR_H 23 | #define AVUTIL_AES_CTR_H 24 | 25 | #include 26 | 27 | #include "attributes.h" 28 | #include "version.h" 29 | 30 | #define AES_CTR_KEY_SIZE (16) 31 | #define AES_CTR_IV_SIZE (8) 32 | 33 | struct AVAESCTR; 34 | 35 | /** 36 | * Allocate an AVAESCTR context. 37 | */ 38 | struct AVAESCTR *av_aes_ctr_alloc(void); 39 | 40 | /** 41 | * Initialize an AVAESCTR context. 42 | * @param key encryption key, must have a length of AES_CTR_KEY_SIZE 43 | */ 44 | int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key); 45 | 46 | /** 47 | * Release an AVAESCTR context. 48 | */ 49 | void av_aes_ctr_free(struct AVAESCTR *a); 50 | 51 | /** 52 | * Process a buffer using a previously initialized context. 53 | * @param dst destination array, can be equal to src 54 | * @param src source array, can be equal to dst 55 | * @param size the size of src and dst 56 | */ 57 | void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size); 58 | 59 | /** 60 | * Get the current iv 61 | */ 62 | const uint8_t* av_aes_ctr_get_iv(struct AVAESCTR *a); 63 | 64 | /** 65 | * Generate a random iv 66 | */ 67 | void av_aes_ctr_set_random_iv(struct AVAESCTR *a); 68 | 69 | /** 70 | * Forcefully change the iv 71 | */ 72 | void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t* iv); 73 | 74 | /** 75 | * Increment the top 64 bit of the iv (performed after each frame) 76 | */ 77 | void av_aes_ctr_increment_iv(struct AVAESCTR *a); 78 | 79 | /** 80 | * @} 81 | */ 82 | 83 | #endif /* AVUTIL_AES_CTR_H */ 84 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/avassert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2010 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * simple assert() macros that are a bit more flexible than ISO C assert(). 24 | * @author Michael Niedermayer 25 | */ 26 | 27 | #ifndef AVUTIL_AVASSERT_H 28 | #define AVUTIL_AVASSERT_H 29 | 30 | #include 31 | #include "avutil.h" 32 | #include "log.h" 33 | 34 | /** 35 | * assert() equivalent, that is always enabled. 36 | */ 37 | #define av_assert0(cond) do { \ 38 | if (!(cond)) { \ 39 | av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \ 40 | AV_STRINGIFY(cond), __FILE__, __LINE__); \ 41 | abort(); \ 42 | } \ 43 | } while (0) 44 | 45 | 46 | /** 47 | * assert() equivalent, that does not lie in speed critical code. 48 | * These asserts() thus can be enabled without fearing speed loss. 49 | */ 50 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0 51 | #define av_assert1(cond) av_assert0(cond) 52 | #else 53 | #define av_assert1(cond) ((void)0) 54 | #endif 55 | 56 | 57 | /** 58 | * assert() equivalent, that does lie in speed critical code. 59 | */ 60 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1 61 | #define av_assert2(cond) av_assert0(cond) 62 | #define av_assert2_fpu() av_assert0_fpu() 63 | #else 64 | #define av_assert2(cond) ((void)0) 65 | #define av_assert2_fpu() ((void)0) 66 | #endif 67 | 68 | /** 69 | * Assert that floating point opperations can be executed. 70 | * 71 | * This will av_assert0() that the cpu is not in MMX state on X86 72 | */ 73 | void av_assert0_fpu(void); 74 | 75 | #endif /* AVUTIL_AVASSERT_H */ 76 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/avconfig.h: -------------------------------------------------------------------------------- 1 | /* Generated by ffconf */ 2 | #ifndef AVUTIL_AVCONFIG_H 3 | #define AVUTIL_AVCONFIG_H 4 | #define AV_HAVE_BIGENDIAN 0 5 | #define AV_HAVE_FAST_UNALIGNED 1 6 | #endif /* AVUTIL_AVCONFIG_H */ 7 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com) 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_BASE64_H 22 | #define AVUTIL_BASE64_H 23 | 24 | #include 25 | 26 | /** 27 | * @defgroup lavu_base64 Base64 28 | * @ingroup lavu_crypto 29 | * @{ 30 | */ 31 | 32 | /** 33 | * Decode a base64-encoded string. 34 | * 35 | * @param out buffer for decoded data 36 | * @param in null-terminated input string 37 | * @param out_size size in bytes of the out buffer, must be at 38 | * least 3/4 of the length of in, that is AV_BASE64_DECODE_SIZE(strlen(in)) 39 | * @return number of bytes written, or a negative value in case of 40 | * invalid input 41 | */ 42 | int av_base64_decode(uint8_t *out, const char *in, int out_size); 43 | 44 | /** 45 | * Calculate the output size in bytes needed to decode a base64 string 46 | * with length x to a data buffer. 47 | */ 48 | #define AV_BASE64_DECODE_SIZE(x) ((x) * 3LL / 4) 49 | 50 | /** 51 | * Encode data to base64 and null-terminate. 52 | * 53 | * @param out buffer for encoded data 54 | * @param out_size size in bytes of the out buffer (including the 55 | * null terminator), must be at least AV_BASE64_SIZE(in_size) 56 | * @param in input buffer containing the data to encode 57 | * @param in_size size in bytes of the in buffer 58 | * @return out or NULL in case of error 59 | */ 60 | char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); 61 | 62 | /** 63 | * Calculate the output size needed to base64-encode x bytes to a 64 | * null-terminated string. 65 | */ 66 | #define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) 67 | 68 | /** 69 | * @} 70 | */ 71 | 72 | #endif /* AVUTIL_BASE64_H */ 73 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/blowfish.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Blowfish algorithm 3 | * Copyright (c) 2012 Samuel Pitoiset 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_BLOWFISH_H 23 | #define AVUTIL_BLOWFISH_H 24 | 25 | #include 26 | 27 | /** 28 | * @defgroup lavu_blowfish Blowfish 29 | * @ingroup lavu_crypto 30 | * @{ 31 | */ 32 | 33 | #define AV_BF_ROUNDS 16 34 | 35 | typedef struct AVBlowfish { 36 | uint32_t p[AV_BF_ROUNDS + 2]; 37 | uint32_t s[4][256]; 38 | } AVBlowfish; 39 | 40 | /** 41 | * Allocate an AVBlowfish context. 42 | */ 43 | AVBlowfish *av_blowfish_alloc(void); 44 | 45 | /** 46 | * Initialize an AVBlowfish context. 47 | * 48 | * @param ctx an AVBlowfish context 49 | * @param key a key 50 | * @param key_len length of the key 51 | */ 52 | void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len); 53 | 54 | /** 55 | * Encrypt or decrypt a buffer using a previously initialized context. 56 | * 57 | * @param ctx an AVBlowfish context 58 | * @param xl left four bytes halves of input to be encrypted 59 | * @param xr right four bytes halves of input to be encrypted 60 | * @param decrypt 0 for encryption, 1 for decryption 61 | */ 62 | void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr, 63 | int decrypt); 64 | 65 | /** 66 | * Encrypt or decrypt a buffer using a previously initialized context. 67 | * 68 | * @param ctx an AVBlowfish context 69 | * @param dst destination array, can be equal to src 70 | * @param src source array, can be equal to dst 71 | * @param count number of 8 byte blocks 72 | * @param iv initialization vector for CBC mode, if NULL ECB will be used 73 | * @param decrypt 0 for encryption, 1 for decryption 74 | */ 75 | void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src, 76 | int count, uint8_t *iv, int decrypt); 77 | 78 | /** 79 | * @} 80 | */ 81 | 82 | #endif /* AVUTIL_BLOWFISH_H */ 83 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/bswap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * byte swapping routines 24 | */ 25 | 26 | #ifndef AVUTIL_BSWAP_H 27 | #define AVUTIL_BSWAP_H 28 | 29 | #include 30 | #include "libavutil/avconfig.h" 31 | #include "attributes.h" 32 | 33 | #ifdef HAVE_AV_CONFIG_H 34 | 35 | #include "config.h" 36 | 37 | #if ARCH_AARCH64 38 | # include "aarch64/bswap.h" 39 | #elif ARCH_ARM 40 | # include "arm/bswap.h" 41 | #elif ARCH_AVR32 42 | # include "avr32/bswap.h" 43 | #elif ARCH_SH4 44 | # include "sh4/bswap.h" 45 | #elif ARCH_X86 46 | # include "x86/bswap.h" 47 | #endif 48 | 49 | #endif /* HAVE_AV_CONFIG_H */ 50 | 51 | #define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff)) 52 | #define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16)) 53 | #define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32)) 54 | 55 | #define AV_BSWAPC(s, x) AV_BSWAP##s##C(x) 56 | 57 | #ifndef av_bswap16 58 | static av_always_inline av_const uint16_t av_bswap16(uint16_t x) 59 | { 60 | x= (x>>8) | (x<<8); 61 | return x; 62 | } 63 | #endif 64 | 65 | #ifndef av_bswap32 66 | static av_always_inline av_const uint32_t av_bswap32(uint32_t x) 67 | { 68 | return AV_BSWAP32C(x); 69 | } 70 | #endif 71 | 72 | #ifndef av_bswap64 73 | static inline uint64_t av_const av_bswap64(uint64_t x) 74 | { 75 | return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32); 76 | } 77 | #endif 78 | 79 | // be2ne ... big-endian to native-endian 80 | // le2ne ... little-endian to native-endian 81 | 82 | #if AV_HAVE_BIGENDIAN 83 | #define av_be2ne16(x) (x) 84 | #define av_be2ne32(x) (x) 85 | #define av_be2ne64(x) (x) 86 | #define av_le2ne16(x) av_bswap16(x) 87 | #define av_le2ne32(x) av_bswap32(x) 88 | #define av_le2ne64(x) av_bswap64(x) 89 | #define AV_BE2NEC(s, x) (x) 90 | #define AV_LE2NEC(s, x) AV_BSWAPC(s, x) 91 | #else 92 | #define av_be2ne16(x) av_bswap16(x) 93 | #define av_be2ne32(x) av_bswap32(x) 94 | #define av_be2ne64(x) av_bswap64(x) 95 | #define av_le2ne16(x) (x) 96 | #define av_le2ne32(x) (x) 97 | #define av_le2ne64(x) (x) 98 | #define AV_BE2NEC(s, x) AV_BSWAPC(s, x) 99 | #define AV_LE2NEC(s, x) (x) 100 | #endif 101 | 102 | #define AV_BE2NE16C(x) AV_BE2NEC(16, x) 103 | #define AV_BE2NE32C(x) AV_BE2NEC(32, x) 104 | #define AV_BE2NE64C(x) AV_BE2NEC(64, x) 105 | #define AV_LE2NE16C(x) AV_LE2NEC(16, x) 106 | #define AV_LE2NE32C(x) AV_LE2NEC(32, x) 107 | #define AV_LE2NE64C(x) AV_LE2NEC(64, x) 108 | 109 | #endif /* AVUTIL_BSWAP_H */ 110 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/camellia.h: -------------------------------------------------------------------------------- 1 | /* 2 | * An implementation of the CAMELLIA algorithm as mentioned in RFC3713 3 | * Copyright (c) 2014 Supraja Meedinti 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_CAMELLIA_H 23 | #define AVUTIL_CAMELLIA_H 24 | 25 | #include 26 | 27 | 28 | /** 29 | * @file 30 | * @brief Public header for libavutil CAMELLIA algorithm 31 | * @defgroup lavu_camellia CAMELLIA 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_camellia_size; 37 | 38 | struct AVCAMELLIA; 39 | 40 | /** 41 | * Allocate an AVCAMELLIA context 42 | * To free the struct: av_free(ptr) 43 | */ 44 | struct AVCAMELLIA *av_camellia_alloc(void); 45 | 46 | /** 47 | * Initialize an AVCAMELLIA context. 48 | * 49 | * @param ctx an AVCAMELLIA context 50 | * @param key a key of 16, 24, 32 bytes used for encryption/decryption 51 | * @param key_bits number of keybits: possible are 128, 192, 256 52 | */ 53 | int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits); 54 | 55 | /** 56 | * Encrypt or decrypt a buffer using a previously initialized context 57 | * 58 | * @param ctx an AVCAMELLIA context 59 | * @param dst destination array, can be equal to src 60 | * @param src source array, can be equal to dst 61 | * @param count number of 16 byte blocks 62 | * @paran iv initialization vector for CBC mode, NULL for ECB mode 63 | * @param decrypt 0 for encryption, 1 for decryption 64 | */ 65 | void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); 66 | 67 | /** 68 | * @} 69 | */ 70 | #endif /* AVUTIL_CAMELLIA_H */ 71 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/cast5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * An implementation of the CAST128 algorithm as mentioned in RFC2144 3 | * Copyright (c) 2014 Supraja Meedinti 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_CAST5_H 23 | #define AVUTIL_CAST5_H 24 | 25 | #include 26 | 27 | 28 | /** 29 | * @file 30 | * @brief Public header for libavutil CAST5 algorithm 31 | * @defgroup lavu_cast5 CAST5 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_cast5_size; 37 | 38 | struct AVCAST5; 39 | 40 | /** 41 | * Allocate an AVCAST5 context 42 | * To free the struct: av_free(ptr) 43 | */ 44 | struct AVCAST5 *av_cast5_alloc(void); 45 | /** 46 | * Initialize an AVCAST5 context. 47 | * 48 | * @param ctx an AVCAST5 context 49 | * @param key a key of 5,6,...16 bytes used for encryption/decryption 50 | * @param key_bits number of keybits: possible are 40,48,...,128 51 | * @return 0 on success, less than 0 on failure 52 | */ 53 | int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits); 54 | 55 | /** 56 | * Encrypt or decrypt a buffer using a previously initialized context, ECB mode only 57 | * 58 | * @param ctx an AVCAST5 context 59 | * @param dst destination array, can be equal to src 60 | * @param src source array, can be equal to dst 61 | * @param count number of 8 byte blocks 62 | * @param decrypt 0 for encryption, 1 for decryption 63 | */ 64 | void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, int decrypt); 65 | 66 | /** 67 | * Encrypt or decrypt a buffer using a previously initialized context 68 | * 69 | * @param ctx an AVCAST5 context 70 | * @param dst destination array, can be equal to src 71 | * @param src source array, can be equal to dst 72 | * @param count number of 8 byte blocks 73 | * @param iv initialization vector for CBC mode, NULL for ECB mode 74 | * @param decrypt 0 for encryption, 1 for decryption 75 | */ 76 | void av_cast5_crypt2(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 77 | /** 78 | * @} 79 | */ 80 | #endif /* AVUTIL_CAST5_H */ 81 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/des.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DES encryption/decryption 3 | * Copyright (c) 2007 Reimar Doeffinger 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_DES_H 23 | #define AVUTIL_DES_H 24 | 25 | #include 26 | 27 | /** 28 | * @defgroup lavu_des DES 29 | * @ingroup lavu_crypto 30 | * @{ 31 | */ 32 | 33 | typedef struct AVDES { 34 | uint64_t round_keys[3][16]; 35 | int triple_des; 36 | } AVDES; 37 | 38 | /** 39 | * Allocate an AVDES context. 40 | */ 41 | AVDES *av_des_alloc(void); 42 | 43 | /** 44 | * @brief Initializes an AVDES context. 45 | * 46 | * @param key_bits must be 64 or 192 47 | * @param decrypt 0 for encryption/CBC-MAC, 1 for decryption 48 | * @return zero on success, negative value otherwise 49 | */ 50 | int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt); 51 | 52 | /** 53 | * @brief Encrypts / decrypts using the DES algorithm. 54 | * 55 | * @param count number of 8 byte blocks 56 | * @param dst destination array, can be equal to src, must be 8-byte aligned 57 | * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL 58 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used, 59 | * must be 8-byte aligned 60 | * @param decrypt 0 for encryption, 1 for decryption 61 | */ 62 | void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 63 | 64 | /** 65 | * @brief Calculates CBC-MAC using the DES algorithm. 66 | * 67 | * @param count number of 8 byte blocks 68 | * @param dst destination array, can be equal to src, must be 8-byte aligned 69 | * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL 70 | */ 71 | void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count); 72 | 73 | /** 74 | * @} 75 | */ 76 | 77 | #endif /* AVUTIL_DES_H */ 78 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/ffversion.h: -------------------------------------------------------------------------------- 1 | /* Automatically generated by version.sh, do not manually edit! */ 2 | #ifndef AVUTIL_FFVERSION_H 3 | #define AVUTIL_FFVERSION_H 4 | #define FFMPEG_VERSION "3.2.5" 5 | #endif /* AVUTIL_FFVERSION_H */ 6 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_FILE_H 20 | #define AVUTIL_FILE_H 21 | 22 | #include 23 | 24 | #include "avutil.h" 25 | 26 | /** 27 | * @file 28 | * Misc file utilities. 29 | */ 30 | 31 | /** 32 | * Read the file with name filename, and put its content in a newly 33 | * allocated buffer or map it with mmap() when available. 34 | * In case of success set *bufptr to the read or mmapped buffer, and 35 | * *size to the size in bytes of the buffer in *bufptr. 36 | * The returned buffer must be released with av_file_unmap(). 37 | * 38 | * @param log_offset loglevel offset used for logging 39 | * @param log_ctx context used for logging 40 | * @return a non negative number in case of success, a negative value 41 | * corresponding to an AVERROR error code in case of failure 42 | */ 43 | av_warn_unused_result 44 | int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, 45 | int log_offset, void *log_ctx); 46 | 47 | /** 48 | * Unmap or free the buffer bufptr created by av_file_map(). 49 | * 50 | * @param size size in bytes of bufptr, must be the same as returned 51 | * by av_file_map() 52 | */ 53 | void av_file_unmap(uint8_t *bufptr, size_t size); 54 | 55 | /** 56 | * Wrapper to work around the lack of mkstemp() on mingw. 57 | * Also, tries to create file in /tmp first, if possible. 58 | * *prefix can be a character constant; *filename will be allocated internally. 59 | * @return file descriptor of opened file (or negative value corresponding to an 60 | * AVERROR code on error) 61 | * and opened file name in **filename. 62 | * @note On very old libcs it is necessary to set a secure umask before 63 | * calling this, av_tempfile() can't call umask itself as it is used in 64 | * libraries and could interfere with the calling application. 65 | * @deprecated as fd numbers cannot be passed saftely between libs on some platforms 66 | */ 67 | int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx); 68 | 69 | #endif /* AVUTIL_FILE_H */ 70 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/hmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Martin Storsjo 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_HMAC_H 22 | #define AVUTIL_HMAC_H 23 | 24 | #include 25 | 26 | #include "version.h" 27 | /** 28 | * @defgroup lavu_hmac HMAC 29 | * @ingroup lavu_crypto 30 | * @{ 31 | */ 32 | 33 | enum AVHMACType { 34 | AV_HMAC_MD5, 35 | AV_HMAC_SHA1, 36 | AV_HMAC_SHA224, 37 | AV_HMAC_SHA256, 38 | AV_HMAC_SHA384 = 12, 39 | AV_HMAC_SHA512, 40 | }; 41 | 42 | typedef struct AVHMAC AVHMAC; 43 | 44 | /** 45 | * Allocate an AVHMAC context. 46 | * @param type The hash function used for the HMAC. 47 | */ 48 | AVHMAC *av_hmac_alloc(enum AVHMACType type); 49 | 50 | /** 51 | * Free an AVHMAC context. 52 | * @param ctx The context to free, may be NULL 53 | */ 54 | void av_hmac_free(AVHMAC *ctx); 55 | 56 | /** 57 | * Initialize an AVHMAC context with an authentication key. 58 | * @param ctx The HMAC context 59 | * @param key The authentication key 60 | * @param keylen The length of the key, in bytes 61 | */ 62 | void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen); 63 | 64 | /** 65 | * Hash data with the HMAC. 66 | * @param ctx The HMAC context 67 | * @param data The data to hash 68 | * @param len The length of the data, in bytes 69 | */ 70 | void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len); 71 | 72 | /** 73 | * Finish hashing and output the HMAC digest. 74 | * @param ctx The HMAC context 75 | * @param out The output buffer to write the digest into 76 | * @param outlen The length of the out buffer, in bytes 77 | * @return The number of bytes written to out, or a negative error code. 78 | */ 79 | int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen); 80 | 81 | /** 82 | * Hash an array of data with a key. 83 | * @param ctx The HMAC context 84 | * @param data The data to hash 85 | * @param len The length of the data, in bytes 86 | * @param key The authentication key 87 | * @param keylen The length of the key, in bytes 88 | * @param out The output buffer to write the digest into 89 | * @param outlen The length of the out buffer, in bytes 90 | * @return The number of bytes written to out, or a negative error code. 91 | */ 92 | int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len, 93 | const uint8_t *key, unsigned int keylen, 94 | uint8_t *out, unsigned int outlen); 95 | 96 | /** 97 | * @} 98 | */ 99 | 100 | #endif /* AVUTIL_HMAC_H */ 101 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/hwcontext_cuda.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | 20 | #ifndef AVUTIL_HWCONTEXT_CUDA_H 21 | #define AVUTIL_HWCONTEXT_CUDA_H 22 | 23 | #include 24 | 25 | #include "pixfmt.h" 26 | 27 | /** 28 | * @file 29 | * An API-specific header for AV_HWDEVICE_TYPE_CUDA. 30 | * 31 | * This API supports dynamic frame pools. AVHWFramesContext.pool must return 32 | * AVBufferRefs whose data pointer is a CUdeviceptr. 33 | */ 34 | 35 | /** 36 | * This struct is allocated as AVHWDeviceContext.hwctx 37 | */ 38 | typedef struct AVCUDADeviceContext { 39 | CUcontext cuda_ctx; 40 | } AVCUDADeviceContext; 41 | 42 | /** 43 | * AVHWFramesContext.hwctx is currently not used 44 | */ 45 | 46 | #endif /* AVUTIL_HWCONTEXT_CUDA_H */ 47 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/hwcontext_dxva2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | 20 | #ifndef AVUTIL_HWCONTEXT_DXVA2_H 21 | #define AVUTIL_HWCONTEXT_DXVA2_H 22 | 23 | /** 24 | * @file 25 | * An API-specific header for AV_HWDEVICE_TYPE_DXVA2. 26 | * 27 | * Only fixed-size pools are supported. 28 | * 29 | * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs 30 | * with the data pointer set to a pointer to IDirect3DSurface9. 31 | */ 32 | 33 | #include 34 | #include 35 | 36 | /** 37 | * This struct is allocated as AVHWDeviceContext.hwctx 38 | */ 39 | typedef struct AVDXVA2DeviceContext { 40 | IDirect3DDeviceManager9 *devmgr; 41 | } AVDXVA2DeviceContext; 42 | 43 | /** 44 | * This struct is allocated as AVHWFramesContext.hwctx 45 | */ 46 | typedef struct AVDXVA2FramesContext { 47 | /** 48 | * The surface type (e.g. DXVA2_VideoProcessorRenderTarget or 49 | * DXVA2_VideoDecoderRenderTarget). Must be set by the caller. 50 | */ 51 | DWORD surface_type; 52 | 53 | /** 54 | * The surface pool. When an external pool is not provided by the caller, 55 | * this will be managed (allocated and filled on init, freed on uninit) by 56 | * libavutil. 57 | */ 58 | IDirect3DSurface9 **surfaces; 59 | int nb_surfaces; 60 | 61 | /** 62 | * Certain drivers require the decoder to be destroyed before the surfaces. 63 | * To allow internally managed pools to work properly in such cases, this 64 | * field is provided. 65 | * 66 | * If it is non-NULL, libavutil will call IDirectXVideoDecoder_Release() on 67 | * it just before the internal surface pool is freed. 68 | */ 69 | IDirectXVideoDecoder *decoder_to_release; 70 | } AVDXVA2FramesContext; 71 | 72 | #endif /* AVUTIL_HWCONTEXT_DXVA2_H */ 73 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/hwcontext_qsv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_HWCONTEXT_QSV_H 20 | #define AVUTIL_HWCONTEXT_QSV_H 21 | 22 | #include 23 | 24 | /** 25 | * @file 26 | * An API-specific header for AV_HWDEVICE_TYPE_QSV. 27 | * 28 | * This API does not support dynamic frame pools. AVHWFramesContext.pool must 29 | * contain AVBufferRefs whose data pointer points to an mfxFrameSurface1 struct. 30 | */ 31 | 32 | /** 33 | * This struct is allocated as AVHWDeviceContext.hwctx 34 | */ 35 | typedef struct AVQSVDeviceContext { 36 | mfxSession session; 37 | } AVQSVDeviceContext; 38 | 39 | /** 40 | * This struct is allocated as AVHWFramesContext.hwctx 41 | */ 42 | typedef struct AVQSVFramesContext { 43 | mfxFrameSurface1 *surfaces; 44 | int nb_surfaces; 45 | 46 | /** 47 | * A combination of MFX_MEMTYPE_* describing the frame pool. 48 | */ 49 | int frame_type; 50 | } AVQSVFramesContext; 51 | 52 | #endif /* AVUTIL_HWCONTEXT_QSV_H */ 53 | 54 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/hwcontext_vaapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_HWCONTEXT_VAAPI_H 20 | #define AVUTIL_HWCONTEXT_VAAPI_H 21 | 22 | #include 23 | 24 | /** 25 | * @file 26 | * API-specific header for AV_HWDEVICE_TYPE_VAAPI. 27 | * 28 | * Dynamic frame pools are supported, but note that any pool used as a render 29 | * target is required to be of fixed size in order to be be usable as an 30 | * argument to vaCreateContext(). 31 | * 32 | * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs 33 | * with the data pointer set to a VASurfaceID. 34 | */ 35 | 36 | /** 37 | * VAAPI connection details. 38 | * 39 | * Allocated as AVHWDeviceContext.hwctx 40 | */ 41 | typedef struct AVVAAPIDeviceContext { 42 | /** 43 | * The VADisplay handle, to be filled by the user. 44 | */ 45 | VADisplay display; 46 | } AVVAAPIDeviceContext; 47 | 48 | /** 49 | * VAAPI-specific data associated with a frame pool. 50 | * 51 | * Allocated as AVHWFramesContext.hwctx. 52 | */ 53 | typedef struct AVVAAPIFramesContext { 54 | /** 55 | * Set by the user to apply surface attributes to all surfaces in 56 | * the frame pool. If null, default settings are used. 57 | */ 58 | VASurfaceAttrib *attributes; 59 | int nb_attributes; 60 | /** 61 | * The surfaces IDs of all surfaces in the pool after creation. 62 | * Only valid if AVHWFramesContext.initial_pool_size was positive. 63 | * These are intended to be used as the render_targets arguments to 64 | * vaCreateContext(). 65 | */ 66 | VASurfaceID *surface_ids; 67 | int nb_surfaces; 68 | } AVVAAPIFramesContext; 69 | 70 | /** 71 | * VAAPI hardware pipeline configuration details. 72 | * 73 | * Allocated with av_hwdevice_hwconfig_alloc(). 74 | */ 75 | typedef struct AVVAAPIHWConfig { 76 | /** 77 | * ID of a VAAPI pipeline configuration. 78 | */ 79 | VAConfigID config_id; 80 | } AVVAAPIHWConfig; 81 | 82 | #endif /* AVUTIL_HWCONTEXT_VAAPI_H */ 83 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/hwcontext_vdpau.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_HWCONTEXT_VDPAU_H 20 | #define AVUTIL_HWCONTEXT_VDPAU_H 21 | 22 | #include 23 | 24 | /** 25 | * @file 26 | * An API-specific header for AV_HWDEVICE_TYPE_VDPAU. 27 | * 28 | * This API supports dynamic frame pools. AVHWFramesContext.pool must return 29 | * AVBufferRefs whose data pointer is a VdpVideoSurface. 30 | */ 31 | 32 | /** 33 | * This struct is allocated as AVHWDeviceContext.hwctx 34 | */ 35 | typedef struct AVVDPAUDeviceContext { 36 | VdpDevice device; 37 | VdpGetProcAddress *get_proc_address; 38 | } AVVDPAUDeviceContext; 39 | 40 | /** 41 | * AVHWFramesContext.hwctx is currently not used 42 | */ 43 | 44 | #endif /* AVUTIL_HWCONTEXT_VDPAU_H */ 45 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/intfloat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Mans Rullgard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_INTFLOAT_H 22 | #define AVUTIL_INTFLOAT_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | union av_intfloat32 { 28 | uint32_t i; 29 | float f; 30 | }; 31 | 32 | union av_intfloat64 { 33 | uint64_t i; 34 | double f; 35 | }; 36 | 37 | /** 38 | * Reinterpret a 32-bit integer as a float. 39 | */ 40 | static av_always_inline float av_int2float(uint32_t i) 41 | { 42 | union av_intfloat32 v; 43 | v.i = i; 44 | return v.f; 45 | } 46 | 47 | /** 48 | * Reinterpret a float as a 32-bit integer. 49 | */ 50 | static av_always_inline uint32_t av_float2int(float f) 51 | { 52 | union av_intfloat32 v; 53 | v.f = f; 54 | return v.i; 55 | } 56 | 57 | /** 58 | * Reinterpret a 64-bit integer as a double. 59 | */ 60 | static av_always_inline double av_int2double(uint64_t i) 61 | { 62 | union av_intfloat64 v; 63 | v.i = i; 64 | return v.f; 65 | } 66 | 67 | /** 68 | * Reinterpret a double as a 64-bit integer. 69 | */ 70 | static av_always_inline uint64_t av_double2int(double f) 71 | { 72 | union av_intfloat64 v; 73 | v.f = f; 74 | return v.i; 75 | } 76 | 77 | #endif /* AVUTIL_INTFLOAT_H */ 78 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/lfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lagged Fibonacci PRNG 3 | * Copyright (c) 2008 Michael Niedermayer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_LFG_H 23 | #define AVUTIL_LFG_H 24 | 25 | typedef struct AVLFG { 26 | unsigned int state[64]; 27 | int index; 28 | } AVLFG; 29 | 30 | void av_lfg_init(AVLFG *c, unsigned int seed); 31 | 32 | /** 33 | * Get the next random unsigned 32-bit number using an ALFG. 34 | * 35 | * Please also consider a simple LCG like state= state*1664525+1013904223, 36 | * it may be good enough and faster for your specific use case. 37 | */ 38 | static inline unsigned int av_lfg_get(AVLFG *c){ 39 | c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; 40 | return c->state[c->index++ & 63]; 41 | } 42 | 43 | /** 44 | * Get the next random unsigned 32-bit number using a MLFG. 45 | * 46 | * Please also consider av_lfg_get() above, it is faster. 47 | */ 48 | static inline unsigned int av_mlfg_get(AVLFG *c){ 49 | unsigned int a= c->state[(c->index-55) & 63]; 50 | unsigned int b= c->state[(c->index-24) & 63]; 51 | return c->state[c->index++ & 63] = 2*a*b+a+b; 52 | } 53 | 54 | /** 55 | * Get the next two numbers generated by a Box-Muller Gaussian 56 | * generator using the random numbers issued by lfg. 57 | * 58 | * @param out array where the two generated numbers are placed 59 | */ 60 | void av_bmg_get(AVLFG *lfg, double out[2]); 61 | 62 | #endif /* AVUTIL_LFG_H */ 63 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * @ingroup lavu 22 | * Utility Preprocessor macros 23 | */ 24 | 25 | #ifndef AVUTIL_MACROS_H 26 | #define AVUTIL_MACROS_H 27 | 28 | /** 29 | * @addtogroup preproc_misc Preprocessor String Macros 30 | * 31 | * String manipulation macros 32 | * 33 | * @{ 34 | */ 35 | 36 | #define AV_STRINGIFY(s) AV_TOSTRING(s) 37 | #define AV_TOSTRING(s) #s 38 | 39 | #define AV_GLUE(a, b) a ## b 40 | #define AV_JOIN(a, b) AV_GLUE(a, b) 41 | 42 | /** 43 | * @} 44 | */ 45 | 46 | #define AV_PRAGMA(s) _Pragma(#s) 47 | 48 | #define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1)) 49 | 50 | #endif /* AVUTIL_MACROS_H */ 51 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/mastering_display_metadata.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016 Neil Birkbeck 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_MASTERING_DISPLAY_METADATA_H 22 | #define AVUTIL_MASTERING_DISPLAY_METADATA_H 23 | 24 | #include "frame.h" 25 | #include "rational.h" 26 | 27 | 28 | /** 29 | * Mastering display metadata capable of representing the color volume of 30 | * the display used to master the content (SMPTE 2086:2014). 31 | * 32 | * To be used as payload of a AVFrameSideData or AVPacketSideData with the 33 | * appropriate type. 34 | * 35 | * @note The struct should be allocated with av_mastering_display_metadata_alloc() 36 | * and its size is not a part of the public ABI. 37 | */ 38 | typedef struct AVMasteringDisplayMetadata { 39 | /** 40 | * CIE 1931 xy chromaticity coords of color primaries (r, g, b order). 41 | */ 42 | AVRational display_primaries[3][2]; 43 | 44 | /** 45 | * CIE 1931 xy chromaticity coords of white point. 46 | */ 47 | AVRational white_point[2]; 48 | 49 | /** 50 | * Min luminance of mastering display (cd/m^2). 51 | */ 52 | AVRational min_luminance; 53 | 54 | /** 55 | * Max luminance of mastering display (cd/m^2). 56 | */ 57 | AVRational max_luminance; 58 | 59 | /** 60 | * Flag indicating whether the display primaries (and white point) are set. 61 | */ 62 | int has_primaries; 63 | 64 | /** 65 | * Flag indicating whether the luminance (min_ and max_) have been set. 66 | */ 67 | int has_luminance; 68 | 69 | } AVMasteringDisplayMetadata; 70 | 71 | /** 72 | * Allocate an AVMasteringDisplayMetadata structure and set its fields to 73 | * default values. The resulting struct can be freed using av_freep(). 74 | * 75 | * @return An AVMasteringDisplayMetadata filled with default values or NULL 76 | * on failure. 77 | */ 78 | AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void); 79 | 80 | /** 81 | * Allocate a complete AVMasteringDisplayMetadata and add it to the frame. 82 | * 83 | * @param frame The frame which side data is added to. 84 | * 85 | * @return The AVMasteringDisplayMetadata structure to be filled by caller. 86 | */ 87 | AVMasteringDisplayMetadata *av_mastering_display_metadata_create_side_data(AVFrame *frame); 88 | 89 | #endif /* AVUTIL_MASTERING_DISPLAY_METADATA_H */ 90 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * @ingroup lavu_md5 24 | * Public header for MD5 hash function implementation. 25 | */ 26 | 27 | #ifndef AVUTIL_MD5_H 28 | #define AVUTIL_MD5_H 29 | 30 | #include 31 | 32 | #include "attributes.h" 33 | #include "version.h" 34 | 35 | /** 36 | * @defgroup lavu_md5 MD5 37 | * @ingroup lavu_hash 38 | * MD5 hash function implementation. 39 | * 40 | * @{ 41 | */ 42 | 43 | extern const int av_md5_size; 44 | 45 | struct AVMD5; 46 | 47 | /** 48 | * Allocate an AVMD5 context. 49 | */ 50 | struct AVMD5 *av_md5_alloc(void); 51 | 52 | /** 53 | * Initialize MD5 hashing. 54 | * 55 | * @param ctx pointer to the function context (of size av_md5_size) 56 | */ 57 | void av_md5_init(struct AVMD5 *ctx); 58 | 59 | /** 60 | * Update hash value. 61 | * 62 | * @param ctx hash function context 63 | * @param src input data to update hash with 64 | * @param len input data length 65 | */ 66 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len); 67 | 68 | /** 69 | * Finish hashing and output digest value. 70 | * 71 | * @param ctx hash function context 72 | * @param dst buffer where output digest value is stored 73 | */ 74 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); 75 | 76 | /** 77 | * Hash an array of data. 78 | * 79 | * @param dst The output buffer to write the digest into 80 | * @param src The data to hash 81 | * @param len The length of the data, in bytes 82 | */ 83 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); 84 | 85 | /** 86 | * @} 87 | */ 88 | 89 | #endif /* AVUTIL_MD5_H */ 90 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/motion_vector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_MOTION_VECTOR_H 20 | #define AVUTIL_MOTION_VECTOR_H 21 | 22 | #include 23 | 24 | typedef struct AVMotionVector { 25 | /** 26 | * Where the current macroblock comes from; negative value when it comes 27 | * from the past, positive value when it comes from the future. 28 | * XXX: set exact relative ref frame reference instead of a +/- 1 "direction". 29 | */ 30 | int32_t source; 31 | /** 32 | * Width and height of the block. 33 | */ 34 | uint8_t w, h; 35 | /** 36 | * Absolute source position. Can be outside the frame area. 37 | */ 38 | int16_t src_x, src_y; 39 | /** 40 | * Absolute destination position. Can be outside the frame area. 41 | */ 42 | int16_t dst_x, dst_y; 43 | /** 44 | * Extra flag information. 45 | * Currently unused. 46 | */ 47 | uint64_t flags; 48 | /** 49 | * Motion vector 50 | * src_x = dst_x + motion_x / motion_scale 51 | * src_y = dst_y + motion_y / motion_scale 52 | */ 53 | int32_t motion_x, motion_y; 54 | uint16_t motion_scale; 55 | } AVMotionVector; 56 | 57 | #endif /* AVUTIL_MOTION_VECTOR_H */ 58 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/pixelutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_PIXELUTILS_H 20 | #define AVUTIL_PIXELUTILS_H 21 | 22 | #include 23 | #include 24 | #include "common.h" 25 | 26 | /** 27 | * Sum of abs(src1[x] - src2[x]) 28 | */ 29 | typedef int (*av_pixelutils_sad_fn)(const uint8_t *src1, ptrdiff_t stride1, 30 | const uint8_t *src2, ptrdiff_t stride2); 31 | 32 | /** 33 | * Get a potentially optimized pointer to a Sum-of-absolute-differences 34 | * function (see the av_pixelutils_sad_fn prototype). 35 | * 36 | * @param w_bits 1< 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_RANDOM_SEED_H 22 | #define AVUTIL_RANDOM_SEED_H 23 | 24 | #include 25 | /** 26 | * @addtogroup lavu_crypto 27 | * @{ 28 | */ 29 | 30 | /** 31 | * Get a seed to use in conjunction with random functions. 32 | * This function tries to provide a good seed at a best effort bases. 33 | * Its possible to call this function multiple times if more bits are needed. 34 | * It can be quite slow, which is why it should only be used as seed for a faster 35 | * PRNG. The quality of the seed depends on the platform. 36 | */ 37 | uint32_t av_get_random_seed(void); 38 | 39 | /** 40 | * @} 41 | */ 42 | 43 | #endif /* AVUTIL_RANDOM_SEED_H */ 44 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/rc4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RC4 encryption/decryption/pseudo-random number generator 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_RC4_H 22 | #define AVUTIL_RC4_H 23 | 24 | #include 25 | 26 | /** 27 | * @defgroup lavu_rc4 RC4 28 | * @ingroup lavu_crypto 29 | * @{ 30 | */ 31 | 32 | typedef struct AVRC4 { 33 | uint8_t state[256]; 34 | int x, y; 35 | } AVRC4; 36 | 37 | /** 38 | * Allocate an AVRC4 context. 39 | */ 40 | AVRC4 *av_rc4_alloc(void); 41 | 42 | /** 43 | * @brief Initializes an AVRC4 context. 44 | * 45 | * @param key_bits must be a multiple of 8 46 | * @param decrypt 0 for encryption, 1 for decryption, currently has no effect 47 | * @return zero on success, negative value otherwise 48 | */ 49 | int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt); 50 | 51 | /** 52 | * @brief Encrypts / decrypts using the RC4 algorithm. 53 | * 54 | * @param count number of bytes 55 | * @param dst destination array, can be equal to src 56 | * @param src source array, can be equal to dst, may be NULL 57 | * @param iv not (yet) used for RC4, should be NULL 58 | * @param decrypt 0 for encryption, 1 for decryption, not (yet) used 59 | */ 60 | void av_rc4_crypt(struct AVRC4 *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | #endif /* AVUTIL_RC4_H */ 67 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/replaygain.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_REPLAYGAIN_H 20 | #define AVUTIL_REPLAYGAIN_H 21 | 22 | #include 23 | 24 | /** 25 | * ReplayGain information (see 26 | * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification). 27 | * The size of this struct is a part of the public ABI. 28 | */ 29 | typedef struct AVReplayGain { 30 | /** 31 | * Track replay gain in microbels (divide by 100000 to get the value in dB). 32 | * Should be set to INT32_MIN when unknown. 33 | */ 34 | int32_t track_gain; 35 | /** 36 | * Peak track amplitude, with 100000 representing full scale (but values 37 | * may overflow). 0 when unknown. 38 | */ 39 | uint32_t track_peak; 40 | /** 41 | * Same as track_gain, but for the whole album. 42 | */ 43 | int32_t album_gain; 44 | /** 45 | * Same as track_peak, but for the whole album, 46 | */ 47 | uint32_t album_peak; 48 | } AVReplayGain; 49 | 50 | #endif /* AVUTIL_REPLAYGAIN_H */ 51 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/ripemd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * Copyright (C) 2013 James Almer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | /** 23 | * @file 24 | * @ingroup lavu_ripemd 25 | * Public header for RIPEMD hash function implementation. 26 | */ 27 | 28 | #ifndef AVUTIL_RIPEMD_H 29 | #define AVUTIL_RIPEMD_H 30 | 31 | #include 32 | 33 | #include "attributes.h" 34 | #include "version.h" 35 | 36 | /** 37 | * @defgroup lavu_ripemd RIPEMD 38 | * @ingroup lavu_hash 39 | * RIPEMD hash function implementation. 40 | * 41 | * @{ 42 | */ 43 | 44 | extern const int av_ripemd_size; 45 | 46 | struct AVRIPEMD; 47 | 48 | /** 49 | * Allocate an AVRIPEMD context. 50 | */ 51 | struct AVRIPEMD *av_ripemd_alloc(void); 52 | 53 | /** 54 | * Initialize RIPEMD hashing. 55 | * 56 | * @param context pointer to the function context (of size av_ripemd_size) 57 | * @param bits number of bits in digest (128, 160, 256 or 320 bits) 58 | * @return zero if initialization succeeded, -1 otherwise 59 | */ 60 | int av_ripemd_init(struct AVRIPEMD* context, int bits); 61 | 62 | /** 63 | * Update hash value. 64 | * 65 | * @param context hash function context 66 | * @param data input data to update hash with 67 | * @param len input data length 68 | */ 69 | void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len); 70 | 71 | /** 72 | * Finish hashing and output digest value. 73 | * 74 | * @param context hash function context 75 | * @param digest buffer where output digest value is stored 76 | */ 77 | void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest); 78 | 79 | /** 80 | * @} 81 | */ 82 | 83 | #endif /* AVUTIL_RIPEMD_H */ 84 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/sha.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * @ingroup lavu_sha 24 | * Public header for SHA-1 & SHA-256 hash function implementations. 25 | */ 26 | 27 | #ifndef AVUTIL_SHA_H 28 | #define AVUTIL_SHA_H 29 | 30 | #include 31 | 32 | #include "attributes.h" 33 | #include "version.h" 34 | 35 | /** 36 | * @defgroup lavu_sha SHA 37 | * @ingroup lavu_hash 38 | * SHA-1 and SHA-256 (Secure Hash Algorithm) hash function implementations. 39 | * 40 | * This module supports the following SHA hash functions: 41 | * 42 | * - SHA-1: 160 bits 43 | * - SHA-224: 224 bits, as a variant of SHA-2 44 | * - SHA-256: 256 bits, as a variant of SHA-2 45 | * 46 | * @see For SHA-384, SHA-512, and variants thereof, see @ref lavu_sha512. 47 | * 48 | * @{ 49 | */ 50 | 51 | extern const int av_sha_size; 52 | 53 | struct AVSHA; 54 | 55 | /** 56 | * Allocate an AVSHA context. 57 | */ 58 | struct AVSHA *av_sha_alloc(void); 59 | 60 | /** 61 | * Initialize SHA-1 or SHA-2 hashing. 62 | * 63 | * @param context pointer to the function context (of size av_sha_size) 64 | * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits) 65 | * @return zero if initialization succeeded, -1 otherwise 66 | */ 67 | int av_sha_init(struct AVSHA* context, int bits); 68 | 69 | /** 70 | * Update hash value. 71 | * 72 | * @param context hash function context 73 | * @param data input data to update hash with 74 | * @param len input data length 75 | */ 76 | void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len); 77 | 78 | /** 79 | * Finish hashing and output digest value. 80 | * 81 | * @param context hash function context 82 | * @param digest buffer where output digest value is stored 83 | */ 84 | void av_sha_final(struct AVSHA* context, uint8_t *digest); 85 | 86 | /** 87 | * @} 88 | */ 89 | 90 | #endif /* AVUTIL_SHA_H */ 91 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/sha512.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * Copyright (C) 2013 James Almer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | /** 23 | * @file 24 | * @ingroup lavu_sha512 25 | * Public header for SHA-512 implementation. 26 | */ 27 | 28 | #ifndef AVUTIL_SHA512_H 29 | #define AVUTIL_SHA512_H 30 | 31 | #include 32 | 33 | #include "attributes.h" 34 | #include "version.h" 35 | 36 | /** 37 | * @defgroup lavu_sha512 SHA-512 38 | * @ingroup lavu_hash 39 | * SHA-512 (Secure Hash Algorithm) hash function implementations. 40 | * 41 | * This module supports the following SHA-2 hash functions: 42 | * 43 | * - SHA-512/224: 224 bits 44 | * - SHA-512/256: 256 bits 45 | * - SHA-384: 384 bits 46 | * - SHA-512: 512 bits 47 | * 48 | * @see For SHA-1, SHA-256, and variants thereof, see @ref lavu_sha. 49 | * 50 | * @{ 51 | */ 52 | 53 | extern const int av_sha512_size; 54 | 55 | struct AVSHA512; 56 | 57 | /** 58 | * Allocate an AVSHA512 context. 59 | */ 60 | struct AVSHA512 *av_sha512_alloc(void); 61 | 62 | /** 63 | * Initialize SHA-2 512 hashing. 64 | * 65 | * @param context pointer to the function context (of size av_sha512_size) 66 | * @param bits number of bits in digest (224, 256, 384 or 512 bits) 67 | * @return zero if initialization succeeded, -1 otherwise 68 | */ 69 | int av_sha512_init(struct AVSHA512* context, int bits); 70 | 71 | /** 72 | * Update hash value. 73 | * 74 | * @param context hash function context 75 | * @param data input data to update hash with 76 | * @param len input data length 77 | */ 78 | void av_sha512_update(struct AVSHA512* context, const uint8_t* data, unsigned int len); 79 | 80 | /** 81 | * Finish hashing and output digest value. 82 | * 83 | * @param context hash function context 84 | * @param digest buffer where output digest value is stored 85 | */ 86 | void av_sha512_final(struct AVSHA512* context, uint8_t *digest); 87 | 88 | /** 89 | * @} 90 | */ 91 | 92 | #endif /* AVUTIL_SHA512_H */ 93 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/tea.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A 32-bit implementation of the TEA algorithm 3 | * Copyright (c) 2015 Vesselin Bontchev 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_TEA_H 23 | #define AVUTIL_TEA_H 24 | 25 | #include 26 | 27 | /** 28 | * @file 29 | * @brief Public header for libavutil TEA algorithm 30 | * @defgroup lavu_tea TEA 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_tea_size; 36 | 37 | struct AVTEA; 38 | 39 | /** 40 | * Allocate an AVTEA context 41 | * To free the struct: av_free(ptr) 42 | */ 43 | struct AVTEA *av_tea_alloc(void); 44 | 45 | /** 46 | * Initialize an AVTEA context. 47 | * 48 | * @param ctx an AVTEA context 49 | * @param key a key of 16 bytes used for encryption/decryption 50 | * @param rounds the number of rounds in TEA (64 is the "standard") 51 | */ 52 | void av_tea_init(struct AVTEA *ctx, const uint8_t key[16], int rounds); 53 | 54 | /** 55 | * Encrypt or decrypt a buffer using a previously initialized context. 56 | * 57 | * @param ctx an AVTEA context 58 | * @param dst destination array, can be equal to src 59 | * @param src source array, can be equal to dst 60 | * @param count number of 8 byte blocks 61 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 62 | * @param decrypt 0 for encryption, 1 for decryption 63 | */ 64 | void av_tea_crypt(struct AVTEA *ctx, uint8_t *dst, const uint8_t *src, 65 | int count, uint8_t *iv, int decrypt); 66 | 67 | /** 68 | * @} 69 | */ 70 | 71 | #endif /* AVUTIL_TEA_H */ 72 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000-2003 Fabrice Bellard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_TIME_H 22 | #define AVUTIL_TIME_H 23 | 24 | #include 25 | 26 | /** 27 | * Get the current time in microseconds. 28 | */ 29 | int64_t av_gettime(void); 30 | 31 | /** 32 | * Get the current time in microseconds since some unspecified starting point. 33 | * On platforms that support it, the time comes from a monotonic clock 34 | * This property makes this time source ideal for measuring relative time. 35 | * The returned values may not be monotonic on platforms where a monotonic 36 | * clock is not available. 37 | */ 38 | int64_t av_gettime_relative(void); 39 | 40 | /** 41 | * Indicates with a boolean result if the av_gettime_relative() time source 42 | * is monotonic. 43 | */ 44 | int av_gettime_relative_is_monotonic(void); 45 | 46 | /** 47 | * Sleep for a period of time. Although the duration is expressed in 48 | * microseconds, the actual delay may be rounded to the precision of the 49 | * system timer. 50 | * 51 | * @param usec Number of microseconds to sleep. 52 | * @return zero on success or (negative) error code. 53 | */ 54 | int av_usleep(unsigned usec); 55 | 56 | #endif /* AVUTIL_TIME_H */ 57 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/timestamp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * timestamp utils, mostly useful for debugging/logging purposes 22 | */ 23 | 24 | #ifndef AVUTIL_TIMESTAMP_H 25 | #define AVUTIL_TIMESTAMP_H 26 | 27 | #include "common.h" 28 | 29 | #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64) 30 | #error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS 31 | #endif 32 | 33 | #define AV_TS_MAX_STRING_SIZE 32 34 | 35 | /** 36 | * Fill the provided buffer with a string containing a timestamp 37 | * representation. 38 | * 39 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE 40 | * @param ts the timestamp to represent 41 | * @return the buffer in input 42 | */ 43 | static inline char *av_ts_make_string(char *buf, int64_t ts) 44 | { 45 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); 46 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%" PRId64, ts); 47 | return buf; 48 | } 49 | 50 | /** 51 | * Convenience macro, the return value should be used only directly in 52 | * function arguments but never stand-alone. 53 | */ 54 | #define av_ts2str(ts) av_ts_make_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts) 55 | 56 | /** 57 | * Fill the provided buffer with a string containing a timestamp time 58 | * representation. 59 | * 60 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE 61 | * @param ts the timestamp to represent 62 | * @param tb the timebase of the timestamp 63 | * @return the buffer in input 64 | */ 65 | static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb) 66 | { 67 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); 68 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts); 69 | return buf; 70 | } 71 | 72 | /** 73 | * Convenience macro, the return value should be used only directly in 74 | * function arguments but never stand-alone. 75 | */ 76 | #define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb) 77 | 78 | #endif /* AVUTIL_TIMESTAMP_H */ 79 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/twofish.h: -------------------------------------------------------------------------------- 1 | /* 2 | * An implementation of the TwoFish algorithm 3 | * Copyright (c) 2015 Supraja Meedinti 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_TWOFISH_H 23 | #define AVUTIL_TWOFISH_H 24 | 25 | #include 26 | 27 | 28 | /** 29 | * @file 30 | * @brief Public header for libavutil TWOFISH algorithm 31 | * @defgroup lavu_twofish TWOFISH 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_twofish_size; 37 | 38 | struct AVTWOFISH; 39 | 40 | /** 41 | * Allocate an AVTWOFISH context 42 | * To free the struct: av_free(ptr) 43 | */ 44 | struct AVTWOFISH *av_twofish_alloc(void); 45 | 46 | /** 47 | * Initialize an AVTWOFISH context. 48 | * 49 | * @param ctx an AVTWOFISH context 50 | * @param key a key of size ranging from 1 to 32 bytes used for encryption/decryption 51 | * @param key_bits number of keybits: 128, 192, 256 If less than the required, padded with zeroes to nearest valid value; return value is 0 if key_bits is 128/192/256, -1 if less than 0, 1 otherwise 52 | */ 53 | int av_twofish_init(struct AVTWOFISH *ctx, const uint8_t *key, int key_bits); 54 | 55 | /** 56 | * Encrypt or decrypt a buffer using a previously initialized context 57 | * 58 | * @param ctx an AVTWOFISH context 59 | * @param dst destination array, can be equal to src 60 | * @param src source array, can be equal to dst 61 | * @param count number of 16 byte blocks 62 | * @paran iv initialization vector for CBC mode, NULL for ECB mode 63 | * @param decrypt 0 for encryption, 1 for decryption 64 | */ 65 | void av_twofish_crypt(struct AVTWOFISH *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); 66 | 67 | /** 68 | * @} 69 | */ 70 | #endif /* AVUTIL_TWOFISH_H */ 71 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libavutil/xtea.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A 32-bit implementation of the XTEA algorithm 3 | * Copyright (c) 2012 Samuel Pitoiset 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_XTEA_H 23 | #define AVUTIL_XTEA_H 24 | 25 | #include 26 | 27 | /** 28 | * @file 29 | * @brief Public header for libavutil XTEA algorithm 30 | * @defgroup lavu_xtea XTEA 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | typedef struct AVXTEA { 36 | uint32_t key[16]; 37 | } AVXTEA; 38 | 39 | /** 40 | * Allocate an AVXTEA context. 41 | */ 42 | AVXTEA *av_xtea_alloc(void); 43 | 44 | /** 45 | * Initialize an AVXTEA context. 46 | * 47 | * @param ctx an AVXTEA context 48 | * @param key a key of 16 bytes used for encryption/decryption, 49 | * interpreted as big endian 32 bit numbers 50 | */ 51 | void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]); 52 | 53 | /** 54 | * Initialize an AVXTEA context. 55 | * 56 | * @param ctx an AVXTEA context 57 | * @param key a key of 16 bytes used for encryption/decryption, 58 | * interpreted as little endian 32 bit numbers 59 | */ 60 | void av_xtea_le_init(struct AVXTEA *ctx, const uint8_t key[16]); 61 | 62 | /** 63 | * Encrypt or decrypt a buffer using a previously initialized context, 64 | * in big endian format. 65 | * 66 | * @param ctx an AVXTEA context 67 | * @param dst destination array, can be equal to src 68 | * @param src source array, can be equal to dst 69 | * @param count number of 8 byte blocks 70 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 71 | * @param decrypt 0 for encryption, 1 for decryption 72 | */ 73 | void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, 74 | int count, uint8_t *iv, int decrypt); 75 | 76 | /** 77 | * Encrypt or decrypt a buffer using a previously initialized context, 78 | * in little endian format. 79 | * 80 | * @param ctx an AVXTEA context 81 | * @param dst destination array, can be equal to src 82 | * @param src source array, can be equal to dst 83 | * @param count number of 8 byte blocks 84 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 85 | * @param decrypt 0 for encryption, 1 for decryption 86 | */ 87 | void av_xtea_le_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, 88 | int count, uint8_t *iv, int decrypt); 89 | 90 | /** 91 | * @} 92 | */ 93 | 94 | #endif /* AVUTIL_XTEA_H */ 95 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libswresample/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of libswresample 5 | * 6 | * libswresample is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * libswresample is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with libswresample; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef SWRESAMPLE_VERSION_H 22 | #define SWRESAMPLE_VERSION_H 23 | 24 | /** 25 | * @file 26 | * Libswresample version macros 27 | */ 28 | 29 | #include "libavutil/avutil.h" 30 | 31 | #define LIBSWRESAMPLE_VERSION_MAJOR 2 32 | #define LIBSWRESAMPLE_VERSION_MINOR 3 33 | #define LIBSWRESAMPLE_VERSION_MICRO 100 34 | 35 | #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ 36 | LIBSWRESAMPLE_VERSION_MINOR, \ 37 | LIBSWRESAMPLE_VERSION_MICRO) 38 | #define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \ 39 | LIBSWRESAMPLE_VERSION_MINOR, \ 40 | LIBSWRESAMPLE_VERSION_MICRO) 41 | #define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT 42 | 43 | #define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION) 44 | 45 | #endif /* SWRESAMPLE_VERSION_H */ 46 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/libswscale/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef SWSCALE_VERSION_H 20 | #define SWSCALE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * swscale version macros 25 | */ 26 | 27 | #include "libavutil/version.h" 28 | 29 | #define LIBSWSCALE_VERSION_MAJOR 4 30 | #define LIBSWSCALE_VERSION_MINOR 2 31 | #define LIBSWSCALE_VERSION_MICRO 100 32 | 33 | #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ 34 | LIBSWSCALE_VERSION_MINOR, \ 35 | LIBSWSCALE_VERSION_MICRO) 36 | #define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \ 37 | LIBSWSCALE_VERSION_MINOR, \ 38 | LIBSWSCALE_VERSION_MICRO) 39 | #define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT 40 | 41 | #define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION) 42 | 43 | /** 44 | * FF_API_* defines may be placed below to indicate public API that will be 45 | * dropped at a future version bump. The defines themselves are not part of 46 | * the public API and may change, break or disappear at any time. 47 | */ 48 | 49 | #ifndef FF_API_SWS_VECTOR 50 | #define FF_API_SWS_VECTOR (LIBSWSCALE_VERSION_MAJOR < 6) 51 | #endif 52 | 53 | #endif /* SWSCALE_VERSION_H */ 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/esay/ffmtool/FfmpegTool.java: -------------------------------------------------------------------------------- 1 | package com.esay.ffmtool; 2 | 3 | import android.util.Log; 4 | /** 5 | * Created by ZBK on 2017/9/28. 6 | * Describe: 7 | */ 8 | 9 | public class FfmpegTool { 10 | 11 | static { 12 | System.loadLibrary("avutil"); 13 | System.loadLibrary("fdk-aac"); 14 | System.loadLibrary("avcodec"); 15 | System.loadLibrary("avformat"); 16 | System.loadLibrary("swscale"); 17 | System.loadLibrary("swresample"); 18 | System.loadLibrary("avfilter"); 19 | System.loadLibrary("jxffmpegrun"); 20 | } 21 | 22 | /** 23 | * 执行FFmpeg命令 24 | * @param cmd 25 | * @return 26 | */ 27 | public static native int cmdRun(String[] cmd); 28 | 29 | /** 30 | *把视频按秒解码成图片 31 | * @param srcPath 视频源地址 32 | * @param savePath 要保存的图片目录 33 | * @param startTime 从视频的什么时间开始 单位秒 34 | * @param count 要解码多少个 35 | * @return 返回码 成功0 36 | */ 37 | public static native int decodToImage(String srcPath,String savePath,int startTime,int count); 38 | 39 | 40 | 41 | public void decodToImageCall(String path,int index){ 42 | Log.i("decodToImageCall","path:"+path+"___index:"+index); 43 | } 44 | 45 | public native int decodToImageWithCall(String srcPath,String savePath,int startTime,int count); 46 | 47 | 48 | //test 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/esay/ffmtool/MyAplication.java: -------------------------------------------------------------------------------- 1 | package com.esay.ffmtool; 2 | 3 | import android.app.Application; 4 | 5 | import com.squareup.leakcanary.LeakCanary; 6 | 7 | /** 8 | * Created by KUI on 2018/1/9/009. 9 | */ 10 | 11 | public class MyAplication extends Application { 12 | 13 | 14 | @Override 15 | public void onCreate() { 16 | super.onCreate(); 17 | //初始化LeakCanary 18 | if (LeakCanary.isInAnalyzerProcess(this)) { 19 | return; 20 | } 21 | LeakCanary.install(this); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/jniLibs/arm64-v8a/libavcodec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/arm64-v8a/libavcodec.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/arm64-v8a/libavfilter.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/arm64-v8a/libavfilter.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/arm64-v8a/libavformat.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/arm64-v8a/libavformat.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/arm64-v8a/libavutil.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/arm64-v8a/libavutil.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/arm64-v8a/libfdk-aac.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/arm64-v8a/libfdk-aac.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/arm64-v8a/libswresample.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/arm64-v8a/libswresample.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/arm64-v8a/libswscale.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/arm64-v8a/libswscale.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libavcodec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi-v7a/libavcodec.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libavfilter.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi-v7a/libavfilter.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libavformat.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi-v7a/libavformat.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libavutil.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi-v7a/libavutil.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libfdk-aac.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi-v7a/libfdk-aac.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libswresample.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi-v7a/libswresample.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libswscale.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi-v7a/libswscale.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/libavcodec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi/libavcodec.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/libavfilter.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi/libavfilter.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/libavformat.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi/libavformat.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/libavutil.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi/libavutil.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/libfdk-aac.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi/libfdk-aac.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/libswresample.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi/libswresample.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/libswscale.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/jniLibs/armeabi/libswscale.so -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 22 | 23 | 34 | 35 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | FfmTool 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/com/esay/ffmtool/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.esay.ffmtool; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.3.2' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kui92/FFmpegTools/785971e2539b00789645b64690a28c2ac29c4e64/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Sep 28 10:43:54 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------