Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

CameraV4L2 Class Reference

Inheritance diagram for CameraV4L2:

List of all members.

Detailed Description

Driver for capturing frames from V4L2 compatible device.

Definition at line 287 of file camerav4l2.cpp.

Public Member Functions

 CameraV4L2 (ConfigFile *cf, int section)
 Constructor.
virtual int Setup ()
 Setup/shutdown routines.
virtual int Shutdown ()
 Setup/shutdown routines.

Private Member Functions

virtual void Main ()
 Main function for device thread.
int HandleRequests ()
 Process requests.
void WriteData ()
 Update the device data (the data going back to the client).
int selectNorm (const char *snorm)
 some parsing functions, to change string to apropriate settings
int selectFormat (const char *sformat)
int selectField (const char *sfield)
int tryPixelSettings (FRAMEGRABBER2 *fg, int w, int h, unsigned int fmt, enum v4l2_field fld)
int handleCommand (char *cmd, int len)
 handle command with optional reply
int handleCommand (char *cmd, int len, char *reply, int rlen)

Private Attributes

const char * device
 Video device.
const char * sourceCh
 Input source. If sourceCh==0, then source matters.
int source
v4l2_std_id norm
 The signal norm: VIDEO_NORM_PAL or VIDEO_NORM_NTSC.
int depth
 Pixel depth.
int width
 Image dimensions.
int height
enum v4l2_field fieldType
 field type
unsigned int v4l2_type_id
int flip_rb
int showFPS
FRAMEGRABBER2fg
 Frame grabber interface.
uint32_t tsec
 Capture timestamp.
uint32_t tusec
player_camera_data_t data
 Data to send to server.
int numOfCtls
const char ** ctlNames
double * ctlVals
int back_source
 backup for rollback, when failed to set new parameters
v4l2_std_id back_norm
int back_depth
int back_width
int back_height
enum v4l2_field back_fieldType
unsigned int back_v4l2_type_id


Member Function Documentation

int CameraV4L2::handleCommand char *  cmd,
int  len,
char *  reply,
int  rlen
[private]
 

handle command and generate reply

Parameters:
cmd command in text representation
len length of cmd (including '')
reply buffer for reply
rlen length of buffer for reply
Returns:
0 ok, -1 failure

Definition at line 1109 of file camerav4l2.cpp.

int CameraV4L2::handleCommand char *  cmd,
int  len
[private]
 

handle command with optional reply

handle command without reply

Parameters:
cmd command in text representation
len length of cmd (including '')
Returns:
0 ok, -1 failure

Definition at line 985 of file camerav4l2.cpp.

int CameraV4L2::HandleRequests  )  [private]
 

Process requests.

Process incoming requests

Definition at line 930 of file camerav4l2.cpp.

int CameraV4L2::selectField const char *  sfield  )  [private]
 

Apply setting according to field value read from config or request; changed are: this->fieldType

Parameters:
sfield one of values mentioned in config for "field" setting
Returns:
0 on success

Definition at line 676 of file camerav4l2.cpp.

int CameraV4L2::selectFormat const char *  sformat  )  [private]
 

Apply setting according to mode value from config or request; changed are: this->data.format, this->depth, this->v4l2_type_id

Parameters:
sformat one of values mentioned in config for "mode" setting
Returns:
0 on success

Definition at line 652 of file camerav4l2.cpp.

int CameraV4L2::selectNorm const char *  snorm  )  [private]
 

some parsing functions, to change string to apropriate settings

Apply setting according to snorm value read from config or request; changed are: this->norm, this->width, this->height

Parameters:
snorm one of values mentioned in config for "norm" setting
Returns:
0 on success

Definition at line 628 of file camerav4l2.cpp.

int CameraV4L2::tryPixelSettings FRAMEGRABBER2 fg,
int  w,
int  h,
unsigned int  fmt,
enum v4l2_field  fld
[private]
 

try given parameters, and back to previous when failed and return !=0 on failure

Parameters:
fg Handler
w width
h height
fmt v4l2_type_id
fld fieldType
Returns:
0 ok, -1 bad

Definition at line 910 of file camerav4l2.cpp.


The documentation for this class was generated from the following file:
Generated on Thu Jun 29 22:04:43 2006 for Camerav4l2 by  doxygen 1.4.4