31 #include <sys/ioctl.h>
34 #include <linux/videodev2.h>
36 #define VCAP_DEFAULT_VIDEODEV "/dev/video0"
37 #define VCAP_DEFAULT_OUTPUTFILE "vcap.jpg"
38 #define VCAP_DEFAULT_WIDTH 640
39 #define VCAP_DEFAULT_HEIGHT 480
40 #define VCAP_DEFAULT_JPEG_QUALITY 99
77 VCAP(std::string videoDev=VCAP_DEFAULT_VIDEODEV);
112 bool saveImage(std::string filename=VCAP_DEFAULT_OUTPUTFILE);
164 m_debugging = enable;
169 bool initVideoDevice();
172 bool checkCapabilities();
175 bool YUYV2JPEG(FILE *file);
179 void releaseBuffer();
182 bool doCaptureImage();
186 int xioctl(
int fd,
int request,
void* argp);
188 std::string m_videoDevice;
194 struct v4l2_capability m_caps;
195 struct v4l2_format m_format;
198 unsigned char *m_buffer;
207 bool m_imageCaptured;
void setDebug(bool enable)
Definition: vcap.hpp:162
API for the Video Capture driver.
Definition: vcap.hpp:69
int getWidth() const
Definition: vcap.hpp:121
~VCAP()
Definition: vcap.cxx:61
void setJPGQuality(unsigned int quality)
Definition: vcap.cxx:521
int getHeight() const
Definition: vcap.hpp:133
VCAP(std::string videoDev=VCAP_DEFAULT_VIDEODEV)
Definition: vcap.cxx:40
bool captureImage()
Definition: vcap.cxx:417
bool saveImage(std::string filename=VCAP_DEFAULT_OUTPUTFILE)
Definition: vcap.cxx:383
bool setResolution(int width, int height)
Definition: vcap.cxx:141
int getJPGQuality() const
Definition: vcap.hpp:152