A base class for input video streams. More...
#include <vidl_istream.h>
Public Member Functions | |
vidl_istream () | |
Constructor. | |
virtual | ~vidl_istream () |
Destructor. | |
virtual bool | is_open () const =0 |
Return true if the stream is open for reading. | |
virtual bool | is_valid () const =0 |
Return true if the stream is in a valid state. | |
virtual bool | is_seekable () const =0 |
Return true if the stream supports seeking. | |
virtual int | num_frames () const =0 |
Return the number of frames if known. | |
virtual unsigned int | frame_number () const =0 |
Return the current frame number. | |
virtual unsigned int | width () const =0 |
Return the width of each frame. | |
virtual unsigned int | height () const =0 |
Return the height of each frame. | |
virtual vidl_pixel_format | format () const =0 |
Return the pixel format. | |
virtual double | frame_rate () const =0 |
Return the frame rate (FPS, 0.0 if unspecified). | |
virtual double | duration () const =0 |
Return the duration in seconds (0.0 if unknown). | |
virtual void | close ()=0 |
Close the stream. | |
virtual bool | advance ()=0 |
Advance to the next frame (but don't acquire an image). | |
virtual vidl_frame_sptr | read_frame ()=0 |
Read the next frame from the stream (advance and acquire). | |
virtual vidl_frame_sptr | current_frame ()=0 |
Return the current frame in the stream. | |
virtual bool | seek_frame (unsigned int frame_number)=0 |
Seek to the given frame number. | |
void | ref () |
Increment reference count. | |
void | unref () |
Decrement reference count. | |
int | ref_count () const |
Number of objects referring to this data. | |
Private Member Functions | |
vidl_istream (const vidl_istream &) | |
prevent deep copying a stream. | |
Private Attributes | |
int | ref_count_ |
A base class for input video streams.
Definition at line 18 of file vidl_istream.h.
vidl_istream::vidl_istream | ( | ) | [inline] |
Constructor.
Definition at line 22 of file vidl_istream.h.
virtual vidl_istream::~vidl_istream | ( | ) | [inline, virtual] |
Destructor.
Definition at line 24 of file vidl_istream.h.
vidl_istream::vidl_istream | ( | const vidl_istream & | ) | [inline, private] |
prevent deep copying a stream.
Definition at line 80 of file vidl_istream.h.
virtual bool vidl_istream::advance | ( | ) | [pure virtual] |
Advance to the next frame (but don't acquire an image).
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_v4l_istream, vidl_dshow_file_istream, vidl_image_list_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
virtual void vidl_istream::close | ( | ) | [pure virtual] |
Close the stream.
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_v4l_istream, vidl_v4l2_istream, vidl_image_list_istream, vidl_dc1394_istream, and vidl_ffmpeg_istream.
virtual vidl_frame_sptr vidl_istream::current_frame | ( | ) | [pure virtual] |
Return the current frame in the stream.
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_v4l_istream, vidl_image_list_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
virtual double vidl_istream::duration | ( | ) | const [pure virtual] |
Return the duration in seconds (0.0 if unknown).
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_image_list_istream, vidl_v4l_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
virtual vidl_pixel_format vidl_istream::format | ( | ) | const [pure virtual] |
Return the pixel format.
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_image_list_istream, vidl_v4l_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
virtual unsigned int vidl_istream::frame_number | ( | ) | const [pure virtual] |
Return the current frame number.
before the first call to advance() the frame number is static_cast<unsigned int>(-1)
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_v4l_istream, vidl_dshow_file_istream, vidl_image_list_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
virtual double vidl_istream::frame_rate | ( | ) | const [pure virtual] |
Return the frame rate (FPS, 0.0 if unspecified).
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_image_list_istream, vidl_v4l_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
virtual unsigned int vidl_istream::height | ( | ) | const [pure virtual] |
Return the height of each frame.
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_image_list_istream, vidl_v4l_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
virtual bool vidl_istream::is_open | ( | ) | const [pure virtual] |
Return true if the stream is open for reading.
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_v4l_istream, vidl_dc1394_istream, vidl_image_list_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
virtual bool vidl_istream::is_seekable | ( | ) | const [pure virtual] |
Return true if the stream supports seeking.
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_v4l_istream, vidl_image_list_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
virtual bool vidl_istream::is_valid | ( | ) | const [pure virtual] |
Return true if the stream is in a valid state.
Streams open in an invalid state pointing to the frame before the first valid frame. The stream becomes valid when it is first advanced.
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_v4l_istream, vidl_dc1394_istream, vidl_image_list_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
virtual int vidl_istream::num_frames | ( | ) | const [pure virtual] |
Return the number of frames if known.
returns -1 for non-seekable streams
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_v4l_istream, vidl_image_list_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
virtual vidl_frame_sptr vidl_istream::read_frame | ( | ) | [pure virtual] |
Read the next frame from the stream (advance and acquire).
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_v4l_istream, vidl_image_list_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
void vidl_istream::ref | ( | ) | [inline] |
Increment reference count.
Definition at line 87 of file vidl_istream.h.
int vidl_istream::ref_count | ( | ) | const [inline] |
Number of objects referring to this data.
Definition at line 93 of file vidl_istream.h.
virtual bool vidl_istream::seek_frame | ( | unsigned int | frame_number | ) | [pure virtual] |
Seek to the given frame number.
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_v4l_istream, vidl_image_list_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
void vidl_istream::unref | ( | ) | [inline] |
Decrement reference count.
Definition at line 90 of file vidl_istream.h.
virtual unsigned int vidl_istream::width | ( | ) | const [pure virtual] |
Return the width of each frame.
Implemented in vidl_dshow_live_istream< ParamsObject >, vidl_dshow_file_istream, vidl_image_list_istream, vidl_v4l_istream, vidl_dc1394_istream, vidl_ffmpeg_istream, and vidl_v4l2_istream.
int vidl_istream::ref_count_ [private] |
Definition at line 96 of file vidl_istream.h.