Mplayer 移植到UP6410 开发板
本文档是移植Mplayer到up6410,本人亲身测试的。如果移植的其他型号的arm板可参考本文档裁剪的命令可以使用 ./configure --help 查看!
一:
准备阶段:
在移植Mplayer之前要确保电脑上安装了 arm-linux-gcc 编译器,并正确配置环境变量!
二:
移植阶段:
1. 配置参数
首先解压Mplayer 到当前文件夹
进入Mplayer 文件夹
输入以下配置命令:
其中 --prefix 是指定Mplayer的安装路径
./configure --cc=arm-linux-gcc --host-cc=gcc --target=arm-armv41-linux --enable-linux-devfs --disable-win32dll --disable-dvdread --enable-fbdev --disable-mencoder --enable-liba52 --disable-libmpeg2 --enable-static --disable-mp3lib --disable-live --prefix=/root/dd
--enable 后加的参数是让生成的可执行文件支持相应的设置,例如 --enable-static 是支持静态库,就是让mplayer 生成的可执行文件不需要动态库的依赖。
--disable 后加的参数是不支持相应的设置例如 --disable-dvdread 不支持光盘的读取。
--cc 是指定编译器, --cc =arm-linxu-gcc 是指定编译器为arm-linux-gcc 编译器
--prefix 是指定安装的路径(也就是生成的arm 所依赖的库和可执行文件存放的位置一般会包含 include , lib ,bin share(本例支持静态库所以没有lib))。
更多指令见:
Mplayer 文件夹先的 ./configure --help
2. 发现错误
然后执行 make
会出现如下错误:
MPlayer-1.0rc2/libdvdcss/ioctl.c
arm-linux-gcc -D__USE_UNIX98 -D_GNU_SOURCE -DVERSION=\"1.2.9\" -I../libavcodec -I../libavformat -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -I. -I.. -I../libavutil -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -pipe -ffast-math -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAVE_CONFIG_H -c -o ioctl.o ioctl.c
ioctl.c:273:5: error: #error "DVD ioctls are unavailable on this system"
ioctl.c:446:5: error: #error "DVD ioctls are unavailable on this system"
ioctl.c:610:5: error: #error "DVD ioctls are unavailable on this system"
ioctl.c:734:5: error: #error "DVD ioctls are unavailable on this system"
ioctl.c:868:5: error: #error "DVD ioctls are unavailable on this system"
ioctl.c:1001:5: error: #error "DVD ioctls are unavailable on this system"
ioctl.c:1130:5: error: #error "DVD ioctls are unavailable on this system"
ioctl.c:1241:5: error: #error "DVD ioctls are unavailable on this system"
ioctl.c:1378:5: error: #error "DVD ioctls are unavailable on this system"
ioctl.c:1515:5: error: #error "DVD ioctls are unavailable on this system"
ioctl.c:1670:5: error: #error "DVD ioctls are unavailable on this system"
ioctl.c:1797:5: error: #error "DVD ioctls are unavailable on this system"
make[1]: *** [ioctl.o] Error 1
make[1]: Leaving directory `/root/test_123/MPlayer-1.0rc2/libdvdcss'
make: *** [libdvdcss/libdvdcss.a] 错误 2
3. 解决错误
这时只需要进入 MPlayer-1.0rc2/libdvdcss/ 文件夹把ioctl.c 源文件中的把对应行号的
#else
# error "DVD ioctls are unavailable on this system"
注释掉就行了。
然后执行
Make install
make[1]: Leaving directory `/root/MPlayer-1.0rc2/osdep'
install -m 755 -s mplayer /root/dd/bin
strip: Unable to recognise the format of the input file `/root/dd/bin/mplayer'
install: strip process terminated abnormally
make: *** [install-mplayer] 错误 1
也会提示出错,是因为生成的Mplayer 是arm板上的可执行程序但是,pc机不能识别这种格式。我手动移动mplayer 就行了。
4. 安装完成
到这里就应经成功的生成了 arm 板上可运行的mplayer了。以为我配置文件里写的是支持静态库所以直接到mplayer copy到arm上就能运行了。
三:挂载文件系统
1.配置pc机的共享目录
在pc上的/etc/exports 文件里配置nfs的共享目录。
以arm6410的ip 为 192.168.1.199,共享目录为 /usr/player_arm为例:
只需要在exports 里写 /usr/player_arm 192.168.1.199(rw, sync)
其中(rw,sync)是赋予可读可写实时更新权限。
然后保存并重新启动一下nfs 服务,可以用命令 service nfs restart
2.挂载文件系统
用 minicom 命令进入开发板
在终端里输入 mountnfs (pc机的ip) :(共享目录)要挂载的目录前提是双方的目录要存在
例如:
Mountnfs 192.168.1.120: /usr/arm_player /mnt/nfs
就是把 usr/arm_player 挂载到arm 的 /mnt/nfs下
3.拷贝文件并运行
在pc机上把用arm-linux-gcc 编译通过的二进制文件方到 /usr/arm_player 下,在arm机上的就可以在 /mnt/nfs 下找到该文件,复制到yaffs下就可以直接运行了。
Write dy :douyuan888
2012、12、17号晚