Installation instructions for GPAC on windows CE platform
last modified: Mai 2012

0 Foreword
  
  ** GPAC IS NO LONGER MAINTAINED ON PocketPC 2002/eVC3 PLATFORMS **
  
	Compilation has only been tested with evc4 and ARM platforms
	
	GPAC should be stable on most devices running PocketPC/SmartPhone 2003. It has know bugs with higher versions
	of the Windows Mobile OS, but should still be stable.

	The output directory for all plugins and applications for Windows PocketPC 2003 is
		gpac/bin/Smartphone 2003/Debug in debug mode
		gpac/bin/Smartphone 2003/Release in release mode
	
	As of 0.2.2, GPAC cannot be compiled without ZLIB. You'd better make sure it is installed locally or on your system (zlib is provided in gpac_extra_libs package)
	
I Extra lib installation
	It is recommended to download and compile all extra libs needed by gpac on winCE.
	In case you don't do so, you will need to to modify project settings.


II GPAC compilation
	open /build/msvc8/gpac.sln (GPAC workspace) with MSVC 2005
	open /build/msvc9/gpac.sln (GPAC workspace) with MSVC 2008
	
	NEVER ATTEMPT TO LOAD A PROJECT OUTSIDE THIS WORKSPACE
	
	II.1 Setting up libgpac
		libgpac is the core library of the GPAC framework used by all GPAC applications 

		If you have not installed the SpiderMonkey (JavaScript, libjs), JPEG or PNG libraries, remove the indicated macros in the file gpac/include/gpac/internal/config_static.h
		
		If you are compiling for PocketPC 2003 OS, and wish to use the Intel GPP library, uncomment the desired macro in 
		the file gpac/include/gpac/internal/config_static.h

    3D Rendering	
      GPAC can use OpenGL ES for 3D rendering on embedded devices, but you will need development files of OpenGL ES. 
      GPAC has been tested with 2 implementations of OpenGL ES:
      * HybridGraphics one (cf http://www.hybrid.fi/), by far the most efficient one tested, available for evc4/PockePC 2003 only
      * Vincent3D (aka ogl-es, cf http://ogl-es.sourceforge.net/), slower but with good visual results
      
      To setup OpenGL ES, get one of these libraries, configure the IDE to locate the include and lib files (or copy them in gpac/extra_lib/ which is setup by default)
      The GL ES lib shall be named "libGLES_CM.lib" or "libGLES_CL.lib" for the OpenGL-ES Light profile, and the GL ES include files shall be located in a "GLES" directory, the include path pointing to its parent directory.
      
      NOTE 1: The Klimt library (cf http://studierstube.org/klimt/), which is not 100% OpenGL_ES compliant, may be used but needs some code rewrite here and there,
      mainly in gapi video output.

      NOTE 2: If you do not plan to support 3D rendering, uncomment the related macro in the file gpac/include/gpac/internal/config_static.h

	
	II.2 Checking Plugins
		
		Before compiling GPAC plugins, you must make sure the projects are configured with the right libraries
		* aac_in
			If you have not installed faad2 library, remove the GPAC_HAS_FAAD preprocessor variable from the aac_in project settings.
			Note that if no aac decoder	is installed for gpac you may as well remove the "aac_in" project from the workspace (DEL).

		* ac3_in
			If you have not installed liba52 library, remove the GPAC_HAS_LIBA52 preprocessor variable from the ac3_in project settings.
			Note that if no ac3 decoder	is installed for gpac you may as well remove the "ac3_in" project from the workspace (DEL).

		* mp3_in
			If you have not installed mad library, remove the GPAC_HAS_MAD preprocessor variable from the mp3_in project settings.
			Note that if no mp3 decoder is installed for gpac you may as well remove the "mp3_in" project from the workspace (DEL).

		* amr_nb		
			This plugin handles speech coded data using AMR Narrow Band format. It uses the decoder of the 3GPP consortium (TS26.073) available 
			from http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-700.zip. 
			It is the same version included in gpac_extra_libs/AMR_NB with a slight header modifcation.
 			To compile this plugin, copy the source code to modules/amr_dec/amr_nb WITHOUT OVERWRITING typedefs.h file.
 			Otherwise, remove the "amr_dec" project from the workspace (DEL).

		* img_in:
			If you have not installed libopenjpeg, remove the GPAC_HAS_JP2 preprocessor variable from the img_in project settings
        and the relevant library from the link settings
			If none of the above lib is installed, you can simply remove the img_in project from the workspace (DEL).
		
		* ft_font
			if you have not installed freetype, remove the project dependecies to freetype in project Osmo4 and MP4Client
			NOTE: if you have not installed freetype, you won't have text support at all in GPAC.

		* ogg
			if you have not installed libogg library, remove the "ogg" project from the workspace (DEL).
			if you have not installed libvorbis library, remove the GPAC_HAS_VORBIS preprocessor variable from the ogg project settings
			if you have not installed libtheora library, remove the GPAC_HAS_THEORA preprocessor variable from the ogg project settings
			Note that if you have only installed libogg you can also remove the "ogg" project from the workspace, it won't be any usefull.
				
		* gapi:
			you must make sure you have installed the GAPI SDK for windows (also known as GX) before compiling - cf gpac_extra_libs/ReadMe
      			
  II.3 Recompiling
	  select the target platform (PocketPC or Smartphone)
	  Rebuild all (Build->Batch Build->Rebuild All)
	  
	  Note:
  	  Osmo4 build will fail for smartphone devices, the GPAC GUI available on this platform is Osmophone		
						
	II.4 Launching Osmo4 or Osmophone
		Osmo4/Osmophone will automatically create a config file in the Osmo4/Osmophone executable directory if needed. You must copy all plugins to this 
		directory (recommended), or edit by hand the config file "ModulesDirectory" key to point to the modules directory, otherwise Osmo4/Osmophone will not 
		launch. You can then launch Osmo4/Osmophone (cf Misc section below)
		
III GPAC Installer for WinCE

		The GPAC installer uses MS installer and EZSetup to get an Osmo4/Osmophone installer on PocketPC 2003 Systems
		Install scripts are located in gpac/bin/arm_ppc02_rel/install and gpac/bin/arm_ppc03_rel/install
				THIS INSTALLER IS ONLY INTENDED FOR STRONGARM BASED DEVICES
		
		* compile GPAC for PocketPC 2003
		* make sure the js.dll is copied in the release build directory if you have compiled GPAC with SpiderMonkey support, otherwise comment lines "js.dll" in gpac.inf
		* make sure the libGLES_CM.dll (or libGLES_CL.dll ) is copied in the release build directory if you have compiled with OpenGL ES support, otherwise comment lines "libGLES_CM.dll" and "gm_render3d.dll" in gpac.inf
		* make sure the libxml2.dll is copied in the release build directory if you have compiled the svg loader, otherwise comment lines "libxml2.dll" in gpac.inf
		* remove any lines in gpac.inf that refer to plugins you have not built.
		* if you have built the smartphone version, change AppName and ExeName accordingly in gpac.inf
		* get MS PocketPC Cabwizard (search for Cabwiz.exe in your ActiveSync distribution)
		* copy cabwiz.exe, cabwiz.ddf and MAKECAB.exe in the install directory
		* if needed copy gx.dll in the install directory (download from microsoft, or use gpac extra libs version)
		* get Ezsetup from http://www.eskimo.com/~scottlu/win/, and copy it in this directory
		* run do.bat file
		
IV Misc

	IV.1 Note on Video
		As of 0.2.3, the OpenDivx plugin is no longer included in GPAC. A new, modified version of XviD 1.0 for ARM is included (cf gpac/modules/xvid_dec/xvid_wce/ReadMe.txt)
	
	IV.2 Note on Network
		Ipaq devices under WindowsCE below Windows CE .NET 4.1 (and maybe other devices) have a small default UDP buffer size, and this buffer size cannot 
		be changed through WinSock (software) calls. To increase it, you must manually edit the registry and set (add a DWORD key if not present):
					HKEY_LOCAL_MACHINE\Comm\Afd\DgramBuffer 16
		16 is the maximum value possible, DON'T TRY TO SPECIFY MORE.
		The device MUST be reseted (soft reset, cf your manual)	for the parameter to be taken into account.

