Building for iOS

From Gnash Project Wiki

Jump to: navigation, search

This page hopes to provide flash for the ipad/iphone. The great thing here is that gnash is currently under development. This requires your device to be jail broken (not detailed here, search on the Internet).

The information is very rough and there are a lot of extras that need to be added to make this a complete solution, so please let me know if you need any more ... ashreid #at# gmail . com

Contents

Current status

- Youtube video works ok after getting ffmpeg arm optimisations.

- Frash looks good and has a great framework to run the plugin out of process.

- I got basic plugin running in process.

- Open question here is are there codecs somewhere we can use?

Next steps: AGG/SDL slow at the moment. Want to convert to using cairo, as that uses pixman with arm optimisations.

Temporary repository

http://github.com/arcanon/ipadflash.

Here I have put all the "info" so far. Mainly the script files used to build all the libraries and gnash itself. See gnash_ipad.sh.

The standalone player is located under TestApp.app

Git reference:

http://gitref.org/remotes/

Gnash infrastructure used

SDL + AGG (but AGG is slow so probably want to convert to cairo, which utilizes pixman which has arm optimisations)

Compiler

Two approaches:

  1. Build with xcode + native iphone SDK

I think a problem here is that the native SDK does may not have all the headers, so some libraries may not build. Like AGG for example. Advantage is you get all the apple infrastructure

  1. Use self compiled tool chain

Gives you control over all included libraries. see http://code.google.com/p/iphonedevonlinux/. Can just update the libraries to for iOS 3.2 (and even 4.0).

Safari Plugin

Two possible approaches:

  1. Using a netscape plugin

Theoretically this should work, but has not been proven. It may be equivalent then on multiple platforms, but the SDL infrastructure (based on extending UIViews would not match up so well). There might be other ways to use this? http://git.webvm.net/?p=npsimple;a=blob;f=Makefile;h=eed3543fa4573631af7daf66e04a571c9d52a15d;hb=HEAD

  1. native plugin

"pretty much exactly the same as a Safari plugin on the desktop". Prove of concept. http://github.com/steventroughtonsmith/MobileSafariPlugin

Debugging

  1. Install gdb

Can be installed from cydia, but a bit slow and all the code needs to be copied on to the machine. I could not get gdb to allow remote debugging, something about the port not being allowed, but maybe I missed something.

  1. use fprintf(stderr, ...) or printf

The system log file needs to be enabled (most easily done using a program like SBsettings installed from cydia). Then you can use tail -f /var/log/syslog.

Library search directory

need to create a script file that sets this path. e.g:

HT=$(dirname "$0")
export DYLD_LIBRARY_PATH=/var/lib
exec "${HT}"/Fireworks_

This should be do able with libtool during compilation, but I have not figured this out yet.

When running the plugin it also needs to find the libraries. This can be resolved by replacing the executable MobileSafari with a script file similar to above (make sure that you copy the old executable to MobileSafari_ or something equivalent)

Issues

  1. The app always comes out black not matter what you do, but the code is running, as debug output is visible

Reolved by using UIApplication instead of ApplicationDelegate. The latter is a special form used by apple and this then loads the view of the app from the .nib file which is compiled by interface builder from a .xml file. This is not present on linux so needs to be avoided.