Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
usb_cam::UsbCam Class Reference

#include <usb_cam.h>

List of all members.

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 &param, int value)
void set_v4l_parameter (const std::string &param, 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_
bufferbuffers_
std::string camera_dev_
int fd_
camera_image_timage_
io_method io_
bool monochrome_
unsigned int n_buffers_
unsigned int pixelformat_
struct SwsContext * video_sws_

Detailed Description

Definition at line 62 of file usb_cam.h.


Member Enumeration Documentation

Enumerator:
IO_METHOD_READ 
IO_METHOD_MMAP 
IO_METHOD_USERPTR 
IO_METHOD_UNKNOWN 

Definition at line 64 of file usb_cam.h.

Enumerator:
PIXEL_FORMAT_YUYV 
PIXEL_FORMAT_UYVY 
PIXEL_FORMAT_MJPEG 
PIXEL_FORMAT_YUVMONO10 
PIXEL_FORMAT_RGB24 
PIXEL_FORMAT_UNKNOWN 

Definition at line 69 of file usb_cam.h.


Constructor & Destructor Documentation

Definition at line 356 of file usb_cam.cpp.

Definition at line 361 of file usb_cam.cpp.


Member Function Documentation

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.

Parameters:
paramThe name of the parameter to set
paramThe 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.

Parameters:
paramThe name of the parameter to set
paramThe 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.


Member Data Documentation

AVCodec* usb_cam::UsbCam::avcodec_ [private]

Definition at line 139 of file usb_cam.h.

AVCodecContext* usb_cam::UsbCam::avcodec_context_ [private]

Definition at line 141 of file usb_cam.h.

Definition at line 137 of file usb_cam.h.

Definition at line 142 of file usb_cam.h.

AVFrame* usb_cam::UsbCam::avframe_rgb_ [private]

Definition at line 138 of file usb_cam.h.

Definition at line 143 of file usb_cam.h.

AVDictionary* usb_cam::UsbCam::avoptions_ [private]

Definition at line 140 of file usb_cam.h.

Definition at line 135 of file usb_cam.h.

std::string usb_cam::UsbCam::camera_dev_ [private]

Definition at line 130 of file usb_cam.h.

int usb_cam::UsbCam::fd_ [private]

Definition at line 134 of file usb_cam.h.

Definition at line 145 of file usb_cam.h.

Definition at line 133 of file usb_cam.h.

Definition at line 132 of file usb_cam.h.

unsigned int usb_cam::UsbCam::n_buffers_ [private]

Definition at line 136 of file usb_cam.h.

unsigned int usb_cam::UsbCam::pixelformat_ [private]

Definition at line 131 of file usb_cam.h.

struct SwsContext* usb_cam::UsbCam::video_sws_ [private]

Definition at line 144 of file usb_cam.h.


The documentation for this class was generated from the following files:


usb_cam
Author(s): Benjamin Pitzer
autogenerated on Wed Aug 26 2015 16:38:37