SphereDriver Class Reference
Inheritance diagram for SphereDriver:
ThreadedDriver Driver

List of all members.

Public Member Functions

 SphereDriver (ConfigFile *cf, int section)
int MainSetup ()
 Sets up the resources needed by the driver thread.
void MainQuit ()
 Cleanup method for driver thread (called when main exits)
virtual void Main ()
 Main method for driver thread.
virtual int ProcessMessage (QueuePointer &resp_queue, player_msghdr *hdr, void *data)
 Message handler.
void ProcessCommand (player_msghdr_t *hdr, player_ptz_cmd_t &data)
void RefreshData ()

Private Member Functions

void YUV422toRGB (uint8_t *argInputData, uint8_t *argOutputData)
 Conversion of YUV422 pixel data into RGB ( CCIR 601 )
double LimitPan (double argP)
double LimitTilt (double argT)

Private Attributes

player_devaddr_t mCameraAddr
player_camera_data_t mCameraData
player_devaddr_t mPtzAddr
player_ptz_data_t mPtzData
player_ptz_cmd_t mPtzCmd
int32_t mSleep
int32_t mFrameRate
int32_t mShutterSpeed
int32_t mCompressionPreference
int32_t mAutomaticGain
int32_t mSharpness
int32_t mBacklight
int32_t mFlicker
int32_t mNoiseReduction
int32_t mDumpSettings
int32_t mDebug
const char * mAutomaticWb
double mPanMin
double mPanMax
double mTiltMin
double mTiltMax
const char * mDevice
int32_t mSource
const char * mPalette
int32_t mFrameNumber
int32_t mWidth
int32_t mHeight
int32_t mDepth
int32_t mSave

Constructor & Destructor Documentation

SphereDriver::SphereDriver ( ConfigFile cf,
int  section 

Member Function Documentation

void SphereDriver::Main ( ) [virtual]

Main method for driver thread.

drivers have their own thread of execution, created using StartThread(); this is the entry point for the driver thread, and must be overloaded by all threaded drivers.

Implements ThreadedDriver.

References Driver::ProcessMessages().

void SphereDriver::MainQuit ( void  ) [virtual]

Cleanup method for driver thread (called when main exits)

Overload this method and to do additional cleanup when the driver thread exits.

Reimplemented from ThreadedDriver.

int SphereDriver::ProcessMessage ( QueuePointer resp_queue,
player_msghdr hdr,
void *  data 
) [virtual]

Message handler.

This function is called once for each message in the incoming queue. Reimplement it to provide message handling. Return 0 if you handled the message and -1 otherwise

resp_queueThe queue to which any response should go.
hdrThe message header
dataThe message body

Reimplemented from Driver.

References Driver::device_addr, Message::MatchMessage(), PLAYER_ERROR1, PLAYER_MSGTYPE_CMD, PLAYER_MSGTYPE_REQ, PLAYER_MSGTYPE_RESP_ACK, PLAYER_PTZ_CMD_STATE, PLAYER_PTZ_REQ_STATUS, Driver::Publish(), player_msghdr::size, and player_msghdr::type.

void SphereDriver::YUV422toRGB ( uint8_t *  argInputData,
uint8_t *  argOutputData 
) [private]

Conversion of YUV422 pixel data into RGB ( CCIR 601 )

R = (Y - 16) * 1.164 + (V-128) * 1.596 G = (Y - 16) * 1.164 - (U-128) * 0.391 - (V-128) * 0.813 B = (Y - 16) * 1.164 + (U-128) * 2.018

The formulas are approximated by

R = Y * (291/250) + V * (399/250) - 223 G = Y * (291/250) + U * (319/1000) - V * (813/1000) + 35 B = Y * (291/250) + U * (1009/500) - 277

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

Last updated 25 May 2011 21:17:00