Highlighted

Crash on "video.attachCamera" with front camera (S3, Android)

New Here ,
Nov 10, 2014

Copy link to clipboard

Copied

Hi,

I'm developing a camera app with Adobe Air (version 15.0.0 build 302). I would appreciate any help with this really weird bug that I found.

In the Samsung S3 device, attaching the front camera to a Video instance always results in the app crashing. After the crash, the camera becomes unusable by any app on the device. The device must be reset in order to restore the camera. After many tests, I know that the app crashes when the "video.attachCamera" method is called.

This is the relevant piece of code:

this.cameraPos = CameraPosition.FRONT;

this.camera = this.getCamera(this.cameraPos);

this.camera.setMode(640, 640, 30);

this.video = new Video(640, 640);

this.video.attachCamera(this.camera); // crash!

private function getCamera(position:String):Camera

{

  for(var i:int=0; i<Camera.names.length; i++)

  {

    var c:Camera = Camera.getCamera(String(i));

    if(c.position == position) return c;

  }

  return Camera.getCamera();

}


The same code works fine in other Android devices. Listing all available cameras show that both (back and front) cameras are available in the S3. And the front camera works fine when I use CameraUI.

Any help will be much appreciated.

Thanks in advance!

TOPICS
Development

Views

146

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Crash on "video.attachCamera" with front camera (S3, Android)

New Here ,
Nov 10, 2014

Copy link to clipboard

Copied

Hi,

I'm developing a camera app with Adobe Air (version 15.0.0 build 302). I would appreciate any help with this really weird bug that I found.

In the Samsung S3 device, attaching the front camera to a Video instance always results in the app crashing. After the crash, the camera becomes unusable by any app on the device. The device must be reset in order to restore the camera. After many tests, I know that the app crashes when the "video.attachCamera" method is called.

This is the relevant piece of code:

this.cameraPos = CameraPosition.FRONT;

this.camera = this.getCamera(this.cameraPos);

this.camera.setMode(640, 640, 30);

this.video = new Video(640, 640);

this.video.attachCamera(this.camera); // crash!

private function getCamera(position:String):Camera

{

  for(var i:int=0; i<Camera.names.length; i++)

  {

    var c:Camera = Camera.getCamera(String(i));

    if(c.position == position) return c;

  }

  return Camera.getCamera();

}


The same code works fine in other Android devices. Listing all available cameras show that both (back and front) cameras are available in the S3. And the front camera works fine when I use CameraUI.

Any help will be much appreciated.

Thanks in advance!

TOPICS
Development

Views

147

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 10, 2014 0

Have something to add?

Join the conversation