Code example for Semaphore

Methods: tryAcquire

0
        public void onError(int error, android.hardware.Camera camera) {
            if (error == android.hardware.Camera.CAMERA_ERROR_SERVER_DIED) {
                assertTrue("Camera test mediaserver died", false);
            } 
        } 
    } 
 
    private ShutterCallback shutterCallback = new ShutterCallback() {
        @Override 
        public void onShutter() { 
            Log.v(TAG, "Shutter"); 
        } 
    }; 
 
    private PictureCallback rawCallback = new PictureCallback() {
        @Override 
        public void onPictureTaken(byte[] data, Camera camera) { 
            Log.v(TAG, "Raw picture taken"); 
        } 
    }; 
 
    private PictureCallback jpegCallback = new PictureCallback() {