fix: Correctly set video size/aspect ratio for Image Analysis (Frame Processor) (#453)
This commit is contained in:
parent
e99da26561
commit
98f58367d3
@ -367,6 +367,7 @@ class CameraView(context: Context, private val frameProcessorThread: ExecutorSer
|
|||||||
previewBuilder.setTargetAspectRatio(aspectRatio)
|
previewBuilder.setTargetAspectRatio(aspectRatio)
|
||||||
imageCaptureBuilder.setTargetAspectRatio(aspectRatio)
|
imageCaptureBuilder.setTargetAspectRatio(aspectRatio)
|
||||||
videoCaptureBuilder.setTargetAspectRatio(aspectRatio)
|
videoCaptureBuilder.setTargetAspectRatio(aspectRatio)
|
||||||
|
imageAnalysisBuilder.setTargetAspectRatio(aspectRatio)
|
||||||
} else {
|
} else {
|
||||||
// User has selected a custom format={}. Use that
|
// User has selected a custom format={}. Use that
|
||||||
val format = DeviceFormat(format!!)
|
val format = DeviceFormat(format!!)
|
||||||
@ -374,6 +375,7 @@ class CameraView(context: Context, private val frameProcessorThread: ExecutorSer
|
|||||||
previewBuilder.setTargetResolution(format.videoSize)
|
previewBuilder.setTargetResolution(format.videoSize)
|
||||||
imageCaptureBuilder.setTargetResolution(format.photoSize)
|
imageCaptureBuilder.setTargetResolution(format.photoSize)
|
||||||
videoCaptureBuilder.setTargetResolution(format.videoSize)
|
videoCaptureBuilder.setTargetResolution(format.videoSize)
|
||||||
|
imageAnalysisBuilder.setTargetResolution(format.videoSize)
|
||||||
|
|
||||||
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