Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

CameraDriverV4L1 Class Reference

description of CameraDriverV4L1 More...

#include <CameraDriverV4L1.h>

Inheritance diagram for CameraDriverV4L1:

Detailed Description

description of CameraDriverV4L1

Definition at line 17 of file CameraDriverV4L1.h.

List of all members.

Public Member Functions

 CameraDriverV4L1 (const std::string &name)
 ~CameraDriverV4L1 ()
virtual std::string getClassName () const
 Returns the name of the class (aka its type).
virtual void getImageSources (std::map< std::string, DataSource * > &sources)
virtual unsigned int nextTimestamp ()
 Returns the simulator time of the next data segment.
virtual const std::string & nextName ()
 Returns a descriptive name of the next data segment for user feedback (e.g. a filename for logged data).
virtual unsigned int getData (const char *&payload, unsigned int &payloadSize, unsigned int &timestamp, std::string &name)
virtual void setDataSourceThread (LoadDataThread *th)
virtual void plistValueChanged (const plist::PrimitiveBase &pl)
 watches path, triggers a close() and re-open() if it changes

Public Attributes

plist::Primitive< std::string > path
plist::Primitive< unsigned int > resolution
plist::Primitive< int > layer
 Controls the resolution layer at which the image should be processed.
0 indicates "automatic" mode (picks layer closest to image's resolution), positive numbers indicate the resolution layer directly.
Negative values are relative to the number of layers marked available by the vision setup, so that typically -1 would correspond to the "double" layer, and -2 would correspond to the "full" layer.
plist::Primitive< boolautobright

Protected Member Functions

void close_cam ()
void open_cam ()
void get_cam_info ()
void set_cam_info ()
void set_resolution ()
void auto_bright ()
void interleave_yuv_down ()
void interleave_yuv_up ()
size_t getWidth () const
size_t getHeight () const
size_t getBufferSize () const

Protected Attributes

int camfd
size_t img_size
struct video_capability vid_caps
struct video_window vid_win
struct video_picture vid_pic
unsigned int frameCount
bool isYUVMode
bool blocking
std::vector< unsigned char > curBuf
 the buffer to write the image into
std::vector< unsigned char > lastBuf
 the buffer we returned last time (might still be in use while writing curBuf)
std::vector< unsigned char > tmpBuf
 used during interleave_yuv_up(), swapped back and forth with curBuf
Thread::Lock lock

Static Protected Attributes

static const size_t HEADER_SIZE

Static Private Attributes

static const std::string autoRegisterCameraDriverV4L1
 holds the class name, set via registration with the DeviceDriver registry

Constructor & Destructor Documentation

CameraDriverV4L1 ( const std::string &  name  )  [explicit]

Definition at line 19 of file CameraDriverV4L1.h.

~CameraDriverV4L1 (  ) 

Definition at line 33 of file CameraDriverV4L1.h.


Member Function Documentation

void auto_bright (  )  [protected]
void close_cam (  )  [protected]
void get_cam_info (  )  [protected]
size_t getBufferSize (  )  const [protected]

Definition at line 69 of file CameraDriverV4L1.h.

virtual std::string getClassName (  )  const [virtual]

Returns the name of the class (aka its type).

Suggested implementation is to declare a static string member, set it to the result of calling the registry's registerType, and then return that member here

Implements DeviceDriver.

Definition at line 38 of file CameraDriverV4L1.h.

virtual unsigned int getData ( const char *&  payload,
unsigned int &  payloadSize,
unsigned int &  timestamp,
std::string &  name 
) [virtual]
size_t getHeight (  )  const [protected]

Definition at line 68 of file CameraDriverV4L1.h.

virtual void getImageSources ( std::map< std::string, DataSource * > &  sources  )  [virtual]

Reimplemented from DeviceDriver.

Definition at line 40 of file CameraDriverV4L1.h.

size_t getWidth (  )  const [protected]

Definition at line 67 of file CameraDriverV4L1.h.

void interleave_yuv_down (  )  [protected]
void interleave_yuv_up (  )  [protected]
virtual const std::string& nextName (  )  [virtual]

Returns a descriptive name of the next data segment for user feedback (e.g. a filename for logged data).

Just use your class name if you don't have a useful name for individual samples.

Implements DataSource.

Definition at line 45 of file CameraDriverV4L1.h.

virtual unsigned int nextTimestamp (  )  [virtual]

Returns the simulator time of the next data segment.

Should be in the future if nothing new since last data segment, otherwise should be the timestamp of the most recent data segment (older segments are skipped), return -1U if there is no more data

Implements DataSource.

Definition at line 44 of file CameraDriverV4L1.h.

void open_cam (  )  [protected]
virtual void plistValueChanged ( const plist::PrimitiveBase pl  )  [virtual]

watches path, triggers a close() and re-open() if it changes

Implements PrimitiveListener.

void set_cam_info (  )  [protected]
void set_resolution (  )  [protected]
virtual void setDataSourceThread ( LoadDataThread *  th  )  [virtual]

Member Data Documentation

Definition at line 55 of file CameraDriverV4L1.h.

Referenced by CameraDriverV4L1().

const std::string autoRegisterCameraDriverV4L1 [static, private]

holds the class name, set via registration with the DeviceDriver registry

Definition at line 100 of file CameraDriverV4L1.h.

Referenced by getClassName().

bool blocking [protected]

Definition at line 80 of file CameraDriverV4L1.h.

int camfd [protected]

Definition at line 73 of file CameraDriverV4L1.h.

std::vector<unsigned char> curBuf [protected]

the buffer to write the image into

Definition at line 82 of file CameraDriverV4L1.h.

unsigned int frameCount [protected]

Definition at line 78 of file CameraDriverV4L1.h.

const size_t HEADER_SIZE [static, protected]

Definition at line 71 of file CameraDriverV4L1.h.

Referenced by getBufferSize().

size_t img_size [protected]

Definition at line 74 of file CameraDriverV4L1.h.

bool isYUVMode [protected]

Definition at line 79 of file CameraDriverV4L1.h.

std::vector<unsigned char> lastBuf [protected]

the buffer we returned last time (might still be in use while writing curBuf)

Definition at line 83 of file CameraDriverV4L1.h.

Controls the resolution layer at which the image should be processed.
0 indicates "automatic" mode (picks layer closest to image's resolution), positive numbers indicate the resolution layer directly.
Negative values are relative to the number of layers marked available by the vision setup, so that typically -1 would correspond to the "double" layer, and -2 would correspond to the "full" layer.

Definition at line 54 of file CameraDriverV4L1.h.

Referenced by CameraDriverV4L1().

Thread::Lock lock [protected]

Definition at line 85 of file CameraDriverV4L1.h.

plist::Primitive<std::string> path

Definition at line 52 of file CameraDriverV4L1.h.

Referenced by CameraDriverV4L1(), and ~CameraDriverV4L1().

std::vector<unsigned char> tmpBuf [protected]

used during interleave_yuv_up(), swapped back and forth with curBuf

Definition at line 84 of file CameraDriverV4L1.h.

struct video_capability vid_caps [protected]

Definition at line 75 of file CameraDriverV4L1.h.

struct video_picture vid_pic [protected]

Definition at line 77 of file CameraDriverV4L1.h.

struct video_window vid_win [protected]

Definition at line 76 of file CameraDriverV4L1.h.

Referenced by getBufferSize(), getHeight(), and getWidth().


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

Tekkotsu Hardware Abstraction Layer 5.1CVS
Generated Mon May 9 05:01:40 2016 by Doxygen 1.6.3