在iOS5.0上编译ffmpeg0.8.11
1. 从ffmpeg.org上下载ffmpeg0.8.11并解压缩到用户目录。
2. 从https://github.com/yuvi/gas-preprocessor下载https://github.com/yuvi/gas-preprocessor.git脚本并放到ffmpeg0.8.11目录。
3. ./configure --enable-memalign-hack --disable-doc --disable-gpl --disable-nonfree --disable-version3 --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-ffprobe --disable-encoders --disable-muxers --disable-decoder=vp8 --disable-parser=vp8 --disable-devices --disable-avdevice --disable-avfilter --disable-hwaccels --disable-decoder=vp8 --disable-demuxer=vp8 --enable-protocols --enable-protocol=file --enable-protocol=cache --enable-protocol=pipe --enable-protocol=crypto --enable-protocol=md5 --enable-protocol=http --enable-protocol=applehttp --enable-protocol=hls --enable-network --disable-yasm --disable-armv6 --disable-armv6t2 --enable-armvfp --enable-neon --enable-pthreads --disable-debug --disable-zlib --enable-cross-compile --arch=arm --target-os=darwin --enable-pic --disable-shared --enable-static --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc --as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk --cpu=cortex-a8 --enable-neon --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk'
4.编译,后来出错,提示:
invalid operand in inline asm: 'adds $1, ${2:R}, ${2:Q}, lsr #31
mvnne $1, #1<<31 br="" nbsp=""> moveq $0, ${2:Q}
eorne $0, $1, ${2:R}, asr #31
'
31>
5.注释掉libavutil/arm/intmath.h中的函数:
/*
#define av_clipl_int32 av_clipl_int32_arm
static av_always_inline av_const int32_t av_clipl_int32_arm(int64_t a)
{
int x, y;
__asm__ ("adds %1, %R2, %Q2, lsr #31 \n\t"
"mvnne %1, #1<<31 br="" n="" nbsp="" t=""> "moveq %0, %Q2 \n\t"
"eorne %0, %1, %R2, asr #31 \n\t"
: "=r"(x), "=&r"(y) : "r"(a):"cc");
return x;
}
*/
31>
6. 重新编译,生成最终的Lib,未出其他错误。
7. 针对xcode4.4及iOS5.1编译ffmpeg0.11依然适用。
2. 从https://github.com/yuvi/gas-preprocessor下载https://github.com/yuvi/gas-preprocessor.git脚本并放到ffmpeg0.8.11目录。
3. ./configure --enable-memalign-hack --disable-doc --disable-gpl --disable-nonfree --disable-version3 --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-ffprobe --disable-encoders --disable-muxers --disable-decoder=vp8 --disable-parser=vp8 --disable-devices --disable-avdevice --disable-avfilter --disable-hwaccels --disable-decoder=vp8 --disable-demuxer=vp8 --enable-protocols --enable-protocol=file --enable-protocol=cache --enable-protocol=pipe --enable-protocol=crypto --enable-protocol=md5 --enable-protocol=http --enable-protocol=applehttp --enable-protocol=hls --enable-network --disable-yasm --disable-armv6 --disable-armv6t2 --enable-armvfp --enable-neon --enable-pthreads --disable-debug --disable-zlib --enable-cross-compile --arch=arm --target-os=darwin --enable-pic --disable-shared --enable-static --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc --as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk --cpu=cortex-a8 --enable-neon --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk'
4.编译,后来出错,提示:
invalid operand in inline asm: 'adds $1, ${2:R}, ${2:Q}, lsr #31
mvnne $1, #1<<31 br="" nbsp=""> moveq $0, ${2:Q}
eorne $0, $1, ${2:R}, asr #31
'
31>
5.注释掉libavutil/arm/intmath.h中的函数:
/*
#define av_clipl_int32 av_clipl_int32_arm
static av_always_inline av_const int32_t av_clipl_int32_arm(int64_t a)
{
int x, y;
__asm__ ("adds %1, %R2, %Q2, lsr #31 \n\t"
"mvnne %1, #1<<31 br="" n="" nbsp="" t=""> "moveq %0, %Q2 \n\t"
"eorne %0, %1, %R2, asr #31 \n\t"
: "=r"(x), "=&r"(y) : "r"(a):"cc");
return x;
}
*/
31>
6. 重新编译,生成最终的Lib,未出其他错误。
7. 针对xcode4.4及iOS5.1编译ffmpeg0.11依然适用。
沒有留言:
張貼留言