Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes
V4RCam Class Reference

v4l2 camera abstraction More...

#include <v4r_uvc.h>

Inheritance diagram for V4RCam:
Inheritance graph
[legend]

List of all members.

Classes

class  ControlEntry
 shared pointer for v4l2 control entries More...

Public Types

typedef boost::shared_ptr
< ControlEntry
ControlEntryPtr
typedef int FD
typedef boost::shared_ptr
< v4l2_control > 
v4l2_controlPtr

Public Member Functions

const std::vector
< ControlEntryPtr > & 
detectControlEnties ()
ControlEntryPtr getControlEntry (std::string varName)
bool grab ()
 destructor
bool hasErrorMsg () const
bool hasInfoMsg () const
FD initCamera (const std::string &videoDevice="")
 vector of the current supported control entries
bool isBlackListed (int control)
int load_controls (const std::string &filename)
std::string pullErrorMsg ()
std::string pullInfoMsg ()
int save_controls (const std::string &filename)
int v4lget (ControlEntryPtr entry)
int v4lgetInfo (ControlEntryPtr entry)
 v4lcontrols
int v4lset (ControlEntryPtr entry)
int v4lupdate (ControlEntryPtr entry)
 V4RCam ()
 shared pointer for ControlEntry
 ~V4RCam ()
 construtor

Static Public Member Functions

static char removeNonAlNum (char in)

Static Public Attributes

static const int ERROR = 1
static const int LOAD = 1
static const int NA = 0
static const int OK = 0
static const int SAVE = 2

Protected Attributes

std::string aviFilename_
 device name /dev/videoX
std::vector< ControlEntryPtrcontrolEntries_
 mutex to secure critical sections
double durationLastFrame_
 time stamp of the last frame
std::stringstream error_msg_
int format_
 not supported yet
float fps_
 image height
int grabmethod_
 image formate
int height_
 image width
std::stringstream info_msg_
boost::interprocess::interprocess_mutex mutexImage_
 duration between last and the frame before the last one
vdInpVideoIn_
timeval timeLastFrame_
 frames per second
std::string videoDevice_
 pointer to the v4l2 device
int width_

Detailed Description

v4l2 camera abstraction

Definition at line 40 of file v4r_uvc.h.


Member Typedef Documentation

typedef boost::shared_ptr<ControlEntry> V4RCam::ControlEntryPtr

Definition at line 71 of file v4r_uvc.h.

typedef int V4RCam::FD

Definition at line 48 of file v4r_uvc.h.

typedef boost::shared_ptr<v4l2_control> V4RCam::v4l2_controlPtr

Definition at line 49 of file v4r_uvc.h.


Constructor & Destructor Documentation

shared pointer for ControlEntry

Definition at line 67 of file v4r_uvc.cpp.

construtor

Definition at line 58 of file v4r_uvc.cpp.


Member Function Documentation

detects the supporting v4l controls of the device

Returns:
controls

Definition at line 352 of file v4r_uvc.cpp.

Definition at line 449 of file v4r_uvc.cpp.

bool V4RCam::grab ( )

destructor

grabs the next image from the butter

Returns:
false on an error or problem

Definition at line 105 of file v4r_uvc.cpp.

bool V4RCam::hasErrorMsg ( ) const
Returns:
to if there are whaiting error messages

Definition at line 344 of file v4r_uvc.cpp.

bool V4RCam::hasInfoMsg ( ) const
Returns:
to if there are whaiting info messages

Definition at line 348 of file v4r_uvc.cpp.

V4RCam::FD V4RCam::initCamera ( const std::string &  videoDevice = "")

vector of the current supported control entries

Initializedes a video device

Parameters:
videoDevicelike /dev/video0
Returns:
fd to the video device (integer) usabel for v4l2_ioctl calles

Definition at line 80 of file v4r_uvc.cpp.

bool V4RCam::isBlackListed ( int  control)

check if a control is backlisted

Parameters:
control
Returns:
true if it is backlisted
int V4RCam::load_controls ( const std::string &  filename)

loads control entries to a file

Returns:
error >= 1, ok = 0 details are written into info_msg_ and entry.error_msg_
See also:
pullErrorMsg pullInfoMsg hasErrorMsg hasInfoMsg

Definition at line 425 of file v4r_uvc.cpp.

std::string V4RCam::pullErrorMsg ( )
Returns:
error messages

Definition at line 332 of file v4r_uvc.cpp.

std::string V4RCam::pullInfoMsg ( )
Returns:
info messages

Definition at line 338 of file v4r_uvc.cpp.

char V4RCam::removeNonAlNum ( char  in) [static]

Definition at line 51 of file v4r_uvc.cpp.

int V4RCam::save_controls ( const std::string &  filename)

saves control entries to a file

Returns:
error >= 1, ok = 0 details are written into info_msg_ and entry.error_msg_
See also:
pullErrorMsg pullInfoMsg hasErrorMsg hasInfoMsg

Definition at line 388 of file v4r_uvc.cpp.

reads a control entry and stores the value into entry.currentValue

Parameters:
entryentry to get
Returns:
error >= 1, ok = 0 details are written into entry.error_msg and entry.info_msg
Precondition:
v4lgetInfo must be called at least one befor with this control instance

Definition at line 161 of file v4r_uvc.cpp.

v4lcontrols

Delivers info to a control entry

Parameters:
entryentry to check
Returns:
error >= 1, ok = 0 details are written into entry.error_msg and entry.info_msg

Definition at line 128 of file v4r_uvc.cpp.

sets a control entry using entry.targetValue

Parameters:
entryentry to set
Returns:
error >= 1, ok = 0 details are written into entry.error_msg and entry.info_msg
Precondition:
v4lgetInfo must be called at least one befor with this control instance

Definition at line 181 of file v4r_uvc.cpp.

updates a control entry using entry.targetValue it also checks control min, max, stepsize it also verifies the written data by reading the value again into entry.currentValue

Parameters:
entryentry to update
Returns:
error >= 1, ok = 0 details are written into entry.error_msg and entry.info_msg
Precondition:
v4lgetInfo must be called at least one befor with this control instance

Definition at line 200 of file v4r_uvc.cpp.


Member Data Documentation

std::string V4RCam::aviFilename_ [protected]

device name /dev/videoX

Definition at line 82 of file v4r_uvc.h.

std::vector<ControlEntryPtr > V4RCam::controlEntries_ [protected]

mutex to secure critical sections

Definition at line 91 of file v4r_uvc.h.

double V4RCam::durationLastFrame_ [protected]

time stamp of the last frame

Definition at line 89 of file v4r_uvc.h.

const int V4RCam::ERROR = 1 [static]

Definition at line 44 of file v4r_uvc.h.

std::stringstream V4RCam::error_msg_ [protected]

Definition at line 179 of file v4r_uvc.h.

int V4RCam::format_ [protected]

not supported yet

Definition at line 83 of file v4r_uvc.h.

float V4RCam::fps_ [protected]

image height

Definition at line 87 of file v4r_uvc.h.

int V4RCam::grabmethod_ [protected]

image formate

Definition at line 84 of file v4r_uvc.h.

int V4RCam::height_ [protected]

image width

Definition at line 86 of file v4r_uvc.h.

std::stringstream V4RCam::info_msg_ [protected]

Definition at line 178 of file v4r_uvc.h.

const int V4RCam::LOAD = 1 [static]

Definition at line 46 of file v4r_uvc.h.

boost::interprocess::interprocess_mutex V4RCam::mutexImage_ [protected]

duration between last and the frame before the last one

Definition at line 90 of file v4r_uvc.h.

const int V4RCam::NA = 0 [static]

Definition at line 45 of file v4r_uvc.h.

const int V4RCam::OK = 0 [static]

Definition at line 43 of file v4r_uvc.h.

vdIn* V4RCam::pVideoIn_ [protected]

Definition at line 80 of file v4r_uvc.h.

const int V4RCam::SAVE = 2 [static]

Definition at line 47 of file v4r_uvc.h.

timeval V4RCam::timeLastFrame_ [protected]

frames per second

Definition at line 88 of file v4r_uvc.h.

std::string V4RCam::videoDevice_ [protected]

pointer to the v4l2 device

Definition at line 81 of file v4r_uvc.h.

int V4RCam::width_ [protected]
See also:
v4l2 lib for more information

Definition at line 85 of file v4r_uvc.h.


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


v4r_uvc
Author(s):
autogenerated on Wed Aug 26 2015 16:41:35