[MPlayer-users] getting make to work for ARM

Trilok Soni trilok_ulug at yahoo.co.in
Sat Feb 5 14:20:04 CET 2005


--- Kumar Sharad-r2aaju <sharad.kumar at freescale.com>
wrote:

> Torinthiel,
> 
> I followed your instructions to first build for the
> host, and get a bit further.
> 
> > ./configure
> > make codecs.conf.h
> > ./configure --target=arm --cc=arm-linux-gcc
> --as=arm-linux-as --enable-static 
> 

You can try following unstructured and dirty steps to
build mplayer for ARM :-) . arm-linux-gcc is 3.4.0. 

----------snip-----------------
6.4. Building the Mplayer
Now, we can start configuring the mplayer with GUI
support.  Along with default mplayer support, we will
make changes to mplayer source, so that we can play
3GP, H.263 video, Mpeg4 Video too. 
6.4.1.1. Configure and Install Mplayer
#cd /usr/local/build/mplayer
Edit the Gui/mplayer/gtk/about.c with adding following
line before "includes". 
#define GTK_ENABLE_BROKEN
This macro enables broken (not-stable) support of GTK+
too, which is required for building mplayer GUI
support.
Editing configure:
You need to edit "configure" file in order to add
"Xau" library. Open the file and search for
"__ld_x11=" symbol and add the "-lXau -lXcursor
-lXrender -Xfixes" before $ld_sock.
Editing mplayer.c:
Please add #define PATH_MAX 256 before "includes"
otherwise you will get compile time error.
Copy libavformat:
Now copy the "libavformat" from "ffmpeg" source to
mplayer. As mplayer package by default is not
supplying "libavformat" source.
#cp -r /usr/local/build/ffmpeg/libavformat ./
Now configure the mplayer with following command.
#CFLAGS="-I$TARGETDIR/include/pango-1.0
-I$TARGETDIR/include/atk-1.0" ./configure
--target=arm-linux --cc=arm-linux-gcc
--disable-network --disable-ftp --disable-mpdvdkit
--disable-dvdread --disable-fbdev  --disable-win32
--enable-x11 --with-x11incdir=$TARGETDIR/include
--with-x11libdir=$TARGETDIR/lib --prefix=$TARGETDIR
--enable-gui --enable-png
--with-extraincdir=$TARGETDIR/include
--with-extralibdir=$TARGETDIR/lib 
--with-glib-config=$TARGETDIR/bin/glib-config
--with-gtk-config=$TARGETDIR/bin/gtk-config
--with-freetype-config=$TARGETDIR/bin/freetype-config
--enable-runtime-cpudetection
Editing Makefile:
You need to edit makefile so that codec-cfg binary is
created for host machine (x86) not the target (arm).
Please change $(CC) to gcc in lines below :
$(PRG_CFG): version.h codec-cfg.c codec-cfg.h
$(CC) $(CFLAGS) -g codec-cfg.c mp_msg.c -o $(PRG_CFG)
-DCODECS2HTML $(EXTRA_LIB) $(I18NLIBS)

Above process will generate mplayer, which will yet
not support AAC encoding and decoding support, H.263 ,
3GP and amr_nb.
Now copy the "libavcodec" directory from "ffmpeg"
source to mplayer source.  This step will replace
existing "libavcodec" code of mplayer.
#cp -r /usr/local/build/ffmpeg/libavcodec ./ 
Open config.h and edit the HAVE_FAAD line with
following lines. This will enable libfaad support in
mplayer.
---Before---
/* enable FAAD (AAC) support */
#undef HAVE_FAAD
#define USE_INTERNAL_FAAD 1

---After changes-----
-------------snip--------------------
/* enable FAAD (AAC) support */
#define HAVE_FAAD 1
#undef USE_INTERNAL_FAAD
#define FAADVERSION 21
-------------snip--------------------	

And copy following lines at the end of config.h, but
before #endif
-------------snip--------------------
#define CONFIG_FAAD 1
#define CONFIG_FAADBIN 1
#define CONFIG_FAAC 1
#define CONFIG_GPL 1
#define AMR_NB 1
#define AMR_NB_FIXED 1
#define HAVE_BUILTIN_VECTOR 1
#define TUNECPU generic
#define CONFIG_RISKY 1
-------------snip--------------------
Copy following lines to "config.mak" to enable
mplayer-ffmpeg sourcecode for "amr_nb_fixed" support.
    -------------snip--------------------
#---for ffmpeg
CONFIG_ENCODERS=yes
CONFIG_DECODERS=yes
CONFIG_VIDEO4LINUX=yes
CONFIG_DV1394=yes
CONFIG_AUDIO_OSS=yes
CONFIG_NETWORK=yes
CONFIG_MP3LAME=yes
CONFIG_FAAD=yes
CONFIG_FAADBIN=yes
CONFIG_FAAC=yes
CONFIG_FFSERVER=yes
CONFIG_FFPLAY=yes
CONFIG_RISKY=yes
CONFIG_GPL=yes
SRC_PATH=/usr/local/build/ffmpeg/ffmpeg-0.4.9-pre1
AMR_NB=yes
AMR_NB_FIXED=yes
EXTRALIBS=-lmp3lame -lfaac -lfaad -lSDL -lX11 -lXext
-lXau -ldl
    -------------snip--------------------
Note:
You need to change SRC_PATH variable in above ffmpeg
configuration if it is pointing somewhere else.
Patching demux.h:
    Now, we need apply one "amr_nb" patch, which will
fix the audio output problem with "amr codec" in
mplayer.  Follow these instructions to apply the
patch.
   #cd .. [go to one level above from mplayer source]
   #cat patches/mplayer/demux.patch | patch  -p1
Caution: Please don't issue "configure" command after
above modifications. As all the change will be lost if
you do the same.
   Now we can have mplayer with
"3GP/amr_nb/h.263/faac/faad" support.
Finally start building the mplayer:
   #make 
   #make install
6.4.1.2. Files to be copied on OMAP File System.
#cp -a $TARGETDIR/bin/mplayer $FILESYSTEM/bin
#cp -a $TARGETDIR/bin/mencoder $FILESYSTEM/bin
Skin: 
One skin is required for GUI based mplayer to be
displayed with proper look. We have downloaded
"Blue-small" skin from the mplayer site. Please untar
the tarball under your OMAP file system.
#cd $FILESYSTEM/.mplayer/Skin
#tar -xvzf "Blue-small-skin.tar.gz"
Fonts:
Atleast one set of fonts are required to be downloaded
from mplayer website. Please untar the tarball into
following directory.
#tar -xvzf "font-arial-iso-8859-1.tar.gz"
/usr/local/build/mplayer/
Fonts Usage:
select font size and copy the content of the directory
to FILESYSTEM ~/.mplayer/font/ 
example: cp font-arial-18-iso-8859-1/* 
$FILESYSTEM/.mplayer/font/
codecs.conf
This files lists out number of audio and video codecs
supported by mplayer. We need to edit this file before
we copy it to the filesystem for 3GP and AMR formats.
Edit the codecs.conf
#cd /usr/local/scratch/build/windowsystem/mplayer
#vi etc/codecs.conf
Adding support for 3GP format:
Find "ffh263" and add the following line at the end of
that codecs section

format 0x33363273
: Finally it should like this:
-------------snip------------------
videocodec ffh263
  info "FFmpeg H263+ decoder"
  status working
  fourcc H263,U263,h263,X263
  fourcc viv1 h263
  driver ffmpeg
  dll h263
  out YV12,I420,IYUV
  format 0x33363273
-------------snip------------------
 Adding support for AMR codecs:
Please add following audiocodec section into
codecs.conf  :
-------------snip------------------
audiocodec ffamr
  format 0x726D7163
  fourcc samr
  driver ffmpeg
  dll "amr_nb"
-------------snip------------------
Copy codecs.conf to filesystem.
#cp etc/codecs.conf $FILESYSTEM/.mplayer/codecs.conf
You can find mplayer codecs.conf used by us under
patches/mplayer directory.
Mplayer configuration file:
Mplayer config file specifies various configuration
settings for mplayer at run time. Eg. X-server, fb
device, skin name
You can find mplayer config file used by us under
patches/mplayer directory.
Editing example.conf
#vi etc/example.conf
Please make sure that "skin" variable is assigned to
"Blue-Small", "cache=8192" , "vo=x11",
"framedrop=yes", "mixer=/dev/sound/mixer". You can
refer the mplayer.conf supplied in patches directory.
Copy the mplayer configuration file to OMAP
filesystem.
#cp etc/example.conf $FILESYSTEM/.mplayer/config
Now you can run the "mplayer - console based" or
"gmplayer (which is nothing but simlink to mplayer)
and enjoy the AV playback.
-----------snip------------

---Trilok Soni



		
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 




More information about the MPlayer-users mailing list