Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
M. Yoga Nugraha
2022-02-24 13:35:28 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
717621a7bba9a4deecb69917e5e1b525a0298ac6
717621a7
1 parent
82a16e73
change bingToLifecycle argument
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScanner.kt
android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScanner.kt
View file @
717621a
...
...
@@ -113,6 +113,7 @@ class MobileScanner(private val activity: Activity, private val textureRegistry:
private var scanner = BarcodeScanning.getClient()
private lateinit var imageCapture: ImageCapture
@ExperimentalGetImage
private fun start(call: MethodCall, result: MethodChannel.Result) {
...
...
@@ -161,10 +162,14 @@ class MobileScanner(private val activity: Activity, private val textureRegistry:
}
val analysis = analysisBuilder.build().apply { setAnalyzer(executor, analyzer) }
imageCapture = ImageCapture.Builder()
.setCaptureMode(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
.build()
// Select the correct camera
val selector = if (facing == 0) CameraSelector.DEFAULT_FRONT_CAMERA else CameraSelector.DEFAULT_BACK_CAMERA
camera = cameraProvider!!.bindToLifecycle(activity as LifecycleOwner, selector, preview,
analysis
)
camera = cameraProvider!!.bindToLifecycle(activity as LifecycleOwner, selector, preview,
imageCapture
)
val analysisSize = analysis.resolutionInfo?.resolution ?: Size(0, 0)
val previewSize = preview.resolutionInfo?.resolution ?: Size(0, 0)
...
...
Please
register
or
login
to post a comment