fix #171, try avoiding capturing rotated photos

This commit is contained in:
tibbi 2018-07-10 00:03:34 +02:00
parent 8fae1b167a
commit 9548d6621d

View File

@ -578,11 +578,12 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
mCameraState = STATE_PICTURE_TAKEN
mRotationAtCapture = mActivity.mLastHandledOrientation
val jpegOrientation = (mSensorOrientation + compensateDeviceRotation(mRotationAtCapture, mUseFrontCamera)) % 360
val captureBuilder = mCameraDevice!!.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE).apply {
addTarget(mImageReader!!.surface)
setFlashAndExposure(this)
set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE)
set(CaptureRequest.JPEG_ORIENTATION, mSensorOrientation)
set(CaptureRequest.JPEG_ORIENTATION, jpegOrientation)
set(CaptureRequest.CONTROL_CAPTURE_INTENT, CaptureRequest.CONTROL_CAPTURE_INTENT_STILL_CAPTURE)
set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, getFrameRange())
if (mZoomRect != null) {