vidl2_dshow_file_istream Class Reference

#include <vidl2_dshow_file_istream.h>

Inheritance diagram for vidl2_dshow_file_istream:

vidl2_istream List of all members.

Detailed Description

DirectShow file input stream object.

This is still in an experimental stage, but should be usable. It should be able to open avi and wmv files as long as the system has the available decoder, in the case of compressed video.

DirectShow is very flexible and complex. Therefore we have taken the approach to throw an exception or abort in the case where something that is not supported fails, rather than try to parse through every error and provide an alternative. However, we welcome any feedback on desired features to make vidl2_dshow_file_istream more usable in the VXL context.

Definition at line 50 of file vidl2_dshow_file_istream.h.


Public Member Functions

 vidl2_dshow_file_istream (const vcl_string &name)
 Constructor - from a string containing the file name.
virtual ~vidl2_dshow_file_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 supports seeking.
virtual int num_frames () const
 Return the number of frames if known.
virtual unsigned int frame_number () const
 Return the current frame number.
virtual void close ()
 Close the stream.
virtual bool advance ()
 Advance to the next frame (but don't acquire an image).
virtual bool advance_wait ()
 Initiate advance and wait for completion; synchronous advance.
virtual bool advance_start ()
 Initiate advance and return immediately; asynchronous advance.
virtual bool is_frame_available () const
 Returns true if the advance has finished and a frame is available.
virtual vidl2_frame_sptr read_frame ()
 Read the next frame from the stream (advance and acquire).
virtual vidl2_frame_sptr current_frame ()
 Return the current frame in the stream.
virtual bool seek_frame (unsigned int frame_number)
 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

 vidl2_dshow_file_istream (const vidl2_dshow_file_istream &)
vidl2_dshow_file_istreamoperator= (const vidl2_dshow_file_istream &)
void open (const vcl_string &filename)
 Open a video file.

Private Attributes

CComPtr< IFilterGraph2 > filter_graph_
CComPtr< IMediaControl > media_control_
CComPtr< IMediaSeeking > media_seeking_
CComPtr< IMediaEventEx > media_event_
CComPtr< ISampleGrabber > sample_grabber_
vcl_vector< unsigned char > buffer_ [2]
double buffer_time_ [2]
unsigned char buffer_index_
unsigned int buffer_width_
unsigned int buffer_height_
vidl2_pixel_format buffer_pixel_format_
unsigned int frame_index_
REFERENCE_TIME end_position_
bool is_time_format_frame_
bool is_valid_
DWORD register_
 ID in Running Object Table (ROT), for debugging with GraphEdit.

Constructor & Destructor Documentation

vidl2_dshow_file_istream::vidl2_dshow_file_istream ( const vcl_string &  name  ) 

Constructor - from a string containing the file name.

Definition at line 19 of file vidl2_dshow_file_istream.cxx.

vidl2_dshow_file_istream::~vidl2_dshow_file_istream (  )  [virtual]

Destructor.

Definition at line 34 of file vidl2_dshow_file_istream.cxx.

vidl2_dshow_file_istream::vidl2_dshow_file_istream ( const vidl2_dshow_file_istream  )  [private]


Member Function Documentation

virtual bool vidl2_dshow_file_istream::is_open (  )  const [inline, virtual]

Return true if the stream is open for reading.

***** if closed, should return false

Implements vidl2_istream.

Definition at line 61 of file vidl2_dshow_file_istream.h.

virtual bool vidl2_dshow_file_istream::is_valid (  )  const [inline, virtual]

Return true if the stream is in a valid state.

Implements vidl2_istream.

Definition at line 64 of file vidl2_dshow_file_istream.h.

virtual bool vidl2_dshow_file_istream::is_seekable (  )  const [inline, virtual]

Return true if the stream supports seeking.

Implements vidl2_istream.

Definition at line 67 of file vidl2_dshow_file_istream.h.

virtual int vidl2_dshow_file_istream::num_frames (  )  const [inline, virtual]

Return the number of frames if known.

returns -1 for non-seekable streams

Todo:
this needs to be implemented

Implements vidl2_istream.

Definition at line 72 of file vidl2_dshow_file_istream.h.

virtual unsigned int vidl2_dshow_file_istream::frame_number (  )  const [inline, virtual]

Return the current frame number.

Implements vidl2_istream.

Definition at line 75 of file vidl2_dshow_file_istream.h.

void vidl2_dshow_file_istream::close (  )  [virtual]

Close the stream.

Implements vidl2_istream.

Definition at line 164 of file vidl2_dshow_file_istream.cxx.

virtual bool vidl2_dshow_file_istream::advance (  )  [inline, virtual]

Advance to the next frame (but don't acquire an image).

Implements vidl2_istream.

Definition at line 83 of file vidl2_dshow_file_istream.h.

bool vidl2_dshow_file_istream::advance_wait (  )  [inline, virtual]

Initiate advance and wait for completion; synchronous advance.

Definition at line 186 of file vidl2_dshow_file_istream.cxx.

bool vidl2_dshow_file_istream::advance_start (  )  [inline, virtual]

Initiate advance and return immediately; asynchronous advance.

Definition at line 197 of file vidl2_dshow_file_istream.cxx.

bool vidl2_dshow_file_istream::is_frame_available ( void   )  const [inline, virtual]

Returns true if the advance has finished and a frame is available.

***** Apparently it is asynchronous after all...

Definition at line 232 of file vidl2_dshow_file_istream.cxx.

vidl2_frame_sptr vidl2_dshow_file_istream::read_frame (  )  [inline, virtual]

Read the next frame from the stream (advance and acquire).

Implements vidl2_istream.

Definition at line 240 of file vidl2_dshow_file_istream.cxx.

vidl2_frame_sptr vidl2_dshow_file_istream::current_frame (  )  [inline, virtual]

Return the current frame in the stream.

Implements vidl2_istream.

Definition at line 247 of file vidl2_dshow_file_istream.cxx.

bool vidl2_dshow_file_istream::seek_frame ( unsigned int  frame_number  )  [inline, virtual]

Seek to the given frame number.

Returns:
true if successful

Implements vidl2_istream.

Definition at line 280 of file vidl2_dshow_file_istream.cxx.

vidl2_dshow_file_istream& vidl2_dshow_file_istream::operator= ( const vidl2_dshow_file_istream  )  [private]

void vidl2_dshow_file_istream::open ( const vcl_string &  filename  )  [private]

Open a video file.

Definition at line 40 of file vidl2_dshow_file_istream.cxx.

void vidl2_istream::ref (  )  [inline, inherited]

Increment reference count.

Definition at line 67 of file vidl2_istream.h.

void vidl2_istream::unref (  )  [inline, inherited]

Decrement reference count.

Definition at line 70 of file vidl2_istream.h.

int vidl2_istream::ref_count (  )  const [inline, inherited]

Number of objects referring to this data.

Definition at line 73 of file vidl2_istream.h.


Member Data Documentation

CComPtr<IFilterGraph2> vidl2_dshow_file_istream::filter_graph_ [private]

Definition at line 113 of file vidl2_dshow_file_istream.h.

CComPtr<IMediaControl> vidl2_dshow_file_istream::media_control_ [private]

Definition at line 114 of file vidl2_dshow_file_istream.h.

CComPtr<IMediaSeeking> vidl2_dshow_file_istream::media_seeking_ [private]

Definition at line 115 of file vidl2_dshow_file_istream.h.

CComPtr<IMediaEventEx> vidl2_dshow_file_istream::media_event_ [private]

Definition at line 116 of file vidl2_dshow_file_istream.h.

CComPtr<ISampleGrabber> vidl2_dshow_file_istream::sample_grabber_ [private]

Definition at line 117 of file vidl2_dshow_file_istream.h.

vcl_vector<unsigned char> vidl2_dshow_file_istream::buffer_[2] [private]

Definition at line 120 of file vidl2_dshow_file_istream.h.

double vidl2_dshow_file_istream::buffer_time_[2] [private]

Definition at line 121 of file vidl2_dshow_file_istream.h.

unsigned char vidl2_dshow_file_istream::buffer_index_ [private]

Definition at line 122 of file vidl2_dshow_file_istream.h.

unsigned int vidl2_dshow_file_istream::buffer_width_ [private]

Definition at line 123 of file vidl2_dshow_file_istream.h.

unsigned int vidl2_dshow_file_istream::buffer_height_ [private]

Definition at line 124 of file vidl2_dshow_file_istream.h.

vidl2_pixel_format vidl2_dshow_file_istream::buffer_pixel_format_ [private]

Definition at line 125 of file vidl2_dshow_file_istream.h.

unsigned int vidl2_dshow_file_istream::frame_index_ [private]

Definition at line 128 of file vidl2_dshow_file_istream.h.

REFERENCE_TIME vidl2_dshow_file_istream::end_position_ [private]

Definition at line 129 of file vidl2_dshow_file_istream.h.

bool vidl2_dshow_file_istream::is_time_format_frame_ [private]

Definition at line 130 of file vidl2_dshow_file_istream.h.

bool vidl2_dshow_file_istream::is_valid_ [private]

Definition at line 131 of file vidl2_dshow_file_istream.h.

DWORD vidl2_dshow_file_istream::register_ [private]

ID in Running Object Table (ROT), for debugging with GraphEdit.

Definition at line 134 of file vidl2_dshow_file_istream.h.


The documentation for this class was generated from the following files:
Generated on Sun Sep 7 05:21:36 2008 for contrib/brl/bbas/vidl2 by  doxygen 1.5.1