code: @Override
  	public final void stopCapture(){
  		state.stop();
  		// At this stage, further calls to getVideoFrame() will throw an exception..
  		// However, the push thread might still be blocked in getVideoFrame().
  
  		// The push thread blocked in getVideoFrame() can be blocked either:
  		// 1) in getAvailableVideoFrame(), waiting for an available frame
  		// OR
  		// 2) in fillBuffer(), waiting for a V4L buffer
  
  		// If the push thread is blocked in 1), we can wake it up by interrupting it.
  		// If the push thread is blocked in 2), tell the JNI layer to stop the capture
  		// which will wake up the push thread blocked in fillBuffer() with an error.
  
  		// unblock thread in 1): stop the push source
  		pushSource.stopCapture();
  
  		// unblock thread in 2): tell libvideo to stop capture
  		stop(object);
  
  		// wait for thread blocked in 2) to return
  		state.waitTillNoMoreUsers();
  
  		// at this stage, we know that no one is waiting in getVideoFrame() anymore,
  		// and further calls to it will throw a StateException.		
  
  		// Make sure all video frames are recycled
  		for(VideoFrame frame: videoFrames)
  			frame.recycle();
  
  		// remove all frames from available queue
  		synchronized(availableVideoFrames) {
  			availableVideoFrames.removeAllElements();
  		}
  
  		// commit new state
  		state.commit();
  	}
docs: /* (non-Javadoc)
  @see au.edu.jcu.v4l4j.FrameGrabber#stopCapture()