Wednesday, January 9, 2008

Flash player as an application on top of OS

For those of you who are planning on using Flash to an embedded device, please keep in mind that Flash requires multitudes of support from OS. The device configuration (in terms of peripherals, RAM, display, input devices etc). can impact the Flash significantly. In general, just because Flash runs on a device running operating system X, doesn’t mean that it’ll run on a different device running operating system X. Depending on how different the configuration is, it may require complete rework or minor change. So just because you are migrating your

There are a few major areas where Flash requires support from OS:

Input devices: Actionscript application running on Flash can be taking input from the device, and that input needs to be mapped inside the Flash player. In general, input devices could be a keyboard, touchscreen, a panel, of switches- whatever. Each one of them, when invoked, generates an event which the OS recognizes.

From Flash point of view, each event needs to be ‘understood’ by the actionscript. For example, a content developer might write something like ‘Press y to continue’. For a PC based application, since the keyboard has a standard set of characters, ‘a’ is always represented by an ASCII value. In embedded devices though, these can be mapped to different values. For example, an ‘up’ key can be mapped to any of the buttons on the cell phone. So when developing your application, you need to be aware of this distinction.

Audio: Flash is a very powerful tool that provides vector processing, audio, video, animation and the whole range of capabilities. So in general, there are multitudes of events happening while it is playing the content. The audio is an important part of the overall Flash player sync for audio and video. You must have noticed that even though for some content, the video skips, audio continues to play normally. Internally quite a bit of work takes place that drives this mechanism. When considering an embedded system, you may want to use a generic driver that is well adapted so Flash will work without any major modification.

Video: Flash requires support from OS in terms of framebuffer when it comes to blitting the screen. In general, Flash creates the output buffer based on input actionscript content and it impacts the behavior quite a bit. This is particularly true for Linux, since the choice of UI layer- GTK/X11, GTK/directfb, DirectFB, QT etc. can have a major impact on Flash.

In short, when you choose the OS for your device, you may want to consider these factors before making any decision.

No comments: