Flash ANE camera for android, aneandroid
Android native camera ANE packaged with opencv2.4.9 ndk
Not very useful now
Run in Nexus7-I (4.4.4)
But it is not available on Sony LT18i.
Private function openCam (): void {
If (! Camera. isSupported)
Return;
Var cameraNam: Array = Camera. names;
Var cameraID: uint = 0;
If (cameraNam. length = 2 ){
CameraID = 1099; // for back or 1098 for front
}
_ Cam = NativeCamera. instance;
_ Cam. addEventListener (NativeCamera. NATIVE_CAMERA_CREATED, onCreated );
_ Cam. addEventListener (NativeCamera. NATIVE_CAMERA_ERROR, onError );
_ Cam. initCamWith (cameraID );
}
......
/// OnCreated
Var bestR: NativeCameraSupportedResolution = _ cam. getMaxCamParam ();
If (bestR = null) bestR = new NativeCameraSupportedResolution (_ width, _ height );
_ Cam. setCameraParam (bestR. camWidth, bestR. camHeight, 1, 0 );
This. addEventListener (Event. ENTER_FRAME, onShow );
//// // Obtain bitmapdata
_ Bitmapdata = _ cam. grabData ();
//// Set the white balance index = 0-7;
_ Cam. setCamWhiteBalance (index );
//// Release
_ Cam. releaseCam ();
_ Cam = null;
Click to download
Currently supported devices
Problems with Camera development for Android
...
Android cannot open the camera LogCat. The following message is displayed: CameraSwitch no file-can't switch camera.
Add camera Permissions
Remove
Parameters. setPreviewSize (display. getWidth (), display. getHeight ())
Parameters. setPictureSize (display. getHeight (), display. getWidth ())
And then work normally