libcvd
Public Member Functions | Protected Attributes | List of all members
CVD::TimedDiskBuffer< T > Class Template Reference

Play a series of image files as a video stream and use a list of provided timestamps. More...

#include <timeddiskbuffer.h>

Inheritance diagram for CVD::TimedDiskBuffer< T >:
Inheritance graph
[legend]
Collaboration diagram for CVD::TimedDiskBuffer< T >:
Collaboration graph
[legend]

Public Member Functions

 TimedDiskBuffer (const std::vector< std::string > &names, const std::vector< double > &times, CVD::VideoBufferFlags::OnEndOfBuffer eob=CVD::VideoBufferFlags::RepeatLastFrame)
 Construct a TimedDiskBuffer2 from a vector of filenames and timestamps. More...
 
virtual CVD::DiskBuffer2Frame< T > * get_frame ()
 Returns the next frame from the buffer. This function blocks until a frame is ready.
 
- Public Member Functions inherited from CVD::DiskBuffer2< T >
 DiskBuffer2 (const std::vector< std::string > &names, double fps, VideoBufferFlags::OnEndOfBuffer eob=VideoBufferFlags::RepeatLastFrame)
 Construct a DiskBuffer2 from a vector of filenames. More...
 
virtual ImageRef size ()
 The size of the VideoFrames returned by this buffer.
 
virtual bool frame_pending ()
 Is there another frame waiting in the buffer? By default, this always returns true, but if the VideoBufferFlags::OnEndOfBuffer setting is VideoBufferFlags::UnsetPending, this will return false after the last frame has been returned by get_frame()
 
virtual void put_frame (VideoFrame< T > *f)
 Tell the buffer that you are finished with this frame. More...
 
virtual void seek_to (double t)
 Go to a particular point in the video buffer (only implemented in buffers of recorded video) More...
 
virtual void on_end_of_buffer (VideoBufferFlags::OnEndOfBuffer eob)
 What should the buffer do when it reaches the end of the list of files? More...
 
virtual double frame_rate ()
 What is the (expected) frame rate of this video buffer, in frames per second?
 
- Public Member Functions inherited from CVD::LocalVideoBuffer< T >
 LocalVideoBuffer (typename VideoBufferType::Type t)
 
- Public Member Functions inherited from CVD::VideoBuffer< T >
 VideoBuffer (VideoBufferType::Type _type)
 Construct the buffer with the known semantics.
 
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...
 
- Public Member Functions inherited from CVD::RawVideoBuffer
virtual RawVideoBuffersource_buffer ()
 Which video grabber provides the source images for this video grabber. More...
 
RawVideoBufferroot_buffer ()
 Follow the chain of video grabbers back as far as at will go. More...
 

Protected Attributes

std::vector< double > file_times
 
- Protected Attributes inherited from CVD::DiskBuffer2< T >
ImageRef my_size
 
int next_frame
 
double start_time
 
double time_per_frame
 
double frames_per_sec
 
bool frame_ready
 
std::vector< std::string > file_names
 
VideoBufferFlags::OnEndOfBuffer end_of_buffer_behaviour
 

Additional Inherited Members

Detailed Description

template<class T>
class CVD::TimedDiskBuffer< T >

Play a series of image files as a video stream and use a list of provided timestamps.

Provides frames of type CVD::DiskBuffer2Frame and throws exceptions of type CVD::Exceptions::DiskBuffer2 and CVD::Exceptions::TimedDiskBuffer

Parameters
TThe pixel type of the frames to provide (usually CVD::Rgb<CVD::byte> or CVD::byte. If the image files are of a different type, they will be automatically converted (see Image loading and saving, and format conversion).

Constructor & Destructor Documentation

◆ TimedDiskBuffer()

template<class T >
CVD::TimedDiskBuffer< T >::TimedDiskBuffer ( const std::vector< std::string > &  names,
const std::vector< double > &  times,
CVD::VideoBufferFlags::OnEndOfBuffer  eob = CVD::VideoBufferFlags::RepeatLastFrame 
)
inline

Construct a TimedDiskBuffer2 from a vector of filenames and timestamps.

see Diskbuffer2 for details on how to use it.

Parameters
namesThe filenames to use (played in the order that they are in the vector)
timesThe frame time stamps
eobWhat should the buffer do when it reaches the end of the list of files?

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