Transplantation of mplayer on arm9rm9200

Source: Internet
Author: User
Tags builtin
Mplayer only supports 16 BPP and above graphics display, but does not support 8bpp graphics display. Therefore, when mplayer is running on a development board with the LCD configured as STN, only the sound can be played, not the image, when the LCD is configured as a TFT Development Board, it can play sound and display graphics.
1. Download and decompress
Go to the main page of mplayer's official website http://www.mplayerhq.hu and download the mplayer-0.93.tar.bz2 package.
CD/work
Tar-jxvf MPlayer-0.93.tar.bz2
Check the README and install files that are decompressed to see if there is anything specifically stated during installation. Because different versions of the same software sometimes have different installation methods. Enter./configure -- help to check whether there are more or less options.
2. The source code bug solves the problem of header file reference. It is important to note that there is an omission in the libmp codecs and libavcodec directories, that is, the source files of these two directories all use # incude "config. h to reference the header file "config. h, but the header file "config. H ", these source files are actually expected to reference the" config. H "header file, so we need to manually create a file named config in the libmp codecs and libavcodec directories. h links to the "config. H "header file, creation method:

$> Cd libmp codecs
$> Ln-S ../config. h config. h
$> Cd ../
$> Cd libavcodec
$> Ln-S ../config. h config. h
3. Cross-Compilation
Create a script file in the/MPlayer-0.93 Directory: mkall, which is a compilation script with the following content :. /configure -- cc =/usr/local/ARM/3.4.1/bin/ARM-Linux-GCC -- target = arm-Linux -- With-extralibdir =/usr/local/ARM/3.4.1 /ARM-Linux/lib/-- With-extraincdir =/usr/local/ARM/3.4.1/ARM-Linux/include/-- disable-SDL -- enable-static -- disable-dvdnv -- disable-TV -- disable-Gui -- disable-mpdvdkit -- enable-Linux-devfs

Then execute./mkall to complete the configuration.
Run make.
The source code of mplayer is very large, and many third-party libraries are used. After a few compilation times, mplayer stops. The following error occurs:
./Codec-cfg./etc/codecs. conf> codecs. conf. h
/Bin/sh: Line 1:./codec-CFG: cannot execute binary file
According to the online post solution: after checking the solution, we found that the executable file codec-CFG was the first file to be compiled and generated. This file exists. Why can't it be executed? After a manual execution, the system prompts "cannot execute binary file". Suddenly, codec-CFG is compiled on a cross-platform basis and generates arm code, of course, it cannot be executed on x86, so we should first compile mplayer into x86 code without cross-platform compilation, and then reconfigure it, which is simple. /configure, make, and then rename the generated codec-cfg to the codec-cfg.x86. Then configure, compile, and wait for the compiler to stop compilation errors, the codec-cfg.x86 name codec-CFG, and then make
The following error occurs:
Codec-cfg.c: In function 'parse _ codec_cfg ':
Codec-cfg.c: 501: 'builtin _ video_codecs 'undeclared (first use in this function)
Codec-cfg.c: 501: (each undeclared identifier is reported only once
Codec-cfg.c: 501: for each function it appears in .)
Codec-cfg.c: 502: 'builtin _ audio_codecs 'undeclared (first use in this function), at this time you need to modify the current makefile
$ (CC) $ (cflags)-G codec-cfg.c mp-msg.c-O -----
In the $ (CC) to change to GCC, through the compilation.
After compilation is successful, the mplayer file is generated under the/MPlayer-0.93 Directory, which is the mplayer Media Player program.
# Cp mplayer/tftpboot copy the code to the specified directory
4. download and run
Start arm-Linux on the 9200 Development Board and run the following command on the host:
# Mount-O nolock-t nfs 202.200.93.154:/tftpboot/mnt
Run on minicom:
CD/mnt
./Mplayer
The following message is displayed:
#./Mplayer
Mplayer 0.93-3.4.1 (c) 2000-2003 mplayer team
Reading config file/usr/local/etc/mplayer. conf: no such file or directory
Reading config file //. mplayer/config
Reading //. mplayer/codecs. conf: Can't open '//. mplayer/codecs. conf': no such file or directory
Reading/usr/local/etc/mplayer/codecs. conf: Can't open '/usr/local/etc/mplayer/codecs. conf': no such file or directory
Using built-in default codecs. conf
Usage: mplayer [Options] [url | path/] filename

Basic options: (complete list in the man page)
-Vo <DRV [: Dev]> select video output driver & device ('-vo help' for a list)
-AO <DRV [: Dev]> select audio output driver & device ('-ao help' for a list)
-VCD <trackno> play VCD (Video CD) track from device instead of plain file
-SS <timepos> seek to given (seconds or hh: mm: SS) Position
-Nosound do not play sound
-Fs fullscreen playback (or-vm,-zoom, details in the man page)
-X <x>-Y <Y> set display resolution (for use with-Vm or-zoom)
-Sub <File> specify subtitle file to use (also see-subfps,-subdelay)
-Playlist <File> specify playlist file
-Vid X-aid y select video (X) and audio (y) stream to play
-Fps x-srate y change video (x FPS) and audio (Y Hz) rate
-PP <quality> enable postprocessing filter (details in the man page)
-Framedrop enable frame dropping (for slow machines)

Basic keys: (complete list in the man page, also check input. conf)
<-Or-> seek backward/forward 10 seconds
Up or down seek backward/forward 1 minute
Pgup or pgdown seek backward/forward 10 minutes
<Or> step backward/forward in playlist
P or space pause movie (press any key to continue)
Q or ESC stop playing and quit Program
+ Or-adjust audio delay by +/-0.1 second
O cycle OSD mode: NONE/seekbar + Timer
* Or/increase or decrease PCM volume
Z or X adjust subtitle delay by +/-0.1 second
R or t adjust subtitle position up/down, also see-VOP expand

*** See the man page for details, further (advanced) options and keys ***
It can be seen that the cross-compilation is successful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.