processWebRtcFrame method

  1. @override
Future<Code> processWebRtcFrame(
  1. Uint8List encodedBytes,
  2. DecodeParams params, {
  3. double cropPercent = 0.5,
  4. double horizontalCropOffset = 0.0,
  5. double verticalCropOffset = 0.0,
})
override

Reads barcode from a WebRTC video frame (encoded JPEG bytes from captureFrame())

Implementation

@override
Future<Code> processWebRtcFrame(
  Uint8List encodedBytes,
  DecodeParams params, {
  double cropPercent = 0.5,
  double horizontalCropOffset = 0.0,
  double verticalCropOffset = 0.0,
}) async {
  final Uint8List bytes = await _prepareBytes(
    encodedBytes,
    params,
    cropPercent,
    horizontalCropOffset,
    verticalCropOffset,
  );
  final List<Code> results = await _callWasm(bytes, params);
  return results.isNotEmpty ? results.first : Code();
}