// Path: src/main/java/au/edu/jcu/v4l4j/exceptions/ImageFormatException.java
// public class ImageFormatException extends V4L4JException {
// 
// 	private static final long serialVersionUID = -3338859321078232443L;
// 
// 	public ImageFormatException(String message) {
// 		super(message);
// 	}
// 
// 	public ImageFormatException(String message, Throwable throwable) {
// 		super(message, throwable);
// 	}
// 
// 	public ImageFormatException(Throwable throwable) {
// 		super(throwable);
// 	}
// }
// 
// 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);
// 	}
// }


import java.util.concurrent.ThreadFactory;
import au.edu.jcu.v4l4j.exceptions.ImageFormatException;
import au.edu.jcu.v4l4j.exceptions.StateException;
/*
* Copyright (C) 2007-2008 Gilles Gigan (gilles.gigan@gmail.com)
* eResearch Centre, James Cook University (eresearch.jcu.edu.au)
*
* This program was developed as part of the ARCHER project
* (Australian Research Enabling Environment) funded by a   
* Systemic Infrastructure Initiative (SII) grant and supported by the Australian
* Department of Innovation, Industry, Science and Research
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public  License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.  
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
*/

package au.edu.jcu.v4l4j;



/**
 * This class provides methods to capture raw frames from a {@link VideoDevice}.
 * Raw means that the image format will be left untouched and passed on straight
 * away to the caller. v4l4j also provides additional frame grabber classes 
 * which encodes frames in a specific format before handing them out.
 * <code>FrameGrabber</code> objects are not instantiated directly. Instead, the 
 * {@link VideoDevice#getRawFrameGrabber(int, int, int, int) getRawFrameGrabber()}
 * method must be called on the associated {@link VideoDevice}. Raw frame grabbers
 * implement the {@link FrameGrabber} interface which provides methods to handle
 * video capture. See {@link FrameGrabber its documentation} for more information.
 * 
 * @see FrameGrabber {@link FrameGrabber}
 * @see JPEGFrameGrabber {@link RGBFrameGrabber}
 * @author gilles
 *
 */
public class RawFrameGrabber extends AbstractGrabber {
	/**
	 * This constructor builds a raw FrameGrabber object used to raw frames 
	 * from a video source.
	 * @param di the DeviceInfo of the VideoDevice who created this frame grabber
	 * @param o a JNI pointer to the v4l4j_device structure
	 * @param w the requested frame width 
	 * @param h the requested frame height
	 * @param ch the input index, as returned by
	 * <code>InputInfo.getIndex()</code>
	 * @param std the video standard, as returned by 
	 * <code>InputInfo.getSupportedStandards()</code> (see V4L4JConstants)
	 * @param t the {@link Tuner} associated with this frame grabber or
	 * <code>null</code>.
	 * @param imf the image format frames should be captured in
	 * @param factory the thread factory to sue when creating the push source
	 * @throws ImageFormatException if the image format is null and a RAW frame 
	 * grabber is to be created  
	 */
	RawFrameGrabber(DeviceInfo di, long o, int w, int h, int ch, 
// Path: src/main/java/au/edu/jcu/v4l4j/exceptions/ImageFormatException.java
// public class ImageFormatException extends V4L4JException {
// 
// 	private static final long serialVersionUID = -3338859321078232443L;
// 
// 	public ImageFormatException(String message) {
// 		super(message);
// 	}
// 
// 	public ImageFormatException(String message, Throwable throwable) {
// 		super(message, throwable);
// 	}
// 
// 	public ImageFormatException(Throwable throwable) {
// 		super(throwable);
// 	}
// }
// 
// 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/RawFrameGrabber.java
import java.util.concurrent.ThreadFactory;
import au.edu.jcu.v4l4j.exceptions.ImageFormatException;
import au.edu.jcu.v4l4j.exceptions.StateException;

/*
* Copyright (C) 2007-2008 Gilles Gigan (gilles.gigan@gmail.com)
* eResearch Centre, James Cook University (eresearch.jcu.edu.au)
*
* This program was developed as part of the ARCHER project
* (Australian Research Enabling Environment) funded by a   
* Systemic Infrastructure Initiative (SII) grant and supported by the Australian
* Department of Innovation, Industry, Science and Research
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public  License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.  
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
*/

package au.edu.jcu.v4l4j;



/**
 * This class provides methods to capture raw frames from a {@link VideoDevice}.
 * Raw means that the image format will be left untouched and passed on straight
 * away to the caller. v4l4j also provides additional frame grabber classes 
 * which encodes frames in a specific format before handing them out.
 * <code>FrameGrabber</code> objects are not instantiated directly. Instead, the 
 * {@link VideoDevice#getRawFrameGrabber(int, int, int, int) getRawFrameGrabber()}
 * method must be called on the associated {@link VideoDevice}. Raw frame grabbers
 * implement the {@link FrameGrabber} interface which provides methods to handle
 * video capture. See {@link FrameGrabber its documentation} for more information.
 * 
 * @see FrameGrabber {@link FrameGrabber}
 * @see JPEGFrameGrabber {@link RGBFrameGrabber}
 * @author gilles
 *
 */
public class RawFrameGrabber extends AbstractGrabber {
	/**
	 * This constructor builds a raw FrameGrabber object used to raw frames 
	 * from a video source.
	 * @param di the DeviceInfo of the VideoDevice who created this frame grabber
	 * @param o a JNI pointer to the v4l4j_device structure
	 * @param w the requested frame width 
	 * @param h the requested frame height
	 * @param ch the input index, as returned by
	 * <code>InputInfo.getIndex()</code>
	 * @param std the video standard, as returned by 
	 * <code>InputInfo.getSupportedStandards()</code> (see V4L4JConstants)
	 * @param t the {@link Tuner} associated with this frame grabber or
	 * <code>null</code>.
	 * @param imf the image format frames should be captured in
	 * @param factory the thread factory to sue when creating the push source
	 * @throws ImageFormatException if the image format is null and a RAW frame 
	 * grabber is to be created  
	 */
	RawFrameGrabber(DeviceInfo di, long o, int w, int h, int ch, 
			int std, Tuner t, ImageFormat imf, ThreadFactory factory) throws ImageFormatException{