Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vidl2_dshow_live_istream< ParamsObject > Class Template Reference

#include <vidl2_dshow_live_istream.h>

Inheritance diagram for vidl2_dshow_live_istream< ParamsObject >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class ParamsObject>
class vidl2_dshow_live_istream< ParamsObject >

DirectShow live video input stream support.

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 83 of file vidl2_dshow_live_istream.h.

Public Member Functions

 vidl2_dshow_live_istream ()
 Constructor - default.
 vidl2_dshow_live_istream (const vcl_string &device_name)
 Constructor - from a string containing a device name.
 vidl2_dshow_live_istream (const ParamsObject &params)
 Constructor - from a parameter object.
virtual ~vidl2_dshow_live_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 void close ()
 Close the stream.
virtual bool advance ()
 Advance to the next frame (but don't acquire an image).
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 run (void)
void pause (void)
void stop (void)
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_live_istream (const vidl2_dshow_live_istream &)
vidl2_dshow_live_istreamoperator= (const vidl2_dshow_live_istream &)
void connect (void)
 Connect to a device using its FriendlyName (in params_ object).
void wait_for_state_change (HRESULT hr)
 If hr == S_FALSE, wait for the state change to complete.
bool advance_wait ()
 Initiate advance and wait for completion; synchronous advance.
bool advance_start ()
 Initiate advance and return immediately; asynchronous advance.
bool is_frame_available () const
 Advance to the next frame (but don't acquire an image).

Private Attributes

ParamsObject params_
 Parameters that define the input stream process.
sample_grabber_cb sample_grabber_callback_
 ***** Callback method.
CComPtr< IFilterGraph2 > filter_graph_
CComPtr< IMoniker > moniker_
CComPtr< IMediaControl > media_control_
vidl2_frame_sptr buffer_
unsigned int buffer_width_
unsigned int buffer_height_
vidl2_pixel_format buffer_pixel_format_
bool is_valid_
DWORD register_
 ID in Running Object Table (ROT), for debugging with GraphEdit.


Constructor & Destructor Documentation

template<class ParamsObject>
vidl2_dshow_live_istream< ParamsObject >::vidl2_dshow_live_istream  ) 
 

Constructor - default.

Definition at line 110 of file vidl2_dshow_live_istream.cxx.

template<class ParamsObject>
vidl2_dshow_live_istream< ParamsObject >::vidl2_dshow_live_istream const vcl_string &  device_name  ) 
 

Constructor - from a string containing a device name.

Definition at line 131 of file vidl2_dshow_live_istream.cxx.

template<class ParamsObject>
vidl2_dshow_live_istream< ParamsObject >::vidl2_dshow_live_istream const ParamsObject &  params  ) 
 

Constructor - from a parameter object.

Definition at line 141 of file vidl2_dshow_live_istream.cxx.

template<class ParamsObject>
virtual vidl2_dshow_live_istream< ParamsObject >::~vidl2_dshow_live_istream  )  [inline, virtual]
 

Destructor.

Definition at line 96 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
vidl2_dshow_live_istream< ParamsObject >::vidl2_dshow_live_istream const vidl2_dshow_live_istream< ParamsObject > &   )  [private]
 


Member Function Documentation

template<class ParamsObject>
virtual bool vidl2_dshow_live_istream< ParamsObject >::advance void   )  [inline, virtual]
 

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

Implements vidl2_istream.

Definition at line 118 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
bool vidl2_dshow_live_istream< ParamsObject >::advance_start  )  [inline, private]
 

Initiate advance and return immediately; asynchronous advance.

Definition at line 340 of file vidl2_dshow_live_istream.cxx.

template<class ParamsObject>
bool vidl2_dshow_live_istream< ParamsObject >::advance_wait  )  [inline, private]
 

Initiate advance and wait for completion; synchronous advance.

Definition at line 331 of file vidl2_dshow_live_istream.cxx.

template<class ParamsObject>
void vidl2_dshow_live_istream< ParamsObject >::close  )  [inline, virtual]
 

Close the stream.

Implements vidl2_istream.

Definition at line 312 of file vidl2_dshow_live_istream.cxx.

template<class ParamsObject>
void vidl2_dshow_live_istream< ParamsObject >::connect void   )  [private]
 

Connect to a device using its FriendlyName (in params_ object).

Definition at line 158 of file vidl2_dshow_live_istream.cxx.

template<class ParamsObject>
vidl2_frame_sptr vidl2_dshow_live_istream< ParamsObject >::current_frame  )  [inline, virtual]
 

Return the current frame in the stream.

Implements vidl2_istream.

Definition at line 366 of file vidl2_dshow_live_istream.cxx.

template<class ParamsObject>
virtual unsigned int vidl2_dshow_live_istream< ParamsObject >::frame_number  )  const [inline, virtual]
 

Return the current frame number.

***** through exception ??

Implements vidl2_istream.

Definition at line 110 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
bool vidl2_dshow_live_istream< ParamsObject >::is_frame_available  )  const [inline, private]
 

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

Definition at line 349 of file vidl2_dshow_live_istream.cxx.

template<class ParamsObject>
virtual bool vidl2_dshow_live_istream< ParamsObject >::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 100 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
virtual bool vidl2_dshow_live_istream< ParamsObject >::is_seekable  )  const [inline, virtual]
 

Return true if the stream support seeking.

Implements vidl2_istream.

Definition at line 106 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
virtual bool vidl2_dshow_live_istream< ParamsObject >::is_valid  )  const [inline, virtual]
 

Return true if the stream is in a valid state.

Implements vidl2_istream.

Definition at line 103 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
vidl2_dshow_live_istream& vidl2_dshow_live_istream< ParamsObject >::operator= const vidl2_dshow_live_istream< ParamsObject > &   )  [private]
 

template<class ParamsObject>
void vidl2_dshow_live_istream< ParamsObject >::pause void   )  [inline]
 

Definition at line 400 of file vidl2_dshow_live_istream.cxx.

template<class ParamsObject>
vidl2_frame_sptr vidl2_dshow_live_istream< ParamsObject >::read_frame  )  [inline, virtual]
 

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

Implements vidl2_istream.

Definition at line 357 of file vidl2_dshow_live_istream.cxx.

void vidl2_istream::ref  )  [inline, inherited]
 

Increment reference count.

Definition at line 63 of file vidl2_istream.h.

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

Number of objects referring to this data.

Definition at line 69 of file vidl2_istream.h.

template<class ParamsObject>
void vidl2_dshow_live_istream< ParamsObject >::run void   )  [inline]
 

Definition at line 394 of file vidl2_dshow_live_istream.cxx.

template<class ParamsObject>
virtual bool vidl2_dshow_live_istream< ParamsObject >::seek_frame unsigned int  frame_number  )  [inline, virtual]
 

Seek to the given frame number.

***** throw exception ??

Implements vidl2_istream.

Definition at line 128 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
void vidl2_dshow_live_istream< ParamsObject >::stop void   )  [inline]
 

Definition at line 406 of file vidl2_dshow_live_istream.cxx.

void vidl2_istream::unref  )  [inline, inherited]
 

Decrement reference count.

Definition at line 66 of file vidl2_istream.h.

template<class ParamsObject>
void vidl2_dshow_live_istream< ParamsObject >::wait_for_state_change HRESULT  hr  )  [inline, private]
 

If hr == S_FALSE, wait for the state change to complete.

Definition at line 384 of file vidl2_dshow_live_istream.cxx.


Member Data Documentation

template<class ParamsObject>
vidl2_frame_sptr vidl2_dshow_live_istream< ParamsObject >::buffer_ [private]
 

Definition at line 157 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
unsigned int vidl2_dshow_live_istream< ParamsObject >::buffer_height_ [private]
 

Definition at line 159 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
vidl2_pixel_format vidl2_dshow_live_istream< ParamsObject >::buffer_pixel_format_ [private]
 

Definition at line 160 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
unsigned int vidl2_dshow_live_istream< ParamsObject >::buffer_width_ [private]
 

Definition at line 158 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
CComPtr<IFilterGraph2> vidl2_dshow_live_istream< ParamsObject >::filter_graph_ [private]
 

Definition at line 152 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
bool vidl2_dshow_live_istream< ParamsObject >::is_valid_ [private]
 

Definition at line 163 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
CComPtr<IMediaControl> vidl2_dshow_live_istream< ParamsObject >::media_control_ [private]
 

Definition at line 154 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
CComPtr<IMoniker> vidl2_dshow_live_istream< ParamsObject >::moniker_ [private]
 

Definition at line 153 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
ParamsObject vidl2_dshow_live_istream< ParamsObject >::params_ [private]
 

Parameters that define the input stream process.

Definition at line 140 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
DWORD vidl2_dshow_live_istream< ParamsObject >::register_ [private]
 

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

Definition at line 166 of file vidl2_dshow_live_istream.h.

template<class ParamsObject>
sample_grabber_cb vidl2_dshow_live_istream< ParamsObject >::sample_grabber_callback_ [private]
 

***** Callback method.

..

Definition at line 149 of file vidl2_dshow_live_istream.h.


The documentation for this class was generated from the following files:
Generated on Thu Jan 10 14:51:33 2008 for contrib/brl/bbas/vidl2 by  doxygen 1.4.4