VideoSource Class Reference
[Videosource: Video acquisition abstraction]

Video source abstraction class. More...

#include <videosource.h>

Inheritance diagram for VideoSource:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool initialize ()=0
 initialized the video source.
virtual bool getFrame (IplImage *dst)=0
 get the next frame and convert it to the format described in "dst".
virtual void getSize (int &width, int &height)=0
 return width and height of images coming from the video source.
virtual ~VideoSource ()
virtual void start ()=0
 Start the video source: getFrame() will provide each time a different image.
virtual void stop ()=0
 Pause the source.
virtual void restart ()
 Restart the video. On live media, just "start" it.
virtual bool isPlaying ()=0
 return false if the source is paused.
virtual int getId ()
 This method is usefull only for video files, not grabbing hardware.
virtual int getChannels ()
 Get the number of channels the video source provides.
virtual void postProcess (FptFrame *)
 Allow the video source to have access to tracked data.
virtual const char * getStreamName () const =0
 Returns a string describing the stream.
virtual const char * getStreamType () const =0
 Returns a string describing the type of the stream.
virtual void * getInternalPointer ()


Detailed Description

Video source abstraction class.

This class represent a video source, providing a sequence of images. In order to use a VideoSource object, initialize() has to be call and has to return true.

To construct a VideoSource object, it is a good idea to use the VideoSourceFactory class.

Definition at line 49 of file videosource.h.


Constructor & Destructor Documentation

virtual VideoSource::~VideoSource (  )  [inline, virtual]

Definition at line 70 of file videosource.h.


Member Function Documentation

virtual int VideoSource::getChannels (  )  [inline, virtual]

Get the number of channels the video source provides.

Returns:
1 for gray level images, 3 for RGB images.

Reimplemented in DC1394.

Definition at line 97 of file videosource.h.

virtual bool VideoSource::getFrame ( IplImage *  dst  )  [pure virtual]

get the next frame and convert it to the format described in "dst".

The image will be deinterlaced, scaled, and color converted to match dst.

Parameters:
dst the image to copy the frame into.
Returns:
true on success, false on error.

Implemented in BmpVideoSource, DC1394, DShowCB, DShowFile, FlyCaptureVideoSource, MPlayerVideoSource, and OpenCVVideoSource.

Referenced by vobj_tracker_view::timerEvent(), VSView::timerEvent(), vobj_tracker_view::vobj_tracker_view(), and VSView::VSView().

virtual int VideoSource::getId (  )  [inline, virtual]

This method is usefull only for video files, not grabbing hardware.

It returns a the number of the last frame provided by getFrame().

Returns:
the unique frame number or -1 if the video source does not support frame counting.

Reimplemented in BmpVideoSource, DShowCB, DShowFile, MPlayerVideoSource, and OpenCVVideoSource.

Definition at line 92 of file videosource.h.

Referenced by vobj_tracker_view::timerEvent(), and VSView::timerEvent().

virtual void* VideoSource::getInternalPointer (  )  [inline, virtual]

Reimplemented in DC1394.

Definition at line 113 of file videosource.h.

virtual void VideoSource::getSize ( int &  width,
int &  height 
) [pure virtual]

virtual const char* VideoSource::getStreamName (  )  const [pure virtual]

Returns a string describing the stream.

If the source comes from a file, the filename is returned.

Implemented in BmpVideoSource, DC1394, DShowCB, DShowFile, FlyCaptureVideoSource, MPlayerVideoSource, and OpenCVVideoSource.

virtual const char* VideoSource::getStreamType (  )  const [pure virtual]

Returns a string describing the type of the stream.

For example: BmpFile, AviFile, DShowCB...

Implemented in BmpVideoSource, DC1394, DShowCB, DShowFile, FlyCaptureVideoSource, MPlayerVideoSource, and OpenCVVideoSource.

virtual bool VideoSource::initialize (  )  [pure virtual]

initialized the video source.

Has to be called before any other method.

Returns:
true on success, false on error.

Implemented in BmpVideoSource, DC1394, DShowCB, DShowFile, FlyCaptureVideoSource, MPlayerVideoSource, and OpenCVVideoSource.

virtual bool VideoSource::isPlaying (  )  [pure virtual]

virtual void VideoSource::postProcess ( FptFrame *   )  [inline, virtual]

Allow the video source to have access to tracked data.

Usefull for networked applications.

Definition at line 101 of file videosource.h.

virtual void VideoSource::restart (  )  [inline, virtual]

Restart the video. On live media, just "start" it.

Definition at line 82 of file videosource.h.

References start().

virtual void VideoSource::start (  )  [pure virtual]

Start the video source: getFrame() will provide each time a different image.

After calling initialize(), the video source is playing.

Implemented in BmpVideoSource, DC1394, DShowCB, DShowFile, FlyCaptureVideoSource, MPlayerVideoSource, and OpenCVVideoSource.

Referenced by vobj_tracker_view::keyPressEvent(), VSView::keyPressEvent(), restart(), vobj_tracker_view::vobj_tracker_view(), and VSView::VSView().

virtual void VideoSource::stop (  )  [pure virtual]

Pause the source.

The getFrame() method will always provide the current frame.

Implemented in BmpVideoSource, DC1394, DShowCB, DShowFile, FlyCaptureVideoSource, MPlayerVideoSource, and OpenCVVideoSource.

Referenced by vobj_tracker_view::keyPressEvent(), and VSView::keyPressEvent().


The documentation for this class was generated from the following file:

Generated on Tue Mar 30 15:53:26 2010 for Polyora by  doxygen 1.5.9