BufferedInputFrameSeries Class Reference

Buffered version of InputFrameSeries. More...

#include <Media/BufferedInputFrameSeries.H>

Inheritance diagram for BufferedInputFrameSeries:
Inheritance graph
[legend]
Collaboration diagram for BufferedInputFrameSeries:
Collaboration graph
[legend]

List of all members.

Classes

struct  Checkpoint

Public Member Functions

 BufferedInputFrameSeries (OptionManager &mgr, const size_t qsize, const bool forcergb=false)
 Construct with buffer size qmax.
GenericFrameSpec peekFrameSpec () const
 Get the specs of our frames.
GenericFrame get (bool *did_underflow=0)
 Returns the next frame out of our buffer.

Detailed Description

Buffered version of InputFrameSeries.

Frames are read from their source in a separate worker thread which fills a frame buffer queue; clients of this class running in the main thread can frames out of the queue.

Definition at line 53 of file BufferedInputFrameSeries.H.


Constructor & Destructor Documentation

BufferedInputFrameSeries::BufferedInputFrameSeries ( OptionManager mgr,
const size_t  qsize,
const bool  forcergb = false 
)

Construct with buffer size qmax.

Parameters:
qsize size fo the buffer
forcergb convert to RGB in the thread, so that the GenericFrame returned will have a native type of RGB instead of whatever it might have been from the source. This can save time for the recipient since asRGB() will then be a pass-through.

Definition at line 56 of file BufferedInputFrameSeries.C.

References ModelComponent::addSubComponent().


Member Function Documentation

GenericFrame BufferedInputFrameSeries::get ( bool *  did_underflow = 0  ) 

Returns the next frame out of our buffer.

Returns an empty frame if either (1) the input source is exhausted, or (2) the input buffer underflowed prior to the input source being exhausted. If you care to distinguish between these, you can pass a non-null pointer did_underflow which will be set to false in case (1) and true in case (2). It is up to the caller whether to treat premature underflow as a fatal error, or whether to retry after a delay.

Definition at line 87 of file BufferedInputFrameSeries.C.

References rutz::ix86_atomic_int::atomic_decr_return(), rutz::ix86_atomic_int::atomic_get(), and rutz::circular_queue< T >::pop_front().

GenericFrameSpec BufferedInputFrameSeries::peekFrameSpec (  )  const

Get the specs of our frames.

Definition at line 78 of file BufferedInputFrameSeries.C.

References ModelComponent::started().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:20:43 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3