Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove hardcoded resolution selector #2997

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.mrousavy.camera.core
import android.annotation.SuppressLint
import android.util.Log
import android.util.Range
import android.util.Size
import androidx.annotation.OptIn
import androidx.camera.core.CameraSelector
import androidx.camera.core.CameraState
Expand Down Expand Up @@ -211,11 +210,7 @@ internal fun CameraSession.configureOutputs(configuration: CameraConfiguration)
val codeScannerConfig = configuration.codeScanner as? CameraConfiguration.Output.Enabled<CameraConfiguration.CodeScanner>
if (codeScannerConfig != null) {
Log.i(CameraSession.TAG, "Creating CodeScanner output...")
val analyzer = ImageAnalysis.Builder().also { analysis ->
val targetSize = Size(1280, 720)
val resolutionSelector = ResolutionSelector.Builder().forSize(targetSize).build()
analysis.setResolutionSelector(resolutionSelector)
}.build()
val analyzer = ImageAnalysis.Builder().build()
val pipeline = CodeScannerPipeline(codeScannerConfig.config, callback)
analyzer.setAnalyzer(CameraQueues.analyzerExecutor, pipeline)
codeScannerOutput = analyzer
Expand Down