Fix orientation of image captured by camera.

This commit is contained in:
Sergio Martínez Portela 2020-06-05 18:31:04 +02:00
parent f82edf041c
commit d07d73b56a

View File

@ -377,6 +377,7 @@ public class CameraStreamer implements Part {
public void onConfigured(@NonNull CameraCaptureSession session) {
try {
CaptureRequest.Builder requestBuilder = session.getDevice().createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);
requestBuilder.set(CaptureRequest.JPEG_ORIENTATION, mCameraCharacteristics.get(CameraCharacteristics.SENSOR_ORIENTATION));
requestBuilder.addTarget(surface);
//set to null - image data will be produced but will not receive metadata
session.setRepeatingRequest(requestBuilder.build(), null, CameraStreamer.this._handler);