Archive for October, 2011

AIR Native Extensions, ByteArray, and BitmapData

[Note: Updated on October 11, 2011 to note that multiple ByteArrays or BitmapDatas can be acquired at the same time in the AIR 3 implementation. —Oliver]

The new-to-AIR 3 native extensions capability includes not only a general-purpose API for manipulating ActionScript objects from native code, but also fast-path APIs that allow direct access to ByteArray and BitmapData objects.

Using these APIs, native code can get direct access to the memory that sits behind a ByteArray or BitmapData—no copies, no translations. In order to achieve that, native applications have to declare when they want access via an acquire call, and when they’re done via a release. In between the two, we restrict access to the rest of the API in order to guarantee the pointer that’s returned remains valid.

Furthermore, it’s possible to acquire two or more byte arrays or bitmaps at the same time so long as there no intervening calls to the rest of the API. This can be used, for example, to take image as an input for a filter and write directly to a second as the output.

As always, if you have ideas for enhancements to this and other features, you can vote for them at ideas.adobe.com/air.

See the Native Extensions documentation for more on working with ByteArray and working with BitmapData.

MAX 2011 Follow-up

Thanks to all of you who attended my MAX talks earlier this week! I had a great time presenting, and always enjoy the chance to meet people in person.

Slides and video of my Adobe MAX 2011 presentations are now available online. The two talks are largely the same, with some mobile- versus desktop-specific details appearing in the last 15 minutes or so of each.

How to Extend Your Mobile AIR Applications Using Native Extensions: video on Adobe TV, and slides on Acrobat.com.

How to Extend Your Desktop AIR Applications Using Native Extensions: video on Adobe TV, and slides on Acrobat.com.