Image Component Library (ICL)
|
Internal used utility class for fast handling of DMA buffers. More...
#include <DCFrameQueue.h>
Public Member Functions | |
ICLIO_API | DCFrameQueue (dc1394camera_t *c, DCDeviceOptions *options, int nDMABuffers=5, int nQueuedBuffers=1) |
Creates a new DCFrameQueue objects with given camera, DMABuffer size and count of queued buffers. More... | |
ICLIO_API | ~DCFrameQueue () |
releases the internal camera using icl::dc::release_dc_cam() More... | |
ICLIO_API void | step () |
performs a new step More... | |
dc1394video_frame_t * | front () |
returns the oldest frame in the queue More... | |
dc1394video_frame_t * | back () |
returns the newest frame in the queue More... | |
void | lock () |
locks the queue More... | |
void | unlock () |
unlocks the queue More... | |
ICLIO_API void | push (dc1394video_frame_t *f) |
pushes a new frame to the back of the internal queue (auto lock()/unlock()) More... | |
ICLIO_API dc1394video_frame_t * | pop () |
pops the oldest frame from the front of the internal queue (auto lock()/unlock()) More... | |
ICLIO_API void | showDetails () const |
shows some debugging information for the wrapped camera More... | |
ICLIO_API void | resetBus () |
calls dc1394_reset_bus (not save!) More... | |
Private Attributes | |
std::queue< dc1394video_frame_t * > | q |
wrapped queue structure More... | |
utils::Mutex | mutex |
queue mutex More... | |
dc1394camera_t * | m_poCam |
associated camera More... | |
int | m_iBuffers |
count of internal used DMA buffers More... | |
int | m_iQueuedBuffers |
count of queued buffers More... | |
Internal used utility class for fast handling of DMA buffers.
This Queue implementation initializes the given camera. Then it dequeues all DMA ring buffer frames once, and pushes them into its wrapped std::queue<dc1394video_frame_t*>. After that, it re-enqueues a fixed number (given by the 3rd constructor argument nQueuedBuffers which is set to 2 by default) into the DMA-queue. This buffers are filled continuously with new frame data by the DMA-Thread. After this initialization, the Queue is used by the DCGrabberThread to buffer grabbed image data as fast a possible, and to offer the newest frame safely at any time to other threads.
ICLIO_API icl::io::dc::DCFrameQueue::DCFrameQueue | ( | dc1394camera_t * | c, |
DCDeviceOptions * | options, | ||
int | nDMABuffers = 5 , |
||
int | nQueuedBuffers = 1 |
||
) |
Creates a new DCFrameQueue objects with given camera, DMABuffer size and count of queued buffers.
ICLIO_API icl::io::dc::DCFrameQueue::~DCFrameQueue | ( | ) |
releases the internal camera using icl::dc::release_dc_cam()
|
inline |
|
inline |
|
inline |
locks the queue
ICLIO_API dc1394video_frame_t* icl::io::dc::DCFrameQueue::pop | ( | ) |
pops the oldest frame from the front of the internal queue (auto lock()/unlock())
The function internally locks the queue
ICLIO_API void icl::io::dc::DCFrameQueue::push | ( | dc1394video_frame_t * | f | ) |
pushes a new frame to the back of the internal queue (auto lock()/unlock())
The function internally locks the queue
ICLIO_API void icl::io::dc::DCFrameQueue::resetBus | ( | ) |
calls dc1394_reset_bus (not save!)
ICLIO_API void icl::io::dc::DCFrameQueue::showDetails | ( | ) | const |
shows some debugging information for the wrapped camera
ICLIO_API void icl::io::dc::DCFrameQueue::step | ( | ) |
|
inline |
unlocks the queue
|
private |
count of internal used DMA buffers
|
private |
count of queued buffers
|
private |
associated camera
|
private |
queue mutex
|
private |
wrapped queue structure