Buffered version of InputFrameSeries. More...
#include <Media/BufferedInputFrameSeries.H>
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. |
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.
BufferedInputFrameSeries::BufferedInputFrameSeries | ( | OptionManager & | mgr, | |
const size_t | qsize, | |||
const bool | forcergb = false | |||
) |
Construct with buffer size qmax.
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().
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().