2 #ifndef CVD_VIDEOFILEBUFFER_H 3 #define CVD_VIDEOFILEBUFFER_H 11 #include <cvd/image_io.h> 12 #include <cvd/localvideobuffer.h> 13 #include <cvd/videobufferflags.h> 14 #include <cvd/videofilebuffer_frame.h> 31 using CVD::Exceptions::VideoBuffer::All::All;
37 FileOpen(
const std::string& file,
const std::string& error);
49 BadDecode(
double t,
const std::string& =
"");
61 BadSeek(
double t,
const std::string& =
"");
70 #ifndef DOXYGEN_IGNORE_INTERNAL 74 static const bool p = C::Error__type_not_valid___Use_byte_or_rgb_of_byte;
80 static const bool p =
false;
86 static const bool p =
true;
101 RawVideoFileBuffer(
const std::string& file,
const std::string& formatname,
bool is_rgb,
bool verbose,
const std::map<std::string, std::string>&);
111 void put_frame(
void* f);
114 bool frame_pending();
118 void seek_to(
double t);
125 double frames_per_second();
128 std::string file_name();
131 std::unique_ptr<RawVideoFileBufferPIMPL> p;
144 template <
typename T>
155 , vf(file,
"", VFB::rgb<T>::p, verbose,
std::map<
std::string,
std::string> {})
159 VideoFileBuffer(
const std::string& file,
const std::string& fmt,
bool verbose =
false)
161 , vf(file, fmt,
VFB::rgb<T>::p, verbose, std::map<std::string, std::string> {})
165 VideoFileBuffer(
const std::string& file,
const std::string& fmt,
bool verbose,
const std::map<std::string, std::string>& o)
A frame from a VideoFileBuffer.
Definition: videofilebuffer_frame.h:23
Definition: videofilebuffer.h:72
OnEndOfBuffer
If it is a finite buffer (a video file, for example), what should happen when the end of the buffer i...
Definition: videobufferflags.h:14
void seek_to(double t)
Go to a particular point in the video buffer (only implemented in buffers of recorded video) ...
Definition: videofilebuffer2.cc:687
VideoFileBuffer(const std::string &file, bool verbose=false)
Construct a VideoFileBuffer to play this file.
Definition: videofilebuffer.h:153
A colour consisting of red, green and blue components.
Definition: rgb.h:25
virtual void put_frame(VideoFrame< T > *f)
Tell the buffer that you are finished with this frame.
Definition: videofilebuffer.h:202
All classes and functions are within the CVD namespace.
Definition: argb.h:6
void on_end_of_buffer(VideoBufferFlags::OnEndOfBuffer behaviour)
What should the buffer do when it reaches the end of the list of files?
Definition: videofilebuffer2.cc:692
std::string file_name()
What is the path to the video file?
Definition: videofilebuffer.h:215
virtual void on_end_of_buffer(VideoBufferFlags::OnEndOfBuffer behaviour)
What should the buffer do when it reaches the end of the list of files?
Definition: videofilebuffer.h:187
Internal (non type-safe) class used by VideoFileBuffer This does the real interfacing with the ffmpeg...
Definition: videofilebuffer.h:95
Unable to decode the video frame.
Definition: videofilebuffer.h:47
Definition: videofilebuffer2.cc:203
double frames_per_second()
What is the (expected) frame rate of this video buffer, in frames per second?
Definition: videofilebuffer2.cc:697
The semsntics of the videobuffer. See VideoFrame::type()
Definition: videobuffer.h:12
The buffer does not have live semantics: frames are not throttled by something external.
Definition: videobuffer.h:20
seek_to() was called for an invalid timestamp
Definition: videofilebuffer.h:59
Base class for all VideoFileBuffer exceptions.
Definition: videofilebuffer.h:29
std::string file_name()
What is the path to the video file?
virtual ImageRef size()
The size of the VideoFrames returned by this buffer.
Definition: videofilebuffer.h:175
Base class for a VideoBuffer which manages its own memory for each VideoFrame that it provides...
Definition: localvideobuffer.h:17
get_frame() was called when at the end of the buffer
Definition: videofilebuffer.h:53
Definition: image_ref.h:29
double frame_rate()
What is the (expected) frame rate of this video buffer, in frames per second?
Definition: videofilebuffer.h:209
virtual void seek_to(double t)
Go to a particular point in the video buffer (only implemented in buffers of recorded video) ...
Definition: videofilebuffer.h:192
Unable to open allocate a video frame.
Definition: videofilebuffer.h:41
unsigned char byte
An 8-bit datatype.
Definition: byte.h:8
Base class for all VideoBuffer exceptions.
Definition: videobuffer.h:153
Unable to open the file as a video stream, for various reasons.
Definition: videofilebuffer.h:35
virtual VideoFileFrame< T > * get_frame()
Returns the next frame from the buffer. This function blocks until a frame is ready.
Definition: videofilebuffer.h:197
A frame from a VideoBuffer.
Definition: videoframe.h:35
void * get_frame()
Returns the next frame from the buffer. This function blocks until a frame is ready.
Definition: videofilebuffer2.cc:677
bool frame_pending()
Is there a frame waiting in the buffer? This function does not block.
Definition: videofilebuffer2.cc:672
A video buffer to play frames from a video file.
Definition: videofilebuffer.h:145
ImageRef size()
The size of the VideoFrames returned by this buffer.
Definition: videofilebuffer2.cc:667
virtual bool frame_pending()
Is there a frame waiting in the buffer? This function does not block.
Definition: videofilebuffer.h:180
void put_frame(void *f)
Tell the buffer that you are finished with this frame.
Definition: videofilebuffer2.cc:682