Mplayer的移植

 

日期: 2013.8.4  作者:杨正 QQ:1209758756  Email:yz2012ww@gmail.com

前言

MPlayer最初的名字叫做"MPlayer - The Movie Player for Linux",不过后来开发者们简称其为"MPlayer - The Movie Player"原因是MPlayer已经不仅可以用于Linux而可以在所有平台上运行.MPlayer是一款开源多媒体播放器,以GNU通用公共许可证发布。此款软件可在各主流作业系统使用,例如Linux和其他类Unix系统、微软的视窗系统及苹果电脑的Mac OS X系统。MPlayer是建基于命令行界面,在各作业系统可选择安装不同的图形界面。mplayer的另一个大的特色是广泛的输出设备支持。它可以在X11XvDGAOpenGLSVGAlibfbdevAAlibDirectFB下工作。

开发环境:linux

目标环境:fl2440

移植步骤:

         移植libmad
      
移植
libid3tag
       移植
madplay
       移植
mplayer
       测试

一、移植libmad库

1)、下载源代码包,并解压缩:

[lingyun@localhost mplayer]$ wget ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz

[lingyun@localhost mplayer]$ tar -zxf libmad-0.15.1b.tar.gz

[lingyun@localhost mplayer]$ ls

libmad-0.15.1b  libmad-0.15.1b.tar.gz

[lingyun@localhost mplayer]$ mkdir -p install/libmad

[lingyun@localhost mplayer]$ pwd

/home/lingyun/yangzheng/mplayer

[lingyun@localhost mplayer]$ cd libmad-0.15.1b

 

2)、配置生产Makefile(--prefix=/home/lingyun/yangzheng/mplayer/install/libmad/:指定最终库文件的安装路径; CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc指定交叉编译器)

[lingyun@localhost libmad-0.15.1b]$  ./configure --enable-fpm=arm --host=arm-linux --disable-shared \

> --disable-debugging --prefix=/home/lingyun/yangzheng/mplayer/install/libmad/ \

>CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc

注:sed -i -e 's/-fforce-mem//' Makefile    //makefile中的-fforce-mem删除掉

3)、使用make和make install进行编译,安装:

[lingyun@localhost libmad-0.15.1b]$ make

[lingyun@localhost libmad-0.15.1b]$ make install

[lingyun@localhost libmad]$ tree

.

|-- include

|   `-- mad.h

`-- lib

    |-- libmad.a

    `-- libmad.la

 

2 directories, 3 files

 

 

 

 

二、移植libid3tag

1)、下载源代码包:

[lingyun@localhost mplayer]$ wget ftp://ftp.mars.org/pub/mpeg/libid3tag-0.15.1b.tar.gz

[lingyun@localhost mplayer]$ tar -zxf libid3tag-0.15.1b.tar.gz
[lingyun@localhost mplayer]$ mkdir –p install/madid3

2)、配置生产Makefile(CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc:指定交叉编译器):

[lingyun@localhost libid3tag-0.15.1b]$ ./configure --host=arm-linux --prefix=/home/lingyun/yangzheng/mplayer/install/madid3/ \
disable-shared --disable-debugging  \
CC=
/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc

再修改一下makefile,当然也可以把CFLAGSLDFLAGS一次加到上面的那条命令里面:

[lingyun@localhost libid3tag-0.15.1b]$ vim Makefile

INST_PATH = /home/lingyun/yangzheng/mplayer/install

#CFLAGS = -Wall -O2 -fomit-frame-pointer

CFLAGS = -I${INST_PATH}/libmad/include

#LDFLAGS =

LDFLAGS=-L${INST_PATH}/libmad/lib

[lingyun@localhost libid3tag-0.15.1b]$ make

[lingyun@localhost libid3tag-0.15.1b]$ make install

[lingyun@localhost madid3]$ tree

.

|-- include

|   `-- id3tag.h

`-- lib

    |-- libid3tag.a

    `-- libid3tag.la

 

2 directories, 3 files

 

 

 

三、移植madplay

1)、下载源代码包,并解压缩:

[lingyun@localhost mplayer]$ wget ftp://ftp.mars.org/pub/mpeg/madplay-0.15.2b.tar.gz
[lingyun@localhost mplayer]$ tar –zxf madplay-0.15.2b.tar.gz

[lingyun@localhost mplayer]$ mkdir -p install/madplay

2)、配置生产Makefile(--prefix=/home/lingyun/yangzheng/mplayer/install/madplay/:指定安装路径;CFLAGSLDFLAGS指定编译时所用到的库文件;CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc指定交叉编译器):

[lingyun@localhost madplay-0.15.2b]$ ./configure --host=arm-linux  \
--prefix=
/home/lingyun/yangzheng/mplayer/install/madplay/ \
--disable-shared --disable-debugging \
CFLAGS=”-I/home/lingyun/yangzheng/mplayer/install/libmad/include \
-I/home/lingyun/yangzheng/mplayer/install/madid3/include "
LDFLAGS="-L/home/lingyun/yangzheng/mplayer/install/libmad/lib \
-L/home/lingyun/yangzheng/mplayer/install/madid3/lib"
CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc

 

3)、使用makemake install进行安装:

[lingyun@localhost madplay-0.15.2b]$ make

[lingyun@localhost madplay-0.15.2b]$ make install

[lingyun@localhost madplay]$ tree

.

|-- bin

|   |-- abxtest

|   `-- madplay

|-- man

|   `-- man1

|       |-- abxtest.1

|       `-- madplay.1

`-- share

    `-- locale

        |-- en

        |   `-- LC_MESSAGES

        |       `-- madplay.mo

        |-- es

        |   `-- LC_MESSAGES

        |       `-- madplay.mo

        |-- fr

        |   `-- LC_MESSAGES

        |       `-- madplay.mo

        |-- hr

        |   `-- LC_MESSAGES

        |       `-- madplay.mo

        |-- locale.alias

        `-- no

            `-- LC_MESSAGES

                `-- madplay.mo

 

15 directories, 10 files

 

四、移植mplayer

1)、下载源代码包,并解压缩:

[lingyun@localhost mplayer]$ wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc3.tar.bz2

[lingyun@localhost mplayer]$ tar -jxf MPlayer-1.0rc3.tar.bz2

[lingyun@localhost mplayer]$ mkdir -p install/mplayer

 

2)、修改motion_comp_arm_s.S文件

[lingyun@localhost libmpeg2]$ pwd

/home/lingyun/yangzheng/mplayer/MPlayer-1.0rc3/libmpeg2

[lingyun@localhost libmpeg2]$ ls

alloc.c       cpu_state.c   idct_altivec.c         mmx.h                  motion_comp_arm_s.S  mpeg2.h           vlc.h

alpha_asm.h   decode.c      idct.c                 motion_comp_alpha.c    motion_comp.c        mpeg2_internal.h

attributes.h  header.c      idct_mmx.c             motion_comp_altivec.c  motion_comp_mmx.c    slice.c

cpu_accel.c   idct_alpha.c  libmpeg2_changes.diff  motion_comp_arm.c      motion_comp_vis.c    vis.h

 

[lingyun@localhost libmpeg2]$ vim motion_comp_arm_s.S

    .text

 

#ifndef HAVE_PLD

    .macro pld reg

    .endm

#endif

 

3)、配置生产Makefile(prefix=/home/lingyun/yangzheng/mplayer/install/mplayer/:
指定安装路径;--cc=arm-linux-gcc --ar=arm-linux-ar --ranlib=arm-linux-ranlib --disable-gui:指定交叉编译器):

[lingyun@localhost MPlayer-1.0rc3]$ ./configure --prefix=/home/lingyun/yangzheng/mplayer/install/mplayer/ \

> --cc=arm-linux-gcc  --ar=arm-linux-ar --ranlib=arm-linux-ranlib --disable-gui \

> --target=arm-armv4-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-mp3lib \

> --enable-ass \

> --disable-dvdnav  --disable-dvdread-internal    --disable-jpeg --disable-tga \

> --disable-dvbhead --disable-pnm --disable-tv --disable-ivtv \

> --disable-fontconfig --disable-xanim --disable-win32dll --disable-armv5te --disable-armv6

 

4)、使用makemake install进行编译,安装:

[lingyun@localhost MPlayer-1.0rc3]$ make

[lingyun@localhost MPlayer-1.0rc3]$ make install

 

[lingyun@localhost MPlayer-1.0rc3]$ /opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-strip /home/lingyun/yangzheng/mplayer/install/mplayer/bin/mplayer

[lingyun@localhost install]$ cd mplayer/

[lingyun@localhost mplayer]$ ls

bin  etc  lib

[lingyun@localhost mplayer]$ tree

.

|-- bin

|   `-- mplayer

|-- etc

|   `-- mplayer

`-- lib

 

4 directories, 1 file

 

[lingyun@localhost MPlayer-1.0rc3]$ ls

******mplayer******

5)、把生成的mplayer下载到开发板的/bin目录下

 

五、测试:

>: ./bin/mplayer zhendeaini.mp3

Creating config file: //.mplayer/config

MPlayer 1.0rc3-4.5.4 (C) 2000-2009 MPlayer Team

 

Playing zhendeaini.mp3.

Audio only file format detected.

Clip info:

 Title: ?μ???

 Artist: Beyond(????

 Album: ?μMusicPalace

 Year:

 Comment:

 Genre: Unknown

==========================================================================

Requested audio codec family [mp3] (afm=mp3lib) not available.

Enable it at compilation.

Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders

AUDIO: 44100 Hz, 2 ch, s16le, 32.0 kbit/2.27% (ratio: 4000->176400)

Selected audio codec: [ffmp3] afm: ffmpeg (FFmpeg MPEG layer-3 audio)

==========================================================================

AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)

Video: no video

Starting playback...

A:  42.7 (42.7) of 1097.0 (18:17.0) 12.1%                                      

 

MPlayer interrupted by signal 2 in module: play_audio

A:  42.8 (42.7) of 1097.0 (18:17.0) 12.1%                                      

Exiting... (Quit)

>: ./bin/mplayer zhendeaini.mp3

MPlayer 1.0rc3-4.5.4 (C) 2000-2009 MPlayer Team

 

Playing zhendeaini.mp3.

Audio only file format detected.

Clip info:

 Title: ?μ???

 Artist: Beyond(????

 Album: ?μMusicPalace

 Year:

 Comment:

 Genre: Unknown

==========================================================================

Requested audio codec family [mp3] (afm=mp3lib) not available.

Enable it at compilation.

Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders

AUDIO: 44100 Hz, 2 ch, s16le, 32.0 kbit/2.27% (ratio: 4000->176400)

Selected audio codec: [ffmp3] afm: ffmpeg (FFmpeg MPEG layer-3 audio)

==========================================================================

AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)

Video: no video

Starting playback...

A:  19.3 (19.3) of 1097.0 (18:17.0) 12.0%                                      

 

MPlayer interrupted by signal 2 in module: play_audio

A:  19.4 (19.3) of 1097.0 (18:17.0) 12.0%                                      

Exiting... (Quit)

结束!!!!

 

 

 

参考文档:http://blog.csdn.net/qq419036154/article/details/6256011

              http://www.360doc.com/content/13/0804/20/13396188_304740347.shtml

                   http://www.360doc.com/content/13/0804/20/13396188_304740347.shtml

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值