欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

imx6ul上mplayer的移植

程序员文章站 2022-05-22 19:22:30
...

安装libmad,这里使用版本libmad-0.15.1b.tar.gz
下载链接:ftp://ftp.mars.org/pub/mpeg/
安装Mplayer,这里使用版本MPlayer-1.0rc2.tar.bz2
下载链接:http://www.mplayerhq.hu/MPlayer/releases/
imx6ul上mplayer的移植
环境:Ubuntu16.04 64位
工具链版本:4.9.4
目标平台:TQ.IMX6UL
imx6ul上mplayer的移植
1.安装libmad

#tar xvf libmad-0.15.1b.tar.gz
#cd libmad-0.15.1b/
#vi mplayer.sh

#!/bin/sh
CC=arm-linux-gnueabihf-gcc ./configure --host=arm-linux  --prefix=/home/mm/work/project/yichuan/embesky/mplayer/mplayer-arm --disable-shared --disable-debugging --enable-speed
#make -j4

#make

编译时会出现以下错误:

arm-linux-gnueabihf-gcc: error: unrecognized command line option '-fforce-mem'

这个要在Makefile中去了-fforce-mem
#vi Makefile
将:

  CFLAGS = -Wall -g -O -fforce-mem -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -fstrength-reduce

改为:

  CFLAGS = -Wall -g -O  -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -fstrength-reduce      

保存继续编译
#make
又出现以下问题:

/tmp/ccFLzPIj.s: Assembler messages:
/tmp/ccFLzPIj.s:1308: Error: selected processor does not support Thumb mode `rsc r7,r7,#0'
/tmp/ccFLzPIj.s:1455: Error: selected processor does not support Thumb mode `rsc r9,r9,#0'
/tmp/ccFLzPIj.s:1881: Error: selected processor does not support Thumb mode `rsc r7,r7,#0'
/tmp/ccFLzPIj.s:2023: Error: selected processor does not support Thumb mode `rsc r8,r8,#0'
Makefile:383: recipe for target 'synth.lo' failed
make[2]: *** [synth.lo] Error 1
make[2]: Leaving directory '/home/mm/work/project/yichuan/embesky/mplayer/libmad-0.15.1b'
Makefile:424: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/mm/work/project/yichuan/embesky/mplayer/libmad-0.15.1b'
Makefile:249: recipe for target 'all' failed
make: *** [all] Error 2

在配置时加上–enable-speed参数即可
#make
#make install
最终的编译脚本为mplayer.sh

#!/bin/sh
CC=arm-linux-gnueabihf-gcc 
./configure \
--host=arm-linux \  
--prefix=/home/mm/work/project/yichuan/embesky/mplayer/mplayer-arm  \
--disable-shared  \
--disable-debugging  \
--enable-speed \
make -j4 
make install

最终在–prefix指定的路径生成头文件和库文件
imx6ul上mplayer的移植
2.编译安装Mplayer
#tar xvf MPlayer-1.0rc2.tar.bz2
#cd MPlayer-1.0rc2/
#vi mplayer.sh

#!/bin/sh
./configure --prefix=/home/mm/work/project/yichuan/embesky/mplayer/mplayer-arm  --cc=arm-linux-gnueabihf-gcc --disable-gui  --target=arm-linux  --host-cc=gcc  --disable-freetype  --enable-fbdev  --disable-mencoder   --disable-sdl --disable-live  --disable-dvdread  --disable-libdvdcss-internal --disable-x11 --enable-cross-compile  --disable-dvdnav --disable-dvdread-internal --disable-jpeg --disable-tga --disable-pnm --disable-tv --disable-ivtv --disable-fontconfig --disable-xanim --disable-win32dll --disable-armv5te --disable-armv6 --enable-static

make

执行脚本编译
#./mplayer.sh
生成可执行文件mplayer
imx6ul上mplayer的移植
将执行文件mplayer拷贝至arm板/bin目录,另外再拷贝一个mp4文件
mplayer -fs -zoom -x 800 -y 480 /test_file/movie.mp4
-fs 视频图像居中
-zoom -x 800 -y 480 设置大小(具体按自己的开发板LCD分辨率设置)
imx6ul上mplayer的移植
参考链接:
https://blog.csdn.net/nanfeibuyi/article/details/82657631