ImageBase Class Reference
Public Member Functions | |
| ImageBase (ConfigFile *cf, int section, bool overwrite_cmds, size_t queue_maxlen, int interf) | |
| ImageBase (ConfigFile *cf, int section, bool overwrite_cmds=true, size_t queue_maxlen=PLAYER_MSGQUEUE_DEFAULT_MAXLEN) | |
| virtual int | Setup () |
| Initialize the driver. | |
| virtual int | Shutdown () |
| Finalize the driver. | |
| int | ProcessMessage (MessageQueue *resp_queue, player_msghdr *hdr, void *data) |
| Message handler. | |
Protected Member Functions | |
| virtual int | ProcessFrame ()=0 |
| virtual void | Main () |
| Main method for driver thread. | |
Protected Attributes | |
| Device * | camera_driver |
| player_devaddr_t | camera_addr |
| player_camera_data_t | stored_data |
| bool | HaveData |
Member Function Documentation
| void ImageBase::Main | ( | ) | [protected, 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.
Reimplemented from Driver.
References Driver::InQueue, Driver::Lock(), Driver::ProcessMessages(), Driver::Unlock(), and MessageQueue::Wait().
| int ImageBase::ProcessMessage | ( | MessageQueue * | 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_queue The queue to which any response should go. hdr The message header data The message body
Reimplemented from Driver.
References Driver::Lock(), Message::MatchMessage(), PLAYER_CAMERA_DATA_STATE, PLAYER_MSGTYPE_DATA, player_msghdr::size, and Driver::Unlock().
| int ImageBase::Setup | ( | ) | [virtual] |
Initialize the driver.
This function is called with the first client subscribes; it MUST be implemented by the driver.
- Returns:
- Returns 0 on success.
Implements Driver.
References Driver::device_addr, Driver::InQueue, Device::MatchDeviceAddress(), PLAYER_ERROR, and Device::Subscribe().
| int ImageBase::Shutdown | ( | ) | [virtual] |
Finalize the driver.
This function is called with the last client unsubscribes; it MUST be implemented by the driver.
- Returns:
- Returns 0 on success.
Implements Driver.
References Driver::InQueue, Driver::StopThread(), and Device::Unsubscribe().
The documentation for this class was generated from the following files:
- imagebase.h
- imagebase.cc
