Highlighted

Android AIR continuous autofocus doesn't work

Community Beginner ,
Jan 26, 2015

Copy link to clipboard

Copied

Hello!

I am making an application for Android using AIR - it has to make a streaming of video from the camera to server. I started with a simple application which draws rear camera preview on the screen, the code looks like this:

camera = Camera.getCamera("0");

video = new Video(camera.width, camera.height);

video.attachCamera(camera);

And I have three problems when tesing the app on my LG L65 with Android 4.4.2:

1) The preview is very dark. It becomes a bit brighter when I show the lamp, or some other sources of light - the brightness is being adjusted continuously, but when i return back to ordinal views with no really-bright sources - it becomes dark again. The front camera does not have such a problem - the brightness is ok. The most important here is that the native Camera Roll application shows good and bright previews from both cameras, and also, when i test a simple Android app to check camera preview - it also shows good and bright picture from both cameras - so, i have this problem only in AIR application and only for rear camera.

Screenshot_2015-01-26-19-54-02.png

  Rear camera preview screenshot From AIR application

Screenshot_2015-01-26-19-55-29.png

   Rear camera preview screenshot From Android application

2) I noticed, that the continuous autofocus doesn't work in AIR application - it works (refocuses) only when manually calling Camera.setMode, but the solution of refocusing every, for example, 3 seconds won't fix the problem, because it will hang the video every time for half a second. There was a discussion here: https://forums.adobe.com/message/3775731, whitch led to creation of a bug in bugbase here: https://bugbase.adobe.com/index.cfm?event=bug&id=2921514, which was closed, but should not. It was concluded there, that if a smartphone does not provide continuous autofocus - it won't work continuously in AIR also. BUT: i checked my LG L65, and also Samsung Galaxy Note 2 for continuous autofocus - made a simple Android application, set the autofocus mode to continious, and it worked for both smartphones. But the AIR continuous autofocus did not, for both LG and Samsung. That's why i really ask you to reopen that bug in a bugbase and try to help to find some solution. The code I use to check continuous autofocus in Android:

parameters.setFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);

camera.setParameters(parameters);

3) I also tried to use flashlight at the same time, as the video is previewed from camera - and failed: we cannot use one camera object in AIR and one in ANE at the same time - we only can release it in one side to work with it in another, by making camera object null in AIR or by calling Camera.release in android. I could only blink the flashlight, using the native extension (make AIR camera null, start flashlight from ANE, release camera object in ANE, make a new camera object in AIR, attach it to video). What would you kindly suggest to do here - to show camera preview and use flashlight at the same time? Are there any possibilities to change android camera parameters to use in AIR camera with help of ANE or anything else? And maybe you are already planning to add some more functionality to Camera class in AIR to use more camera settings?

Hope this post helps other developers when you answer!

I also submitted the 3 bugs here:

https://bugbase.adobe.com/index.cfm?event=bug&id=3927313

https://bugbase.adobe.com/index.cfm?event=bug&id=3927321

Also, i have made a feature request for using the flashlight in AIR during the camera preview working:

https://bugbase.adobe.com/index.cfm?event=bug&id=3927326

And a feature request for controlling the camera parameters of android and use them in AIR camera:

https://bugbase.adobe.com/index.cfm?event=bug&id=3927339

please, vote it up!

Thanks,

Vassad2214.

TOPICS
Development

Views

280

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

Android AIR continuous autofocus doesn't work

Community Beginner ,
Jan 26, 2015

Copy link to clipboard

Copied

Hello!

I am making an application for Android using AIR - it has to make a streaming of video from the camera to server. I started with a simple application which draws rear camera preview on the screen, the code looks like this:

camera = Camera.getCamera("0");

video = new Video(camera.width, camera.height);

video.attachCamera(camera);

And I have three problems when tesing the app on my LG L65 with Android 4.4.2:

1) The preview is very dark. It becomes a bit brighter when I show the lamp, or some other sources of light - the brightness is being adjusted continuously, but when i return back to ordinal views with no really-bright sources - it becomes dark again. The front camera does not have such a problem - the brightness is ok. The most important here is that the native Camera Roll application shows good and bright previews from both cameras, and also, when i test a simple Android app to check camera preview - it also shows good and bright picture from both cameras - so, i have this problem only in AIR application and only for rear camera.

Screenshot_2015-01-26-19-54-02.png

  Rear camera preview screenshot From AIR application

Screenshot_2015-01-26-19-55-29.png

   Rear camera preview screenshot From Android application

2) I noticed, that the continuous autofocus doesn't work in AIR application - it works (refocuses) only when manually calling Camera.setMode, but the solution of refocusing every, for example, 3 seconds won't fix the problem, because it will hang the video every time for half a second. There was a discussion here: https://forums.adobe.com/message/3775731, whitch led to creation of a bug in bugbase here: https://bugbase.adobe.com/index.cfm?event=bug&id=2921514, which was closed, but should not. It was concluded there, that if a smartphone does not provide continuous autofocus - it won't work continuously in AIR also. BUT: i checked my LG L65, and also Samsung Galaxy Note 2 for continuous autofocus - made a simple Android application, set the autofocus mode to continious, and it worked for both smartphones. But the AIR continuous autofocus did not, for both LG and Samsung. That's why i really ask you to reopen that bug in a bugbase and try to help to find some solution. The code I use to check continuous autofocus in Android:

parameters.setFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);

camera.setParameters(parameters);

3) I also tried to use flashlight at the same time, as the video is previewed from camera - and failed: we cannot use one camera object in AIR and one in ANE at the same time - we only can release it in one side to work with it in another, by making camera object null in AIR or by calling Camera.release in android. I could only blink the flashlight, using the native extension (make AIR camera null, start flashlight from ANE, release camera object in ANE, make a new camera object in AIR, attach it to video). What would you kindly suggest to do here - to show camera preview and use flashlight at the same time? Are there any possibilities to change android camera parameters to use in AIR camera with help of ANE or anything else? And maybe you are already planning to add some more functionality to Camera class in AIR to use more camera settings?

Hope this post helps other developers when you answer!

I also submitted the 3 bugs here:

https://bugbase.adobe.com/index.cfm?event=bug&id=3927313

https://bugbase.adobe.com/index.cfm?event=bug&id=3927321

Also, i have made a feature request for using the flashlight in AIR during the camera preview working:

https://bugbase.adobe.com/index.cfm?event=bug&id=3927326

And a feature request for controlling the camera parameters of android and use them in AIR camera:

https://bugbase.adobe.com/index.cfm?event=bug&id=3927339

please, vote it up!

Thanks,

Vassad2214.

TOPICS
Development

Views

281

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
Jan 26, 2015 0

Have something to add?

Join the conversation