Flash ANE camera for android, aneandroid

Source: Internet
Author: User

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
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.