fix: Fix format
Preview and Video Capture resolution setting (#325)
* fix: Actually use a format's `videoSize` for Preview/Video Capture * `setDefaultResolution` -> `setTargetResolution`
This commit is contained in:
parent
1c32726ef6
commit
37db643f71
@ -356,10 +356,9 @@ class CameraView(context: Context) : FrameLayout(context), LifecycleOwner {
|
|||||||
// User has selected a custom format={}. Use that
|
// User has selected a custom format={}. Use that
|
||||||
val format = DeviceFormat(format!!)
|
val format = DeviceFormat(format!!)
|
||||||
Log.i(TAG, "Using custom format - photo: ${format.photoSize}, video: ${format.videoSize} @ $fps FPS")
|
Log.i(TAG, "Using custom format - photo: ${format.photoSize}, video: ${format.videoSize} @ $fps FPS")
|
||||||
val aspectRatio = aspectRatio(format.photoSize.width, format.photoSize.height)
|
previewBuilder.setTargetResolution(format.videoSize)
|
||||||
previewBuilder.setTargetAspectRatio(aspectRatio)
|
imageCaptureBuilder.setTargetResolution(format.photoSize)
|
||||||
imageCaptureBuilder.setDefaultResolution(format.photoSize)
|
videoCaptureBuilder.setTargetResolution(format.videoSize)
|
||||||
videoCaptureBuilder.setDefaultResolution(format.photoSize)
|
|
||||||
|
|
||||||
fps?.let { fps ->
|
fps?.let { fps ->
|
||||||
if (format.frameRateRanges.any { it.contains(fps) }) {
|
if (format.frameRateRanges.any { it.contains(fps) }) {
|
||||||
|
Loading…
Reference in New Issue
Block a user