There is a lot of information about mplayer porting to the Internet, but it is confusing. Here, I have made a detailed summary about mplayer. Before doing this, it is best to decompress the source code package and check the configuration through./configure -- help.
The decoding library is already provided on x86 Linux, and you do not need to install the decoding library. However, the file system of the ARM platform does not have a decoding library. You need to install another decoding library.
Download mplayer: MPlayer-1.0rc2.tar.bz2
Decoding library: libmad-0.15.0b.tar.gz
1. Install mplayer on x86 Linux
1 #./configure (./configure -- enable-Gui -- enable-live -- language = ZH)
2 # Make
3 # make install
The executable file mplayer is generated in the MPlayer-1.0rc2 directory.
Copy it to the/bin/directory. To execute:
#/Bin/mpalyer/path/media file name to be played;
#/Bin/mplayer a.mp3
2. Porting mplayer to Linux on the ARM platform (using the 4.3.2 compiler)
1. Configure and install libmad
(If libmad is not configured and installed first, the mad. h error cannot be found during make mplayer)
Echo Path =/usr/local/ARM/3.3.2/bin: $ path
(1 )#. /configure -- enable-FPM = arm -- Host = arm-None-Linux-gnueabi -- disable-shared -- disable-debugging -- prefix =/usr/local/ARM/3.3.2/lib CC = arm-None-Linux-gnueabi-gcc
Parameter Parsing:
-- Enable-FPM = arm
-- Host = arm-None-Linux-gnueabi
-- Disable-shared
-- Disable-debugging
-- Prefix =/home/Linux/libmad (make install installation path)
Cc = arm-None-Linux-gnueabi-GCC (4.3.2 cross-compilation toolchain)
(2) # Make
Note: if an error occurs: Unrecognized command line option "-Fforce-Mem", modify the makefile and remove the -- Fforce-MEM flag (because the arm-Eabi compiler does not support this option)
(3) # make install
The include directory and lib directory are generated under the/home/Linux directory.
The liclude directory contains the file mad. h.
The lib directory contains the file libmad. A libmad. La.
2. Configure and install mplayer
(1 )#. /configure -- Host-CC = GCC -- cc = arm-None-Linux-gnueabi-GCC -- target = arm-Linux -- enable-static -- enable-ossaudio -- prefix =/tmp/ mplayer-rc2 -- disable-win32dll -- disable-dvdread -- enable-fbdev -- disable-mencoder -- disable-live -- disable-mp3lib -- enable-mad -- enable-libavcodec_a -- disable-armv5te -- disable-armv6 -- disable-dvdna v -- disable-dvdread -- disable-dvdread-Internal with-extraincdir =/usr/local/ARM/3.3.2/lib/include -- With-extralibdir =/usr/local/ARM/3.3.2/lib
Parameter Parsing:
-- Host-CC = GCC # C compiler for tools needed while building [GCC]
-- Cc = arm-None-Linux-gnueabi-GCC # C compiler to build mplayer [GCC]
-- Target = arm-Linux # Target Platform (i386-linux, arm-Linux, etc)
-- Enable-static # Build a statically linked binary
-- Enable-ossaudio # enable OSS audio output [autodetect]
-- Prefix =/tmp/mplayer-rc2 # prefix directory for installation [/usr/local]
-- Disable-win32dll # disable Win32 DLL support [enabled]
-- Disable-dvdread # disable libdvdread [autodetect]
-- Enable-fbdev # enable fbdev video output [autodetect]
-- Disable-mencoder # disable mencoder (A/V encoder) compilation [Enable] Enable encoder editing
-- Disable-live # disable live555 Streaming Media [autodetect] Makes mpalyer not support Streaming Media Protocol
-- Disable-mp3lib # disable builtin mp3lib [enabled]
-- Enable-mad # disable libmad (MPEG audio) support [autodetect]
-- Enable-libavcodec_a # disable static libavcodec [autodetect]
-- Disable-armv5te # disable DSP extensions (ARM) [autodetect]
-- Disable-armv6 # disable armv6 (ARM) [autodetect]
-- With-extraincdir =/usr/local/ARM/3.3.2/lib/include # specify the path of mad. h file
-- With-extralibdir =/usr/local/ARM/3.3.2/lib # specify the path of the LIMAD Linked Library
(2) # Make
The following problems may occur:
1. Error: motion_comp_arm_s.s
Add the following content at the beginning of the libmp eg2/motion_comp_arm_s.s file:
# Ifndef have_pld
. Macro PLD Reg
. Endm
# Endif
2. vo_ivtv.c: 79: Error: storage size of 'sd' isn' t known
Vo_ivtv.c: 80: Error: storage size of 'sd1' isn' t known
Add -- disable-ivtv
3. undefined reference to 'video _ out_ivtv'
In File libvo/video_out.c, find
# Ifdef have_dxr2
Extern vo_functions_t video_out_dxr2;
# Endif
Extern vo_functions_t video_out_dxr3;
# Ifdef have_ivtv
Extern vo_functions_t video_out_ivtv;
# Endif
Edit it like this:
# Ifdef have_dxr2
Extern vo_functions_t video_out_dxr2;
# Endif
# Ifdef have_dxr3 // This sentence is to be added
Extern vo_functions_t video_out_dxr3;
# Endif // This sentence is to be added
# Ifdef have_ivtv
Extern vo_functions_t video_out_ivtv;
# Endif
Using arm-Linux-GCC 3.3.2 to compile mplayer may cause an in. h header file error as follows:
/Usr/local/ARM/3.3.2/include/netinet/in. h: 259: Parse error before '('token
/Usr/local/ARM/3.3.2/include/netinet/in. h: 259: Parse error before "_ u32"
/Usr/local/ARM/3.3.2/include/netinet/in. h: 260: Parse error before '('token
/Usr/local/ARM/3.3.2/include/netinet/in. h: 260: Parse error before "_ 2010"
/Usr/local/ARM/3.3.2/include/netinet/in. h: 262: Parse error before '('token
/Usr/local/ARM/3.3.2/include/netinet/in. h: 262: Parse error before "_ u32"
In/usr/local/ARM/3.3.2/include/netinet/in. H, add the following text after _ begin_decls.
# UNDEF ntohl
# UNDEF ntohs
# UNDEF htonl
# UNDEF htons
(3) make install (an unknown file is displayed. Because it is a file running on the ARM platform, all do not know)
Install-M 755-s mplayer/tmp/mplayer-rc2/bin
Strip: unable to recognize the format of the input file '/tmp/mplayer-rc2/bin/mplayer'
The executable file mplayer is generated in the MPlayer-1.0rc2 directory.
Copy it to the/bin/directory.
To execute:
#/Bin/mpalyer/path/media file name to be played;
#/Bin/mplayer-AC mad a.mp3
Iii. mplayer slave command
Add-slave and-Quiet in the command to set mplayer to implement the corresponding functions. In the mplayer source code, the command/docs/Tech/slave.txt is parsed in detail.