A video input stream using a v4l2 device. More...
#include <vidl_v4l2_istream.h>
Public Member Functions | |
vidl_v4l2_istream (vidl_v4l2_device &device) | |
Constructor. | |
virtual | ~vidl_v4l2_istream () |
Destructor. | |
virtual bool | is_open () const |
Return true if the stream is open for reading. | |
virtual bool | is_valid () const |
Return true if the stream is in a valid state. | |
virtual bool | is_seekable () const |
Return true if the stream support seeking. | |
virtual unsigned int | frame_number () const |
Return the current frame number. | |
virtual int | num_frames () const |
Return the number of frames if known. | |
virtual unsigned int | width () const |
Return the width of each frame. | |
virtual unsigned int | height () const |
Return the height of each frame. | |
virtual vidl_pixel_format | format () const |
Return the pixel format. | |
virtual double | frame_rate () const |
Return the frame rate (0.0 if unspecified). | |
virtual double | duration () const |
Return the duration in seconds (0.0 if unknown). | |
unsigned int | frame_number_device () const |
Return the current frame number. does this works?. | |
virtual void | close () |
Close the stream. | |
virtual bool | advance () |
Advance to the next frame (but don't acquire an image). | |
virtual vidl_frame_sptr | read_frame () |
Read the next frame from the stream (advance and acquire). | |
virtual vidl_frame_sptr | current_frame () |
Return the current frame in the stream. | |
virtual bool | seek_frame (unsigned int) |
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 | |
void | update_frame () |
Private Attributes | |
vidl_v4l2_device & | dev |
vidl_frame_sptr | cur_frame_ |
unsigned int | frame_number_ |
A video input stream using a v4l2 device.
Definition at line 19 of file vidl_v4l2_istream.h.
vidl_v4l2_istream::vidl_v4l2_istream | ( | vidl_v4l2_device & | device | ) |
Constructor.
Definition at line 43 of file vidl_v4l2_istream.cxx.
virtual vidl_v4l2_istream::~vidl_v4l2_istream | ( | ) | [inline, virtual] |
Destructor.
Definition at line 33 of file vidl_v4l2_istream.h.
bool vidl_v4l2_istream::advance | ( | void | ) | [virtual] |
Advance to the next frame (but don't acquire an image).
Implements vidl_istream.
Definition at line 48 of file vidl_v4l2_istream.cxx.
virtual void vidl_v4l2_istream::close | ( | void | ) | [inline, virtual] |
virtual vidl_frame_sptr vidl_v4l2_istream::current_frame | ( | void | ) | [inline, virtual] |
Return the current frame in the stream.
Implements vidl_istream.
Definition at line 79 of file vidl_v4l2_istream.h.
virtual double vidl_v4l2_istream::duration | ( | ) | const [inline, virtual] |
Return the duration in seconds (0.0 if unknown).
Implements vidl_istream.
Definition at line 64 of file vidl_v4l2_istream.h.
virtual vidl_pixel_format vidl_v4l2_istream::format | ( | ) | const [inline, virtual] |
Return the pixel format.
Implements vidl_istream.
Definition at line 58 of file vidl_v4l2_istream.h.
virtual unsigned int vidl_v4l2_istream::frame_number | ( | ) | const [inline, virtual] |
Return the current frame number.
Implements vidl_istream.
Definition at line 45 of file vidl_v4l2_istream.h.
unsigned int vidl_v4l2_istream::frame_number_device | ( | ) | const [inline] |
Return the current frame number. does this works?.
Definition at line 67 of file vidl_v4l2_istream.h.
virtual double vidl_v4l2_istream::frame_rate | ( | ) | const [inline, virtual] |
Return the frame rate (0.0 if unspecified).
Implements vidl_istream.
Definition at line 61 of file vidl_v4l2_istream.h.
virtual unsigned int vidl_v4l2_istream::height | ( | ) | const [inline, virtual] |
Return the height of each frame.
Implements vidl_istream.
Definition at line 55 of file vidl_v4l2_istream.h.
virtual bool vidl_v4l2_istream::is_open | ( | ) | const [inline, virtual] |
Return true if the stream is open for reading.
Implements vidl_istream.
Definition at line 36 of file vidl_v4l2_istream.h.
virtual bool vidl_v4l2_istream::is_seekable | ( | ) | const [inline, virtual] |
Return true if the stream support seeking.
Implements vidl_istream.
Definition at line 42 of file vidl_v4l2_istream.h.
virtual bool vidl_v4l2_istream::is_valid | ( | void | ) | const [inline, virtual] |
Return true if the stream is in a valid state.
Implements vidl_istream.
Definition at line 39 of file vidl_v4l2_istream.h.
virtual int vidl_v4l2_istream::num_frames | ( | ) | const [inline, virtual] |
Return the number of frames if known.
returns -1 for non-seekable streams
Implements vidl_istream.
Definition at line 49 of file vidl_v4l2_istream.h.
vidl_frame_sptr vidl_v4l2_istream::read_frame | ( | void | ) | [virtual] |
Read the next frame from the stream (advance and acquire).
Implements vidl_istream.
Definition at line 60 of file vidl_v4l2_istream.cxx.
void vidl_istream::ref | ( | ) | [inline, inherited] |
Increment reference count.
Definition at line 87 of file vidl_istream.h.
int vidl_istream::ref_count | ( | ) | const [inline, inherited] |
Number of objects referring to this data.
Definition at line 93 of file vidl_istream.h.
virtual bool vidl_v4l2_istream::seek_frame | ( | unsigned int | ) | [inline, virtual] |
Seek to the given frame number.
Implements vidl_istream.
Definition at line 83 of file vidl_v4l2_istream.h.
void vidl_istream::unref | ( | ) | [inline, inherited] |
Decrement reference count.
Definition at line 90 of file vidl_istream.h.
void vidl_v4l2_istream::update_frame | ( | ) | [private] |
Definition at line 17 of file vidl_v4l2_istream.cxx.
virtual unsigned int vidl_v4l2_istream::width | ( | ) | const [inline, virtual] |
Return the width of each frame.
Implements vidl_istream.
Definition at line 52 of file vidl_v4l2_istream.h.
vidl_frame_sptr vidl_v4l2_istream::cur_frame_ [mutable, private] |
Definition at line 23 of file vidl_v4l2_istream.h.
vidl_v4l2_device& vidl_v4l2_istream::dev [private] |
Definition at line 22 of file vidl_v4l2_istream.h.
unsigned int vidl_v4l2_istream::frame_number_ [private] |
Definition at line 24 of file vidl_v4l2_istream.h.