mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-01-01 10:07:18 +01:00
fix #171, try avoiding capturing rotated photos
This commit is contained in:
parent
8fae1b167a
commit
9548d6621d
@ -578,11 +578,12 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
|
|||||||
|
|
||||||
mCameraState = STATE_PICTURE_TAKEN
|
mCameraState = STATE_PICTURE_TAKEN
|
||||||
mRotationAtCapture = mActivity.mLastHandledOrientation
|
mRotationAtCapture = mActivity.mLastHandledOrientation
|
||||||
|
val jpegOrientation = (mSensorOrientation + compensateDeviceRotation(mRotationAtCapture, mUseFrontCamera)) % 360
|
||||||
val captureBuilder = mCameraDevice!!.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE).apply {
|
val captureBuilder = mCameraDevice!!.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE).apply {
|
||||||
addTarget(mImageReader!!.surface)
|
addTarget(mImageReader!!.surface)
|
||||||
setFlashAndExposure(this)
|
setFlashAndExposure(this)
|
||||||
set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE)
|
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_CAPTURE_INTENT, CaptureRequest.CONTROL_CAPTURE_INTENT_STILL_CAPTURE)
|
||||||
set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, getFrameRange())
|
set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, getFrameRange())
|
||||||
if (mZoomRect != null) {
|
if (mZoomRect != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user