Merge pull request #121 from frankFic/master

Fix #120 (slow preview on Nexus 4)
This commit is contained in:
Tibor Kaputa 2018-02-22 17:29:03 +01:00 committed by GitHub
commit 513c389658
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -159,6 +159,10 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
mSupportedPreviewSizes = mParameters!!.supportedPreviewSizes.sortedByDescending { it.width * it.height }
refreshPreview()
if ("Nexus 4".equals(Build.MODEL)) {
mParameters!!.setRecordingHint(true)
}
val focusModes = mParameters!!.supportedFocusModes
if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE))
mParameters!!.focusMode = Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE