From a6310d68fcc508125660d93c7dafed7fb35072c2 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Thu, 27 Aug 2015 13:11:26 +0800 Subject: [PATCH] ios: use ffmpeg's config.h --- .../IJKMediaPlayer.xcodeproj/project.pbxproj | 2 - ios/compile-ffmpeg.sh | 6 +-- ios/tools/config.h | 45 +++++++++++++++++++ ios/tools/do-compile-ffmpeg.sh | 2 + 4 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 ios/tools/config.h diff --git a/ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj/project.pbxproj b/ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj/project.pbxproj index f8d7866b..1273a61a 100644 --- a/ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj/project.pbxproj +++ b/ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj/project.pbxproj @@ -247,7 +247,6 @@ E6903FDA17EAFC6100CFD954 /* ff_ffmsg_queue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ff_ffmsg_queue.h; sourceTree = ""; }; E6903FDB17EAFC6100CFD954 /* ff_ffplay.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ff_ffplay.c; sourceTree = ""; }; E6903FDC17EAFC6100CFD954 /* ff_ffplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ff_ffplay.h; sourceTree = ""; }; - E6903FDD17EAFC6100CFD954 /* ff_ffplay_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ff_ffplay_config.h; sourceTree = ""; }; E6903FDE17EAFC6100CFD954 /* ff_ffplay_def.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ff_ffplay_def.h; sourceTree = ""; }; E6903FF117EAFC6100CFD954 /* image_convert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = image_convert.c; sourceTree = ""; }; E6903FF917EAFC6100CFD954 /* ijksdl_image_convert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ijksdl_image_convert.h; sourceTree = ""; }; @@ -568,7 +567,6 @@ E67B91AC1A3801DB00717EA9 /* ff_ffpipeline.h */, E67B91AD1A3801DB00717EA9 /* ff_ffpipenode.c */, E67B91AE1A3801DB00717EA9 /* ff_ffpipenode.h */, - E6903FDD17EAFC6100CFD954 /* ff_ffplay_config.h */, E6C2FD391B300A390081D321 /* ff_ffplay_debug.h */, E6903FDE17EAFC6100CFD954 /* ff_ffplay_def.h */, E6903FDB17EAFC6100CFD954 /* ff_ffplay.c */, diff --git a/ios/compile-ffmpeg.sh b/ios/compile-ffmpeg.sh index e46f0e83..87cfee67 100755 --- a/ios/compile-ffmpeg.sh +++ b/ios/compile-ffmpeg.sh @@ -77,9 +77,6 @@ do_lipo_ssl () { fi } -FF_ALL_GEN_HEADER_FILES= -FF_ALL_GEN_HEADER_FILES="$FF_ALL_GEN_HEADER_FILES include/libavutil/avconfig.h" -FF_ALL_GEN_HEADER_FILES="$FF_ALL_GEN_HEADER_FILES include/libavutil/ffversion.h" do_lipo_all () { mkdir -p $UNI_BUILD_ROOT/build/universal/lib echo "lipo archs: $FF_ALL_ARCHS" @@ -105,6 +102,9 @@ do_lipo_all () { cp -f tools/avconfig.h "$UNI_INC_DIR/libavutil/avconfig.h" cp -f "$ARCH_INC_DIR/libavutil/ffversion.h" "$UNI_INC_DIR/libavutil/$ARCH/ffversion.h" cp -f tools/ffversion.h "$UNI_INC_DIR/libavutil/ffversion.h" + mkdir -p "$UNI_INC_DIR/libffmpeg/$ARCH" + cp -f "$ARCH_INC_DIR/libffmpeg/config.h" "$UNI_INC_DIR/libffmpeg/$ARCH/config.h" + cp -f tools/config.h "$UNI_INC_DIR/libffmpeg/config.h" fi done diff --git a/ios/tools/config.h b/ios/tools/config.h new file mode 100644 index 00000000..ef00f37c --- /dev/null +++ b/ios/tools/config.h @@ -0,0 +1,45 @@ +/* + * config.h + * + * Copyright (c) 2013 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 + */ + +#if defined(__aarch64__) +# include "arm64/config.h" +#elif defined(__x86_64__) +# include "x86_64/config.h" +#elif defined(__arm__) + +# if defined(__ARM_ARCH_7S__) +# include "armv7s/config.h" +# elif defined(__ARM_ARCH) +# if __ARM_ARCH == 7 +# include "armv7/config.h" +# else +# error Unsupport ARM architecture +# endif +# else +# error Unsupport ARM architecture +# endif + +#elif defined(__i386__) +# include "i386/config.h" +#else +# error Unsupport architecture +#endif diff --git a/ios/tools/do-compile-ffmpeg.sh b/ios/tools/do-compile-ffmpeg.sh index 834974eb..a2dbab30 100755 --- a/ios/tools/do-compile-ffmpeg.sh +++ b/ios/tools/do-compile-ffmpeg.sh @@ -222,3 +222,5 @@ echo "--------------------" cp config.* $FF_BUILD_PREFIX make -j3 $FF_GASPP_EXPORT make install +mkdir -p $FF_BUILD_PREFIX/include/libffmpeg +cp -f config.h $FF_BUILD_PREFIX/include/libffmpeg/config.h -- GitLab