Image Component Library (ICL)
|
Grabber implementation for handling DC-Devices using libdc1394 (Version >= 2.0.rc9) \. More...
#include <DCGrabber.h>
Public Member Functions | |
ICLIO_API | DCGrabber (const DCDevice &dev=DCDevice::null, int isoMBits=0) |
Constructor creates a new DCGrabber instance from a given DCDevice. | |
ICLIO_API | ~DCGrabber () |
Destructor. | |
virtual ICLIO_API const core::ImgBase * | acquireImage () |
grab function grabs an image (destination image is adapted on demand) | |
virtual ICLIO_API std::vector < std::string > | get_io_property_list () |
filters out the size property, as it is set by the core::format property | |
Static Public Member Functions | |
static ICLIO_API std::vector < DCDevice > | getDCDeviceList (bool resetBusFirst=false) |
Returns a list of all connected DCDevices. | |
static void | dc1394_reset_bus (bool verbose=false) |
calls dc1394_reset_bus functions (see DCDevice) | |
Private Member Functions | |
void | restartGrabberThread () |
internally used function to restart the DCGrabberThread | |
void | addProperties () |
adds DCGrabbers properties to Configurable. | |
void | processPropertyChange (const utils::Configurable::Property &p) |
callback function for property changes. | |
Private Attributes | |
DCDevice | m_oDev |
Wrapped DCDevice struct. | |
DCDeviceFeatures | m_oDeviceFeatures |
Features corrsponding to m_oDev. | |
dc::DCGrabberThread * | m_poGT |
Wrapped DCGrabberThread struct. | |
utils::Mutex | m_GrabberThreadMutex |
Mutex for clean restarting of GrabberThread. | |
core::ImgBase * | m_poImage |
Internally used buffer images. | |
core::ImgBase * | m_poImageTmp |
core::Converter | m_oConverter |
Internally used image converter. | |
DCDeviceOptions | m_oOptions |
Internal DCDeviceOptions struct. | |
std::string | m_sUserDefinedBayerPattern |
only for unknown device types |
Grabber implementation for handling DC-Devices using libdc1394 (Version >= 2.0.rc9) \.
The DCGrabber class implements the ICL's Grabber interface for providing libdc1395.so.2 based camera device access. Internally it wraps some additional classes with name prefix "DC".
The first time the "grab(..)"-function of the DCGrabber is invoked, it internally creates a so called DCGrabberThread. This thread then will create a so called DCFrameQueue internally. This queue is used to handle dma-image-frames, owned by the libdc which have been temporarily de-queued from the dma ring buffer queue into the user space. Here, the user has read-only access to these frames. The DCGrabberThread runs as fast as the current camera-settings allow and de-queues dma-frames from the system space into the user space DCFrameQueue and it en-queues old user space frames from this DCFrameQueue back into the dma ring buffer. At each time, the newest frame is available at the back of the DCFrameQueue whereas the oldest frame is located at the front of this queue. When the DCGrabbers grab-function is called, it will internally lock the current DCFrameQueue and convert the current frame into another buffer before the DCFrameQueue is unlocked again.
Internally the DCGrabber wraps an instance of type DCDeviceOptions, which is a container for all currently implemented options. The wrapped classes DCGrabberThread and DCFrameQueue get a pointer to this option-struct at construction time, so these objects are able to work with the options currently set inside the parent DCGrabber instance.
In addition, another class called DCDevice is used internally as a high-level wrapper for the libdc1394's camera struct. This DCDevice class provides some additional information to the low level information of the dc1394camera_t struct, e.g. some very camera-model specific information about the bayer-filter layout and so on. Note: New cameras, which should be supported must be included here!.
As in other Grabber implementations, a static function "getDeviceList()" can be used to detect currently supported cameras.
ICLIO_API icl::io::DCGrabber::DCGrabber | ( | const DCDevice & | dev = DCDevice::null , |
int | isoMBits = 0 |
||
) |
Constructor creates a new DCGrabber instance from a given DCDevice.
dev | DCDevice to use (this device can only be created by the static function getDeviceList() |
isoMBits | give the initializer a hint to set instantiated grabber to a specific iso mode by default allowed values are
|
(please note, that this parameter can also be set by the property iso-speed)
Destructor.
virtual ICLIO_API const core::ImgBase* icl::io::DCGrabber::acquireImage | ( | ) | [virtual] |
grab function grabs an image (destination image is adapted on demand)
grab function calls the Grabber-specific acquireImage-method and applies distortion if necessary
If dst is not NULL, it is exploited and filled with image data
Reimplemented from icl::io::Grabber.
void icl::io::DCGrabber::addProperties | ( | ) | [private] |
adds DCGrabbers properties to Configurable.
static void icl::io::DCGrabber::dc1394_reset_bus | ( | bool | verbose = false | ) | [inline, static] |
calls dc1394_reset_bus functions (see DCDevice)
virtual ICLIO_API std::vector<std::string> icl::io::DCGrabber::get_io_property_list | ( | ) | [virtual] |
filters out the size property, as it is set by the core::format property
static ICLIO_API std::vector<DCDevice> icl::io::DCGrabber::getDCDeviceList | ( | bool | resetBusFirst = false | ) | [static] |
Returns a list of all connected DCDevices.
void icl::io::DCGrabber::processPropertyChange | ( | const utils::Configurable::Property & | p | ) | [private] |
callback function for property changes.
Reimplemented from icl::io::Grabber.
void icl::io::DCGrabber::restartGrabberThread | ( | ) | [private] |
internally used function to restart the DCGrabberThread
useful if the grabber thread must have been deleted to update some internal properties
Mutex for clean restarting of GrabberThread.
Internally used image converter.
This converter is used, if the wrapped DCGrabberThread was not able to satisfy all desired parameter claims.
DCDevice icl::io::DCGrabber::m_oDev [private] |
Wrapped DCDevice struct.
Features corrsponding to m_oDev.
Internal DCDeviceOptions struct.
dc::DCGrabberThread* icl::io::DCGrabber::m_poGT [private] |
Wrapped DCGrabberThread struct.
core::ImgBase* icl::io::DCGrabber::m_poImage [private] |
Internally used buffer images.
core::ImgBase * icl::io::DCGrabber::m_poImageTmp [private] |
std::string icl::io::DCGrabber::m_sUserDefinedBayerPattern [private] |
only for unknown device types