#ifndef _OF_VIDEO_GRABBER
#define _OF_VIDEO_GRABBER

#include "ofConstants.h"
#include "ofTexture.h"
#include "ofGraphics.h"


#ifdef OF_VIDEO_CAPTURE_QUICKTIME
	#include "ofQtUtils.h"
#endif

#ifdef OF_VIDEO_CAPTURE_DIRECTSHOW
	#include "videoInput.h"
#endif

// todo:
// 		-callback, via SGSetDataProc - couldn't get this to work yet
// 		image decompress options ala mung...


class ofVideoGrabber{

	public :
	
		ofVideoGrabber();		
		
		void 			listDevices();
		bool 			isFrameNew();
		void			grabFrame();
		void			close();
		void 			initGrabber(int w, int h);
		void			initGrabber(int w, int h, bool bTexture);
		void			videoSettings();
		unsigned char 	* getPixels();
		void 			setVerbose(bool bTalkToMe);
		void			setDeviceID(int _deviceID);
		void 			setUseTexture(bool bUse);
		void 			draw(float x, float y, float w, float h);	
		void 			draw(float x, float y);	
		
		int 			width, height;
		
	private:
		
		
		bool					bChooseDevice;
		int						deviceID;
		bool					bUseTexture;
		ofTexture 				tex;
		bool 					bVerbose;
		bool 					bSgGrabberInited;
	        
		//--------------------------------- quicktime
		#ifdef OF_VIDEO_CAPTURE_QUICKTIME
			videoGrabberData * 		vgd;
		#endif 
	
		//--------------------------------- directshow
		#ifdef OF_VIDEO_CAPTURE_DIRECTSHOW
			int 					device;
			unsigned char 			* pixels;
			bool 					bFrameNew;
			videoInput 				VI;
		#endif 
		
}; 




#endif
