Fix orientation of image captured by camera.
This commit is contained in:
parent
f82edf041c
commit
d07d73b56a
@ -377,6 +377,7 @@ public class CameraStreamer implements Part {
|
|||||||
public void onConfigured(@NonNull CameraCaptureSession session) {
|
public void onConfigured(@NonNull CameraCaptureSession session) {
|
||||||
try {
|
try {
|
||||||
CaptureRequest.Builder requestBuilder = session.getDevice().createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);
|
CaptureRequest.Builder requestBuilder = session.getDevice().createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);
|
||||||
|
requestBuilder.set(CaptureRequest.JPEG_ORIENTATION, mCameraCharacteristics.get(CameraCharacteristics.SENSOR_ORIENTATION));
|
||||||
requestBuilder.addTarget(surface);
|
requestBuilder.addTarget(surface);
|
||||||
//set to null - image data will be produced but will not receive metadata
|
//set to null - image data will be produced but will not receive metadata
|
||||||
session.setRepeatingRequest(requestBuilder.build(), null, CameraStreamer.this._handler);
|
session.setRepeatingRequest(requestBuilder.build(), null, CameraStreamer.this._handler);
|
||||||
|
Loading…
Reference in New Issue
Block a user