#include <v4l.h>

Public Member Functions | |
| bool | GrabNewest (unsigned char *image, bool wait=true) |
| bool | GrabNext (unsigned char *image, bool wait=true) |
| unsigned | Height () const |
| std::string | PixFormat () const |
| size_t | SizeBytes () const |
| void | Start () |
| Implement VideoSource::Start() | |
| void | Stop () |
| Implement VideoSource::Stop() | |
| V4lVideo (const char *dev_name, io_method io=IO_METHOD_MMAP) | |
| unsigned | Width () const |
| ~V4lVideo () | |
Protected Member Functions | |
| void | close_device () |
| void | init_device (const char *dev_name, unsigned iwidth, unsigned iheight, unsigned ifps, unsigned v4l_format=V4L2_PIX_FMT_YUYV, v4l2_field field=V4L2_FIELD_INTERLACED) |
| void | init_mmap (const char *dev_name) |
| void | init_read (unsigned int buffer_size) |
| void | init_userp (const char *dev_name, unsigned int buffer_size) |
| void | Mainloop () |
| void | open_device (const char *dev_name) |
| int | ReadFrame (unsigned char *image) |
| void | uninit_device () |
Protected Attributes | |
| buffer * | buffers |
| int | fd |
| float | fps |
| unsigned | height |
| size_t | image_size |
| io_method | io |
| unsigned int | n_buffers |
| bool | running |
| unsigned | width |
| pangolin::V4lVideo::V4lVideo | ( | const char * | dev_name, |
| io_method | io = IO_METHOD_MMAP |
||
| ) |
| void pangolin::V4lVideo::close_device | ( | ) | [protected] |
| bool pangolin::V4lVideo::GrabNewest | ( | unsigned char * | image, |
| bool | wait = true |
||
| ) | [virtual] |
Copy the newest frame from the camera to image discarding all older frames. Optionally wait for a frame if one isn't ready Returns true iff image was copied
Implements pangolin::VideoInterface.
| bool pangolin::V4lVideo::GrabNext | ( | unsigned char * | image, |
| bool | wait = true |
||
| ) | [virtual] |
Copy the next frame from the camera to image. Optionally wait for a frame if one isn't ready Returns true iff image was copied
Implements pangolin::VideoInterface.
| unsigned pangolin::V4lVideo::Height | ( | ) | const [virtual] |
Implements pangolin::VideoInterface.
| void pangolin::V4lVideo::init_device | ( | const char * | dev_name, |
| unsigned | iwidth, | ||
| unsigned | iheight, | ||
| unsigned | ifps, | ||
| unsigned | v4l_format = V4L2_PIX_FMT_YUYV, |
||
| v4l2_field | field = V4L2_FIELD_INTERLACED |
||
| ) | [protected] |
| void pangolin::V4lVideo::init_mmap | ( | const char * | dev_name | ) | [protected] |
| void pangolin::V4lVideo::init_read | ( | unsigned int | buffer_size | ) | [protected] |
| void pangolin::V4lVideo::init_userp | ( | const char * | dev_name, |
| unsigned int | buffer_size | ||
| ) | [protected] |
| void pangolin::V4lVideo::Mainloop | ( | ) | [protected] |
| void pangolin::V4lVideo::open_device | ( | const char * | dev_name | ) | [protected] |
| std::string pangolin::V4lVideo::PixFormat | ( | ) | const [virtual] |
Implements pangolin::VideoInterface.
| int pangolin::V4lVideo::ReadFrame | ( | unsigned char * | image | ) | [protected] |
| size_t pangolin::V4lVideo::SizeBytes | ( | ) | const [virtual] |
Implements pangolin::VideoInterface.
| void pangolin::V4lVideo::Start | ( | ) | [virtual] |
Implement VideoSource::Start()
Implements pangolin::VideoInterface.
| void pangolin::V4lVideo::Stop | ( | ) | [virtual] |
Implement VideoSource::Stop()
Implements pangolin::VideoInterface.
| void pangolin::V4lVideo::uninit_device | ( | ) | [protected] |
| unsigned pangolin::V4lVideo::Width | ( | ) | const [virtual] |
Implements pangolin::VideoInterface.
buffer* pangolin::V4lVideo::buffers [protected] |
int pangolin::V4lVideo::fd [protected] |
float pangolin::V4lVideo::fps [protected] |
unsigned pangolin::V4lVideo::height [protected] |
size_t pangolin::V4lVideo::image_size [protected] |
io_method pangolin::V4lVideo::io [protected] |
unsigned int pangolin::V4lVideo::n_buffers [protected] |
bool pangolin::V4lVideo::running [protected] |
unsigned pangolin::V4lVideo::width [protected] |