Installation instructions for GPAC on Familiar+GPE platforms
last modified: December 2008

0 Foreword
  This file is about installing the GPAC framework on an arm device running Linux familiar (cf http://www.handhelds.org)

	Compilation has only been tested for familiar+GPE platforms ( http://gpe.handhelds.org). 
	The GPE version enables GPAC to use X11 video output directly, including shared memory extensions.

	The output directory for all plugins and applications is gpac/bin/gcc 

	As of 0.2.2, GPAC cannot be compiled without ZLIB. You'd better make sure it is installed on your system (zlib is provided in gpac_extra_libs package)

  To install the arm cross-compilation environement on your linux system, refer to:
    * http://www.handhelds.org
    * we're currently using the following tool-chain for Familiar+GPE compil http://www.roebling.de/embedded.html, with X11 and GTK+ support, 
    already compiled.
    
  Do not forget to update your environment variables according to your toolchain.
	
I Extra lib installation
	It is recommended to install all extra libs needed by gpac not installed on your system.

II GPAC compilation
	
	II.1 SDL Support
		GPAC can use SDL for audio/video output. If SDL is not installed on your system, you may indicate configure to build with a local copy:
		    --sdl-cfg=path/to/local/sdlcfg/
    (make sure to update the local sdl-cfg according to your needs)
		
  	If you can't get SDL and don't have OSS audio nor X11 video support on your system, you won't be able to play any presentation with GPAC, 
  	but you can still use MP4Box.

	II.2 wxWidgets Support
		GPAC comes with a GUI player called Osmo4. To compile this player you will need wxWidgets 2.6.0 (2.5.2 should work) installed on your system. 
		NOTE: Osmo4+wxWidgets is quite slow on familiar+GPE, and is therefore not recommended at the time being.
		You can always use GPAC command-line player MP4Client.

	II.3 OpenGL ES support
	  OpenGL ES is not yet supported on Familiar-GPE. However, GPAC renderer supports OpenGL ES API. Porting the 3D module only requires modifying the X11 output (modules/x11_out) for
	  OpenGL ES.

	II.4 Building GPAC
		go to root of gpac distribution. Note: you may need to "chmod +x" the configure file.
		(./configure --help for options)
		./configure --prefix=/usr/local/arm/3.3.2 --cpu=armv4l --enable-fixed-point
		  Note: this assume the cross-compilation tool-chain is located in /usr/local/arm/3.3.2
		  Note: you may also specify any other option supported by configure. It is not recommended to use the floating-point version of GPAC for ARM-based architectures.
		make

	II.5 Installing GPAC
	  copy all files to your device, possibly creating a dedicated directory for modules
	  edit or create ~/.gpacrc to have at least the following lines:
	    [General]
	    ModulesDirectory=AbsolutePathToTheModules
	    
	  For more information on GPAC configuration file, cf man GPAC of gpac/doc/configuration.html
  	  				
III Running GPAC
	
	III.1 MP4Client
		MP4Client is a command-line interface to GPAC. Note that the player cannot work without video support (so you'd better get SDL)
		
		 You need a GPAC configuration file to run MP4Client, and you will need it each time.
		
		First launch of MP4Client
			go to gpac/bin/gcc if not using the install.
			type MP4Client
			the prompt will ask for 
			1- GPAC plugin dir: enter the path from / to gpac/bin/gcc. This is skipped when using the install version of MP4Client (the plugin path is hardcoded to 
			the plugins install location on the system)
			2- Font directory: enter the path to a truetype font directory on your system (note that if you don't have compiled with freetype any directory will do)
			3- cache directory: any directory with write access
		You now have a valid config file for GPAC, more info on this try "man GPAC" or check gpac/doc/configuration.html.

		The config file is called ".gpacrc" and is located in the user home directory. You may run the client with a different config file by using the "-c" option.
		
		*If you don't see any output window, check the config file doesn't use raw_out.so as a video renderer (or simply remove raw_out.so).
		
	III.2 Osmo4
		Osmo4 is the GUI frontend to GPAC. If you have installed Osmo4 on your system, the first launch of the player should ask you to locate a 
		directory with TrueType fonts and a cache directory for internet downloads if no configuration file is found.

	III.3 MP4Box
		MP4Box is a tool to encode, decode and manipulate MPEG-4 systems data. It does not need a configuration file.
		Help for MP4Box is available on GPAC web site, with man MP4Box and with 'MP4Box -h'
		
IV Configuration
	
	IV.0 Foreword
		All configuration information is described in gpac/doc/configuration.html, or man gpac.
	
	IV.1 OpenGL
		OpenGL is badly known for performing quite poorly as far as high data rate texturing is involved. This is a big issue when displaying a typical movie and you will likely find the GPAC 3D Renderer very slow on your system. If your GPU supports non power of 2 texturing or rectangular texturing (most Win32 drivers do)
		you shouldn't have any problem with video. Otherwise here are some tips to configure GPAC on your system:
		1- set the "BitmapCopyPixels" option on: some cards perform rather well at direct pixel transfer. If no improvement, set it off.
		2- set the "BitmapCopyPixels" option off and the "EmulatePOW2" option on. This will trick the GL texturing by using only Power Of 2 textures when converting from YUV to RGB. 
		3- If this does not improve video playback, you're only chance is through discussion forums & co to gather info about your system, your GL implementation and how to fine-tune it.
		
		
