ffmpeg for wince存在的問題總結

編譯配置選項

for armv4

./configure \
--enable-memalign-hack \
--target-os=mingw32ce \
--arch=arm \
--cpu=armv4 \
--enable-cross-compile \
--cross-prefix=arm-wince-mingw32ce- \
--enable-small \
--disable-static \
--enable-shared \
--disable-devices \
--disable-doc    \
--disable-ffplay    \
--disable-ffmpeg    \
--disable-ffprobe    \
--disable-ffserver    \
--disable-encoders \
--disable-network \
--disable-muxers \
--disable-protocols \
--enable-protocol=file \
--prefix=armv4 \
>armv4.txt


for armv6


./configure \
--enable-memalign-hack \
--target-os=mingw32ce \
--arch=arm \
--cpu=armv6 \
--enable-cross-compile \
--cross-prefix=arm-wince-mingw32ce- \
--disable-armv5te \
--enable-small \
--disable-static \
--enable-shared \
--disable-devices \
--disable-doc    \
--disable-ffplay    \
--disable-ffmpeg    \
--disable-ffprobe    \
--disable-ffserver    \
--disable-encoders \
--disable-network \
--disable-muxers \
--disable-protocols \
--enable-protocol=file \
--prefix=armv6 \
>armv6.txt


編譯問題:

1.將bx lr 替換成

#if defined(__ARM_ARCH_2__) || defined(__ARM_ARCH_3__)
|| defined(__ARM_ARCH_3M__) || defined(__ARM_ARCH_4__)
        mov pc, lr
#else
        bx lr
#endif


軟件問題:

1.對應armv6版本,很多彙編指令均拋出異常,在wince 6.0系統中ldr、str系列指令均不支持非對齊訪問

 修改辦法參考:

 static av_always_inline uint16_t AV_RN16(const void *p)
{
    uint16_t v;
    //__asm__ ("ldrh %0, %1" : "=r"(v) : "m"(*(const uint16_t *)p));
        __asm__ ("ldrb   %0, %2  \n\t"
             "ldrb   %1, %3  \n\t"
             : "=&r"(*(uint8_t*)(&v)),"=&r"(*((uint8_t*)&v+1))
             : "m"(*(const uint8_t*)p), "m"(*((const uint8_t*)p+1)));
    return v;
}

usat、ssat等armv6指令也會拋出異常,需要修改。

wince 6.0 OS沒有使用armv6架構的指令,只能運行於armv4指令系統。armv6兼容armv4指令。


2. ffmpeg 0.6 for armv4版本,對asf文件頭不是總能正確解析,弄錯性差,0.8版本相比0.6版本有很大的提高,對使用ffmpeg做流媒體程序,最好選擇0.8版本。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章