libcvd
|
Base class for objects which provide a typed video stream. More...
#include <videobuffer.h>
Public Member Functions | |
VideoBuffer (VideoBufferType::Type _type) | |
Construct the buffer with the known semantics. | |
virtual VideoFrame< T > * | get_frame ()=0 |
Returns the next frame from the buffer. This function blocks until a frame is ready. | |
virtual void | put_frame (VideoFrame< T > *f)=0 |
Tell the buffer that you are finished with this frame. More... | |
virtual void | flush () |
Flush all old frames out of the video buffer, on a flushable buffer, causing the next get_frame() to sleep until a frame arrives. More... | |
VideoBufferType::Type | type () |
Returns the type of the video stream. More... | |
![]() | |
virtual RawVideoBuffer * | source_buffer () |
Which video grabber provides the source images for this video grabber. More... | |
RawVideoBuffer * | root_buffer () |
Follow the chain of video grabbers back as far as at will go. More... | |
virtual ImageRef | size ()=0 |
The size of the VideoFrames returned by this buffer. | |
virtual bool | frame_pending ()=0 |
Is there a frame waiting in the buffer? This function does not block. More... | |
virtual double | frame_rate ()=0 |
What is the (expected) frame rate of this video buffer, in frames per second? | |
virtual void | seek_to (double) |
Go to a particular point in the video buffer (only implemented in buffers of recorded video) More... | |
Base class for objects which provide a typed video stream.
A video stream is a sequence of video frames (derived from VideoFrame).
T | The pixel type of the video frames |
|
inlinevirtual |
Flush all old frames out of the video buffer, on a flushable buffer, causing the next get_frame() to sleep until a frame arrives.
On a non-flushable buffer, this does nothing.
Implements CVD::RawVideoBuffer.
Reimplemented in CVD::VideoBufferWithData< T, D >.
|
pure virtual |
Tell the buffer that you are finished with this frame.
Typically the VideoBuffer then destroys the frame.
f | The frame that you are finished with. |
Implemented in CVD::DVBuffer3< pixel_T >, CVD::DVBuffer2< T >, CVD::VideoFileBuffer< T >, CVD::V4LBuffer< T >, CVD::UVCBuffer< T >, CVD::DiskBuffer2< T >, CVD::DeinterlaceBuffer< T >, CVD::ServerPushJpegBuffer< C >, CVD::ColourspaceBuffer< T, From >, CVD::SkipBuffer< T >, CVD::VideoBufferWithData< T, D >, CVD::LocalVideoBuffer< T >, CVD::LocalVideoBuffer< C >, and CVD::LocalVideoBuffer< Rgba< std::uint8_t > >.
|
inline |
Returns the type of the video stream.
A video with live semantics has frames fed at some externally controlled rate, such as from a video camera.
A stream with live semantics also may be flushable, in that all current frames can be removed from the stream while frame_pending() is 1, and then the next get_frame() will sleep until a frame arrives. This ensures that the latency is low by discarding any old frames. Buffers flushable in this manner have a type of VideoBuffer::Type::Flushable.
Some live streams are not flushable because it is not possible to determine the state of frame_pending(). These have the type VideoBuffer::Type::Live, and frame_pending() is always 1.
Otherwise, streams have a type VideoBuffer::Type::NotLive, and frame_pending is always 1
This should be in the base class