allow toggling flashlight at recording preview
This commit is contained in:
parent
8ae6c32206
commit
f83a841ae4
|
@ -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
|
||||
|
|
|
@ -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?) {}
|
||||
|
|
Loading…
Reference in New Issue