diff --git a/android/compile-ijk.sh b/android/compile-ijk.sh index 07a823ad1450ae26a0900ea4dccbd637fb647411..e1ff92b2bf1f56b25eb9742f2962e18f80570af1 100755 --- a/android/compile-ijk.sh +++ b/android/compile-ijk.sh @@ -24,7 +24,7 @@ fi REQUEST_TARGET=$1 REQUEST_SUB_CMD=$2 ACT_ABI_32="armv5 armv7a x86" -ACT_ABI_64="armv5 armv7a x86 arm64" +ACT_ABI_64="armv5 armv7a arm64 x86 x86_64" ACT_ABI_ALL=$ALL_ABI_64 FF_MAKEFLAGS= @@ -76,7 +76,7 @@ do_ndk_build () { do_sub_cmd $PARAM_SUB_CMD cd - ;; - x86|arm64) + arm64|x86|x86_64) cd "ijkplayer/ijkplayer-$PARAM_TARGET/src/main/jni" if [ "$PARAM_SUB_CMD" = 'prof' ]; then PARAM_SUB_CMD=''; fi do_sub_cmd $PARAM_SUB_CMD @@ -90,7 +90,7 @@ case "$REQUEST_TARGET" in "") do_ndk_build armv7a; ;; - armv5|armv7a|x86|arm64) + armv5|armv7a|arm64|x86|x86_64) do_ndk_build $REQUEST_TARGET $REQUEST_SUB_CMD; ;; all32) @@ -113,7 +113,7 @@ case "$REQUEST_TARGET" in ;; *) echo "Usage:" - echo " compile-ijk.sh armv5|armv7a|x86|arm64" + echo " compile-ijk.sh armv5|armv7a|arm64|x86|x86_64" echo " compile-ijk.sh all|all32" echo " compile-ijk.sh all64" echo " compile-ijk.sh clean" diff --git a/android/contrib/compile-ffmpeg.sh b/android/contrib/compile-ffmpeg.sh index 2a90b516e6d39ea206a2bce9bb04305acd2ac9f0..c806599568f49f1b8a46c5200785d67f6ae4249e 100755 --- a/android/contrib/compile-ffmpeg.sh +++ b/android/contrib/compile-ffmpeg.sh @@ -26,7 +26,7 @@ set -e set +x FF_ACT_ARCHS_32="armv5 armv7a x86" -FF_ACT_ARCHS_64="armv5 armv7a x86 arm64" +FF_ACT_ARCHS_64="armv5 armv7a arm64 x86 x86_64" FF_ACT_ARCHS_ALL=$FF_ACT_ARCHS_64 echo_archs() { @@ -40,7 +40,7 @@ echo_archs() { echo_usage() { echo "Usage:" - echo " compile-ffmpeg.sh armv5|armv7a|x86|arm64" + echo " compile-ffmpeg.sh armv5|armv7a|arm64|x86|x86_64" echo " compile-ffmpeg.sh all|all32" echo " compile-ffmpeg.sh all64" echo " compile-ffmpeg.sh clean" @@ -63,7 +63,7 @@ case "$FF_TARGET" in echo_archs armv7a sh tools/do-compile-ffmpeg.sh armv7a ;; - armv5|armv7a|x86|arm64) + armv5|armv7a|arm64|x86|x86_64) echo_archs $FF_TARGET sh tools/do-compile-ffmpeg.sh $FF_TARGET echo_nextstep_help diff --git a/android/contrib/tools/do-compile-ffmpeg.sh b/android/contrib/tools/do-compile-ffmpeg.sh index 3f57f5ae017414c54d57eb35a449935d29a27e51..79c6ffb0a8e16d6b6c350125e8164ff83b02dbbc 100755 --- a/android/contrib/tools/do-compile-ffmpeg.sh +++ b/android/contrib/tools/do-compile-ffmpeg.sh @@ -156,6 +156,23 @@ elif [ "$FF_ARCH" = "x86" ]; then FF_ASM_OBJ_DIR="libavcodec/x86/*.o libavfilter/x86/*.o libavutil/x86/*.o libswresample/x86/*.o libswscale/x86/*.o" +elif [ "$FF_ARCH" = "x86_64" ]; then + FF_ANDROID_PLATFORM=android-21 + + FF_BUILD_NAME=ffmpeg-x86_64 + FF_BUILD_NAME_OPENSSL=openssl-x86_64 + FF_SOURCE=$FF_BUILD_ROOT/$FF_BUILD_NAME + + FF_CROSS_PREFIX=x86_64-linux-android + FF_TOOLCHAIN_NAME=${FF_CROSS_PREFIX}-${FF_GCC_64_VER} + + FF_CFG_FLAGS="$FF_CFG_FLAGS --arch=x86_64 --enable-yasm" + + FF_EXTRA_CFLAGS="$FF_EXTRA_CFLAGS" + FF_EXTRA_LDFLAGS="$FF_EXTRA_LDFLAGS" + + FF_ASM_OBJ_DIR="libavcodec/x86/*.o libavfilter/x86/*.o libavutil/x86/*.o libswresample/x86/*.o libswscale/x86/*.o" + elif [ "$FF_ARCH" = "arm64" ]; then FF_ANDROID_PLATFORM=android-21 diff --git a/android/ijkplayer/ijkplayer-armv7a/src/main/jni/Android.mk b/android/ijkplayer/ijkplayer-armv7a/src/main/jni/Android.mk index ed20d6d04cac00978e9cef1aaf190711776ad9d4..ba2db29bed8fdc9d63325db7d5bd3d89441165e5 100644 --- a/android/ijkplayer/ijkplayer-armv7a/src/main/jni/Android.mk +++ b/android/ijkplayer/ijkplayer-armv7a/src/main/jni/Android.mk @@ -30,12 +30,16 @@ ifeq ($(TARGET_ARCH_ABI),armeabi) MY_APP_FFMPEG_OUTPUT_PATH := $(realpath $(MY_APP_ANDROID_ROOT)/contrib/build/ffmpeg-armv5/output) MY_APP_FFMPEG_INCLUDE_PATH := $(realpath $(MY_APP_FFMPEG_OUTPUT_PATH)/include) endif +ifeq ($(TARGET_ARCH_ABI),arm64-v8a) +MY_APP_FFMPEG_OUTPUT_PATH := $(realpath $(MY_APP_ANDROID_ROOT)/contrib/build/ffmpeg-arm64/output) +MY_APP_FFMPEG_INCLUDE_PATH := $(realpath $(MY_APP_FFMPEG_OUTPUT_PATH)/include) +endif ifeq ($(TARGET_ARCH_ABI),x86) MY_APP_FFMPEG_OUTPUT_PATH := $(realpath $(MY_APP_ANDROID_ROOT)/contrib/build/ffmpeg-x86/output) MY_APP_FFMPEG_INCLUDE_PATH := $(realpath $(MY_APP_FFMPEG_OUTPUT_PATH)/include) endif -ifeq ($(TARGET_ARCH_ABI),arm64-v8a) -MY_APP_FFMPEG_OUTPUT_PATH := $(realpath $(MY_APP_ANDROID_ROOT)/contrib/build/ffmpeg-arm64/output) +ifeq ($(TARGET_ARCH_ABI),x86_64) +MY_APP_FFMPEG_OUTPUT_PATH := $(realpath $(MY_APP_ANDROID_ROOT)/contrib/build/ffmpeg-x86_64/output) MY_APP_FFMPEG_INCLUDE_PATH := $(realpath $(MY_APP_FFMPEG_OUTPUT_PATH)/include) endif diff --git a/android/ijkplayer/ijkplayer-sample/build.gradle b/android/ijkplayer/ijkplayer-sample/build.gradle index d11feec272c13a2369a451c011858ef8e3a41ded..564d675d73bff1b1896f699666c4d99d6da3fe34 100644 --- a/android/ijkplayer/ijkplayer-sample/build.gradle +++ b/android/ijkplayer/ijkplayer-sample/build.gradle @@ -49,9 +49,11 @@ dependencies { all64Compile project(':ijkplayer-armv7a') all64Compile project(':ijkplayer-arm64') all64Compile project(':ijkplayer-x86') + all64Compile project(':ijkplayer-x86_64') // armv5Compile project(':player-armv5') // armv7aCompile project(':player-armv7a') // arm64Compile project(':player-arm64') // x86Compile project(':player-x86') + // x86_64Compile project(':player-x86_64') } diff --git a/android/ijkplayer/ijkplayer-x86_64/.gitignore b/android/ijkplayer/ijkplayer-x86_64/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..796b96d1c402326528b4ba3c12ee9d92d0e212e9 --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/.gitignore @@ -0,0 +1 @@ +/build diff --git a/android/ijkplayer/ijkplayer-x86_64/build.gradle b/android/ijkplayer/ijkplayer-x86_64/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..8c11468f5f3b884b12f4688d8a81d5c8f0b62f39 --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/build.gradle @@ -0,0 +1,39 @@ +apply plugin: 'com.android.library' + +android { + // http://tools.android.com/tech-docs/new-build-system/tips + //noinspection GroovyAssignabilityCheck + compileSdkVersion rootProject.ext.compileSdkVersion + //noinspection GroovyAssignabilityCheck + buildToolsVersion rootProject.ext.buildToolsVersion + + defaultConfig { + minSdkVersion 21 + targetSdkVersion rootProject.ext.targetSdkVersion + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + sourceSets.main { + jniLibs.srcDirs 'src/main/libs' + jni.srcDirs = [] // This prevents the auto generation of Android.mk + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) +} + +ext { + optionalPlugins = ['tools/gradle-mvn-push.gradle', 'tools/gradle-bintray-upload.gradle']; +} + +ext.optionalPlugins.each{ value -> + def plugin_file = new File(rootProject.projectDir, value); + if (plugin_file.exists()) { + apply from: plugin_file + } +} \ No newline at end of file diff --git a/android/ijkplayer/ijkplayer-x86_64/gradle.properties b/android/ijkplayer/ijkplayer-x86_64/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..b44ac28d6928c03d7b4ca136383dba522219ec9b --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME=ijkplayer-x86_64 +POM_ARTIFACT_ID=ijkplayer-x86_64 +POM_PACKAGING=aar \ No newline at end of file diff --git a/android/ijkplayer/ijkplayer-x86_64/proguard-rules.pro b/android/ijkplayer/ijkplayer-x86_64/proguard-rules.pro new file mode 100644 index 0000000000000000000000000000000000000000..034485dfaa0857c2faa85b36acb8407377bb217d --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /opt/android/ADK/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/android/ijkplayer/ijkplayer-x86_64/src/androidTest/java/com/example/ijkplayer_x86_64/ApplicationTest.java b/android/ijkplayer/ijkplayer-x86_64/src/androidTest/java/com/example/ijkplayer_x86_64/ApplicationTest.java new file mode 100644 index 0000000000000000000000000000000000000000..18b66cfedcfcc5b9d0aac9e7a57f2fbdb15bc109 --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/src/androidTest/java/com/example/ijkplayer_x86_64/ApplicationTest.java @@ -0,0 +1,13 @@ +package com.example.ijkplayer_x86_64; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/android/ijkplayer/ijkplayer-x86_64/src/main/AndroidManifest.xml b/android/ijkplayer/ijkplayer-x86_64/src/main/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..8b52942db889fa45f8a68f86e59fb8cd30b8643a --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/src/main/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/android/ijkplayer/ijkplayer-x86_64/src/main/jni/Android.mk b/android/ijkplayer/ijkplayer-x86_64/src/main/jni/Android.mk new file mode 120000 index 0000000000000000000000000000000000000000..fb3086783d37cf393f20471a26178e451df80fd2 --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/src/main/jni/Android.mk @@ -0,0 +1 @@ +../../../../ijkplayer-armv7a/src/main/jni/Android.mk \ No newline at end of file diff --git a/android/ijkplayer/ijkplayer-x86_64/src/main/jni/Application.mk b/android/ijkplayer/ijkplayer-x86_64/src/main/jni/Application.mk new file mode 100644 index 0000000000000000000000000000000000000000..92eb3cdda4f2852a876513b75b57f6b436bc9158 --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/src/main/jni/Application.mk @@ -0,0 +1,29 @@ +# copyright (c) 2013-2014 Zhang Rui +# +# This file is part of ijkPlayer. +# +# ijkPlayer is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# ijkPlayer is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with ijkPlayer; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +APP_OPTIM := release +APP_PLATFORM := android-21 +APP_ABI := x86_64 +NDK_TOOLCHAIN_VERSION=4.9 +APP_PIE := false + +APP_CFLAGS := -O3 -Wall -pipe \ + -ffast-math \ + -fstrict-aliasing -Werror=strict-aliasing \ + -Wno-psabi -Wa,--noexecstack \ + -DANDROID -DNDEBUG diff --git a/android/ijkplayer/ijkplayer-x86_64/src/main/jni/ffmpeg/Android.mk b/android/ijkplayer/ijkplayer-x86_64/src/main/jni/ffmpeg/Android.mk new file mode 100644 index 0000000000000000000000000000000000000000..ec33908f5357dd57e58d7b5c1b76657555e56990 --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/src/main/jni/ffmpeg/Android.mk @@ -0,0 +1,6 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := ijkffmpeg +LOCAL_SRC_FILES := $(MY_APP_FFMPEG_OUTPUT_PATH)/libijkffmpeg.so +include $(PREBUILT_SHARED_LIBRARY) \ No newline at end of file diff --git a/android/ijkplayer/ijkplayer-x86_64/src/main/jni/ffmpeg/include b/android/ijkplayer/ijkplayer-x86_64/src/main/jni/ffmpeg/include new file mode 120000 index 0000000000000000000000000000000000000000..930e36853222458d14c61aaab2262fd383e8eb26 --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/src/main/jni/ffmpeg/include @@ -0,0 +1 @@ +../../../../../../contrib/build/ffmpeg-x86_64/output/include/ \ No newline at end of file diff --git a/android/ijkplayer/ijkplayer-x86_64/src/main/jni/ijkmedia b/android/ijkplayer/ijkplayer-x86_64/src/main/jni/ijkmedia new file mode 120000 index 0000000000000000000000000000000000000000..f61992095f22a094efbf92820c453e2038d9fe73 --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/src/main/jni/ijkmedia @@ -0,0 +1 @@ +../../../../../../ijkmedia \ No newline at end of file diff --git a/android/ijkplayer/ijkplayer-x86_64/src/main/res/values/strings.xml b/android/ijkplayer/ijkplayer-x86_64/src/main/res/values/strings.xml new file mode 100644 index 0000000000000000000000000000000000000000..266f3352e5abb849d2cfa942bf7d302709a47782 --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + ijkplayer-x86_64 + diff --git a/android/ijkplayer/ijkplayer-x86_64/src/test/java/com/example/ijkplayer_x86_64/ExampleUnitTest.java b/android/ijkplayer/ijkplayer-x86_64/src/test/java/com/example/ijkplayer_x86_64/ExampleUnitTest.java new file mode 100644 index 0000000000000000000000000000000000000000..7dd7a7511a8831eef119c5014db9006e76ad04a5 --- /dev/null +++ b/android/ijkplayer/ijkplayer-x86_64/src/test/java/com/example/ijkplayer_x86_64/ExampleUnitTest.java @@ -0,0 +1,15 @@ +package com.example.ijkplayer_x86_64; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * To work on unit tests, switch the Test Artifact in the Build Variants view. + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() throws Exception { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/android/ijkplayer/settings.gradle b/android/ijkplayer/settings.gradle index 99ddf95654f63b01dd1757a10af1da5396a63f1c..fb1b37cea6886866ad7f9b7b1c6ea41d419dc066 100644 --- a/android/ijkplayer/settings.gradle +++ b/android/ijkplayer/settings.gradle @@ -1,4 +1,4 @@ -include ':ijkplayer-armv5' +include ':ijkplayer-armv5', ':ijkplayer-x86_64' include ':ijkplayer-armv7a' include ':ijkplayer-arm64' include ':ijkplayer-x86'