Public Member Functions | Private Member Functions | Private Attributes | List of all members
SphereDriver Class Reference
Inheritance diagram for SphereDriver:
ThreadedDriver Driver

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 ()
- Public Member Functions inherited from ThreadedDriver
 ThreadedDriver (ConfigFile *cf, int section, bool overwrite_cmds, size_t queue_maxlen, int interf)
 Constructor with implicit interface.
 ThreadedDriver (ConfigFile *cf, int section, bool overwrite_cmds=true, size_t queue_maxlen=PLAYER_MSGQUEUE_DEFAULT_MAXLEN)
 Constructor for multiple-interface drivers.
virtual ~ThreadedDriver ()
 Destructor.
virtual int Setup ()
 Initialize the driver.
virtual int Shutdown ()
 Finalize the driver.
virtual int Terminate ()
 Terminate the driver.
bool Wait (double TimeOut=0.0)
 Wait for new data to arrive on the driver's queue.
virtual void Update ()
 Update non-threaded drivers.
- Public Member Functions inherited from Driver
bool HasSubscriptions ()
virtual void Publish (player_devaddr_t addr, QueuePointer &queue, uint8_t type, uint8_t subtype, void *src=NULL, size_t deprecated=0, double *timestamp=NULL, bool copy=true)
 Publish a message via one of this driver's interfaces.
virtual void Publish (player_devaddr_t addr, uint8_t type, uint8_t subtype, void *src=NULL, size_t deprecated=0, double *timestamp=NULL, bool copy=true)
 Publish a message via one of this driver's interfaces.
virtual void Publish (QueuePointer &queue, player_msghdr_t *hdr, void *src, bool copy=true)
 Publish a message via one of this driver's interfaces.
virtual void Publish (player_msghdr_t *hdr, void *src, bool copy=true)
 Publish a message via one of this driver's interfaces.
 Driver (ConfigFile *cf, int section, bool overwrite_cmds, size_t queue_maxlen, int interf)
 Constructor for single-interface drivers.
 Driver (ConfigFile *cf, int section, bool overwrite_cmds=true, size_t queue_maxlen=PLAYER_MSGQUEUE_DEFAULT_MAXLEN)
 Constructor for multiple-interface drivers.
virtual ~Driver ()
 Destructor.
int GetError ()
 Get last error value.
virtual int Subscribe (player_devaddr_t addr)
 Subscribe to this driver.
virtual int Subscribe (QueuePointer &queue, player_devaddr_t addr)
 Subscribe to this driver.
virtual int Unsubscribe (player_devaddr_t addr)
 Unsubscribe from this driver.
virtual int Unsubscribe (QueuePointer &queue, player_devaddr_t addr)
 Unsubscribe from this driver.
void ProcessMessages (int maxmsgs)
 Process pending messages.
void ProcessMessages (void)
 Process pending messages.
virtual int ProcessInternalMessages (QueuePointer &resp_queue, player_msghdr *hdr, void *data)
 Internal message handler.
virtual bool RegisterProperty (const char *key, Property *prop, ConfigFile *cf, int section)
 Property registration.
virtual bool RegisterProperty (Property *prop, ConfigFile *cf, int section)
 Property registration.

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
FRAMEGRABBERmFg
FRAMEmFrame
FRAMEmRGBFrame
int32_t mFrameNumber
int32_t mWidth
int32_t mHeight
int32_t mDepth
int32_t mSave

Additional Inherited Members

- Public Attributes inherited from Driver
QueuePointer ret_queue
 Last requester's queue.
player_devaddr_t device_addr
 Default device address (single-interface drivers)
int entries
 Total number of entries in the device table using this driver.
bool alwayson
 Always on flag.
QueuePointer InQueue
 Queue for all incoming messages for this driver.
- Protected Member Functions inherited from ThreadedDriver
virtual void StartThread (void)
virtual void StopThread (void)
 Cancel (and wait for termination) of the driver thread.
void TestCancel ()
 enable thread cancellation and test for cancellation
- Static Protected Member Functions inherited from ThreadedDriver
static void * DummyMain (void *driver)
 Dummy main (just calls real main).
static void DummyMainQuit (void *driver)
 Dummy main cleanup (just calls real main cleanup).

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

Parameters
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 12 September 2005 21:38:45