├── .gitignore ├── .idea ├── encodings.xml ├── gradle.xml ├── inspectionProfiles │ └── Project_Default.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── FFmpegAndroid ├── .gitignore ├── assets │ ├── armeabi-v7a │ │ └── ffmpeg │ └── x86 │ │ └── ffmpeg ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jni │ ├── Android.mk │ ├── Application.mk │ └── armArch.c ├── libs │ ├── armeabi-v7a │ │ └── libARM_ARCH.so │ ├── armeabi │ │ └── libARM_ARCH.so │ └── x86 │ │ └── libARM_ARCH.so ├── obj │ └── local │ │ ├── armeabi-v7a │ │ ├── libARM_ARCH.so │ │ ├── libcpufeatures.a │ │ └── objs │ │ │ ├── ARM_ARCH │ │ │ ├── armArch.o │ │ │ └── armArch.o.d │ │ │ └── cpufeatures │ │ │ ├── cpu-features.o │ │ │ └── cpu-features.o.d │ │ ├── armeabi │ │ ├── libARM_ARCH.so │ │ ├── libcpufeatures.a │ │ └── objs │ │ │ ├── ARM_ARCH │ │ │ ├── armArch.o │ │ │ └── armArch.o.d │ │ │ └── cpufeatures │ │ │ ├── cpu-features.o │ │ │ └── cpu-features.o.d │ │ └── x86 │ │ ├── libARM_ARCH.so │ │ ├── libcpufeatures.a │ │ └── objs │ │ ├── ARM_ARCH │ │ ├── armArch.o │ │ └── armArch.o.d │ │ └── cpufeatures │ │ ├── cpu-features.o │ │ └── cpu-features.o.d ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── github │ │ └── hiteshsondhi88 │ │ └── libffmpeg │ │ ├── CommonInstrumentationTestCase.java │ │ ├── CommonTestCase.java │ │ ├── CpuArchHelperTest.java │ │ ├── CpuArchTest.java │ │ ├── LogTest.java │ │ ├── ShellCommandTest.java │ │ ├── UtilTest.java │ │ └── utils │ │ ├── AssertionHelper.java │ │ ├── StubInputStream.java │ │ └── StubOutputStream.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── github │ │ └── hiteshsondhi88 │ │ └── libffmpeg │ │ ├── ArmArchHelper.java │ │ ├── CommandResult.java │ │ ├── CpuArch.java │ │ ├── CpuArchHelper.java │ │ ├── ExecuteBinaryResponseHandler.java │ │ ├── FFmpeg.java │ │ ├── FFmpegExecuteAsyncTask.java │ │ ├── FFmpegExecuteResponseHandler.java │ │ ├── FFmpegInterface.java │ │ ├── FFmpegLoadBinaryResponseHandler.java │ │ ├── FFmpegLoadLibraryAsyncTask.java │ │ ├── FileUtils.java │ │ ├── LoadBinaryResponseHandler.java │ │ ├── Log.java │ │ ├── ResponseHandler.java │ │ ├── ShellCommand.java │ │ ├── Util.java │ │ └── exceptions │ │ ├── FFmpegCommandAlreadyRunningException.java │ │ └── FFmpegNotSupportedException.java │ └── res │ └── values │ └── strings.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── tangxiaopeng │ │ └── ffmpegandroiddemo │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── apeng │ │ │ └── ffmpegandroiddemo │ │ │ ├── CompressListener.java │ │ │ ├── Compressor.java │ │ │ ├── CustomProgressDialog.java │ │ │ ├── GetPathFromUri.java │ │ │ ├── InitListener.java │ │ │ └── MainActivity.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.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 │ └── tangxiaopeng │ └── ffmpegandroiddemo │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pic └── 20181031154801.png └── 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/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 36 | 37 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 85 | 95 | 96 | 97 | 98 | 99 | 100 | 102 | 103 | C:\Users\JY\AppData\Roaming\Subversion 104 | 105 | 106 | 107 | 108 | 109 | Unnamed 110 | 111 | 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /FFmpegAndroid/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### Java ### 4 | *.class 5 | 6 | # Mobile Tools for Java (J2ME) 7 | .mtj.tmp/ 8 | 9 | # Package Files # 10 | *.jar 11 | *.war 12 | *.ear 13 | 14 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 15 | hs_err_pid* 16 | 17 | 18 | ### Eclipse ### 19 | *.pydevproject 20 | .metadata 21 | .gradle 22 | bin/ 23 | tmp/ 24 | *.tmp 25 | *.bak 26 | *.swp 27 | *~.nib 28 | local.properties 29 | .settings/ 30 | .loadpath 31 | 32 | # External tool builders 33 | .externalToolBuilders/ 34 | 35 | # Locally stored "Eclipse launch configurations" 36 | *.launch 37 | 38 | # CDT-specific 39 | .cproject 40 | 41 | # PDT-specific 42 | .buildpath 43 | 44 | # sbteclipse plugin 45 | .target 46 | 47 | # TeXlipse plugin 48 | .texlipse 49 | 50 | 51 | ### Android ### 52 | # Built application files 53 | *.apk 54 | *.ap_ 55 | 56 | # Files for the Dalvik VM 57 | *.dex 58 | 59 | # Java class files 60 | *.class 61 | 62 | # Generated files 63 | bin/ 64 | gen/ 65 | 66 | # Gradle files 67 | .gradle/ 68 | build/ 69 | 70 | # Local configuration file (sdk path, etc) 71 | local.properties 72 | 73 | # Proguard folder generated by Eclipse 74 | proguard/ 75 | 76 | # Log Files 77 | *.log 78 | 79 | 80 | ### Intellij ### 81 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 82 | 83 | /*.iml 84 | 85 | ## Directory-based project format: 86 | .idea/ 87 | # if you remove the above rule, at least ignore the follwing: 88 | 89 | # User-specific stuff: 90 | # .idea/workspace.xml 91 | # .idea/tasks.xml 92 | # .idea/dictionaries 93 | 94 | # Sensitive or high-churn files: 95 | # .idea/dataSources.ids 96 | # .idea/dataSources.xml 97 | # .idea/sqlDataSources.xml 98 | # .idea/dynamic.xml 99 | # .idea/uiDesigner.xml 100 | 101 | # Gradle: 102 | # .idea/gradle.xml 103 | # .idea/libraries 104 | 105 | # Mongo Explorer plugin: 106 | # .idea/mongoSettings.xml 107 | 108 | ## File-based project format: 109 | *.ipr 110 | *.iws 111 | 112 | ## Plugin-specific files: 113 | 114 | # IntelliJ 115 | out/ 116 | 117 | # mpeltonen/sbt-idea plugin 118 | .idea_modules/ 119 | 120 | # JIRA plugin 121 | atlassian-ide-plugin.xml 122 | 123 | # Crashlytics plugin (for Android Studio and IntelliJ) 124 | com_crashlytics_export_strings.xml 125 | 126 | 127 | ### OSX ### 128 | .DS_Store 129 | .AppleDouble 130 | .LSOverride 131 | 132 | # Icon must end with two \r 133 | Icon 134 | 135 | 136 | # Thumbnails 137 | ._* 138 | 139 | # Files that might appear on external disk 140 | .Spotlight-V100 141 | .Trashes 142 | 143 | # Directories potentially created on remote AFP share 144 | .AppleDB 145 | .AppleDesktop 146 | Network Trash Folder 147 | Temporary Items 148 | .apdisk 149 | 150 | 151 | ### Linux ### 152 | *~ 153 | 154 | # KDE directory preferences 155 | .directory 156 | .gradle 157 | -------------------------------------------------------------------------------- /FFmpegAndroid/assets/armeabi-v7a/ffmpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/assets/armeabi-v7a/ffmpeg -------------------------------------------------------------------------------- /FFmpegAndroid/assets/x86/ffmpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/assets/x86/ffmpeg -------------------------------------------------------------------------------- /FFmpegAndroid/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion "26.0.1" 6 | 7 | defaultConfig { 8 | minSdkVersion 18 9 | targetSdkVersion 26 10 | } 11 | sourceSets.main { 12 | assets.srcDirs = ['assets'] 13 | jni.srcDirs = [] //disable automatic ndk-build 14 | jniLibs.srcDirs = ['libs'] 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } 24 | 25 | dependencies { 26 | compile fileTree(dir: 'libs', include: ['*.jar']) 27 | androidTestCompile 'com.squareup.assertj:assertj-android:1.0.0' 28 | } 29 | 30 | task sourcesJar(type: Jar) { 31 | from android.sourceSets.main.java.srcDirs 32 | classifier = 'sources' 33 | } 34 | 35 | task javadoc(type: Javadoc) { 36 | source = android.sourceSets.main.java.srcDirs 37 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) 38 | } 39 | 40 | task javadocJar(type: Jar, dependsOn: javadoc) { 41 | classifier = 'javadoc' 42 | from javadoc.destinationDir 43 | } 44 | artifacts { 45 | archives javadocJar 46 | archives sourcesJar 47 | } 48 | 49 | Properties properties = new Properties() 50 | properties.load(project.rootProject.file('local.properties').newDataInputStream()) 51 | 52 | -------------------------------------------------------------------------------- /FFmpegAndroid/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=FFmpegAndroid Library 2 | POM_ARTIFACT_ID=FFmpegAndroid 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /FFmpegAndroid/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Feb 01 16:24:53 GMT+08:00 2018 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 | -------------------------------------------------------------------------------- /FFmpegAndroid/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /FFmpegAndroid/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 | -------------------------------------------------------------------------------- /FFmpegAndroid/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := ARM_ARCH 6 | 7 | LOCAL_SRC_FILES := armArch.c 8 | 9 | LOCAL_CFLAGS := -DHAVE_NEON=1 10 | LOCAL_STATIC_LIBRARIES := cpufeatures 11 | 12 | LOCAL_LDLIBS := -llog 13 | 14 | include $(BUILD_SHARED_LIBRARY) 15 | $(call import-module,cpufeatures) 16 | -------------------------------------------------------------------------------- /FFmpegAndroid/jni/Application.mk: -------------------------------------------------------------------------------- 1 | # Build for arm only 2 | APP_ABI := armeabi armeabi-v7a x86 3 | 4 | APP_PLATFORM := android-14 -------------------------------------------------------------------------------- /FFmpegAndroid/jni/armArch.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | jstring 7 | Java_com_github_hiteshsondhi88_libffmpeg_ArmArchHelper_cpuArchFromJNI(JNIEnv* env, jobject obj) 8 | { 9 | // Maximum we need to store here is ARM v7-neon 10 | // Which is 11 char long, so initializing a character array of length 11 11 | char arch_info[11] = ""; 12 | 13 | // checking if CPU is of ARM family or not 14 | if (android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM) { 15 | strcpy(arch_info, "ARM"); 16 | 17 | // checking if CPU is ARM v7 or not 18 | uint64_t cpuFeatures = android_getCpuFeatures(); 19 | if ((cpuFeatures & ANDROID_CPU_ARM_FEATURE_ARMv7) != 0) { 20 | strcat(arch_info, " v7"); 21 | 22 | // checking if CPU is ARM v7 Neon 23 | if((cpuFeatures & ANDROID_CPU_ARM_FEATURE_NEON) != 0) { 24 | strcat(arch_info, "-neon"); 25 | } 26 | } 27 | } 28 | return (*env)->NewStringUTF(env, arch_info); 29 | } 30 | -------------------------------------------------------------------------------- /FFmpegAndroid/libs/armeabi-v7a/libARM_ARCH.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/libs/armeabi-v7a/libARM_ARCH.so -------------------------------------------------------------------------------- /FFmpegAndroid/libs/armeabi/libARM_ARCH.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/libs/armeabi/libARM_ARCH.so -------------------------------------------------------------------------------- /FFmpegAndroid/libs/x86/libARM_ARCH.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/libs/x86/libARM_ARCH.so -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi-v7a/libARM_ARCH.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/armeabi-v7a/libARM_ARCH.so -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi-v7a/libcpufeatures.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/armeabi-v7a/libcpufeatures.a -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi-v7a/objs/ARM_ARCH/armArch.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/armeabi-v7a/objs/ARM_ARCH/armArch.o -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi-v7a/objs/ARM_ARCH/armArch.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi-v7a/objs/ARM_ARCH/armArch.o: jni/armArch.c \ 2 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/jni.h \ 3 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs.h \ 4 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs_elf.h \ 5 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/android/api-level.h \ 6 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdio.h \ 7 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/types.h \ 8 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdint.h \ 9 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_types.h \ 10 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/_types.h \ 11 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_wchar_limits.h \ 12 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/posix_types.h \ 13 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/stddef.h \ 14 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/compiler.h \ 15 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/posix_types.h \ 16 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/types.h \ 17 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/types.h \ 18 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/kernel.h \ 19 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysmacros.h \ 20 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdlib.h \ 21 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/string.h \ 22 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/malloc.h \ 23 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/alloca.h \ 24 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/strings.h \ 25 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/memory.h \ 26 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h 27 | 28 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/jni.h: 29 | 30 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs.h: 31 | 32 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs_elf.h: 33 | 34 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/android/api-level.h: 35 | 36 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdio.h: 37 | 38 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/types.h: 39 | 40 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdint.h: 41 | 42 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_types.h: 43 | 44 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/_types.h: 45 | 46 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_wchar_limits.h: 47 | 48 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/posix_types.h: 49 | 50 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/stddef.h: 51 | 52 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/compiler.h: 53 | 54 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/posix_types.h: 55 | 56 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/types.h: 57 | 58 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/types.h: 59 | 60 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/kernel.h: 61 | 62 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysmacros.h: 63 | 64 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdlib.h: 65 | 66 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/string.h: 67 | 68 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/malloc.h: 69 | 70 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/alloca.h: 71 | 72 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/strings.h: 73 | 74 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/memory.h: 75 | 76 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h: 77 | -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi-v7a/objs/cpufeatures/cpu-features.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/armeabi-v7a/objs/cpufeatures/cpu-features.o -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi-v7a/objs/cpufeatures/cpu-features.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi-v7a/objs/cpufeatures/cpu-features.o: \ 2 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.c \ 3 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h \ 4 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs.h \ 5 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs_elf.h \ 6 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/android/api-level.h \ 7 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdint.h \ 8 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_types.h \ 9 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/_types.h \ 10 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_wchar_limits.h \ 11 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/dlfcn.h \ 12 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/errno.h \ 13 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/errno.h \ 14 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/errno.h \ 15 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/errno.h \ 16 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/errno-base.h \ 17 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/fcntl.h \ 18 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/types.h \ 19 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/posix_types.h \ 20 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/stddef.h \ 21 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/compiler.h \ 22 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/posix_types.h \ 23 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/types.h \ 24 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/types.h \ 25 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/kernel.h \ 26 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysmacros.h \ 27 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/fcntl.h \ 28 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/fcntl.h \ 29 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/fcntl.h \ 30 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/unistd.h \ 31 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/select.h \ 32 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/time.h \ 33 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/time.h \ 34 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/signal.h \ 35 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/limits.h \ 36 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/limits.h \ 37 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/limits.h \ 38 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/internal_types.h \ 39 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/limits.h \ 40 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/syslimits.h \ 41 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/page.h \ 42 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/string.h \ 43 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/malloc.h \ 44 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/signal.h \ 45 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/signal.h \ 46 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/sigcontext.h \ 47 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/siginfo.h \ 48 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/siginfo.h \ 49 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysconf.h \ 50 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/capability.h \ 51 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/pathconf.h \ 52 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/pthread.h \ 53 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/time.h \ 54 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sched.h \ 55 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdio.h \ 56 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdlib.h \ 57 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/alloca.h \ 58 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/strings.h \ 59 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/memory.h \ 60 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/system_properties.h 61 | 62 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h: 63 | 64 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs.h: 65 | 66 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs_elf.h: 67 | 68 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/android/api-level.h: 69 | 70 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdint.h: 71 | 72 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_types.h: 73 | 74 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/_types.h: 75 | 76 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_wchar_limits.h: 77 | 78 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/dlfcn.h: 79 | 80 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/errno.h: 81 | 82 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/errno.h: 83 | 84 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/errno.h: 85 | 86 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/errno.h: 87 | 88 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/errno-base.h: 89 | 90 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/fcntl.h: 91 | 92 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/types.h: 93 | 94 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/posix_types.h: 95 | 96 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/stddef.h: 97 | 98 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/compiler.h: 99 | 100 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/posix_types.h: 101 | 102 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/types.h: 103 | 104 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/types.h: 105 | 106 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/kernel.h: 107 | 108 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysmacros.h: 109 | 110 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/fcntl.h: 111 | 112 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/fcntl.h: 113 | 114 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/fcntl.h: 115 | 116 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/unistd.h: 117 | 118 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/select.h: 119 | 120 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/time.h: 121 | 122 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/time.h: 123 | 124 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/signal.h: 125 | 126 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/limits.h: 127 | 128 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/limits.h: 129 | 130 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/limits.h: 131 | 132 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/internal_types.h: 133 | 134 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/limits.h: 135 | 136 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/syslimits.h: 137 | 138 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/page.h: 139 | 140 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/string.h: 141 | 142 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/malloc.h: 143 | 144 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/signal.h: 145 | 146 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/signal.h: 147 | 148 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/sigcontext.h: 149 | 150 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/siginfo.h: 151 | 152 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/siginfo.h: 153 | 154 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysconf.h: 155 | 156 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/capability.h: 157 | 158 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/pathconf.h: 159 | 160 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/pthread.h: 161 | 162 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/time.h: 163 | 164 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sched.h: 165 | 166 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdio.h: 167 | 168 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdlib.h: 169 | 170 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/alloca.h: 171 | 172 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/strings.h: 173 | 174 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/memory.h: 175 | 176 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/system_properties.h: 177 | -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi/libARM_ARCH.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/armeabi/libARM_ARCH.so -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi/libcpufeatures.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/armeabi/libcpufeatures.a -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi/objs/ARM_ARCH/armArch.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/armeabi/objs/ARM_ARCH/armArch.o -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi/objs/ARM_ARCH/armArch.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi/objs/ARM_ARCH/armArch.o: jni/armArch.c \ 2 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/jni.h \ 3 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs.h \ 4 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs_elf.h \ 5 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/android/api-level.h \ 6 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdio.h \ 7 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/types.h \ 8 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdint.h \ 9 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_types.h \ 10 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/_types.h \ 11 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_wchar_limits.h \ 12 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/posix_types.h \ 13 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/stddef.h \ 14 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/compiler.h \ 15 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/posix_types.h \ 16 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/types.h \ 17 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/types.h \ 18 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/kernel.h \ 19 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysmacros.h \ 20 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdlib.h \ 21 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/string.h \ 22 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/malloc.h \ 23 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/alloca.h \ 24 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/strings.h \ 25 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/memory.h \ 26 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h 27 | 28 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/jni.h: 29 | 30 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs.h: 31 | 32 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs_elf.h: 33 | 34 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/android/api-level.h: 35 | 36 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdio.h: 37 | 38 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/types.h: 39 | 40 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdint.h: 41 | 42 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_types.h: 43 | 44 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/_types.h: 45 | 46 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_wchar_limits.h: 47 | 48 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/posix_types.h: 49 | 50 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/stddef.h: 51 | 52 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/compiler.h: 53 | 54 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/posix_types.h: 55 | 56 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/types.h: 57 | 58 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/types.h: 59 | 60 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/kernel.h: 61 | 62 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysmacros.h: 63 | 64 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdlib.h: 65 | 66 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/string.h: 67 | 68 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/malloc.h: 69 | 70 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/alloca.h: 71 | 72 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/strings.h: 73 | 74 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/memory.h: 75 | 76 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h: 77 | -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi/objs/cpufeatures/cpu-features.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/armeabi/objs/cpufeatures/cpu-features.o -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/armeabi/objs/cpufeatures/cpu-features.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi/objs/cpufeatures/cpu-features.o: \ 2 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.c \ 3 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h \ 4 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs.h \ 5 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs_elf.h \ 6 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/android/api-level.h \ 7 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdint.h \ 8 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_types.h \ 9 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/_types.h \ 10 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_wchar_limits.h \ 11 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/dlfcn.h \ 12 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/errno.h \ 13 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/errno.h \ 14 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/errno.h \ 15 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/errno.h \ 16 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/errno-base.h \ 17 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/fcntl.h \ 18 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/types.h \ 19 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/posix_types.h \ 20 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/stddef.h \ 21 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/compiler.h \ 22 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/posix_types.h \ 23 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/types.h \ 24 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/types.h \ 25 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/kernel.h \ 26 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysmacros.h \ 27 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/fcntl.h \ 28 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/fcntl.h \ 29 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/fcntl.h \ 30 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/unistd.h \ 31 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/select.h \ 32 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/time.h \ 33 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/time.h \ 34 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/signal.h \ 35 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/limits.h \ 36 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/limits.h \ 37 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/limits.h \ 38 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/internal_types.h \ 39 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/limits.h \ 40 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/syslimits.h \ 41 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/page.h \ 42 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/string.h \ 43 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/malloc.h \ 44 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/signal.h \ 45 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/signal.h \ 46 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/sigcontext.h \ 47 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/siginfo.h \ 48 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/siginfo.h \ 49 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysconf.h \ 50 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/capability.h \ 51 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/pathconf.h \ 52 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/pthread.h \ 53 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/time.h \ 54 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sched.h \ 55 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdio.h \ 56 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdlib.h \ 57 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/alloca.h \ 58 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/strings.h \ 59 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/memory.h \ 60 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/system_properties.h 61 | 62 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h: 63 | 64 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs.h: 65 | 66 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/cdefs_elf.h: 67 | 68 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/android/api-level.h: 69 | 70 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdint.h: 71 | 72 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_types.h: 73 | 74 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/_types.h: 75 | 76 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/_wchar_limits.h: 77 | 78 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/dlfcn.h: 79 | 80 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/errno.h: 81 | 82 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/errno.h: 83 | 84 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/errno.h: 85 | 86 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/errno.h: 87 | 88 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/errno-base.h: 89 | 90 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/fcntl.h: 91 | 92 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/types.h: 93 | 94 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/posix_types.h: 95 | 96 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/stddef.h: 97 | 98 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/compiler.h: 99 | 100 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/posix_types.h: 101 | 102 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/types.h: 103 | 104 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/types.h: 105 | 106 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/kernel.h: 107 | 108 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysmacros.h: 109 | 110 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/fcntl.h: 111 | 112 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/fcntl.h: 113 | 114 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/fcntl.h: 115 | 116 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/unistd.h: 117 | 118 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/select.h: 119 | 120 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/time.h: 121 | 122 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/time.h: 123 | 124 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/signal.h: 125 | 126 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/limits.h: 127 | 128 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/limits.h: 129 | 130 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/limits.h: 131 | 132 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/internal_types.h: 133 | 134 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/machine/limits.h: 135 | 136 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/syslimits.h: 137 | 138 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/page.h: 139 | 140 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/string.h: 141 | 142 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/malloc.h: 143 | 144 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/signal.h: 145 | 146 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/signal.h: 147 | 148 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/sigcontext.h: 149 | 150 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm/siginfo.h: 151 | 152 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/asm-generic/siginfo.h: 153 | 154 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/sysconf.h: 155 | 156 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/linux/capability.h: 157 | 158 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/pathconf.h: 159 | 160 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/pthread.h: 161 | 162 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/time.h: 163 | 164 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sched.h: 165 | 166 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdio.h: 167 | 168 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/stdlib.h: 169 | 170 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/alloca.h: 171 | 172 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/strings.h: 173 | 174 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/memory.h: 175 | 176 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-arm/usr/include/sys/system_properties.h: 177 | -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/x86/libARM_ARCH.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/x86/libARM_ARCH.so -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/x86/libcpufeatures.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/x86/libcpufeatures.a -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/x86/objs/ARM_ARCH/armArch.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/x86/objs/ARM_ARCH/armArch.o -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/x86/objs/ARM_ARCH/armArch.o.d: -------------------------------------------------------------------------------- 1 | obj/local/x86/objs/ARM_ARCH/armArch.o: jni/armArch.c \ 2 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/jni.h \ 3 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/cdefs.h \ 4 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/cdefs_elf.h \ 5 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/android/api-level.h \ 6 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdio.h \ 7 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/types.h \ 8 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdint.h \ 9 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/_types.h \ 10 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/_types.h \ 11 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/_wchar_limits.h \ 12 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/posix_types.h \ 13 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/stddef.h \ 14 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/compiler.h \ 15 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/posix_types.h \ 16 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/posix_types_32.h \ 17 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/types.h \ 18 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/types.h \ 19 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/kernel.h \ 20 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/sysmacros.h \ 21 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdlib.h \ 22 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/string.h \ 23 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/malloc.h \ 24 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/alloca.h \ 25 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/strings.h \ 26 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/memory.h \ 27 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h 28 | 29 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/jni.h: 30 | 31 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/cdefs.h: 32 | 33 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/cdefs_elf.h: 34 | 35 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/android/api-level.h: 36 | 37 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdio.h: 38 | 39 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/types.h: 40 | 41 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdint.h: 42 | 43 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/_types.h: 44 | 45 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/_types.h: 46 | 47 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/_wchar_limits.h: 48 | 49 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/posix_types.h: 50 | 51 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/stddef.h: 52 | 53 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/compiler.h: 54 | 55 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/posix_types.h: 56 | 57 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/posix_types_32.h: 58 | 59 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/types.h: 60 | 61 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/types.h: 62 | 63 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/kernel.h: 64 | 65 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/sysmacros.h: 66 | 67 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdlib.h: 68 | 69 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/string.h: 70 | 71 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/malloc.h: 72 | 73 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/alloca.h: 74 | 75 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/strings.h: 76 | 77 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/memory.h: 78 | 79 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h: 80 | -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/x86/objs/cpufeatures/cpu-features.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangpeng/FFmpegDemo/a602325c0e224ddc7e3402668a2f4bd9d9b4b1d5/FFmpegAndroid/obj/local/x86/objs/cpufeatures/cpu-features.o -------------------------------------------------------------------------------- /FFmpegAndroid/obj/local/x86/objs/cpufeatures/cpu-features.o.d: -------------------------------------------------------------------------------- 1 | obj/local/x86/objs/cpufeatures/cpu-features.o: \ 2 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.c \ 3 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h \ 4 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/cdefs.h \ 5 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/cdefs_elf.h \ 6 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/android/api-level.h \ 7 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdint.h \ 8 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/_types.h \ 9 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/_types.h \ 10 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/_wchar_limits.h \ 11 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/dlfcn.h \ 12 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/errno.h \ 13 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/errno.h \ 14 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/errno.h \ 15 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm-generic/errno.h \ 16 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm-generic/errno-base.h \ 17 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/fcntl.h \ 18 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/types.h \ 19 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/posix_types.h \ 20 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/stddef.h \ 21 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/compiler.h \ 22 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/posix_types.h \ 23 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/posix_types_32.h \ 24 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/types.h \ 25 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/types.h \ 26 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/kernel.h \ 27 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/sysmacros.h \ 28 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/fcntl.h \ 29 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/fcntl.h \ 30 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm-generic/fcntl.h \ 31 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/unistd.h \ 32 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/select.h \ 33 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/time.h \ 34 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/time.h \ 35 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/signal.h \ 36 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/limits.h \ 37 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/limits.h \ 38 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/limits.h \ 39 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/internal_types.h \ 40 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/limits.h \ 41 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/syslimits.h \ 42 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/page.h \ 43 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/page_32.h \ 44 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/string.h \ 45 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/malloc.h \ 46 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/signal.h \ 47 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm-generic/signal.h \ 48 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/sigcontext.h \ 49 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/siginfo.h \ 50 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm-generic/siginfo.h \ 51 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/sysconf.h \ 52 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/capability.h \ 53 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/pathconf.h \ 54 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/pthread.h \ 55 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/time.h \ 56 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sched.h \ 57 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdio.h \ 58 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdlib.h \ 59 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/alloca.h \ 60 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/strings.h \ 61 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/memory.h \ 62 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/system_properties.h 63 | 64 | /Users/sb/Documents/android-ndk-r10/sources//android/cpufeatures/cpu-features.h: 65 | 66 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/cdefs.h: 67 | 68 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/cdefs_elf.h: 69 | 70 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/android/api-level.h: 71 | 72 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdint.h: 73 | 74 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/_types.h: 75 | 76 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/_types.h: 77 | 78 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/_wchar_limits.h: 79 | 80 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/dlfcn.h: 81 | 82 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/errno.h: 83 | 84 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/errno.h: 85 | 86 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/errno.h: 87 | 88 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm-generic/errno.h: 89 | 90 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm-generic/errno-base.h: 91 | 92 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/fcntl.h: 93 | 94 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/types.h: 95 | 96 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/posix_types.h: 97 | 98 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/stddef.h: 99 | 100 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/compiler.h: 101 | 102 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/posix_types.h: 103 | 104 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/posix_types_32.h: 105 | 106 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/types.h: 107 | 108 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/types.h: 109 | 110 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/kernel.h: 111 | 112 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/sysmacros.h: 113 | 114 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/fcntl.h: 115 | 116 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/fcntl.h: 117 | 118 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm-generic/fcntl.h: 119 | 120 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/unistd.h: 121 | 122 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/select.h: 123 | 124 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/time.h: 125 | 126 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/time.h: 127 | 128 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/signal.h: 129 | 130 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/limits.h: 131 | 132 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/limits.h: 133 | 134 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/limits.h: 135 | 136 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/internal_types.h: 137 | 138 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/machine/limits.h: 139 | 140 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/syslimits.h: 141 | 142 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/page.h: 143 | 144 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/page_32.h: 145 | 146 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/string.h: 147 | 148 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/malloc.h: 149 | 150 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/signal.h: 151 | 152 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm-generic/signal.h: 153 | 154 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/sigcontext.h: 155 | 156 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm/siginfo.h: 157 | 158 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/asm-generic/siginfo.h: 159 | 160 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/sysconf.h: 161 | 162 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/linux/capability.h: 163 | 164 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/pathconf.h: 165 | 166 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/pthread.h: 167 | 168 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/time.h: 169 | 170 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sched.h: 171 | 172 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdio.h: 173 | 174 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/stdlib.h: 175 | 176 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/alloca.h: 177 | 178 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/strings.h: 179 | 180 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/memory.h: 181 | 182 | /Users/sb/Documents/android-ndk-r10/platforms/android-14/arch-x86/usr/include/sys/system_properties.h: 183 | -------------------------------------------------------------------------------- /FFmpegAndroid/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 /Applications/Android Studio.app/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 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/androidTest/java/com/github/hiteshsondhi88/libffmpeg/CommonInstrumentationTestCase.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import android.test.InstrumentationTestCase; 4 | 5 | public class CommonInstrumentationTestCase extends InstrumentationTestCase { 6 | 7 | @Override 8 | protected void setUp() throws Exception { 9 | super.setUp(); 10 | Log.setDEBUG(true); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/androidTest/java/com/github/hiteshsondhi88/libffmpeg/CommonTestCase.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import junit.framework.TestCase; 4 | 5 | public abstract class CommonTestCase extends TestCase { 6 | 7 | public void setUp() throws Exception { 8 | super.setUp(); 9 | Log.setDEBUG(true); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/androidTest/java/com/github/hiteshsondhi88/libffmpeg/CpuArchHelperTest.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import android.os.Build; 4 | 5 | import junit.framework.TestCase; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | public class CpuArchHelperTest extends TestCase { 10 | 11 | public void testGetCpuArch() throws Exception { 12 | CpuArch cpuArch = CpuArchHelper.getCpuArch(); 13 | assertNotNull(cpuArch); 14 | if (Build.CPU_ABI.equals(CpuArchHelper.getx86CpuAbi()) || Build.CPU_ABI.equals(CpuArchHelper.getx86_64CpuAbi())) { 15 | assertEquals(cpuArch, CpuArch.x86); 16 | } else if (Build.CPU_ABI.equals(CpuArchHelper.getArmeabiv7CpuAbi())) { 17 | assertEquals(cpuArch, CpuArch.ARMv7); 18 | } else if (Build.CPU_ABI.equals(CpuArchHelper.getArm64CpuAbi())) { 19 | assertEquals(cpuArch, CpuArch.ARMv7); 20 | }else { 21 | assertEquals(cpuArch, CpuArch.NONE); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /FFmpegAndroid/src/androidTest/java/com/github/hiteshsondhi88/libffmpeg/CpuArchTest.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import android.content.res.AssetManager; 4 | import android.text.TextUtils; 5 | 6 | import com.github.hiteshsondhi88.libffmpeg.utils.AssertionHelper; 7 | 8 | import java.io.IOException; 9 | import java.io.InputStream; 10 | 11 | import static org.assertj.core.api.Assertions.assertThat; 12 | 13 | public class CpuArchTest extends CommonInstrumentationTestCase { 14 | 15 | public void testFFmpegAssetsWithSha1Sum() { 16 | testFFmpegAsset(CpuArch.ARMv7, "armeabi-v7a/ffmpeg"); 17 | testFFmpegAsset(CpuArch.x86, "x86/ffmpeg"); 18 | } 19 | 20 | private void testFFmpegAsset(CpuArch cpuArch, String assetsPath) { 21 | AssetManager assetMgr = getInstrumentation().getContext().getResources().getAssets(); 22 | InputStream is = null; 23 | try { 24 | is = assetMgr.open(assetsPath); 25 | String assetSha1Sum = FileUtils.SHA1(is); 26 | assertThat(!TextUtils.isEmpty(cpuArch.getSha1()) 27 | && !TextUtils.isEmpty(assetSha1Sum) 28 | && cpuArch.getSha1().equals(assetSha1Sum)).isTrue(); 29 | } catch (IOException e) { 30 | Log.e(e); 31 | AssertionHelper.assertError("error validating ffmpeg asset "+assetsPath); 32 | } finally { 33 | Util.close(is); 34 | } 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/androidTest/java/com/github/hiteshsondhi88/libffmpeg/LogTest.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import com.github.hiteshsondhi88.libffmpeg.utils.AssertionHelper; 4 | 5 | /** 6 | * Trying Logging everything I can Log.java class should never throw any error 7 | */ 8 | public class LogTest extends CommonTestCase { 9 | 10 | private Object[] OBJECTS_TO_TEST = {null, "", "test string", 1, 1.00123, 2.45225747946181e-072}; 11 | private Throwable[] EXCEPTIONS_TO_TEST = {new Exception(), new Exception("Test exception"), new Exception("")}; 12 | 13 | public void testD() throws Exception { 14 | printLog(new PrintLogInterface() { 15 | @Override 16 | public void print(Object obj) throws Exception { 17 | Log.d(obj); 18 | } 19 | 20 | @Override 21 | public void print(Throwable throwable) throws Exception { 22 | Log.d(throwable); 23 | } 24 | }); 25 | } 26 | 27 | public void testW() throws Exception { 28 | printLog(new PrintLogInterface() { 29 | @Override 30 | public void print(Object obj) throws Exception { 31 | Log.w(obj); 32 | } 33 | 34 | @Override 35 | public void print(Throwable throwable) throws Exception { 36 | Log.w(throwable); 37 | } 38 | }); 39 | } 40 | 41 | public void testI() throws Exception { 42 | printLog(new PrintLogInterface() { 43 | @Override 44 | public void print(Object obj) throws Exception { 45 | Log.i(obj); 46 | } 47 | 48 | @Override 49 | public void print(Throwable throwable) throws Exception { 50 | Log.i(throwable); 51 | } 52 | }); 53 | } 54 | 55 | public void testV() throws Exception { 56 | printLog(new PrintLogInterface() { 57 | @Override 58 | public void print(Object obj) throws Exception { 59 | Log.v(obj); 60 | } 61 | 62 | @Override 63 | public void print(Throwable throwable) throws Exception { 64 | Log.v(throwable); 65 | } 66 | }); 67 | } 68 | 69 | public void testE() throws Exception { 70 | printLog(new PrintLogInterface() { 71 | @Override 72 | public void print(Object obj) throws Exception { 73 | Log.e(obj); 74 | } 75 | 76 | @Override 77 | public void print(Throwable throwable) throws Exception { 78 | Log.e(throwable); 79 | } 80 | }); 81 | 82 | for (Object obj : OBJECTS_TO_TEST) { 83 | for (Throwable throwable : EXCEPTIONS_TO_TEST) { 84 | try { 85 | Log.e(obj, throwable); 86 | } catch (Exception e) { 87 | AssertionHelper.assertError("Logging failed for object " + obj + " and throwable " + throwable); 88 | } 89 | } 90 | } 91 | } 92 | 93 | private void printLog(PrintLogInterface printLogInterface) { 94 | for (Object obj : OBJECTS_TO_TEST) { 95 | try { 96 | printLogInterface.print(obj); 97 | } catch (Exception e) { 98 | AssertionHelper.assertError("Logging failed for object "+obj); 99 | } 100 | } 101 | for (Throwable throwable : EXCEPTIONS_TO_TEST) { 102 | try { 103 | printLogInterface.print(throwable); 104 | } catch (Exception e) { 105 | AssertionHelper.assertError("Logging failed for throwable "+throwable); 106 | } 107 | } 108 | } 109 | 110 | private interface PrintLogInterface { 111 | void print(Object obj) throws Exception; 112 | void print(Throwable throwable) throws Exception; 113 | } 114 | } -------------------------------------------------------------------------------- /FFmpegAndroid/src/androidTest/java/com/github/hiteshsondhi88/libffmpeg/ShellCommandTest.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import com.github.hiteshsondhi88.libffmpeg.utils.AssertionHelper; 4 | 5 | import java.util.concurrent.ExecutorService; 6 | import java.util.concurrent.Executors; 7 | import java.util.concurrent.Future; 8 | import java.util.concurrent.TimeUnit; 9 | import java.util.concurrent.TimeoutException; 10 | 11 | import static org.assertj.core.api.Assertions.assertThat; 12 | 13 | public class ShellCommandTest extends CommonTestCase { 14 | 15 | public void testRun() throws Exception { 16 | ShellCommand shellCommand = new ShellCommand(); 17 | final Process process = shellCommand.run(new String[] {"logcat"}); 18 | assertNotNull(process); 19 | assertEquals(false, Util.isProcessCompleted(process)); 20 | 21 | Util.destroyProcess(process); 22 | 23 | ExecutorService executor = Executors.newSingleThreadExecutor(); 24 | 25 | Future future = executor.submit(new Runnable() { 26 | @Override 27 | public void run() { 28 | String errorStream = Util.convertInputStreamToString(process.getErrorStream()); 29 | String inputStream = Util.convertInputStreamToString(process.getInputStream()); 30 | 31 | assertEquals(null, errorStream); 32 | assertEquals(null, inputStream); 33 | } 34 | }); 35 | 36 | try { 37 | future.get(1, TimeUnit.SECONDS); 38 | } catch (TimeoutException e) { 39 | AssertionHelper.assertError("could not destroy process"); 40 | } 41 | 42 | executor.shutdownNow(); 43 | } 44 | 45 | public void testRunWaitFor() throws Exception { 46 | ShellCommand shellCommand = new ShellCommand(); 47 | CommandResult commandResult = shellCommand.runWaitFor(new String[] {"ls"}); 48 | assertNotNull(commandResult); 49 | assertEquals(true, commandResult.success); 50 | assertThat(commandResult.output).isNotEmpty(); 51 | } 52 | } -------------------------------------------------------------------------------- /FFmpegAndroid/src/androidTest/java/com/github/hiteshsondhi88/libffmpeg/UtilTest.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import android.os.AsyncTask; 4 | 5 | import com.github.hiteshsondhi88.libffmpeg.utils.AssertionHelper; 6 | import com.github.hiteshsondhi88.libffmpeg.utils.StubInputStream; 7 | import com.github.hiteshsondhi88.libffmpeg.utils.StubOutputStream; 8 | 9 | import java.io.ByteArrayInputStream; 10 | import java.io.InputStream; 11 | import java.util.concurrent.ExecutorService; 12 | import java.util.concurrent.Executors; 13 | import java.util.concurrent.Future; 14 | import java.util.concurrent.TimeUnit; 15 | import java.util.concurrent.TimeoutException; 16 | 17 | public class UtilTest extends CommonTestCase { 18 | 19 | public void testIsDebug() throws Exception { 20 | // do nothing for now 21 | } 22 | 23 | public void testCloseInputStream() throws Exception { 24 | StubInputStream stubInputStream = new StubInputStream(); 25 | // initially input stream shouldn't be closed 26 | assertEquals(false, stubInputStream.isClosed()); 27 | 28 | // closing input stream 29 | Util.close(stubInputStream); 30 | 31 | // Input stream should be closed now 32 | assertEquals(true, stubInputStream.isClosed()); 33 | } 34 | 35 | public void testCloseOutputStream() throws Exception { 36 | StubOutputStream stubOutputStream = new StubOutputStream(); 37 | // initially output stream shouldn't be closed 38 | assertEquals(false, stubOutputStream.isClosed()); 39 | 40 | // closing output stream 41 | Util.close(stubOutputStream); 42 | 43 | // Output stream should be closed now 44 | assertEquals(true, stubOutputStream.isClosed()); 45 | } 46 | 47 | public void testConvertInputStreamToString() throws Exception { 48 | String exampleString1 = "Example to provide source to InputStream"; 49 | String exampleString2 = ""; 50 | String exampleString3 = 1+""; 51 | InputStream stream1 = new ByteArrayInputStream(exampleString1.getBytes()); 52 | InputStream stream2 = new ByteArrayInputStream(exampleString2.getBytes()); 53 | InputStream stream3 = new ByteArrayInputStream(exampleString3.getBytes()); 54 | String output1 = Util.convertInputStreamToString(stream1); 55 | String output2 = Util.convertInputStreamToString(stream2); 56 | String output3 = Util.convertInputStreamToString(stream3); 57 | 58 | assertEquals(output1, exampleString1); 59 | assertEquals(output2, exampleString2); 60 | assertEquals(output3, exampleString3); 61 | } 62 | 63 | public void testDestroyProcessAndIsProcessCompleted() throws Exception { 64 | final Process process = Runtime.getRuntime().exec("logcat"); 65 | assertEquals(false, Util.isProcessCompleted(process)); 66 | 67 | Util.destroyProcess(process); 68 | 69 | ExecutorService executor = Executors.newSingleThreadExecutor(); 70 | 71 | Future future = executor.submit(new Runnable() { 72 | @Override 73 | public void run() { 74 | String errorStream = Util.convertInputStreamToString(process.getErrorStream()); 75 | String inputStream = Util.convertInputStreamToString(process.getInputStream()); 76 | 77 | assertEquals(null, errorStream); 78 | assertEquals(null, inputStream); 79 | } 80 | }); 81 | 82 | try { 83 | future.get(1, TimeUnit.SECONDS); 84 | } catch (TimeoutException e) { 85 | AssertionHelper.assertError("could not destroy process"); 86 | } 87 | 88 | executor.shutdownNow(); 89 | } 90 | 91 | public void testKillAsync() throws Exception { 92 | AsyncTask asyncTask = new AsyncTask() { 93 | @Override 94 | protected Void doInBackground(Void... params) { 95 | try { 96 | Log.d("AsyncTask started and putting to sleep"); 97 | Thread.sleep(5000); 98 | Log.d("could not kill AsyncTask"); 99 | AssertionHelper.assertError("could not kill AsyncTask"); 100 | } catch (InterruptedException e) { 101 | Log.d("AsyncTask has been terminated"); 102 | AssertionHelper.assertError("AsyncTask has been terminated"); 103 | } 104 | return null; 105 | } 106 | }; 107 | asyncTask.execute(); 108 | assertEquals(true, Util.killAsync(asyncTask)); 109 | } 110 | } -------------------------------------------------------------------------------- /FFmpegAndroid/src/androidTest/java/com/github/hiteshsondhi88/libffmpeg/utils/AssertionHelper.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg.utils; 2 | 3 | import static junit.framework.Assert.assertTrue; 4 | 5 | @SuppressWarnings("unused") 6 | public class AssertionHelper { 7 | 8 | public static void assertError(String message) { 9 | assertTrue(message, false); 10 | } 11 | 12 | public static void assertError() { 13 | assertError(""); 14 | } 15 | 16 | public static void assertOK(String message) { 17 | assertTrue(message, true); 18 | } 19 | 20 | public static void assertOK() { 21 | assertOK(""); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/androidTest/java/com/github/hiteshsondhi88/libffmpeg/utils/StubInputStream.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg.utils; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | public class StubInputStream extends InputStream { 7 | 8 | private boolean closed = false; 9 | 10 | @Override 11 | public int read() throws IOException { 12 | // Do nothing for now, just need to test if input stream is closed 13 | return 0; 14 | } 15 | 16 | @Override 17 | public void close() throws IOException { 18 | super.close(); 19 | closed = true; 20 | } 21 | 22 | public boolean isClosed() { 23 | return closed; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/androidTest/java/com/github/hiteshsondhi88/libffmpeg/utils/StubOutputStream.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg.utils; 2 | 3 | import java.io.IOException; 4 | import java.io.OutputStream; 5 | 6 | public class StubOutputStream extends OutputStream { 7 | 8 | private boolean closed = false; 9 | 10 | @Override 11 | public void write(int oneByte) throws IOException { 12 | // Do nothing for now, just need to test if output stream is closed 13 | } 14 | 15 | @Override 16 | public void close() throws IOException { 17 | super.close(); 18 | closed = true; 19 | } 20 | 21 | public boolean isClosed() { 22 | return closed; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/ArmArchHelper.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | class ArmArchHelper { 4 | static { 5 | System.loadLibrary("ARM_ARCH"); 6 | } 7 | 8 | native String cpuArchFromJNI(); 9 | 10 | boolean isARM_v7_CPU(String cpuInfoString) { 11 | return cpuInfoString.contains("v7"); 12 | } 13 | 14 | boolean isNeonSupported(String cpuInfoString) { 15 | // check cpu arch for loading correct ffmpeg lib 16 | return cpuInfoString.contains("-neon"); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/CommandResult.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | class CommandResult { 4 | final String output; 5 | final boolean success; 6 | 7 | CommandResult(boolean success, String output) { 8 | this.success = success; 9 | this.output = output; 10 | } 11 | 12 | static CommandResult getDummyFailureResponse() { 13 | return new CommandResult(false, ""); 14 | } 15 | 16 | static CommandResult getOutputFromProcess(Process process) { 17 | String output; 18 | if (success(process.exitValue())) { 19 | output = Util.convertInputStreamToString(process.getInputStream()); 20 | } else { 21 | output = Util.convertInputStreamToString(process.getErrorStream()); 22 | } 23 | return new CommandResult(success(process.exitValue()), output); 24 | } 25 | 26 | static boolean success(Integer exitValue) { 27 | return exitValue != null && exitValue == 0; 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/CpuArch.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import android.text.TextUtils; 4 | 5 | enum CpuArch { 6 | x86("0dd4dbad305ff197a1ea9e6158bd2081d229e70e"), 7 | ARMv7("871888959ba2f063e18f56272d0d98ae01938ceb"), 8 | NONE(null); 9 | 10 | private String sha1; 11 | 12 | CpuArch(String sha1) { 13 | this.sha1 = sha1; 14 | } 15 | 16 | String getSha1(){ 17 | return sha1; 18 | } 19 | 20 | static CpuArch fromString(String sha1) { 21 | if (!TextUtils.isEmpty(sha1)) { 22 | for (CpuArch cpuArch : CpuArch.values()) { 23 | if (sha1.equalsIgnoreCase(cpuArch.sha1)) { 24 | return cpuArch; 25 | } 26 | } 27 | } 28 | return NONE; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/CpuArchHelper.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import android.os.Build; 4 | 5 | class CpuArchHelper { 6 | 7 | static CpuArch getCpuArch() { 8 | Log.d("Build.CPU_ABI : " + Build.CPU_ABI); 9 | // check if device is x86 or x86_64 10 | if (Build.CPU_ABI.equals(getx86CpuAbi()) || Build.CPU_ABI.equals(getx86_64CpuAbi())) { 11 | return CpuArch.x86; 12 | } else { 13 | // check if device is armeabi 14 | if (Build.CPU_ABI.equals(getArmeabiv7CpuAbi())) { 15 | ArmArchHelper cpuNativeArchHelper = new ArmArchHelper(); 16 | String archInfo = cpuNativeArchHelper.cpuArchFromJNI(); 17 | // check if device is arm v7 18 | if (cpuNativeArchHelper.isARM_v7_CPU(archInfo)) { 19 | // check if device is neon 20 | return CpuArch.ARMv7; 21 | } 22 | // check if device is arm64 which is supported by ARMV7 23 | } else if (Build.CPU_ABI.equals(getArm64CpuAbi())) { 24 | return CpuArch.ARMv7; 25 | } 26 | } 27 | return CpuArch.NONE; 28 | } 29 | 30 | static String getx86CpuAbi() { 31 | return "x86"; 32 | } 33 | 34 | static String getx86_64CpuAbi() { 35 | return "x86_64"; 36 | } 37 | 38 | static String getArm64CpuAbi() { 39 | return "arm64-v8a"; 40 | } 41 | 42 | static String getArmeabiv7CpuAbi() { 43 | return "armeabi-v7a"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/ExecuteBinaryResponseHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | public class ExecuteBinaryResponseHandler implements FFmpegExecuteResponseHandler { 4 | 5 | @Override 6 | public void onSuccess(String message) { 7 | 8 | } 9 | 10 | @Override 11 | public void onProgress(String message) { 12 | 13 | } 14 | 15 | @Override 16 | public void onFailure(String message) { 17 | 18 | } 19 | 20 | @Override 21 | public void onStart() { 22 | 23 | } 24 | 25 | @Override 26 | public void onFinish() { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/FFmpeg.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import android.content.Context; 4 | import android.text.TextUtils; 5 | 6 | import java.lang.reflect.Array; 7 | import java.util.Map; 8 | 9 | import com.github.hiteshsondhi88.libffmpeg.exceptions.FFmpegCommandAlreadyRunningException; 10 | import com.github.hiteshsondhi88.libffmpeg.exceptions.FFmpegNotSupportedException; 11 | 12 | @SuppressWarnings("unused") 13 | public class FFmpeg implements FFmpegInterface { 14 | 15 | private final Context context; 16 | private FFmpegExecuteAsyncTask ffmpegExecuteAsyncTask; 17 | private FFmpegLoadLibraryAsyncTask ffmpegLoadLibraryAsyncTask; 18 | 19 | private static final long MINIMUM_TIMEOUT = 10 * 1000; 20 | private long timeout = Long.MAX_VALUE; 21 | 22 | private static FFmpeg instance = null; 23 | 24 | private FFmpeg(Context context) { 25 | this.context = context.getApplicationContext(); 26 | Log.setDEBUG(Util.isDebug(this.context)); 27 | } 28 | 29 | public static FFmpeg getInstance(Context context) { 30 | if (instance == null) { 31 | instance = new FFmpeg(context); 32 | } 33 | return instance; 34 | } 35 | 36 | @Override 37 | public void loadBinary(FFmpegLoadBinaryResponseHandler ffmpegLoadBinaryResponseHandler) throws FFmpegNotSupportedException { 38 | String cpuArchNameFromAssets = null; 39 | switch (CpuArchHelper.getCpuArch()) { 40 | case x86: 41 | Log.i("Loading FFmpeg for x86 CPU"); 42 | cpuArchNameFromAssets = "x86"; 43 | break; 44 | case ARMv7: 45 | Log.i("Loading FFmpeg for armv7 CPU"); 46 | cpuArchNameFromAssets = "armeabi-v7a"; 47 | break; 48 | case NONE: 49 | throw new FFmpegNotSupportedException("Device not supported"); 50 | } 51 | 52 | if (!TextUtils.isEmpty(cpuArchNameFromAssets)) { 53 | ffmpegLoadLibraryAsyncTask = new FFmpegLoadLibraryAsyncTask(context, cpuArchNameFromAssets, ffmpegLoadBinaryResponseHandler); 54 | ffmpegLoadLibraryAsyncTask.execute(); 55 | } else { 56 | throw new FFmpegNotSupportedException("Device not supported"); 57 | } 58 | } 59 | 60 | @Override 61 | public void execute(Map environvenmentVars, String[] cmd, FFmpegExecuteResponseHandler ffmpegExecuteResponseHandler) throws FFmpegCommandAlreadyRunningException { 62 | if (ffmpegExecuteAsyncTask != null && !ffmpegExecuteAsyncTask.isProcessCompleted()) { 63 | throw new FFmpegCommandAlreadyRunningException("FFmpeg command is already running, you are only allowed to run single command at a time"); 64 | } 65 | if (cmd.length != 0) { 66 | String[] ffmpegBinary = new String[] { FileUtils.getFFmpeg(context, environvenmentVars) }; 67 | String[] command = concatenate(ffmpegBinary, cmd); 68 | ffmpegExecuteAsyncTask = new FFmpegExecuteAsyncTask(command , timeout, ffmpegExecuteResponseHandler); 69 | ffmpegExecuteAsyncTask.execute(); 70 | } else { 71 | throw new IllegalArgumentException("shell command cannot be empty"); 72 | } 73 | } 74 | 75 | public T[] concatenate (T[] a, T[] b) { 76 | int aLen = a.length; 77 | int bLen = b.length; 78 | 79 | @SuppressWarnings("unchecked") 80 | T[] c = (T[]) Array.newInstance(a.getClass().getComponentType(), aLen + bLen); 81 | System.arraycopy(a, 0, c, 0, aLen); 82 | System.arraycopy(b, 0, c, aLen, bLen); 83 | 84 | return c; 85 | } 86 | 87 | @Override 88 | public void execute(String[] cmd, FFmpegExecuteResponseHandler ffmpegExecuteResponseHandler) throws FFmpegCommandAlreadyRunningException { 89 | execute(null, cmd, ffmpegExecuteResponseHandler); 90 | } 91 | 92 | @Override 93 | public String getDeviceFFmpegVersion() throws FFmpegCommandAlreadyRunningException { 94 | ShellCommand shellCommand = new ShellCommand(); 95 | CommandResult commandResult = shellCommand.runWaitFor(new String[] { FileUtils.getFFmpeg(context), "-version" }); 96 | if (commandResult.success) { 97 | return commandResult.output.split(" ")[2]; 98 | } 99 | // if unable to find version then return "" to avoid NPE 100 | return ""; 101 | } 102 | 103 | @Override 104 | public String getLibraryFFmpegVersion() { 105 | // return context.getString(R.string.shipped_ffmpeg_version); 106 | return "n2.4.2"; 107 | } 108 | 109 | @Override 110 | public boolean isFFmpegCommandRunning() { 111 | return ffmpegExecuteAsyncTask != null && !ffmpegExecuteAsyncTask.isProcessCompleted(); 112 | } 113 | 114 | @Override 115 | public boolean killRunningProcesses() { 116 | return Util.killAsync(ffmpegLoadLibraryAsyncTask) || Util.killAsync(ffmpegExecuteAsyncTask); 117 | } 118 | 119 | @Override 120 | public void setTimeout(long timeout) { 121 | if (timeout >= MINIMUM_TIMEOUT) { 122 | this.timeout = timeout; 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/FFmpegExecuteAsyncTask.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import android.os.AsyncTask; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.IOException; 7 | import java.io.InputStreamReader; 8 | import java.util.concurrent.TimeoutException; 9 | 10 | class FFmpegExecuteAsyncTask extends AsyncTask { 11 | 12 | private final String[] cmd; 13 | private final FFmpegExecuteResponseHandler ffmpegExecuteResponseHandler; 14 | private final ShellCommand shellCommand; 15 | private final long timeout; 16 | private long startTime; 17 | private Process process; 18 | private String output = ""; 19 | 20 | FFmpegExecuteAsyncTask(String[] cmd, long timeout, FFmpegExecuteResponseHandler ffmpegExecuteResponseHandler) { 21 | this.cmd = cmd; 22 | this.timeout = timeout; 23 | this.ffmpegExecuteResponseHandler = ffmpegExecuteResponseHandler; 24 | this.shellCommand = new ShellCommand(); 25 | } 26 | 27 | @Override 28 | protected void onPreExecute() { 29 | startTime = System.currentTimeMillis(); 30 | if (ffmpegExecuteResponseHandler != null) { 31 | ffmpegExecuteResponseHandler.onStart(); 32 | } 33 | } 34 | 35 | @Override 36 | protected CommandResult doInBackground(Void... params) { 37 | try { 38 | process = shellCommand.run(cmd); 39 | if (process == null) { 40 | return CommandResult.getDummyFailureResponse(); 41 | } 42 | Log.d("Running publishing updates method"); 43 | checkAndUpdateProcess(); 44 | return CommandResult.getOutputFromProcess(process); 45 | } catch (TimeoutException e) { 46 | Log.e("FFmpeg timed out", e); 47 | return new CommandResult(false, e.getMessage()); 48 | } catch (Exception e) { 49 | Log.e("Error running FFmpeg", e); 50 | } finally { 51 | Util.destroyProcess(process); 52 | } 53 | return CommandResult.getDummyFailureResponse(); 54 | } 55 | 56 | @Override 57 | protected void onProgressUpdate(String... values) { 58 | if (values != null && values[0] != null && ffmpegExecuteResponseHandler != null) { 59 | ffmpegExecuteResponseHandler.onProgress(values[0]); 60 | } 61 | } 62 | 63 | @Override 64 | protected void onPostExecute(CommandResult commandResult) { 65 | if (ffmpegExecuteResponseHandler != null) { 66 | output += commandResult.output; 67 | if (commandResult.success) { 68 | ffmpegExecuteResponseHandler.onSuccess(output); 69 | } else { 70 | ffmpegExecuteResponseHandler.onFailure(output); 71 | } 72 | ffmpegExecuteResponseHandler.onFinish(); 73 | } 74 | } 75 | 76 | private void checkAndUpdateProcess() throws TimeoutException, InterruptedException { 77 | while (!Util.isProcessCompleted(process)) { 78 | // checking if process is completed 79 | if (Util.isProcessCompleted(process)) { 80 | return; 81 | } 82 | 83 | // Handling timeout 84 | if (timeout != Long.MAX_VALUE && System.currentTimeMillis() > startTime + timeout) { 85 | throw new TimeoutException("FFmpeg timed out"); 86 | } 87 | 88 | try { 89 | String line; 90 | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream())); 91 | while ((line = reader.readLine()) != null) { 92 | if (isCancelled()) { 93 | return; 94 | } 95 | 96 | output += line+"\n"; 97 | publishProgress(line); 98 | } 99 | } catch (IOException e) { 100 | e.printStackTrace(); 101 | } 102 | } 103 | } 104 | 105 | boolean isProcessCompleted() { 106 | return Util.isProcessCompleted(process); 107 | } 108 | 109 | } 110 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/FFmpegExecuteResponseHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | public interface FFmpegExecuteResponseHandler extends ResponseHandler { 4 | 5 | /** 6 | * on Success 7 | * @param message complete output of the FFmpeg command 8 | */ 9 | public void onSuccess(String message); 10 | 11 | /** 12 | * on Progress 13 | * @param message current output of FFmpeg command 14 | */ 15 | public void onProgress(String message); 16 | 17 | /** 18 | * on Failure 19 | * @param message complete output of the FFmpeg command 20 | */ 21 | public void onFailure(String message); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/FFmpegInterface.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import java.util.Map; 4 | 5 | import com.github.hiteshsondhi88.libffmpeg.exceptions.FFmpegCommandAlreadyRunningException; 6 | import com.github.hiteshsondhi88.libffmpeg.exceptions.FFmpegNotSupportedException; 7 | 8 | @SuppressWarnings("unused") 9 | interface FFmpegInterface { 10 | 11 | /** 12 | * Load binary to the device according to archituecture. This also updates FFmpeg binary if the binary on device have old version. 13 | * @param ffmpegLoadBinaryResponseHandler {@link FFmpegLoadBinaryResponseHandler} 14 | * @throws FFmpegNotSupportedException 15 | */ 16 | public void loadBinary(FFmpegLoadBinaryResponseHandler ffmpegLoadBinaryResponseHandler) throws FFmpegNotSupportedException; 17 | 18 | /** 19 | * Executes a command 20 | * @param environvenmentVars Environment variables 21 | * @param cmd command to execute 22 | * @param ffmpegExecuteResponseHandler {@link FFmpegExecuteResponseHandler} 23 | * @throws FFmpegCommandAlreadyRunningException 24 | */ 25 | public void execute(Map environvenmentVars, String[] cmd, FFmpegExecuteResponseHandler ffmpegExecuteResponseHandler) throws FFmpegCommandAlreadyRunningException; 26 | 27 | /** 28 | * Executes a command 29 | * @param cmd command to execute 30 | * @param ffmpegExecuteResponseHandler {@link FFmpegExecuteResponseHandler} 31 | * @throws FFmpegCommandAlreadyRunningException 32 | */ 33 | public void execute(String[] cmd, FFmpegExecuteResponseHandler ffmpegExecuteResponseHandler) throws FFmpegCommandAlreadyRunningException; 34 | 35 | /** 36 | * Tells FFmpeg version currently on device 37 | * @return FFmpeg version currently on device 38 | * @throws FFmpegCommandAlreadyRunningException 39 | */ 40 | public String getDeviceFFmpegVersion() throws FFmpegCommandAlreadyRunningException; 41 | 42 | /** 43 | * Tells FFmpeg version shipped with current library 44 | * @return FFmpeg version shipped with Library 45 | */ 46 | public String getLibraryFFmpegVersion(); 47 | 48 | /** 49 | * Checks if FFmpeg command is Currently running 50 | * @return true if FFmpeg command is running 51 | */ 52 | public boolean isFFmpegCommandRunning(); 53 | 54 | /** 55 | * Kill Running FFmpeg process 56 | * @return true if process is killed successfully 57 | */ 58 | public boolean killRunningProcesses(); 59 | 60 | /** 61 | * Timeout for FFmpeg process, should be minimum of 10 seconds 62 | * @param timeout in milliseconds 63 | */ 64 | public void setTimeout(long timeout); 65 | 66 | } 67 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/FFmpegLoadBinaryResponseHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | public interface FFmpegLoadBinaryResponseHandler extends ResponseHandler { 4 | 5 | /** 6 | * on Fail 7 | */ 8 | public void onFailure(); 9 | 10 | /** 11 | * on Success 12 | */ 13 | public void onSuccess(); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/FFmpegLoadLibraryAsyncTask.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import android.content.Context; 4 | import android.os.AsyncTask; 5 | 6 | import java.io.File; 7 | 8 | class FFmpegLoadLibraryAsyncTask extends AsyncTask { 9 | 10 | private final String cpuArchNameFromAssets; 11 | private final FFmpegLoadBinaryResponseHandler ffmpegLoadBinaryResponseHandler; 12 | private final Context context; 13 | 14 | FFmpegLoadLibraryAsyncTask(Context context, String cpuArchNameFromAssets, FFmpegLoadBinaryResponseHandler ffmpegLoadBinaryResponseHandler) { 15 | this.context = context; 16 | this.cpuArchNameFromAssets = cpuArchNameFromAssets; 17 | this.ffmpegLoadBinaryResponseHandler = ffmpegLoadBinaryResponseHandler; 18 | } 19 | 20 | @Override 21 | protected Boolean doInBackground(Void... params) { 22 | File ffmpegFile = new File(FileUtils.getFFmpeg(context)); 23 | if (ffmpegFile.exists() && isDeviceFFmpegVersionOld() && !ffmpegFile.delete()) { 24 | return false; 25 | } 26 | if (!ffmpegFile.exists()) { 27 | boolean isFileCopied = FileUtils.copyBinaryFromAssetsToData(context, 28 | cpuArchNameFromAssets + File.separator + FileUtils.ffmpegFileName, 29 | FileUtils.ffmpegFileName); 30 | 31 | // make file executable 32 | if (isFileCopied) { 33 | if(!ffmpegFile.canExecute()) { 34 | Log.d("FFmpeg is not executable, trying to make it executable ..."); 35 | if (ffmpegFile.setExecutable(true)) { 36 | return true; 37 | } 38 | } else { 39 | Log.d("FFmpeg is executable"); 40 | return true; 41 | } 42 | } 43 | } 44 | return ffmpegFile.exists() && ffmpegFile.canExecute(); 45 | } 46 | 47 | @Override 48 | protected void onPostExecute(Boolean isSuccess) { 49 | super.onPostExecute(isSuccess); 50 | if (ffmpegLoadBinaryResponseHandler != null) { 51 | if (isSuccess) { 52 | ffmpegLoadBinaryResponseHandler.onSuccess(); 53 | } else { 54 | ffmpegLoadBinaryResponseHandler.onFailure(); 55 | } 56 | ffmpegLoadBinaryResponseHandler.onFinish(); 57 | } 58 | } 59 | 60 | private boolean isDeviceFFmpegVersionOld() { 61 | return CpuArch.fromString(FileUtils.SHA1(FileUtils.getFFmpeg(context))).equals(CpuArch.NONE); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import android.content.Context; 4 | 5 | import java.io.BufferedInputStream; 6 | import java.io.File; 7 | import java.io.FileInputStream; 8 | import java.io.FileOutputStream; 9 | import java.io.IOException; 10 | import java.io.InputStream; 11 | import java.security.MessageDigest; 12 | import java.security.NoSuchAlgorithmException; 13 | import java.util.Formatter; 14 | import java.util.Map; 15 | 16 | class FileUtils { 17 | 18 | static final String ffmpegFileName = "ffmpeg"; 19 | private static final int DEFAULT_BUFFER_SIZE = 1024 * 4; 20 | private static final int EOF = -1; 21 | 22 | static boolean copyBinaryFromAssetsToData(Context context, String fileNameFromAssets, String outputFileName) { 23 | 24 | // create files directory under /data/data/package name 25 | File filesDirectory = getFilesDirectory(context); 26 | 27 | InputStream is; 28 | try { 29 | is = context.getAssets().open(fileNameFromAssets); 30 | // copy ffmpeg file from assets to files dir 31 | final FileOutputStream os = new FileOutputStream(new File(filesDirectory, outputFileName)); 32 | byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; 33 | 34 | int n; 35 | while(EOF != (n = is.read(buffer))) { 36 | os.write(buffer, 0, n); 37 | } 38 | 39 | Util.close(os); 40 | Util.close(is); 41 | 42 | return true; 43 | } catch (IOException e) { 44 | Log.e("issue in coping binary from assets to data. ", e); 45 | } 46 | return false; 47 | } 48 | 49 | static File getFilesDirectory(Context context) { 50 | // creates files directory under data/data/package name 51 | return context.getFilesDir(); 52 | } 53 | 54 | static String getFFmpeg(Context context) { 55 | return getFilesDirectory(context).getAbsolutePath() + File.separator + FileUtils.ffmpegFileName; 56 | } 57 | 58 | static String getFFmpeg(Context context, Map environmentVars) { 59 | String ffmpegCommand = ""; 60 | if (environmentVars != null) { 61 | for (Map.Entry var : environmentVars.entrySet()) { 62 | ffmpegCommand += var.getKey()+"="+var.getValue()+" "; 63 | } 64 | } 65 | ffmpegCommand += getFFmpeg(context); 66 | return ffmpegCommand; 67 | } 68 | 69 | static String SHA1(String file) { 70 | InputStream is = null; 71 | try { 72 | is = new BufferedInputStream(new FileInputStream(file)); 73 | return SHA1(is); 74 | } catch (IOException e) { 75 | Log.e(e); 76 | } finally { 77 | Util.close(is); 78 | } 79 | return null; 80 | } 81 | 82 | static String SHA1(InputStream is) { 83 | try { 84 | MessageDigest messageDigest = MessageDigest.getInstance("SHA1"); 85 | final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; 86 | for (int read; (read = is.read(buffer)) != -1; ) { 87 | messageDigest.update(buffer, 0, read); 88 | } 89 | 90 | Formatter formatter = new Formatter(); 91 | // Convert the byte to hex format 92 | for (final byte b : messageDigest.digest()) { 93 | formatter.format("%02x", b); 94 | } 95 | return formatter.toString(); 96 | } catch (NoSuchAlgorithmException e) { 97 | Log.e(e); 98 | } catch (IOException e) { 99 | Log.e(e); 100 | } finally { 101 | Util.close(is); 102 | } 103 | return null; 104 | } 105 | } -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/LoadBinaryResponseHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | public class LoadBinaryResponseHandler implements FFmpegLoadBinaryResponseHandler { 4 | 5 | @Override 6 | public void onFailure() { 7 | 8 | } 9 | 10 | @Override 11 | public void onSuccess() { 12 | 13 | } 14 | 15 | @Override 16 | public void onStart() { 17 | 18 | } 19 | 20 | @Override 21 | public void onFinish() { 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/Log.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | @SuppressWarnings("unused") 4 | class Log { 5 | 6 | private static String TAG = FFmpeg.class.getSimpleName(); 7 | private static boolean DEBUG = false; 8 | 9 | static void setDEBUG(boolean DEBUG) { 10 | Log.DEBUG = DEBUG; 11 | } 12 | 13 | static void setTAG(String tag) { 14 | Log.TAG = tag; 15 | } 16 | 17 | static void d(Object obj) { 18 | if (DEBUG) { 19 | android.util.Log.d(TAG, obj != null ? obj.toString() : null+""); 20 | } 21 | } 22 | 23 | static void e(Object obj) { 24 | if (DEBUG) { 25 | android.util.Log.e(TAG, obj != null ? obj.toString() : null+""); 26 | } 27 | } 28 | 29 | static void w(Object obj) { 30 | if (DEBUG) { 31 | android.util.Log.w(TAG, obj != null ? obj.toString() : null+""); 32 | } 33 | } 34 | 35 | static void i(Object obj) { 36 | if (DEBUG) { 37 | android.util.Log.i(TAG, obj != null ? obj.toString() : null+""); 38 | } 39 | } 40 | 41 | static void v(Object obj) { 42 | if (DEBUG) { 43 | android.util.Log.v(TAG, obj != null ? obj.toString() : null+""); 44 | } 45 | } 46 | 47 | static void e(Object obj, Throwable throwable) { 48 | if (DEBUG) { 49 | android.util.Log.e(TAG, obj != null ? obj.toString() : null+"", throwable); 50 | } 51 | } 52 | 53 | static void e(Throwable throwable) { 54 | if (DEBUG) { 55 | android.util.Log.e(TAG, "", throwable); 56 | } 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/ResponseHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | abstract interface ResponseHandler { 4 | 5 | /** 6 | * on Start 7 | */ 8 | public void onStart(); 9 | 10 | /** 11 | * on Finish 12 | */ 13 | public void onFinish(); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/ShellCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import java.io.IOException; 4 | 5 | class ShellCommand { 6 | 7 | Process run(String[] commandString) { 8 | Process process = null; 9 | try { 10 | process = Runtime.getRuntime().exec(commandString); 11 | } catch (IOException e) { 12 | Log.e("Exception while trying to run: " + commandString, e); 13 | } 14 | return process; 15 | } 16 | 17 | CommandResult runWaitFor(String[] s) { 18 | Process process = run(s); 19 | 20 | Integer exitValue = null; 21 | String output = null; 22 | try { 23 | if (process != null) { 24 | exitValue = process.waitFor(); 25 | 26 | if (CommandResult.success(exitValue)) { 27 | output = Util.convertInputStreamToString(process.getInputStream()); 28 | } else { 29 | output = Util.convertInputStreamToString(process.getErrorStream()); 30 | } 31 | } 32 | } catch (InterruptedException e) { 33 | Log.e("Interrupt exception", e); 34 | } finally { 35 | Util.destroyProcess(process); 36 | } 37 | 38 | return new CommandResult(CommandResult.success(exitValue), output); 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/Util.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg; 2 | 3 | import android.content.Context; 4 | import android.content.pm.ApplicationInfo; 5 | import android.os.AsyncTask; 6 | 7 | import java.io.BufferedReader; 8 | import java.io.IOException; 9 | import java.io.InputStream; 10 | import java.io.InputStreamReader; 11 | import java.io.OutputStream; 12 | 13 | class Util { 14 | 15 | static boolean isDebug(Context context) { 16 | return (0 != (context.getApplicationContext().getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE)); 17 | } 18 | 19 | static void close(InputStream inputStream) { 20 | if (inputStream != null) { 21 | try { 22 | inputStream.close(); 23 | } catch (IOException e) { 24 | // Do nothing 25 | } 26 | } 27 | } 28 | 29 | static void close(OutputStream outputStream) { 30 | if (outputStream != null) { 31 | try { 32 | outputStream.flush(); 33 | outputStream.close(); 34 | } catch (IOException e) { 35 | // Do nothing 36 | } 37 | } 38 | } 39 | 40 | static String convertInputStreamToString(InputStream inputStream) { 41 | try { 42 | BufferedReader r = new BufferedReader(new InputStreamReader(inputStream)); 43 | String str; 44 | StringBuilder sb = new StringBuilder(); 45 | while ((str = r.readLine()) != null) { 46 | sb.append(str); 47 | } 48 | return sb.toString(); 49 | } catch (IOException e) { 50 | Log.e("error converting input stream to string", e); 51 | } 52 | return null; 53 | } 54 | 55 | static void destroyProcess(Process process) { 56 | if (process != null) 57 | process.destroy(); 58 | } 59 | 60 | static boolean killAsync(AsyncTask asyncTask) { 61 | return asyncTask != null && !asyncTask.isCancelled() && asyncTask.cancel(true); 62 | } 63 | 64 | static boolean isProcessCompleted(Process process) { 65 | try { 66 | if (process == null) return true; 67 | process.exitValue(); 68 | return true; 69 | } catch (IllegalThreadStateException e) { 70 | // do nothing 71 | } 72 | return false; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/exceptions/FFmpegCommandAlreadyRunningException.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg.exceptions; 2 | 3 | public class FFmpegCommandAlreadyRunningException extends Exception { 4 | 5 | public FFmpegCommandAlreadyRunningException(String message) { 6 | super(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/java/com/github/hiteshsondhi88/libffmpeg/exceptions/FFmpegNotSupportedException.java: -------------------------------------------------------------------------------- 1 | package com.github.hiteshsondhi88.libffmpeg.exceptions; 2 | 3 | public class FFmpegNotSupportedException extends Exception { 4 | 5 | public FFmpegNotSupportedException(String message) { 6 | super(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /FFmpegAndroid/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | n2.4.2 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 如果您觉得本项目对你有用,请随手star,谢谢 2 | 个人主页:https://www.jianshu.com/u/521b2b15caba 3 | 4 | 本人试了一下,一个大小为341M,时长为05:13的视频,压缩时间为9分钟,可以通过改变分辨率和码率来进行压缩,有进度条显示 5 | 6 | 如果觉得ffmpeg压缩比较慢,而对视频清晰度要求不是那么高的话,可以使用硬解码的android自带的压缩方法MediaCodec ,速度嗖嗖的,MediaCodec的demo地址:https://github.com/tangpeng/VideoCompressor 7 | 8 | 关于权限的问题,可以看我的一篇文章:https://www.jianshu.com/p/52795b5dab3a 9 | 项目里面的权限判断使用的是朋友封装好的库,很方便,一句代码搞定 10 | 11 | 网上关于 Android 集成 FFmpeg 的文章很多,但大多数都只介绍了步骤,这里推荐几篇文章给大家 12 | 13 | [Android 集成 FFmpeg (一) 基础知识及简单调用](https://blog.csdn.net/yhaolpz/article/details/76408829) 14 | 15 | [Android 集成 FFmpeg (二) 以命令方式调用 FFmpeg](https://blog.csdn.net/yhaolpz/article/details/77146156) 16 | 17 | [Android 集成 FFmpeg (三) 获取 FFmpeg 执行进度](https://blog.csdn.net/yhaolpz/article/details/77146156) 18 | 19 | 20 | 21 | ## Demo 22 | ![Demo](/pic/20181031154801.png) 23 | 24 | 25 | ``` 26 | /** 27 | * @dec 一句代码搞定权限问题 28 | * @author apeng 29 | * @date 2018/10/31 10:54 30 | */ 31 | public void getPermissions() { 32 | XXPermissions.with(this) 33 | .constantRequest() //可设置被拒绝后继续申请,直到用户授权或者永久拒绝 34 | .permission("android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE") 35 | .request(new OnPermission() { 36 | @Override 37 | public void hasPermission(List granted, boolean isAll) { 38 | } 39 | 40 | @Override 41 | public void noPermission(List denied, boolean quick) { 42 | 43 | } 44 | }); 45 | 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | defaultConfig { 6 | applicationId "com.apeng.ffmpegandroiddemo" 7 | minSdkVersion 18 8 | targetSdkVersion 26 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | multiDexEnabled true 13 | ndk {// // 设置支持的 SO 库构架,注意这里要根据你的实际情况来设置 14 | abiFilters "armeabi-v7a" 15 | } 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | sourceSets.main { 24 | assets.srcDirs = ['assets'] 25 | jniLibs.srcDirs = ['libs']//指定jniLibs文件夹路径 26 | jni.srcDirs = []//不编译jni 27 | } 28 | } 29 | 30 | dependencies { 31 | implementation fileTree(include: ['*.jar'], dir: 'libs') 32 | implementation 'com.android.support:appcompat-v7:26.1.0' 33 | implementation project(':FFmpegAndroid') 34 | compile 'com.hjq:xxpermissions:5.0'//添加权限 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/tangxiaopeng/ffmpegandroiddemo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.tangxiaopeng.ffmpegandroiddemo; 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 | * Instrumented 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.tangxiaopeng.ffmpegandroiddemo", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/apeng/ffmpegandroiddemo/CompressListener.java: -------------------------------------------------------------------------------- 1 | package com.apeng.ffmpegandroiddemo; 2 | 3 | /** 4 | */ 5 | public interface CompressListener { 6 | public void onExecSuccess(String message); 7 | 8 | public void onExecFail(String reason); 9 | 10 | public void onExecProgress(String message); 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/apeng/ffmpegandroiddemo/Compressor.java: -------------------------------------------------------------------------------- 1 | package com.apeng.ffmpegandroiddemo; 2 | 3 | import android.app.Activity; 4 | import android.util.Log; 5 | 6 | import com.github.hiteshsondhi88.libffmpeg.ExecuteBinaryResponseHandler; 7 | import com.github.hiteshsondhi88.libffmpeg.FFmpeg; 8 | import com.github.hiteshsondhi88.libffmpeg.LoadBinaryResponseHandler; 9 | import com.github.hiteshsondhi88.libffmpeg.exceptions.FFmpegCommandAlreadyRunningException; 10 | import com.github.hiteshsondhi88.libffmpeg.exceptions.FFmpegNotSupportedException; 11 | 12 | /** 13 | * @dec 14 | * @author apeng 15 | * @date 2018/10/31 11:44 16 | */ 17 | public class Compressor { 18 | protected String TAG = "COMPRESSOR";//日志输出标志 19 | public Activity a; 20 | public FFmpeg ffmpeg; 21 | 22 | public Compressor(Activity activity) { 23 | a = activity; 24 | ffmpeg = FFmpeg.getInstance(a); 25 | } 26 | 27 | public void loadBinary(final InitListener mListener) { 28 | try { 29 | ffmpeg.loadBinary(new LoadBinaryResponseHandler() { 30 | @Override 31 | public void onStart() { 32 | } 33 | 34 | @Override 35 | public void onFailure() { 36 | mListener.onLoadFail("incompatible with this device"); 37 | } 38 | 39 | @Override 40 | public void onSuccess() { 41 | mListener.onLoadSuccess(); 42 | } 43 | 44 | @Override 45 | public void onFinish() { 46 | 47 | } 48 | }); 49 | } catch (FFmpegNotSupportedException e) { 50 | e.printStackTrace(); 51 | } 52 | } 53 | 54 | public void execCommand(String cmd, final CompressListener mListener) { 55 | try { 56 | String[] cmds = cmd.split(" "); 57 | ffmpeg.execute(cmds, new ExecuteBinaryResponseHandler() { 58 | @Override 59 | public void onStart() { 60 | } 61 | 62 | @Override 63 | public void onProgress(String message) { 64 | mListener.onExecProgress(message); 65 | } 66 | 67 | @Override 68 | public void onFailure(String message) { 69 | mListener.onExecFail(message); 70 | } 71 | 72 | @Override 73 | public void onSuccess(String message) { 74 | mListener.onExecSuccess(message); 75 | } 76 | 77 | @Override 78 | public void onFinish() { 79 | } 80 | }); 81 | } catch (FFmpegCommandAlreadyRunningException e) { 82 | e.printStackTrace(); 83 | } 84 | 85 | } 86 | 87 | 88 | public void destory() { 89 | if (ffmpeg != null) { 90 | if (ffmpeg.isFFmpegCommandRunning()) { 91 | Log.i(TAG, "killRunningProcesses"); 92 | ffmpeg.killRunningProcesses(); 93 | Log.i(TAG, "killProcesses"); 94 | } 95 | } 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /app/src/main/java/com/apeng/ffmpegandroiddemo/CustomProgressDialog.java: -------------------------------------------------------------------------------- 1 | package com.apeng.ffmpegandroiddemo; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.Context; 5 | 6 | public class CustomProgressDialog extends ProgressDialog { 7 | public CustomProgressDialog(Context context) { 8 | super(context); 9 | setMessage("处理中..."); 10 | setMax(100); 11 | setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); 12 | setCanceledOnTouchOutside(false); 13 | setCancelable(true); 14 | } 15 | @Override 16 | public void dismiss() { 17 | super.dismiss(); 18 | setProgress(0); 19 | } 20 | 21 | @Override 22 | public void cancel() { 23 | super.cancel(); 24 | setProgress(0); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/apeng/ffmpegandroiddemo/GetPathFromUri.java: -------------------------------------------------------------------------------- 1 | package com.tangxiaopeng.ffmpegandroiddemo; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.ContentUris; 5 | import android.content.Context; 6 | import android.database.Cursor; 7 | import android.net.Uri; 8 | import android.os.Build; 9 | import android.os.Environment; 10 | import android.provider.DocumentsContract; 11 | import android.provider.MediaStore; 12 | 13 | import java.text.SimpleDateFormat; 14 | import java.util.Date; 15 | 16 | public class GetPathFromUri { 17 | 18 | @SuppressLint("NewApi") 19 | public static String getPath(final Context context, final Uri uri) { 20 | 21 | final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; 22 | 23 | // DocumentProvider 24 | if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) { 25 | // ExternalStorageProvider 26 | if (isExternalStorageDocument(uri)) { 27 | final String docId = DocumentsContract.getDocumentId(uri); 28 | final String[] split = docId.split(":"); 29 | final String type = split[0]; 30 | 31 | if ("primary".equalsIgnoreCase(type)) { 32 | return Environment.getExternalStorageDirectory() + "/" + split[1]; 33 | } 34 | 35 | // TODO handle non-primary volumes 36 | if ("5D68-9217".equalsIgnoreCase(type)) { 37 | return Environment.getExternalStorageDirectory() + "/" + split[1]; 38 | } 39 | } 40 | // DownloadsProvider 41 | else if (isDownloadsDocument(uri)) { 42 | 43 | final String id = DocumentsContract.getDocumentId(uri); 44 | final Uri contentUri = ContentUris.withAppendedId( 45 | Uri.parse("content://downloads/public_downloads"), Long.valueOf(id)); 46 | 47 | return getDataColumn(context, contentUri, null, null); 48 | } 49 | // MediaProvider 50 | else if (isMediaDocument(uri)) { 51 | final String docId = DocumentsContract.getDocumentId(uri); 52 | final String[] split = docId.split(":"); 53 | final String type = split[0]; 54 | 55 | Uri contentUri = null; 56 | if ("image".equals(type)) { 57 | contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; 58 | } else if ("video".equals(type)) { 59 | contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI; 60 | } else if ("audio".equals(type)) { 61 | contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; 62 | } 63 | 64 | final String selection = "_id=?"; 65 | final String[] selectionArgs = new String[]{split[1]}; 66 | 67 | return getDataColumn(context, contentUri, selection, selectionArgs); 68 | } 69 | } 70 | // MediaStore (and general) 71 | else if ("content".equalsIgnoreCase(uri.getScheme())) { 72 | return getDataColumn(context, uri, null, null); 73 | } 74 | // File 75 | else if ("file".equalsIgnoreCase(uri.getScheme())) { 76 | return uri.getPath(); 77 | } 78 | 79 | return null; 80 | } 81 | 82 | /** 83 | * Get the value of the data column for this Uri. This is useful for 84 | * MediaStore Uris, and other file-based ContentProviders. 85 | * 86 | * @param context The context. 87 | * @param uri The Uri to query. 88 | * @param selection (Optional) Filter used in the query. 89 | * @param selectionArgs (Optional) Selection arguments used in the query. 90 | * @return The value of the _data column, which is typically a file path. 91 | */ 92 | public static String getDataColumn(Context context, Uri uri, String selection, 93 | String[] selectionArgs) { 94 | 95 | Cursor cursor = null; 96 | final String column = "_data"; 97 | final String[] projection = {column}; 98 | 99 | try { 100 | cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, 101 | null); 102 | if (cursor != null && cursor.moveToFirst()) { 103 | final int column_index = cursor.getColumnIndexOrThrow(column); 104 | return cursor.getString(column_index); 105 | } 106 | } finally { 107 | if (cursor != null) 108 | cursor.close(); 109 | } 110 | return null; 111 | } 112 | 113 | /** 114 | * @param uri The Uri to check. 115 | * @return Whether the Uri authority is ExternalStorageProvider. 116 | */ 117 | public static boolean isExternalStorageDocument(Uri uri) { 118 | return "com.android.externalstorage.documents".equals(uri.getAuthority()); 119 | } 120 | 121 | /** 122 | * @param uri The Uri to check. 123 | * @return Whether the Uri authority is DownloadsProvider. 124 | */ 125 | public static boolean isDownloadsDocument(Uri uri) { 126 | return "com.android.providers.downloads.documents".equals(uri.getAuthority()); 127 | } 128 | 129 | /** 130 | * @param uri The Uri to check. 131 | * @return Whether the Uri authority is MediaProvider. 132 | */ 133 | public static boolean isMediaDocument(Uri uri) { 134 | return "com.android.providers.media.documents".equals(uri.getAuthority()); 135 | } 136 | 137 | public static String getVideoFileName() { 138 | Date date = new Date(System.currentTimeMillis());// 获取当前的系统的时间 139 | SimpleDateFormat dateFormat = new SimpleDateFormat( 140 | "yyyyMMddHHmmss"); 141 | return "android_" + dateFormat.format(date) + (int) ((Math.random() * 9 + 1) * 10000) + ".mp4"; 142 | } 143 | 144 | } 145 | -------------------------------------------------------------------------------- /app/src/main/java/com/apeng/ffmpegandroiddemo/InitListener.java: -------------------------------------------------------------------------------- 1 | package com.apeng.ffmpegandroiddemo; 2 | 3 | public interface InitListener { 4 | public void onLoadSuccess(); 5 | public void onLoadFail(String reason); 6 | } 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/apeng/ffmpegandroiddemo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.apeng.ffmpegandroiddemo; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.DialogInterface; 6 | import android.content.Intent; 7 | import android.graphics.Bitmap; 8 | import android.media.MediaMetadataRetriever; 9 | import android.os.Build; 10 | import android.os.Bundle; 11 | import android.os.Environment; 12 | import android.support.v7.app.AppCompatActivity; 13 | import android.text.TextUtils; 14 | import android.util.Log; 15 | import android.view.View; 16 | import android.widget.Button; 17 | import android.widget.TextView; 18 | import android.widget.Toast; 19 | 20 | import com.hjq.permissions.OnPermission; 21 | import com.hjq.permissions.XXPermissions; 22 | import com.tangxiaopeng.ffmpegandroiddemo.GetPathFromUri; 23 | 24 | import java.io.File; 25 | import java.util.List; 26 | import java.util.regex.Matcher; 27 | import java.util.regex.Pattern; 28 | /** 29 | * @dec https://github.com/tangpeng/FFmpegDemo 30 | * @author apeng 31 | * @date 2018/10/31 11:31 32 | */ 33 | public class MainActivity extends AppCompatActivity implements View.OnClickListener { 34 | protected final String TAG = "MainActivity";//日志输出标志 35 | private Context context = MainActivity.this; 36 | 37 | private TextView mTextView; 38 | private Button btnSelectLocalVideo; 39 | private Button btnCompressorLocalVideo; 40 | 41 | private Compressor mCompressor; 42 | private String currentOutputVideoPath = "";//压缩后的视频地址 43 | 44 | private String videoTime = "";//获取视频时长 45 | private int videoWidth = 0;//获取视频的宽度 46 | private int videoHeight = 0;//获取视频的高度 47 | private int videoGotation = 0;//获取视频的角度 48 | private Bitmap mBitMap; 49 | private Double videoLength = 0.00;//视频时长 s 50 | 51 | private CustomProgressDialog mProcessingDialog; 52 | 53 | private String mVideoPath = "";//原视频地址 54 | 55 | public static final String PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/apeng/"; 56 | 57 | @Override 58 | protected void onCreate(Bundle savedInstanceState) { 59 | super.onCreate(savedInstanceState); 60 | setContentView(R.layout.activity_main); 61 | getPermissions(); 62 | initView(); 63 | initListener(); 64 | initFile(); 65 | initVideo(); 66 | } 67 | 68 | 69 | private void initView() { 70 | mTextView = findViewById(R.id.idSelectLocalVideo); 71 | btnSelectLocalVideo = findViewById(R.id.btnSelectLocalVideo); 72 | btnCompressorLocalVideo = findViewById(R.id.btnCompressorLocalVideo); 73 | } 74 | 75 | private void initListener() { 76 | btnSelectLocalVideo.setOnClickListener(this); 77 | btnCompressorLocalVideo.setOnClickListener(this); 78 | } 79 | 80 | private void initFile() { 81 | makeRootDirectory(PATH); 82 | currentOutputVideoPath = PATH + GetPathFromUri.getVideoFileName(); 83 | } 84 | 85 | 86 | private void initVideo() { 87 | 88 | mProcessingDialog = new CustomProgressDialog(this); 89 | mProcessingDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { 90 | @Override 91 | public void onCancel(DialogInterface dialog) { 92 | Log.i(TAG, "onDismiss");//如果取消压缩,那么需要销毁 93 | if (mCompressor != null) { 94 | mCompressor.destory(); 95 | } 96 | } 97 | }); 98 | 99 | mCompressor = new Compressor(this); 100 | mCompressor.loadBinary(new InitListener() { 101 | @Override 102 | public void onLoadSuccess() { 103 | Log.v(TAG, "load library succeed"); 104 | } 105 | 106 | @Override 107 | public void onLoadFail(String reason) { 108 | Log.i(TAG, "load library fail:" + reason); 109 | } 110 | }); 111 | } 112 | 113 | 114 | /** 115 | * 视频压缩开始 116 | */ 117 | private void startCompress() { 118 | try { 119 | if (TextUtils.isEmpty(mVideoPath)) { 120 | Toast.makeText(this, "请重新选择视频", Toast.LENGTH_SHORT).show(); 121 | finish(); 122 | } else { 123 | File file = new File(currentOutputVideoPath); 124 | if (file.exists()) { 125 | file.delete(); 126 | } 127 | String cmd = ""; 128 | Log.i(TAG, "startCompress=mVideoPath=" + mVideoPath); 129 | if (videoGotation == 90 || videoGotation == 270) {//之前以为和旋转的角度有关系,原来 130 | Log.i(TAG, "videoGotation=90"); 131 | cmd = "-y -i " + mVideoPath + " -strict -2 -vcodec libx264 -preset ultrafast " + 132 | "-crf 24 -acodec aac -ar 44100 -ac 2 -b:a 96k -s 480x800 -aspect 9:16 " + currentOutputVideoPath; 133 | } else { 134 | Log.i(TAG, "videoGotation=0"); 135 | if (videoWidth > videoHeight) { 136 | cmd = "-y -i " + mVideoPath + " -strict -2 -vcodec libx264 -preset ultrafast " + 137 | "-crf 24 -acodec aac -ar 44100 -ac 2 -b:a 96k -s 800x480 -aspect 16:9 " + currentOutputVideoPath; 138 | } else { 139 | cmd = "-y -i " + mVideoPath + " -strict -2 -vcodec libx264 -preset ultrafast " + 140 | "-crf 24 -acodec aac -ar 44100 -ac 2 -b:a 96k -s 480x800 -aspect 9:16 " + currentOutputVideoPath; 141 | } 142 | } 143 | 144 | mProcessingDialog.show(); 145 | mProcessingDialog.setProgress(0); 146 | execCommand(cmd); 147 | } 148 | } catch (Exception e) { 149 | Log.i(TAG, "startCompress=e=" + e.getMessage()); 150 | } 151 | 152 | } 153 | 154 | private void execCommand(final String cmd) { 155 | File mFile = new File(currentOutputVideoPath); 156 | if (mFile.exists()) { 157 | mFile.delete(); 158 | } 159 | Log.i(TAG, "cmd= " + cmd); 160 | mCompressor.execCommand(cmd, new CompressListener() { 161 | @Override 162 | public void onExecSuccess(String message) { 163 | mProcessingDialog.dismiss(); 164 | String result = getString(R.string.compress_result_input_output, mVideoPath 165 | , getFileSize(mVideoPath), currentOutputVideoPath, getFileSize(currentOutputVideoPath)); 166 | Log.i(TAG, "success " + result); 167 | Toast.makeText(context, "success " + result, Toast.LENGTH_SHORT).show(); 168 | } 169 | 170 | @Override 171 | public void onExecFail(String reason) { 172 | Log.i(TAG, "fail " + reason); 173 | Toast.makeText(context, "压缩失败", Toast.LENGTH_SHORT); 174 | mProcessingDialog.dismiss(); 175 | finish(); 176 | } 177 | 178 | @Override 179 | public void onExecProgress(String message) { 180 | try { 181 | Log.i(TAG, "progress " + message); 182 | double switchNum = getProgress(message); 183 | if (switchNum == 10000) { 184 | //如果找不到压缩的片段,返回为10000 185 | Log.i(TAG, "10000"); 186 | mProcessingDialog.setProgress(0); 187 | } else { 188 | mProcessingDialog.setProgress((int) (getProgress(message) / 10)); 189 | } 190 | } catch (Exception e) { 191 | mProcessingDialog.dismiss(); 192 | Log.i(TAG, "e=" + e.getMessage()); 193 | } 194 | } 195 | }); 196 | } 197 | 198 | @Override 199 | public void onClick(View v) { 200 | switch (v.getId()) { 201 | case R.id.btnSelectLocalVideo: 202 | addLoacalVideo(); 203 | break; 204 | case R.id.btnCompressorLocalVideo: 205 | startCompress(); 206 | break; 207 | default: 208 | break; 209 | } 210 | } 211 | 212 | @Override 213 | protected void onDestroy() { 214 | super.onDestroy(); 215 | if (mCompressor != null) { 216 | mCompressor.destory(); 217 | } 218 | } 219 | 220 | 221 | /** 222 | * 进度条,只能是整形,所以max为1000,最少为0 223 | * 224 | * @param source 225 | * @return 226 | */ 227 | double getProgressNum = 0.0; 228 | 229 | private double getProgress(String source) { 230 | if (source.contains("too large")) {//当文件过大的时候,会会出现 Past duration x.y too large 231 | Log.i(TAG, "too large"); 232 | return getProgressNum; 233 | } 234 | Pattern p = Pattern.compile("00:\\d{2}:\\d{2}"); 235 | Matcher m = p.matcher(source); 236 | if (m.find()) { 237 | //00:00:00 238 | String result = m.group(0); 239 | String temp[] = result.split(":"); 240 | double seconds = Double.parseDouble(temp[1]) * 60 + Double.parseDouble(temp[2]); 241 | if (0 != videoLength) { 242 | getProgressNum = seconds / videoLength * 1000; 243 | return seconds / videoLength * 1000; 244 | } 245 | if (seconds == videoLength) { 246 | return 1000; 247 | } 248 | } 249 | // MyLog.i(TAG, "!m.find()="+getProgressNum); 250 | return 10000;//出现异常的时候,返回为10000 251 | // return 0;//出现异常的时候,显示上一个进度条 252 | } 253 | 254 | private String getFileSize(String path) { 255 | File f = new File(path); 256 | if (!f.exists()) { 257 | return "0 MB"; 258 | } else { 259 | long size = f.length(); 260 | return (size / 1024f) / 1024f + "MB"; 261 | } 262 | } 263 | 264 | 265 | private void addLoacalVideo() { 266 | Intent intentvideo = new Intent(); 267 | if (Build.VERSION.SDK_INT < 19) { 268 | intentvideo.setAction(Intent.ACTION_GET_CONTENT); 269 | intentvideo.setType("video/*"); 270 | } else { 271 | intentvideo.setAction(Intent.ACTION_OPEN_DOCUMENT); 272 | intentvideo.addCategory(Intent.CATEGORY_OPENABLE); 273 | intentvideo.setType("video/*"); 274 | } 275 | startActivityForResult(Intent.createChooser(intentvideo, "选择要导入的视频"), 0); 276 | } 277 | 278 | @Override 279 | public void onActivityResult(int requestCode, int resultCode, Intent data) { 280 | super.onActivityResult(requestCode, resultCode, data); 281 | if (resultCode == Activity.RESULT_OK) { 282 | mVideoPath = GetPathFromUri.getPath(context, data.getData()); 283 | Log.i(TAG, "Select file: " + mVideoPath); 284 | mTextView.setText("" + mVideoPath); 285 | getVideoTime(); 286 | } 287 | } 288 | 289 | /** 290 | * 获取视频的时长 291 | */ 292 | void getVideoTime() { 293 | try { 294 | MediaMetadataRetriever retr = new MediaMetadataRetriever(); 295 | retr.setDataSource(mVideoPath); 296 | videoTime = retr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);//获取视频时长 297 | videoWidth = Integer.valueOf(retr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH));//获取视频的宽度 298 | videoHeight = Integer.valueOf(retr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));//获取视频的高度 299 | videoGotation = Integer.valueOf(retr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION));//获取视频的角度 300 | 301 | Log.i(TAG, "videoWidth=" + videoWidth); 302 | Log.i(TAG, "videoHeight=" + videoHeight); 303 | 304 | // MyLog.i(TAG, "videoTime=" + videoTime); 305 | // mBitMap = retr.getFrameAtTime(); 306 | videoLength = Double.parseDouble(videoTime) / 1000.00; 307 | Log.i(TAG, "videoLength=" + videoLength); 308 | 309 | } catch (Exception e) { 310 | e.printStackTrace(); 311 | Log.i(TAG, "e=" + e.getMessage()); 312 | videoLength = 0.00; 313 | finish(); 314 | Toast.makeText(context, "异常错误", Toast.LENGTH_SHORT); 315 | } 316 | 317 | } 318 | 319 | /** 320 | * 没有文件夹。创建文件夹 321 | * 322 | * @param filePath 323 | */ 324 | public void makeRootDirectory(String filePath) { 325 | Log.i(TAG, "makeRootDirectory="); 326 | File file = null; 327 | try { 328 | file = new File(filePath); 329 | if (!file.exists()) { 330 | Boolean isTrue = file.mkdir(); 331 | Log.i(TAG, "istrue=" + isTrue + ""); 332 | } 333 | } catch (Exception e) { 334 | 335 | } 336 | } 337 | 338 | 339 | /** 340 | * @dec 一句代码搞定权限问题 341 | * @author apeng 342 | * @date 2018/10/31 10:54 343 | */ 344 | public void getPermissions() { 345 | XXPermissions.with(this) 346 | .constantRequest() //可设置被拒绝后继续申请,直到用户授权或者永久拒绝 347 | .permission("android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE") 348 | .request(new OnPermission() { 349 | @Override 350 | public void hasPermission(List granted, boolean isAll) { 351 | } 352 | 353 | @Override 354 | public void noPermission(List denied, boolean quick) { 355 | 356 | } 357 | }); 358 | } 359 | } 360 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 11 | 16 | 21 | 26 | 31 | 36 | 41 | 46 | 51 | 56 | 61 | 66 | 71 | 76 | 81 | 86 | 91 | 96 | 101 | 106 | 111 | 116 | 121 | 126 | 131 | 136 | 141 | 146 | 151 | 156 | 161 | 166 | 171 | 172 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 14 | 15 |