CanonEOSLib was developed for a very specific project and to interact only with the Canon EOS1100D. After that, we tried to update the code and communicate with more cameras but due to the differences between them, some functionalities were affected and they didn’t work as expected.
The more problematic functionality is related with the EVF (electronic viewfinder) capture. Using the libraries provided by the camera manufacturer, the extension executes commands that are passed from the Adobe AIR runtime. The commands are executed in a separate thread to avoid overloading the main thread and to keep a good user experience when the camera is working.
To understand a bit better how the EVF captures work, check the follow graphic:
In order to download a live preview image from the camera, process it and save in a global native object we can use this method:
If a new image is ready to capture, the native extension dispatch an event to notify runtime Adobe AIR.
and finally, the bytes are copied from the native bitmap:
To transfer the native bitmap to the bitmap passed by the runtime, the ANE tries to do this in a “byte per byte’ copy operation. It’s is very important to keep the same dimensions (width and height) in both sides.