国产成人精品三级麻豆,色综合天天综合高清网,亚洲精品夜夜夜,国产成人综合在线女婷五月99播放,色婷婷色综合激情国产日韩

Hi,歡迎來到嵌入式培訓(xùn)高端品牌 - 華清遠(yuǎn)見教育科技集團(tuán)<北京總部官網(wǎng)>,專注嵌入式工程師培養(yǎng)15年!
當(dāng)前位置: > 華清遠(yuǎn)見教育科技集團(tuán) > 嵌入式學(xué)習(xí) > 講師博文 > Mplayer 移植
Mplayer 移植
時間:2017-01-05作者:華清遠(yuǎn)見

關(guān)于mplayer移植網(wǎng)上資料很多,但都很混亂。在此,我做了一個關(guān)于mplayer 的詳細(xì)總結(jié)。在做之前好在解壓源碼包后,先通過./configure --help看一下相關(guān)配置。

X86的LINUX上已經(jīng)自帶了解碼庫,不需要另外安裝解碼庫,而arm平臺自己做的文件系統(tǒng)沒有解碼庫,需要另外安裝解碼庫。

下載MPlayer:MPlayer-1.0rc2.tar.bz2
        解碼庫:libmad-0.15.0b.tar.gz

一、在x86的LINUX上安裝mplayer

1 #./configure (./configure    --enable-gui    –-enable-live    –-language=zh )
        2 #make
        3 #make install

此時在MPlayer-1.0rc2目錄下會生成可執(zhí)行文件mplayer.
        把它拷貝到/bin/目錄下。要執(zhí)行時:
        #/bin/mpalyer /路徑/要播放的媒體文件名;
        #/bin/mplayer a.mp3

二、移植mplayer到arm平臺的LINUX上(使用4.3.2編譯器)

1 配置安裝libmad

(如果不先配置安裝libmad,則在make mplayer時出現(xiàn)找不到mad.h 錯誤)
        echo PATH=/usr/local/arm/3.3.2/bin:$PATH

(1)#./configure --enable-fpm=arm --host=arm-none-linux-gnueabi --disable-shared --disable-debugging        --prefix=/usr/local/arm/3.3.2/lib CC=arm-none-linux-gnueabi-gcc

參數(shù)解析:
        --enable-fpm=arm 
        --host=arm-none-linux-gnueabi
        --disable-shared 
        --disable-debugging 
        --prefix=/home/linux/libmad(make install 安裝路徑)
        CC=arm-none-linux-gnueabi-gcc(4.3.2的交叉編譯工具鏈)

(2)#make

注意如果出現(xiàn)error:unrecognized command line option "-fforce-mem"錯誤,需要修改makefile,去掉--fforce-mem標(biāo)志(因?yàn)閍rm-eabi編譯器都不支持這個選項(xiàng))

(3)#make install

此時會在/home/linux目錄下生成include目錄和lib目錄。
        其中l(wèi)iclude目錄下有文件 mad.h
        lib 目錄有文件 libmad.a libmad.la

2 配置安裝mplayer

(1)#./configure    --host-cc=gcc    --cc=arm-none-linux-gnueabi-gcc    --target=arm-linux    --enable-static    --enable-ossaudio    --prefix=/tmp/mplayer-rc2     --disable-win32dll    --disable-dvdread    --enable-fbdev    --disable-mencoder    --disable-live --disable-mp3lib --enable-mad --enable-libavcodec_a    --disable-armv5te    --disable-armv6    --disable-dvdnav    --disable-dvdread    --disable-dvdread-internal        with-extraincdir=/usr/local/arm/3.3.2/lib/include        --with-extralibdir=/usr/local/arm/3.3.2/lib/lib

參數(shù)解析:
        --host-cc=gcc         # C compiler for tools needed while building [gcc]
        --cc=arm-none-linux-gnueabi-gcc        #C compiler to build MPlayer [gcc]
        --target=arm-linux        #target platform (i386-linux, arm-linux, etc)
        --enable-static        #build a statically linked binary
        --enable-ossaudio        #enable OSS audio output [autodetect]
        --prefix=/tmp/mplayer-rc2        #prefix directory for installation [/usr/local]
        --disable-win32dll         # disable Win32 DLL support [enabled]
        --disable-dvdread        #disable libdvdread [autodetect]
        --enable-fbdev        #enable FBDev video output [autodetect]
        --disable-mencoder        #disable MEncoder (A/V encoder) compilation [enable] 使能編碼器編輯
        --disable-live        #disable LIVE555 Streaming Media [autodetect] 讓Mpalyer不支持流媒體協(xié)議
        --disable-mp3lib        # disable builtin mp3lib [enabled]
        --enable-mad        #disable libmad (MPEG audio) support [autodetect]
        --enable-libavcodec_a        #disable static libavcodec [autodetect]
        --disable-armv5te        #disable DSP extensions (ARM) [autodetect]
        --disable-armv6        #disable ARMv6 (ARM) [autodetect]
        --with-extraincdir=/usr/local/arm/3.3.2/lib/include        #指明mad.h文件所在路徑
        --with-extralibdir=/usr/local/arm/3.3.2/lib/lib        #指明limad相關(guān)鏈接庫所在路徑

(2)#make

其中可能會遇到如下問題:

1.Error:motion_comp_arm_s.S

在libmpeg2/motion_comp_arm_s.S文件的前面加上如下的內(nèi)容:

#ifndef HAVE_PLD
        .macro pld reg
        .endm
        #endif

2.vo_ivtv.c:79: error: storage size of ’sd’ isn’t known

vo_ivtv.c:80: error: storage size of ’sd1′ isn’t known

添加--disable-ivtv

3. undefined reference to `video_out_ivtv'

在文件 file libvo/video_out.c, 找到
        #ifdef HAVE_DXR2
        extern vo_functions_t video_out_dxr2;
        #endif
        extern vo_functions_t video_out_dxr3; 
        #ifdef HAVE_IVTV
        extern vo_functions_t video_out_ivtv;
        #endif 
        edit it like this:
        #ifdef HAVE_DXR2
        extern vo_functions_t video_out_dxr2;
        #endif
        #ifdef HAVE_DXR3    //這一句是要添加的
        extern vo_functions_t video_out_dxr3; 
        #endif    //這句是要添加的
        #ifdef HAVE_IVTV
        extern vo_functions_t video_out_ivtv;
        #endif

使用arm-linux-gcc 3.3.2編譯mplayer可能會出現(xiàn)in.h頭文件錯誤如下:

/usr/local/arm/3.3.2/include/netinet/in.h:259: parse error before '(' token
        /usr/local/arm/3.3.2/include/netinet/in.h:259: parse error before "__u32"
        /usr/local/arm/3.3.2/include/netinet/in.h:260: parse error before '(' token
        /usr/local/arm/3.3.2/include/netinet/in.h:260: parse error before "__u16"
        /usr/local/arm/3.3.2/include/netinet/in.h:262: parse error before '(' token
        /usr/local/arm/3.3.2/include/netinet/in.h:262: parse error before "__u32"

需要修改一下/usr/local/arm/3.3.2/include/netinet/in.h中,在 __BEGIN_DECLS 后面增加下述文字

#undef ntohl
        #undef ntohs
        #undef htonl
        #undef htons

(3) make install(出現(xiàn)提示不認(rèn)識的文件。因?yàn)槭茿RM平臺運(yùn)行的文件,所有不認(rèn)識)

install -m 755 -s mplayer /tmp/mplayer-rc2/bin
        strip: Unable to recognise the format of the input file `/tmp/mplayer-rc2/bin/mplayer'
        此時在MPlayer-1.0rc2目錄下會生成可執(zhí)行文件mplayer.
        把它拷貝到/bin/目錄下。

要執(zhí)行時:

#/bin/mpalyer /路徑/要播放的媒體文件名;
        #/bin/mplayer -ac mad a.mp3

三、MPlayer slave命令

在命令中添加 -slave 和 -quiet就可以通過命令設(shè)置Mplayer實(shí)現(xiàn)相應(yīng)的功能。在mplayer源碼中的,/DOCS/tech/slave.txt中對這些命令有詳細(xì)的解析。

Mplayer相關(guān)文章:

Qt編寫Mplayer前端程序

發(fā)表評論
評論列表(網(wǎng)友評論僅供網(wǎng)友表達(dá)個人看法,并不表明本站同意其觀點(diǎn)或證實(shí)其描述)