Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
icl::io::dc::DCFrameQueue Class Reference

Internal used utility class for fast handling of DMA buffers. More...

#include <DCFrameQueue.h>

List of all members.

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.
ICLIO_API ~DCFrameQueue ()
 releases the internal camera using icl::dc::release_dc_cam()
ICLIO_API void step ()
 performs a new step
dc1394video_frame_t * front ()
 returns the oldest frame in the queue
dc1394video_frame_t * back ()
 returns the newest frame in the queue
void lock ()
 locks the queue
void unlock ()
 unlocks the queue
ICLIO_API void push (dc1394video_frame_t *f)
 pushes a new frame to the back of the internal queue (auto lock()/unlock())
ICLIO_API dc1394video_frame_t * pop ()
 pops the oldest frame from the front of the internal queue (auto lock()/unlock())
ICLIO_API void showDetails () const
 shows some debugging information for the wrapped camera
ICLIO_API void resetBus ()
 calls dc1394_reset_bus (not save!)

Private Attributes

std::queue< dc1394video_frame_t * > q
 wrapped queue structure
utils::Mutex mutex
 queue mutex
dc1394camera_t * m_poCam
 associated camera
int m_iBuffers
 count of internal used DMA buffers
int m_iQueuedBuffers
 count of queued buffers

Detailed Description

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.


Constructor & Destructor Documentation

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.

releases the internal camera using icl::dc::release_dc_cam()


Member Function Documentation

dc1394video_frame_t* icl::io::dc::DCFrameQueue::back ( ) [inline]

returns the newest frame in the queue

call lock() / unlock() before and after using this function to ensure, that the returned element remains the newest one and that is stays in the loop

dc1394video_frame_t* icl::io::dc::DCFrameQueue::front ( ) [inline]

returns the oldest frame in the queue

new frames are pushed from the back. call lock() / unlock() before and after using this function to ensure, that the returned element remains the front one and that it stay in the queue

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

calls dc1394_reset_bus (not save!)

shows some debugging information for the wrapped camera

performs a new step

  • enqueue the oldest frame front() in the DMA-queue and pop() it from the internal queue
    • dequeue a frame F ( this is the newest one now)
    • push F into the internal frame

unlocks the queue


Member Data Documentation

count of internal used DMA buffers

count of queued buffers

dc1394camera_t* icl::io::dc::DCFrameQueue::m_poCam [private]

associated camera

queue mutex

std::queue<dc1394video_frame_t*> icl::io::dc::DCFrameQueue::q [private]

wrapped queue structure


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines