@Override
	public final void startCapture() throws V4L4JException {
		state.start();

		// make sure we have a push source
		if(pushSource == null) {
			state.rollback();
			throw new V4L4JException("setCaptureCallback() must be called with a valid "
					+ "callback object before startCapture()"); 
		}

		// start the push source and wait until it's blocked on getVideoFrame()
		pushSource.startCapture();
		state.waitForAtLeastOneUser();

		try {
			// start video capture and enqueue all buffers
			start(object);
		} catch (V4L4JException e) {
			// Error starting the capture...

			// stop the push source thread
			pushSource.stopCapture();

			// return to previous state
			state.rollback();

			// propagate exception
			throw e;
		}

		// change state to STARTED
		state.commit();

		// put all frames into the available queue and wake up push source thread
		synchronized(availableVideoFrames){
			availableVideoFrames.addAll(videoFrames);
			availableVideoFrames.notifyAll();
		}
	}
@ Override public final void startCapture ( ) throws V4L4JException { state . start ( ) ; if ( pushSource == null ) { state . rollback ( ) ; throw new V4L4JException ( "setCaptureCallback() must be called with a valid " + "callback object before startCapture()" ) ; } pushSource . startCapture ( ) ; state . waitForAtLeastOneUser ( ) ; try { start ( object ) ; } catch ( V4L4JException e ) { pushSource . stopCapture ( ) ; state . rollback ( ) ; throw e ; } state . commit ( ) ; synchronized ( availableVideoFrames ) { availableVideoFrames . addAll ( videoFrames ) ; availableVideoFrames . notifyAll ( ) ; } }
/* (non-Javadoc)
@see au.edu.jcu.v4l4j.FrameGrabber#startCapture()