fix: Use acquireLatestImage
instead of acquireNextImage
for CodeScanner (#2549)
This commit is contained in:
parent
b7e24c444e
commit
ec7ce36d25
@ -39,7 +39,7 @@ class CodeScannerPipeline(
|
|||||||
var isBusy = false
|
var isBusy = false
|
||||||
imageReader = ImageReader.newInstance(size.width, size.height, format, MAX_IMAGES)
|
imageReader = ImageReader.newInstance(size.width, size.height, format, MAX_IMAGES)
|
||||||
imageReader.setOnImageAvailableListener({ reader ->
|
imageReader.setOnImageAvailableListener({ reader ->
|
||||||
val image = reader.acquireNextImage() ?: return@setOnImageAvailableListener
|
val image = reader.acquireLatestImage() ?: return@setOnImageAvailableListener
|
||||||
|
|
||||||
if (isBusy) {
|
if (isBusy) {
|
||||||
// We're currently executing on a previous Frame, so we skip this one.
|
// We're currently executing on a previous Frame, so we skip this one.
|
||||||
|
Loading…
Reference in New Issue
Block a user