Fawkes API
Fawkes Development Version
|
24 #include <fvcams/v4l.h>
25 #include <sys/ioctl.h>
32 # include <fvcams/v4l1.h>
33 # include <linux/videodev.h>
37 # include <fvcams/v4l2.h>
38 # include <linux/videodev2.h>
41 #include <core/exception.h>
42 #include <core/exceptions/software.h>
43 #include <fvutils/system/camargp.h>
45 namespace firevision {
60 _device_name = strdup(device_name);
72 if (cap->
has(
"device"))
73 _device_name = strdup(cap->
get(
"device").c_str());
92 int dev =
::open(_device_name, O_RDWR);
97 struct video_capability caps1;
100 struct v4l2_capability caps2;
104 if (ioctl(dev, VIDIOC_QUERYCAP, &caps2)) {
107 if (ioctl(dev, VIDIOCGCAP, &caps1)) {
116 _v4l_cam =
new V4L2Camera(_device_name, dev);
170 return (_v4l_cam ? _v4l_cam->
ready() :
false);
176 return (_v4l_cam ? _v4l_cam->
buffer() : NULL);
213 return (_v4l_cam ? _v4l_cam->
colorspace() : CS_UNKNOWN);
virtual unsigned int pixel_width()
virtual void print_info()
virtual unsigned int pixel_height()
virtual colorspace_t colorspace()=0
virtual unsigned int buffer_size()=0
virtual void dispose_buffer()=0
V4LCamera(const char *device_name="/dev/video0")
Constructor.
virtual unsigned char * buffer()=0
virtual unsigned int pixel_height()=0
virtual void print_info()=0
virtual ~V4LCamera()
Destructor.
bool has(std::string s) const
Check if an parameter was given.
virtual void set_image_number(unsigned int n)=0
virtual unsigned int pixel_width()=0
virtual void set_image_number(unsigned int n)
virtual colorspace_t colorspace()
virtual unsigned int buffer_size()
std::string get(std::string s) const
Get the value of the given parameter.
virtual unsigned char * buffer()
virtual void dispose_buffer()