S3C2440 madplayer mp3移植笔记

声卡移植测试完成,但只能播放wav格式的歌曲,对于我们来说mp3应用更广泛一些,经过昨晚的努力,madplayer移植成功,听着自己的mp3心里很爽呀,也许它足够简陋,但它给我们带来的乐趣是让人热血沸腾的,感谢开源社区默默奋斗的人,感谢网上分享成功经验的人,致敬。

1,下载源码

http://sourceforge.net/projects/mad/files/

madplayer-0.15.2b.tar.gz            libmad-0.15.1b .tar.gz             libid3tag-0.15.1b.tar.gz

http://sourceforge.net/projects/libpng/files/zlib/

zlib-1.2.7.tar.gz

2,建立工作文件夹/home/sxbg/madplayer

将各个文件解压到此目录下

3,编译zlib

root@ubuntu:/home/sxbg/madplayer# cd zlib-1.2.7/
root@ubuntu:/home/sxbg/madplayer/zlib-1.2.7# CC=arm-linux-gcc ./configure --prefix=/home/sxbg/madplayer --shared

Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... Yes.
./ztest25232: 1: ./ztest25232: Syntax error: word unexpected (expecting ")")
Looking for a four-byte integer type... Not found.

由于zlib并非使用标准的autotools,没有考虑交叉编译的情况,这个错误是执行测试程序导致的,用于检测32bit整型是int还是long还是别的,改错误无关紧要,忽略即可。

root@ubuntu:/home/sxbg/madplayer/zlib-1.2.7# make

root@ubuntu:/home/sxbg/madplayer/zlib-1.2.7# make install

3,编译libid3tag

root@ubuntu:/home/sxbg/madplayer/libid3tag-0.15.1b# CC=arm-linux-gcc ./configure --host=arm-linux --disable-shared --enable-static --prefix=/home/sxbg/madplayer

root@ubuntu:/home/sxbg/madplayer/libid3tag-0.15.1b# make

root@ubuntu:/home/sxbg/madplayer/libid3tag-0.15.1b# make install

4,编译libmad

root@ubuntu:/home/sxbg/madplayer/libmad-0.15.1b# CC=arm-linux-gcc ./configure --host=arm-linux --disable-shared --enable-static --prefix=/home/sxbg/madplayer

root@ubuntu:/home/sxbg/madplayer/libmad-0.15.1b# make

cc1: error: unrecognized command line option "-fforce-mem"
make[2]: *** [version.lo] Error 1
make[2]: Leaving directory `/home/sxbg/madplayer/libmad-0.15.1b'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/sxbg/madplayer/libmad-0.15.1b'
make: *** [all] Error 2

解决方法:将Makefile中的"-fforce-mem"选项去掉

root@ubuntu:/home/sxbg/madplayer/libmad-0.15.1b# make

root@ubuntu:/home/sxbg/madplayer/libmad-0.15.1b# make install


5,编译madplayer

root@ubuntu:/home/sxbg/madplayer/madplay-0.15.2b# ./configure CC=arm-linux-gcc --host=arm-linux --disable-shared --enable-static --prefix=/home/sxbg/madplayer CPPFLAGS=-I/home/sxbg/madplayer/include LDFLAGS=-L/home/sxbg/madplayer/lib

root@ubuntu:/home/sxbg/madplayer/madplay-0.15.2b# make

root@ubuntu:/home/sxbg/madplayer/madplay-0.15.2b# make install

6,/home/sxbg/madplayer文件夹下出现三个文件夹

bin :madplay可执行程序,复制到rootfs文件系统内

include:头文件

lib:库文件,将所有库文件下所有文件复制到rootfs/lib下

7,测试

root@FZ:/# ./madplay Hotel.mp3

终端信息:

MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
          Title: Hotel California
         Artist: Eagles
          Album: The Complete Greatest Hits
           Year: 2003

动听的加州旅馆,音质挺好的,呵呵~~~~

至此madplayer移植结束,又12点多了,睡觉了。






  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值