OfriM
OfriM

Reputation: 121

Android: Zoom not effecting preview frame data passed to onPreviewFrame()

I'm building a camera app which access the preview frame by implementing

android.hardware.Camera.PreviewCallback#onPreviewFrame(byte[] data, Camera camera).

When I change my camera zoom by calling the

android.hardware.Camera.Parameters#setZoom(int zoom) 

it doesn't seem to have any effect on the data i get in the onPreviewFrame. The preview display itself is effected as expected.

This is happening on LG Nexus 4.

How can I get the actual zoom which is applied on the preview data. do I have any way of knowing if my device actually applies zoom on the data or not?

Thanks,

Upvotes: 4

Views: 232

Answers (1)

user3260620
user3260620

Reputation: 11

not exactly a solution but... you can set the scene to HDR (Camera.Parameters.setSceneMode("hdr")) and that makes the data to behave as expected (but, of course, then HDR is on). what I did was to work around it and actually crop the data only on the Nexus 4. I used the getZoom() method to detect zoom and then cropped accordingly.

Upvotes: 1

Related Questions