Skip to content

Commit

Permalink
fix: ios ffmpeg armv7 build error, update ffmpeg to 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
befovy committed Feb 21, 2020
1 parent 48859d7 commit 5c3fef0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion init-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# IJK_FFMPEG_UPSTREAM=git://git.videolan.org/ffmpeg.git
IJK_FFMPEG_UPSTREAM=https://github.com/Bilibili/FFmpeg.git
IJK_FFMPEG_FORK=https://github.com/Bilibili/FFmpeg.git
IJK_FFMPEG_COMMIT=ff3.4--ijk0.8.7--20180103--001
IJK_FFMPEG_COMMIT=ff4.0--ijk0.8.25--20191031--001
IJK_FFMPEG_LOCAL_REPO=extra/ffmpeg

IJK_GASP_UPSTREAM=https://github.com/Bilibili/gas-preprocessor.git
Expand Down
16 changes: 11 additions & 5 deletions ios/IJKMediaDemo/IJKMediaDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
E654EAD71B6B28B100B0F2D0 /* IJKMediaFramework.framework */,
21B5D5B022D8A5E500A1D26D /* IJKMediaFrameworkWithSSL.framework */,
E654EAD91B6B28B100B0F2D0 /* IJKMediaFrameworkTests.xctest */,
21B5D5B222D8A5E500A1D26D /* FIJKPlayer.framework */,
21B5D5B222D8A5E500A1D26D /* IJKPlayer.framework */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -389,10 +389,10 @@
remoteRef = 21B5D5AF22D8A5E500A1D26D /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
21B5D5B222D8A5E500A1D26D /* FIJKPlayer.framework */ = {
21B5D5B222D8A5E500A1D26D /* IJKPlayer.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = FIJKPlayer.framework;
path = IJKPlayer.framework;
remoteRef = 21B5D5B122D8A5E500A1D26D /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
Expand Down Expand Up @@ -551,11 +551,16 @@
DEVELOPMENT_TEAM = 7SUQ9UM9P2;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "IJKMediaDemo/IJKMediaDemo-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
"IJK_IOS=1",
);
INFOPLIST_FILE = "IJKMediaDemo/IJKMediaDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = tv.danmaku.IJKMediaDemo.demo;
PRODUCT_BUNDLE_IDENTIFIER = tv.danmaku.IJKMediaDemo.befovy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
TARGETED_DEVICE_FAMILY = 1;
Expand All @@ -573,11 +578,12 @@
DEVELOPMENT_TEAM = 7SUQ9UM9P2;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "IJKMediaDemo/IJKMediaDemo-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "IJK_IOS=1";
INFOPLIST_FILE = "IJKMediaDemo/IJKMediaDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = tv.danmaku.IJKMediaDemo.demo;
PRODUCT_BUNDLE_IDENTIFIER = tv.danmaku.IJKMediaDemo.befovy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
TARGETED_DEVICE_FAMILY = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#import "ijkplayer/ijkavformat/ijkioapplication.h"
#include "string.h"

static const char *kIJKFFRequiredFFmpegVersion = "ff3.4--ijk0.8.7--20180103--001";
static const char *kIJKFFRequiredFFmpegVersion = "ff4.0--ijk0.8.25--20191031--001";

// It means you didn't call shutdown if you found this object leaked.
@interface IJKWeakHolder : NSObject
Expand Down
2 changes: 2 additions & 0 deletions ios/tools/do-compile-ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ elif [ "$FF_ARCH" = "armv7" ]; then
FF_BUILD_NAME_OPENSSL=openssl-armv7
FF_XCRUN_OSVERSION="-miphoneos-version-min=6.0"
FF_XCODE_BITCODE="-fembed-bitcode"
FFMPEG_CFG_FLAGS_ARM="$FFMPEG_CFG_FLAGS_ARM --disable-asm"
FFMPEG_CFG_FLAGS="$FFMPEG_CFG_FLAGS $FFMPEG_CFG_FLAGS_ARM"
# FFMPEG_CFG_CPU="--cpu=cortex-a8"
elif [ "$FF_ARCH" = "armv7s" ]; then
Expand Down Expand Up @@ -214,6 +215,7 @@ FFMPEG_DEP_OPENSSL_LIB=$FF_BUILD_ROOT/build/$FF_BUILD_NAME_OPENSSL/output/lib
if [ -f "${FFMPEG_DEP_OPENSSL_LIB}/libssl.a" ]; then
FFMPEG_CFG_FLAGS="$FFMPEG_CFG_FLAGS --enable-openssl"

echo "OpenSSL Include" $FFMPEG_DEP_OPENSSL_INC
FFMPEG_CFLAGS="$FFMPEG_CFLAGS -I${FFMPEG_DEP_OPENSSL_INC}"
FFMPEG_DEP_LIBS="$FFMPEG_CFLAGS -L${FFMPEG_DEP_OPENSSL_LIB} -lssl -lcrypto"
fi
Expand Down

0 comments on commit 5c3fef0

Please sign in to comment.