Dev Center
Swift
Objective-C
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

Video Decoding Methods

Method Description
setCameraEnhancer Bind a Camera Enhancer instance to the Barcode Reader.
startScanning Start the barcode reading thread.
stopScanning Stop the barcode reading thread.
setTextResultCallback Set callback interface to process text results generated during frame decoding.
setIntermediateResultCallback Set callback interface to process intermediate results generated during frame decoding.
enableResultVerification Result will be verified before output.
enableDuplicateFilter Filter out the duplicate results in the period of duplicateForgetTime for video barcode decoding. Barcode results with the same text and format will be returned only once during the period.

setCameraEnhancer

Bind a Dynamsoft Camera Enhancer instance to the Barcode Reader. Dynamsoft Camera Enhancer is designed for video streaming processing scenarios. It can help the Barcode Reader to acquire video frames continuously for video streaming barcode decoding.

void setCameraEnhancer(CameraEnhancer mCameraEnhancer)

Parameters

mCameraEnhancer: An instance of Dynamsoft Camera Enhancer.

Code Snippet

BarcodeReader reader = new BarcodeReader();
CameraEnhancer mCameraEnhancer = new CameraEnhancer(MainActivity.this);
mCameraEnhancer.setCameraView(cameraView);
reader.setCameraEnhancer(mCameraEnhancer);

startScanning

Start the video streaming barcode decoding thread. Please be sure that you have bound a Camera Enhancer to the barcode reader before you trigger startScanning.

void startScanning()

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.startScanning();

stopScanning

Stop the video streaming barcode decoding thread.

void stopScanning()

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.stopScanning();

setTextResultCallback

Set a callback interface to process text results generated during frame decoding.

void setTextResultCallback(TextResultCallback textResultCallback, Object userData) throws BarcodeReaderException

Parameters

textResultCallback: Callback interface.
userData: Customized arguments passed to your function.

Exceptions

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.setTextResultCallback(new TextResultCallback() {
    @Override
    public void textResultCallback(int frameId, TextResult[] results, Object userData) {
        //TODO add your code for using text results
    }
}, null);

setIntermediateResultCallback

Set a callback interface to process intermediate results generated during frame decoding.

void setIntermediateResultCallback(IntermediateResultCallback intermediateResultCallback, Object userData} throws BarcodeReaderException

Parameters

intermediateResultCallback: Callback interface.
userData: Customized arguments passed to your function.

Exceptions

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader();
PublicRuntimeSettings settings = reader.getRuntimeSettings();
settings.intermediateResultTypes = EnumIntermediateResultType.IRT_ORIGINAL_IMAGE | EnumIntermediateResultType.IRT_COLOUR_CLUSTERED_IMAGE | EnumIntermediateResultType.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE;
reader.updateRuntimeSettings(settings);
reader.setIntermediateResultCallback(new IntermediateResultCallback() {
    @Override
    public void intermediateResultCallback(int frameId, IntermediateResult[] results, Object userData) {
        //TODO add your code for using intermediate results
    }
}, null);

enableResultVerification

Enable Result Verification feature to improve the accuracy of barcode results for video streaming barcode decoding. This feature is not enabled by default.

There are 2 way for you to get barcode results:

  • From the return value of decode methods when processing a single image.
  • From the textResultCallback when processing the video streaming.

Result verification feature only effects on the OneD barcode results you get from textResultCallback.

void enableResultVerification(boolean)

Code Snippet

reader.enableResultVerification(true)
// To check the status of this mode:
boolean x = reader.getEnableResultVerificationStatus();

enableDuplicateFilter

Enable Duplicate Filter feature to filter out the duplicate results in the period of 3000ms for video barcode decoding. Barcode results with the same text and format will be returned only once during the period.

There are 2 way for you to get barcode results:

  • From the return value of decode methods when processing a single image.
  • From the textResultCallback when processing the video streaming.

Duplicate filter only effects on the duplicate results that output by textResultCallback.

void enableDuplicateFilter(boolean)

Code Snippet

reader.enableDuplicateFilter(true)

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

version 8.9.3

  • Latest version
  • Version 9.x
    • Version 9.6.40
    • Version 9.6.20
    • Version 9.6.11
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.13
    • Version 9.2.11
    • Version 9.2.10
    • Version 9.0.2
    • Version 9.0.1
    • Version 9.0.0
  • Version 8.x
    • Version 8.9.3
    • Version 8.9.1
    • Version 8.9.0
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.1
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +