zxingscanview/src/main/java/com/google/zxing/client/android/decode/DecodeHandler.java
/**
     * Decode the data within the viewfinder rectangle, and time how long it took. For efficiency,
     * reuse the same reader objects from one decode to the next.
     *
     * @param data   The YUV preview frame.
     * @param width  The width of the preview frame.
     * @param height The height of the preview frame.
     */
Decode the data within the viewfinder rectangle, and time how long it took. For efficiency,
reuse the same reader objects from one decode to the next.

@param data   The YUV preview frame.
@param width  The width of the preview frame.
@param height The height of the preview frame.
Decode the data within the viewfinder rectangle and time how long it took . For efficiency reuse the same reader objects from one decode to the next . @param data The YUV preview frame . @param width The width of the preview frame . @param height The height of the preview frame .
private void decode(byte[] data, int width, int height) {
        Result rawResult = null;
        PlanarYUVLuminanceSource source = cameraManager.buildLuminanceSource(data, width, height);
        if (source != null) {
            BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
            try {
                rawResult = multiFormatReader.decodeWithState(bitmap);
            } catch (ReaderException re) {
            } finally {
                multiFormatReader.reset();
            }
        }
        if (rawResult != null) {
            if (mHandler != null) {
                Message message = Message.obtain(mHandler, ID.decode_succeeded, rawResult);
                Bundle bundle = new Bundle();
                bundleThumbnail(source, bundle);
                message.setData(bundle);
                message.sendToTarget();
            }
        } else {
            if (mHandler != null) {
                Message message = Message.obtain(mHandler, ID.decode_failed);
                message.sendToTarget();
            }
        }
    }
private void decode ( byte [ ] data , int width , int height ) { Result rawResult = null ; PlanarYUVLuminanceSource source = cameraManager . buildLuminanceSource ( data , width , height ) ; if ( source != null ) { BinaryBitmap bitmap = new BinaryBitmap ( new HybridBinarizer ( source ) ) ; try { rawResult = multiFormatReader . decodeWithState ( bitmap ) ; } catch ( ReaderException re ) { } finally { multiFormatReader . reset ( ) ; } } if ( rawResult != null ) { if ( mHandler != null ) { Message message = Message . obtain ( mHandler , ID . decode_succeeded , rawResult ) ; Bundle bundle = new Bundle ( ) ; bundleThumbnail ( source , bundle ) ; message . setData ( bundle ) ; message . sendToTarget ( ) ; } } else { if ( mHandler != null ) { Message message = Message . obtain ( mHandler , ID . decode_failed ) ; message . sendToTarget ( ) ; } } }
Decode the data within the viewfinder rectangle, and time how long it took.
Decode the data within the viewfinder rectangle and time how long it took .
// continue // Don't log the barcode contents for security.