From 98f58367d3d163d7f3b12b2e5e719b94df030b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Guerrero?= <68583906+icc-guerrero@users.noreply.github.com> Date: Fri, 24 Sep 2021 12:01:45 +0200 Subject: [PATCH] fix: Correctly set video size/aspect ratio for Image Analysis (Frame Processor) (#453) --- android/src/main/java/com/mrousavy/camera/CameraView.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/src/main/java/com/mrousavy/camera/CameraView.kt b/android/src/main/java/com/mrousavy/camera/CameraView.kt index 4d1032a..c3cd74b 100644 --- a/android/src/main/java/com/mrousavy/camera/CameraView.kt +++ b/android/src/main/java/com/mrousavy/camera/CameraView.kt @@ -367,6 +367,7 @@ class CameraView(context: Context, private val frameProcessorThread: ExecutorSer previewBuilder.setTargetAspectRatio(aspectRatio) imageCaptureBuilder.setTargetAspectRatio(aspectRatio) videoCaptureBuilder.setTargetAspectRatio(aspectRatio) + imageAnalysisBuilder.setTargetAspectRatio(aspectRatio) } else { // User has selected a custom format={}. Use that val format = DeviceFormat(format!!) @@ -374,6 +375,7 @@ class CameraView(context: Context, private val frameProcessorThread: ExecutorSer previewBuilder.setTargetResolution(format.videoSize) imageCaptureBuilder.setTargetResolution(format.photoSize) videoCaptureBuilder.setTargetResolution(format.videoSize) + imageAnalysisBuilder.setTargetResolution(format.videoSize) fps?.let { fps -> if (format.frameRateRanges.any { it.contains(fps) }) {