Transplantation of MPlayer on ARM9 (at91rm9200)

Source: Internet
Author: User
Tags bz2
MPlayer supports only 16BPP graphics display and does not support 8BPP graphics display, so when the MPlayer program runs on the Development Board with an LCD configured as STN, only sound can be played, graphics cannot be displayed, and when the LCD is configured as a TFT Development Board, You can play both sound and graphics.
1, download and decompression
Go to MPlayer's official website http://www.mplayerhq.hu's homepage and download the MPLAYER-0.93.TAR.BZ2 package.
Cd/work
TAR-JXVF mplayer-0.93.tar.bz2
Check out the Readme and install files to see if there is anything special to declare when you install it, because different versions of the same software sometimes do not have the same method of installation. then enter the./configure--help to see if there are more or less options
2. Source code Bug Resolution
The problem with the header file reference, in particular, is that in both the Libmpcodecs and LIBAVCODEC directories, there is a omission, that both directories of the source files are #incude "Config.h" way to refer to the header file "Config.h", However, the header file "Config.h" does not exist in either directory, and these source files are actually expected to refer to the "config.h" header file in the MPlayer installation package root directory, So we need to manually set up a link named Config.h in both the Libmpcodecs and Libavcodec directories and point to the package root header file in the MPlayer installation config.h directory to establish a method:
$> CD Libmpcodecs
$> 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, this script is a compilation script that reads as follows:.
/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-dvdnav--disable-tv--disable-gui--disable-mpdvdkit--enable-linux-devfs
Then execute the./mkall complete configuration.
Then run make
MPlayer source code is very large, and used to many of the third party's library, did not compile a few, it stopped, there are such errors:
./codec-cfg./etc/codecs.conf > Codecs.conf.h
/bin/sh:line 1:/codec-cfg:cannot Execute binary file
According to the online post solution: Check, found codec-cfg This executable file is the first compiled a file, the file is there, how can not be implemented. So manually executed a bit, the system prompts "cannot execute binary file", suddenly remembered, Codec-cfg is compiled on a cross-platform basis, the resulting arm of the code, of course, can not be implemented on the x86, then the first use without Cross-platform compilation of the Way, First compile the MPlayer into x86 code, then reconfigure, simple./configure, make, and then rename the generated codec-cfg to codec-cfg.x86. Then the cross-platform configuration, compile, and so on compiler error stop compiling, will codec-cfg.x86 that name as Codec-cfg, and then make
The results of the following error occur:
codec-cfg.c:in function ' parse_codec_cfg ':
codec-cfg.c:501: ' Builtin_video_codecs ' undeclared (in the This function)
codec-cfg.c:501: (Each undeclared identifier are reported only once
Codec-cfg.c:501:for each function it appears in.)
codec-cfg.c:502: ' Builtin_audio_codecs ' undeclared (this function) requires that the current makefile be modified to
$ (CC) $ (cflags)-G codec-cfg.c mp-msg.c-o-----
The parameter $ (CC) in is changed to GCC, by compiling.
After the compilation is successful, the MPlayer file is generated in the/mplayer-0.93 directory, which is the MPlayer media playback program.
#cp mplayer/tftpboot Copy the code to the specified directory
4. Download and run
Launch the Arm-linux on the 9200 Development Board to run the command on the host:
#mount-O nolock-t NFS 202.200.93.154:/tftpboot/mnt
To run on minicom:
Cd/mnt
./mplayer
The following message appears:
#./mplayer
MPlayer 0.93-3.4.1 (C) 2000-2003 MPlayer Team
Reading config file/usr/local/etc/mplayer/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 Mans page)
-vo <drv[:d ev]> Select Video Output driver & Device ("-vo help" for a list)
-ao <drv[:d ev]> Select audio Output driver & Device ('-ao help ' for a list)
-VCD <trackno> play VCD (video CDs) track from device instead of plain file
-ss <timepos> seek to given (seconds or hh:mm:ss) position
-nosound do don't 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 mans page)
-framedrop Enable frame dropping (for slow machines)

Basic Keys: (complete list in the Mans page, also check input.conf)
<-or-> seek backward/forward seconds
Up or down seek backward/forward 1 minute
PgUp or Pgdown seek backward/forward minutes
< or > step Backward/forward in Playlist
p or spaces 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/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

* * * * The man PAGE for DETAILS, further (ADVANCED) OPTIONS and KEYS * * *
This shows the success of the cross compilation.

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.