Code example for Camera

Methods: releasesetPreviewCallbackWithBuffersetPreviewTexturestopPreview

0
 
    @CalledByNative 
    public int startCapture() { 
        if (mCamera == null) {
            Log.e(TAG, "startCapture: camera is null");
            return -1; 
        } 
 
        mPreviewBufferLock.lock();
        try { 
            if (mIsRunning) {
                return 0; 
            } 
            mIsRunning = true;
        } finally { 
            mPreviewBufferLock.unlock();
        } 
        mCamera.setPreviewCallbackWithBuffer(this);
        mCamera.startPreview();
        return 0; 
    } 
 
    @CalledByNative 
    public int stopCapture() { 
        if (mCamera == null) {
            Log.e(TAG, "stopCapture: camera is null");
            return 0;