提交 5e6bb1ab 编写于 作者: Z Zhang Rui

android: support x86_64

上级 d35ac2ca
......@@ -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"
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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')
}
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
POM_NAME=ijkplayer-x86_64
POM_ARTIFACT_ID=ijkplayer-x86_64
POM_PACKAGING=aar
\ No newline at end of file
# 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 *;
#}
package com.example.ijkplayer_x86_64;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
\ No newline at end of file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ijkplayer_x86_64">
<uses-sdk
android:minSdkVersion="21" />
</manifest>
../../../../ijkplayer-armv7a/src/main/jni/Android.mk
\ No newline at end of file
# copyright (c) 2013-2014 Zhang Rui <bbcallen@gmail.com>
#
# 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
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
../../../../../../contrib/build/ffmpeg-x86_64/output/include/
\ No newline at end of file
../../../../../../ijkmedia
\ No newline at end of file
<resources>
<string name="app_name">ijkplayer-x86_64</string>
</resources>
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
include ':ijkplayer-armv5'
include ':ijkplayer-armv5', ':ijkplayer-x86_64'
include ':ijkplayer-armv7a'
include ':ijkplayer-arm64'
include ':ijkplayer-x86'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册