[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.
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.
It is with great pleasure (and a little bit of relief) that I report that AIR 3 will deliver new and much improved installation and deployment options for the desktop. These options enable installation without administrative rights, GPO-based deployment of AIR applications, XCOPY deployment, run-in-place from flash drives, tight binding to specific versions of AIR, and more.
These advantages arise from two new key capabilities:
- Captive runtimes. Already used on iOS, this capability allows a copy of the AIR runtime to be embedded with each AIR application. This capability is now supported across Mac OS, Windows, and Android, too.
- Custom installers. The application packaging tool, adt, can now be used to generate an application’s file set instead of a complete installer. The file set is a complete copy of the application, capable of being run in place. Or, you can package it up in your own custom installer, whether that’s an MSI for GPO, a PKG for Mac OS, or something else.
In conjunction with today’s announcement of AIR 3, we have now posted a Native Extensions for Adobe AIR page on the Adobe Developer Connection. It currently lists four extensions available for download from both Adobe and our developer community. We’ll post more here as they become available.
And, a reminder that there’s still time to register for Adobe MAX 2011. It’s a great place to find out about all of the new AIR 3 and Flash Player 11 features, including native extensions.