4

我正在构建一个相机应用程序,它通过实现访问预览帧

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

当我通过调用

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

它似乎对我在 onPreviewFrame 中获得的数据没有任何影响。预览显示本身按预期进行。

这发生在 LG Nexus 4 上。

如何获得应用于预览数据的实际缩放。我有什么办法知道我的设备是否真的对数据应用了缩放?

谢谢,

4

1 回答 1

1

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.

于 2015-10-24T19:48:29.243 回答