Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
V4RCam Class Reference

v4l2 camera abstraction More...

#include <uvc.h>

Inheritance diagram for V4RCam:
Inheritance graph
[legend]

Classes

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

Public Types

typedef boost::shared_ptr< ControlEntryControlEntryPtr
 
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 More...
 
bool hasErrorMsg () const
 
bool hasInfoMsg () const
 
FD initCamera (const std::string &videoDevice="")
 vector of the current supported control entries More...
 
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 More...
 
int v4lset (ControlEntryPtr entry)
 
int v4lupdate (ControlEntryPtr entry)
 
 V4RCam ()
 shared pointer for ControlEntry More...
 
 ~V4RCam ()
 construtor More...
 

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 More...
 
std::vector< ControlEntryPtrcontrolEntries_
 mutex to secure critical sections More...
 
double durationLastFrame_
 time stamp of the last frame More...
 
std::stringstream error_msg_
 
int format_
 not supported yet More...
 
float fps_
 image height More...
 
int grabmethod_
 image formate More...
 
int height_
 image width More...
 
std::stringstream info_msg_
 
boost::interprocess::interprocess_mutex mutexImage_
 duration between last and the frame before the last one More...
 
vdInpVideoIn_
 
timeval timeLastFrame_
 frames per second More...
 
std::string videoDevice_
 pointer to the v4l2 device More...
 
int width_
 

Detailed Description

v4l2 camera abstraction

Definition at line 40 of file uvc.h.

Member Typedef Documentation

Definition at line 71 of file uvc.h.

typedef int V4RCam::FD

Definition at line 48 of file uvc.h.

Definition at line 49 of file uvc.h.

Constructor & Destructor Documentation

V4RCam::V4RCam ( )

shared pointer for ControlEntry

Definition at line 67 of file uvc.cpp.

V4RCam::~V4RCam ( )

construtor

Definition at line 58 of file uvc.cpp.

Member Function Documentation

const std::vector< V4RCam::ControlEntryPtr > & V4RCam::detectControlEnties ( )

detects the supporting v4l controls of the device

Returns
controls

Definition at line 352 of file uvc.cpp.

V4RCam::ControlEntryPtr V4RCam::getControlEntry ( std::string  varName)

Definition at line 449 of file 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 uvc.cpp.

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

Definition at line 344 of file uvc.cpp.

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

Definition at line 348 of file 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 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 uvc.cpp.

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

Definition at line 332 of file uvc.cpp.

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

Definition at line 338 of file uvc.cpp.

char V4RCam::removeNonAlNum ( char  in)
static

Definition at line 51 of file 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 uvc.cpp.

int V4RCam::v4lget ( ControlEntryPtr  entry)

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 uvc.cpp.

int V4RCam::v4lgetInfo ( ControlEntryPtr  entry)

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 uvc.cpp.

int V4RCam::v4lset ( ControlEntryPtr  entry)

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 uvc.cpp.

int V4RCam::v4lupdate ( ControlEntryPtr  entry)

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 uvc.cpp.

Member Data Documentation

std::string V4RCam::aviFilename_
protected

device name /dev/videoX

Definition at line 82 of file uvc.h.

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

mutex to secure critical sections

Definition at line 91 of file uvc.h.

double V4RCam::durationLastFrame_
protected

time stamp of the last frame

Definition at line 89 of file uvc.h.

const int V4RCam::ERROR = 1
static

Definition at line 44 of file uvc.h.

std::stringstream V4RCam::error_msg_
protected

Definition at line 179 of file uvc.h.

int V4RCam::format_
protected

not supported yet

Definition at line 83 of file uvc.h.

float V4RCam::fps_
protected

image height

Definition at line 87 of file uvc.h.

int V4RCam::grabmethod_
protected

image formate

Definition at line 84 of file uvc.h.

int V4RCam::height_
protected

image width

Definition at line 86 of file uvc.h.

std::stringstream V4RCam::info_msg_
protected

Definition at line 178 of file uvc.h.

const int V4RCam::LOAD = 1
static

Definition at line 46 of file 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 uvc.h.

const int V4RCam::NA = 0
static

Definition at line 45 of file uvc.h.

const int V4RCam::OK = 0
static

Definition at line 43 of file uvc.h.

vdIn* V4RCam::pVideoIn_
protected

Definition at line 80 of file uvc.h.

const int V4RCam::SAVE = 2
static

Definition at line 47 of file uvc.h.

timeval V4RCam::timeLastFrame_
protected

frames per second

Definition at line 88 of file uvc.h.

std::string V4RCam::videoDevice_
protected

pointer to the v4l2 device

Definition at line 81 of file uvc.h.

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

Definition at line 85 of file uvc.h.


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


tuw_uvc
Author(s): Markus Bader
autogenerated on Mon Jun 10 2019 15:39:24