Dev Center
Swift
Objective-C
Table of contents

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.
setDBRTextResultDelegate Set callback function to process text results generated during frame decoding.
setDBRIntermediateResultDelegate Set callback function to process intermediate results generated during frame decoding.
enableResultVerification Enable Result Verification feature to improve the accuracy of barcode results for video streaming barcode decoding.
enableDuplicateFilter Enable Duplicate Filter feature to filter out the duplicate results in the period of 3000ms for video barcode decoding.

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:(DynamsoftCameraEnhancer* _Nonnull)cameraInstance;

Parameters

dce: An instance of Dynamsoft Camera Enhancer.

Code Snippet

  • Objective-C
  • Swift
  1. @property(nonatomic, strong) DynamsoftBarcodeReader *barcodeReader;
    @property(nonatomic, strong) DynamsoftCameraEnhancer *dce;
    [_barcodeReader setCameraEnhancer:_dce];
    
  2. var dce:DynamsoftCameraEnhancer! = nil
    var barcodeReader:DynamsoftBarcodeReader! = nil
    barcodeReader.setCameraEnhancer(dce)
    

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

  • Objective-C
  • Swift
  1. [_barcodeReader startScanning];
    
  2. barcodeReader.startScanning()
    

stopScanning

Stop the video streaming barcode decoding thread.

-(void)stopScanning;

Code Snippet

  • Objective-C
  • Swift
  1. [_barcodeReader stopScanning];
    
  2. barcodeReader.stopScanning()
    

setDBRTextResultDelegate

Set callback function to process text results generated during frame decoding.

-(void)setDBRTextResultDelegate:(id _Nullable)textResultDelegate userData:(NSObject* _Nullable)userData;

Parameters

[in] textResultDelegate: Callback function.
[in] userData: Customized arguments passed to your function.

Code Snippet

  • Objective-C
  • Swift
  1. [barcodeReader setDBRTextResultDelegate:self userData:nil];
    
  2. barcodeReader.setDBRTextResultDelegate(self, userData:nil)
    

setDBRIntermediateResultDelegate

Set callback function to process intermediate results generated during frame decoding.

-(void)setDBRIntermediateResultDelegate:(id _Nullable)intermediateResultDelegate userData:(NSObject* _Nullable)userData;

Parameters

[in] intermediateResultDelegate: Callback function.
[in] userData: Customized arguments passed to your function.

Code Snippet

  • Objective-C
  • Swift
  1. DynamsoftBarcodeReader *barcodeReader;
    [barcodeReader setDBRIntermediateResultDelegate:self userData:nil];
    
  2. barcodeReader.setDBRIntermediateResultDelegate(self, userData:nil)
    

enableResultVerification

Enable Result Verification on the barcode results of 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.

@property (nonatomic, assign) BOOL enableResultVerification;

Parameters

boolean value which stands for the target status of result verification mode.

Code Snippet

  • Objective-C
  • Swift
  1. [barcodeReader enableResultVerification:true];
    // To check the status of this mode
    [barcodeReader getEnableResultVerification]
    
  2. barcodeReader.enableResultVerification = true
    // To check the status of this mode
    let x = barcodeReader.enableResultVerification
    

enableDuplicateFilter

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.

@property (nonatomic, assign) BOOL enableDuplicateFilter;

Parameters

boolean value which stands for the target status of result duplicate filter mode.

Code Snippet

  • Objective-C
  • Swift
  1. [barcodeReader enableDuplicateFilter:true];
    // To check the status of this mode
    [barcodeReader getEnableDuplicateFilter]
    
  2. barcodeReader.enableDuplicateFilter = true
    // To check the status of this mode
    let x = barcodeReader.enableDuplicateFilter
    

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article:

version 8.9.3

  • Latest version
  • Version 10.x
    • Version 10.2.1100
    • Version 10.2.1101
    • Version 10.2.10
    • Version 10.0.21
    • Version 10.0.20
    • Version 10.2.10
    • Version 10.0.21
    • Version 10.0.20
  • 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.11
    • Version 9.2.10
    • Version 9.0.2
    • Version 9.0.1
    • Version 9.0.0
    • Version 9.6.40
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.13
    • 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 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
    • Version 7.6.0
    • Version 7.5.0
  • Documentation Homepage
Change +