libcvd
Public Member Functions | Public Attributes | List of all members
CVD::VideoBufferWithData< T, D > Class Template Reference

Certain video buffers, especially the decorator classes, and buffers such as ServerPushJpegBuffer have additional data with the same lifetime as the buffer. More...

#include <videobufferwithdata.h>

Inheritance diagram for CVD::VideoBufferWithData< T, D >:
Inheritance graph
[legend]
Collaboration diagram for CVD::VideoBufferWithData< T, D >:
Collaboration graph
[legend]

Public Member Functions

 VideoBufferWithData (std::unique_ptr< VideoBuffer< T >> &buf_, std::unique_ptr< D > &d)
 
ImageRef size ()
 The size of the VideoFrames returned by this buffer.
 
virtual RawVideoBuffersource_buffer ()
 Which video grabber provides the source images for this video grabber. More...
 
VideoFrame< T > * get_frame ()
 Returns the next frame from the buffer. This function blocks until a frame is ready.
 
void put_frame (VideoFrame< T > *f)
 Tell the buffer that you are finished with this frame. More...
 
bool frame_pending ()
 Is there a frame waiting in the buffer? This function does not block. More...
 
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...
 
double frame_rate ()
 What is the (expected) frame rate of this video buffer, in frames per second?
 
void seek_to (double time)
 Go to a particular point in the video buffer (only implemented in buffers of recorded video) More...
 
- Public Member Functions inherited from CVD::VideoBuffer< T >
 VideoBuffer (VideoBufferType::Type _type)
 Construct the buffer with the known semantics.
 
VideoBufferType::Type type ()
 Returns the type of the video stream. More...
 
- Public Member Functions inherited from CVD::RawVideoBuffer
RawVideoBufferroot_buffer ()
 Follow the chain of video grabbers back as far as at will go. More...
 

Public Attributes

std::unique_ptr< D > extra_data
 

Detailed Description

template<class T, class D>
class CVD::VideoBufferWithData< T, D >

Certain video buffers, especially the decorator classes, and buffers such as ServerPushJpegBuffer have additional data with the same lifetime as the buffer.

This is a tool to allow management of this data. This class manages a video buffer and some data concurrently.

Parameters
TThe pixel type of the video frames

Member Function Documentation

◆ flush()

template<class T, class D>
void CVD::VideoBufferWithData< T, D >::flush ( )
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.

Reimplemented from CVD::VideoBuffer< T >.

◆ frame_pending()

template<class T, class D>
bool CVD::VideoBufferWithData< T, D >::frame_pending ( )
inlinevirtual

Is there a frame waiting in the buffer? This function does not block.

See is_live and is_flushable.

Implements CVD::RawVideoBuffer.

◆ put_frame()

template<class T, class D>
void CVD::VideoBufferWithData< T, D >::put_frame ( VideoFrame< T > *  f)
inlinevirtual

Tell the buffer that you are finished with this frame.

Typically the VideoBuffer then destroys the frame.

Parameters
fThe frame that you are finished with.

Implements CVD::VideoBuffer< T >.

◆ seek_to()

template<class T, class D>
void CVD::VideoBufferWithData< T, D >::seek_to ( double  )
inlinevirtual

Go to a particular point in the video buffer (only implemented in buffers of recorded video)

Parameters
tThe frame time in seconds

Reimplemented from CVD::RawVideoBuffer.

◆ source_buffer()

template<class T, class D>
virtual RawVideoBuffer* CVD::VideoBufferWithData< T, D >::source_buffer ( )
inlinevirtual

Which video grabber provides the source images for this video grabber.

Reimplemented from CVD::RawVideoBuffer.


The documentation for this class was generated from the following file: