get low quality camcorder, if high quality isnt available

This commit is contained in:
tibbi 2017-11-21 13:44:31 +01:00
parent 4359f0f3ed
commit 3295e58306
1 changed files with 6 additions and 1 deletions

View File

@ -609,7 +609,12 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
}
val resolution = getSelectedResolution()
CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).apply {
val profile = if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_HIGH)) {
CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH)
} else {
CamcorderProfile.get(CamcorderProfile.QUALITY_LOW)
}
profile.apply {
videoFrameWidth = resolution.width
videoFrameHeight = resolution.height
mRecorder!!.setProfile(this)