#include <usb_cam.h>
Classes | |
struct | buffer |
struct | camera_image_t |
Public Types | |
enum | io_method { IO_METHOD_READ, IO_METHOD_MMAP, IO_METHOD_USERPTR, IO_METHOD_UNKNOWN } |
enum | pixel_format { PIXEL_FORMAT_YUYV, PIXEL_FORMAT_UYVY, PIXEL_FORMAT_MJPEG, PIXEL_FORMAT_YUVMONO10, PIXEL_FORMAT_RGB24, PIXEL_FORMAT_UNKNOWN } |
Public Member Functions | |
void | grab_image (sensor_msgs::Image *image) |
void | set_auto_focus (int value) |
void | set_v4l_parameter (const std::string ¶m, int value) |
void | set_v4l_parameter (const std::string ¶m, const std::string &value) |
void | shutdown (void) |
void | start (const std::string &dev, io_method io, pixel_format pf, int image_width, int image_height, int framerate) |
UsbCam () | |
~UsbCam () | |
Static Public Member Functions | |
static io_method | io_method_from_string (const std::string &str) |
static pixel_format | pixel_format_from_string (const std::string &str) |
Private Member Functions | |
void | close_device (void) |
void | grab_image () |
void | init_device (int image_width, int image_height, int framerate) |
int | init_mjpeg_decoder (int image_width, int image_height) |
void | init_mmap (void) |
void | init_read (unsigned int buffer_size) |
void | init_userp (unsigned int buffer_size) |
void | mjpeg2rgb (char *MJPEG, int len, char *RGB, int NumPixels) |
void | open_device (void) |
void | process_image (const void *src, int len, camera_image_t *dest) |
int | read_frame () |
void | start_capturing (void) |
void | stop_capturing (void) |
void | uninit_device (void) |
Private Attributes | |
AVCodec * | avcodec_ |
AVCodecContext * | avcodec_context_ |
AVFrame * | avframe_camera_ |
int | avframe_camera_size_ |
AVFrame * | avframe_rgb_ |
int | avframe_rgb_size_ |
AVDictionary * | avoptions_ |
buffer * | buffers_ |
std::string | camera_dev_ |
int | fd_ |
camera_image_t * | image_ |
io_method | io_ |
bool | monochrome_ |
unsigned int | n_buffers_ |
unsigned int | pixelformat_ |
struct SwsContext * | video_sws_ |
Definition at line 356 of file usb_cam.cpp.
Definition at line 361 of file usb_cam.cpp.
void usb_cam::UsbCam::close_device | ( | void | ) | [private] |
Definition at line 954 of file usb_cam.cpp.
void usb_cam::UsbCam::grab_image | ( | sensor_msgs::Image * | image | ) |
Definition at line 1059 of file usb_cam.cpp.
void usb_cam::UsbCam::grab_image | ( | ) | [private] |
Definition at line 1078 of file usb_cam.cpp.
void usb_cam::UsbCam::init_device | ( | int | image_width, |
int | image_height, | ||
int | framerate | ||
) | [private] |
Definition at line 815 of file usb_cam.cpp.
int usb_cam::UsbCam::init_mjpeg_decoder | ( | int | image_width, |
int | image_height | ||
) | [private] |
Definition at line 366 of file usb_cam.cpp.
void usb_cam::UsbCam::init_mmap | ( | void | ) | [private] |
Definition at line 706 of file usb_cam.cpp.
void usb_cam::UsbCam::init_read | ( | unsigned int | buffer_size | ) | [private] |
Definition at line 686 of file usb_cam.cpp.
void usb_cam::UsbCam::init_userp | ( | unsigned int | buffer_size | ) | [private] |
Definition at line 766 of file usb_cam.cpp.
UsbCam::io_method usb_cam::UsbCam::io_method_from_string | ( | const std::string & | str | ) | [static] |
Definition at line 1194 of file usb_cam.cpp.
void usb_cam::UsbCam::mjpeg2rgb | ( | char * | MJPEG, |
int | len, | ||
char * | RGB, | ||
int | NumPixels | ||
) | [private] |
Definition at line 404 of file usb_cam.cpp.
void usb_cam::UsbCam::open_device | ( | void | ) | [private] |
Definition at line 962 of file usb_cam.cpp.
UsbCam::pixel_format usb_cam::UsbCam::pixel_format_from_string | ( | const std::string & | str | ) | [static] |
Definition at line 1206 of file usb_cam.cpp.
void usb_cam::UsbCam::process_image | ( | const void * | src, |
int | len, | ||
camera_image_t * | dest | ||
) | [private] |
Definition at line 457 of file usb_cam.cpp.
int usb_cam::UsbCam::read_frame | ( | ) | [private] |
Definition at line 478 of file usb_cam.cpp.
void usb_cam::UsbCam::set_auto_focus | ( | int | value | ) |
Definition at line 1112 of file usb_cam.cpp.
void usb_cam::UsbCam::set_v4l_parameter | ( | const std::string & | param, |
int | value | ||
) |
Set video device parameter via call to v4l-utils.
param | The name of the parameter to set |
param | The value to assign |
Definition at line 1158 of file usb_cam.cpp.
void usb_cam::UsbCam::set_v4l_parameter | ( | const std::string & | param, |
const std::string & | value | ||
) |
Set video device parameter via call to v4l-utils.
param | The name of the parameter to set |
param | The value to assign |
Definition at line 1168 of file usb_cam.cpp.
void usb_cam::UsbCam::shutdown | ( | void | ) |
Definition at line 1036 of file usb_cam.cpp.
void usb_cam::UsbCam::start | ( | const std::string & | dev, |
io_method | io, | ||
pixel_format | pf, | ||
int | image_width, | ||
int | image_height, | ||
int | framerate | ||
) |
Definition at line 987 of file usb_cam.cpp.
void usb_cam::UsbCam::start_capturing | ( | void | ) | [private] |
Definition at line 602 of file usb_cam.cpp.
void usb_cam::UsbCam::stop_capturing | ( | void | ) | [private] |
Definition at line 581 of file usb_cam.cpp.
void usb_cam::UsbCam::uninit_device | ( | void | ) | [private] |
Definition at line 661 of file usb_cam.cpp.
AVCodec* usb_cam::UsbCam::avcodec_ [private] |
AVCodecContext* usb_cam::UsbCam::avcodec_context_ [private] |
AVFrame* usb_cam::UsbCam::avframe_camera_ [private] |
int usb_cam::UsbCam::avframe_camera_size_ [private] |
AVFrame* usb_cam::UsbCam::avframe_rgb_ [private] |
int usb_cam::UsbCam::avframe_rgb_size_ [private] |
AVDictionary* usb_cam::UsbCam::avoptions_ [private] |
buffer* usb_cam::UsbCam::buffers_ [private] |
std::string usb_cam::UsbCam::camera_dev_ [private] |
int usb_cam::UsbCam::fd_ [private] |
camera_image_t* usb_cam::UsbCam::image_ [private] |
io_method usb_cam::UsbCam::io_ [private] |
bool usb_cam::UsbCam::monochrome_ [private] |
unsigned int usb_cam::UsbCam::n_buffers_ [private] |
unsigned int usb_cam::UsbCam::pixelformat_ [private] |
struct SwsContext* usb_cam::UsbCam::video_sws_ [private] |