allow toggling flashlight at recording preview

This commit is contained in:
tibbi 2018-06-06 22:41:56 +02:00
parent 8ae6c32206
commit f83a841ae4
2 changed files with 3 additions and 1 deletions

View File

@ -37,6 +37,7 @@ const val STATE_PICTURE_TAKEN = 2
const val STATE_WAITING_LOCK = 3
const val STATE_WAITING_PRECAPTURE = 4
const val STATE_WAITING_NON_PRECAPTURE = 5
const val STATE_RECORDING = 6
fun compensateDeviceRotation(orientation: Int, isUsingFrontCamera: Boolean) = when {
orientation == ORIENT_LANDSCAPE_LEFT -> 270

View File

@ -416,8 +416,8 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
mPreviewRequest = build()
}
mCaptureSession!!.setRepeatingRequest(mPreviewRequest, mCaptureCallback, mBackgroundHandler)
mCameraState = STATE_PREVIEW
}
mCameraState = STATE_PREVIEW
} catch (e: Exception) {
}
}
@ -734,6 +734,7 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
mMediaRecorder?.start()
}
mActivity.setRecordingState(true)
mCameraState = STATE_RECORDING
}
override fun onConfigureFailed(session: CameraCaptureSession?) {}