// Path: src/main/java/au/edu/jcu/v4l4j/exceptions/StateException.java
// public class StateException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 1351714754008657462L;
// 
// 	public StateException(String message) {
// 		super(message);
// 	}
// 
// 	public StateException(String message, Throwable throwable) {
// 		super(message, throwable);
// 	}
// 
// 	public StateException(Throwable throwable) {
// 		super(throwable);
// 	}
// }
// 
// Path: src/main/java/au/edu/jcu/v4l4j/exceptions/UnsupportedMethod.java
// public class UnsupportedMethod extends RuntimeException {
// 	private static final long serialVersionUID = -8801339441741012577L;
// 
// 	public UnsupportedMethod(String message) {
// 		super(message);
// 	}
// 
// 	public UnsupportedMethod(String message, Throwable throwable) {
// 		super(message, throwable);
// 	}
// 
// 	public UnsupportedMethod(Throwable throwable) {
// 		super(throwable);
// 	}
// }


import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.WritableRaster;
import au.edu.jcu.v4l4j.exceptions.StateException;
import au.edu.jcu.v4l4j.exceptions.UnsupportedMethod;
	protected WritableRaster refreshRaster() {
		if (raster == null)
			throw new UnsupportedMethod("A raster can not be generated for this "
					+ "image format ("+frameGrabber.getImageFormat().toString()+")");

		return raster;
	}

	/**
	 * Subclasses can override this method to either
	 * return a {@link BufferedImage} for this video frame, or throw
	 * a {@link UnsupportedMethod} exception if this video frame cannot
	 * generate a {@link BufferedImage}.
	 * @return  a {@link BufferedImage}.
	 * @throws UnsupportedMethod exception if a buffered image cannot be generated
	 * for this video frame (because of its image format for instance) 
	 */
	protected BufferedImage refreshBufferedImage() {
		if (bufferedImage == null)
			throw new UnsupportedMethod("A Bufferedimage can not be generated for this "
					+ "image format ("+frameGrabber.getImageFormat().toString()+")");

		return bufferedImage;
	}
	
	/**
	 * This method must be called with this video frame lock held, and
	 * throws a {@link StateException} if it is recycled.
	 * @throws StateException if this video frame is recycled.
	 */
// Path: src/main/java/au/edu/jcu/v4l4j/exceptions/StateException.java
// public class StateException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 1351714754008657462L;
// 
// 	public StateException(String message) {
// 		super(message);
// 	}
// 
// 	public StateException(String message, Throwable throwable) {
// 		super(message, throwable);
// 	}
// 
// 	public StateException(Throwable throwable) {
// 		super(throwable);
// 	}
// }
// 
// Path: src/main/java/au/edu/jcu/v4l4j/exceptions/UnsupportedMethod.java
// public class UnsupportedMethod extends RuntimeException {
// 	private static final long serialVersionUID = -8801339441741012577L;
// 
// 	public UnsupportedMethod(String message) {
// 		super(message);
// 	}
// 
// 	public UnsupportedMethod(String message, Throwable throwable) {
// 		super(message, throwable);
// 	}
// 
// 	public UnsupportedMethod(Throwable throwable) {
// 		super(throwable);
// 	}
// }


// Path: src/main/java/au/edu/jcu/v4l4j/BaseVideoFrame.java
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.WritableRaster;
import au.edu.jcu.v4l4j.exceptions.StateException;
import au.edu.jcu.v4l4j.exceptions.UnsupportedMethod;

	protected WritableRaster refreshRaster() {
		if (raster == null)
			throw new UnsupportedMethod("A raster can not be generated for this "
					+ "image format ("+frameGrabber.getImageFormat().toString()+")");

		return raster;
	}

	/**
	 * Subclasses can override this method to either
	 * return a {@link BufferedImage} for this video frame, or throw
	 * a {@link UnsupportedMethod} exception if this video frame cannot
	 * generate a {@link BufferedImage}.
	 * @return  a {@link BufferedImage}.
	 * @throws UnsupportedMethod exception if a buffered image cannot be generated
	 * for this video frame (because of its image format for instance) 
	 */
	protected BufferedImage refreshBufferedImage() {
		if (bufferedImage == null)
			throw new UnsupportedMethod("A Bufferedimage can not be generated for this "
					+ "image format ("+frameGrabber.getImageFormat().toString()+")");

		return bufferedImage;
	}
	
	/**
	 * This method must be called with this video frame lock held, and
	 * throws a {@link StateException} if it is recycled.
	 * @throws StateException if this video frame is recycled.
	 */
	private final void checkIfRecycled() throws StateException {