每天写这些烦人的协议代码,总想在LINUX上做点东西,乘闲暇功夫,今天将Mplayer移植到AT91SAM9261上去了。
我的Mplayer源代码版本是:mplayer-20070814.tar.bz2
交叉gcc用的是 arm-linux-gcc-3.3.2
host-gcc用的是 (Ubuntu)gcc-4.3.2
1、 我也换过网上很多人说的MPlayer-1.0rc1.tar.bz2版本,试过很多次,那硬是没成功。
2、 编译mplayer-20070814.tar.bz2时出,以为是host-gcc的版本问题,后来估计应该不是这个问题(成功后没有换其它host-gcc试过)。
3、./configure 是个麻烦的过程,我参照别人的:
--cc=arm-linux-gcc   \
--host-cc=gcc   \
--enable-cross-compile   \
--target=arm-armv41-linux   \
--enable-linux-devfs   \ 
--disable-dvdread   \
--enable-fbdev   \
--disable-mencoder   \
--enable-libavcodec   \
--enable-liba52   \
--enable-mp3lib   \ 
--enable-static   \
--disable-live   \  
--disable-armv5te   \
--disable-rtc   \
--disable-iconv   \
--charset=noconv   \
--prefix=/tmp/mplayer
便于copy,括号里的(./configure --cc=arm-linux-gcc --host-cc=gcc --enable-cross-compile --target=arm-armv4l-linux --enable-linux-devfs --disable-dvdread --enable-fbdev --disable-mencoder --enable-liba52 --enable-mp3lib --enable-static --disable-live --disable-armv5te --disable-rtc --disable-iconv --charset=noconv --prefix=/tmp/mplayer)
加了libmad时的配置是
(./configure --cc=/usr/local/arm/3.3.2/bin/arm-linux-gcc --host-cc=gcc --enable-cross-compile --target=arm-armv4l-linux --enable-linux-devfs --disable-dvdread --enable-fbdev --disable-mencoder --enable-liba52 --disable-mp3lib --enable-static --disable-live --disable-armv5te --disable-rtc --disable-iconv --charset=noconv --enable-mad --enable-ossaudio --with-extraincdir=/usr/local/arm/3.3.2/arm-linux/sys-include/:/usr/local/arm/3.3.2/lib/include --with-extralibdir=/usr/local/arm/3.3.2/arm-linux/lib/:/usr/local/arm/3.3.2/lib/lib --prefix=/tmp/mplayer
可惜的是最终mplayer不是生成在/tmp/mplayer,而是在源代码根目录下.
4、出现两处错误,是通过
  http://blog.sina.com.cn/s/blog_4cbc67c00100c79x.html (/usr/include/netinet/in.h文件,在 __BEGIN_DECLS 后面增加下述文字
               #undef ntohl
        #undef ntohs
        #undef htonl
        #undef htons
        )
  http://blog.csdn.net/figolqt/archive/2008/12/10/3486727.aspx (ioctl.c:1797:5: #error "DVD ioctls are unavailable on this system"
        到ioctl.c中注释这些语句即可编译通过。
 )
 解决掉的
5、命令式用 ./mplayer -nosound xxx.wmv 效果不错。 因为声音占很大的资源,所以下次研究
1、那是因为默认播放音频的库,是适合在x86系统下的,占用系统很大资源。
后记: 如果用mplayer 播放mp3时, 会提示找不到 “/dev/../dsp”什么的,具体忘记了, 找到这个dsp,修改源代码。再编译就OK 呢
我的播放不了 wmv格式的,avi格式的倒还可以。