createBarcodeScannerOutput

Create a new Barcode Scanner CameraOutput.

The Barcode Scanner CameraOutput can be attached to a CameraSession, and calls BarcodeScannerOutputOptions.onBarcodeScanned with the Barcodes detected in the Camera feed.

val barcodeOutput = createBarcodeScannerOutput(
BarcodeScannerOutputOptions(
barcodeFormats = listOf(TargetBarcodeFormat.ALL_FORMATS),
onBarcodeScanned = { barcodes -> barcodes.forEach { println("Barcode value: ${it.rawValue}") } },
onError = { error -> println("Failed to scan barcodes: $error") },
),
)