InputMPEGStream Class Reference

InputMPEGStream is a wrapper class to read video frames from mpeg-1. More...

#include <Media/MpegInputStream.H>

Inheritance diagram for InputMPEGStream:
Inheritance graph
[legend]
Collaboration diagram for InputMPEGStream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 InputMPEGStream (OptionManager &mgr, const std::string &descrName="Input MPEG Stream", const std::string &tagName="InputMPEGStream")
 Construct an mpegstream object for mpeg input.
virtual ~InputMPEGStream ()
 Virtual destructor.
virtual void setConfigInfo (const std::string &filename)
 Override from FrameIstream; just calls setFileName().
virtual bool setFrameNumber (int n)
 override the base class version so we can seek to the proper frame number
virtual GenericFrameSpec peekFrameSpec ()
 get frame specifications, peeking at the first frame if necessary
void setFileName (std::string fname)
 Configure the MPEG Stream for decoding.
virtual GenericFrame readFrame ()
 Read the next frame from the mpeg stream.
virtual Image< PixRGB< byte > > readRGB ()
 Read the next frame from the mpeg stream.
virtual bool readAndDiscardFrame ()
 Read a frame from the stream and discard it.
VideoFrame readVideoFrame ()
 Get the next raw VideoFrame from the stream.

Protected Member Functions

void stop2 ()
 get stopped; close any open write stream

Protected Attributes

NModelParam< int > itsBuffLen
OModelParam< std::stringitsCodecName
OModelParam< bool > itsDoPreload
std::string itsFileName

Detailed Description

InputMPEGStream is a wrapper class to read video frames from mpeg-1.

InputMPEGStream is a wrapper class to read video frames from mpeg-1, mpeg-4 (aka divx), asf, avi, mov and any other format that mplayer can decode. Audio streams are entirely ignored.

Definition at line 57 of file MpegInputStream.H.


Constructor & Destructor Documentation

InputMPEGStream::InputMPEGStream ( OptionManager mgr,
const std::string descrName = "Input MPEG Stream",
const std::string tagName = "InputMPEGStream" 
)

Construct an mpegstream object for mpeg input.

Definition at line 94 of file MpegInputStream.C.

InputMPEGStream::~InputMPEGStream (  )  [virtual]

Virtual destructor.

Definition at line 107 of file MpegInputStream.C.


Member Function Documentation

GenericFrameSpec InputMPEGStream::peekFrameSpec (  )  [virtual]

get frame specifications, peeking at the first frame if necessary

Implements FrameIstream.

Definition at line 140 of file MpegInputStream.C.

References ASSERT, and MovieDecoder::peekFrameSpec().

bool InputMPEGStream::readAndDiscardFrame (  )  [virtual]

Read a frame from the stream and discard it.

If you know you are going to discard the frame (e.g. to skip ahead to a certain frame number, or to count the frame), then it is more efficient to call readAndDiscardFrame() than to call readVideoFrame() or readRGB() but ignore the result.

Reimplemented from FrameIstream.

Definition at line 184 of file MpegInputStream.C.

References ASSERT, and MovieDecoder::readAndDiscardFrame().

GenericFrame InputMPEGStream::readFrame (  )  [virtual]

Read the next frame from the mpeg stream.

The native representation of the GenericFrame will be a VideoFrame.

Implements FrameIstream.

Definition at line 162 of file MpegInputStream.C.

References ASSERT, and MovieDecoder::readVideoFrame().

Image< PixRGB< byte > > InputMPEGStream::readRGB (  )  [virtual]

Read the next frame from the mpeg stream.

returns an image of size (0,0) at the end of the stream

Reimplemented from FrameIstream.

Definition at line 173 of file MpegInputStream.C.

References ASSERT, and MovieDecoder::readRGB().

VideoFrame InputMPEGStream::readVideoFrame (  ) 

Get the next raw VideoFrame from the stream.

Definition at line 195 of file MpegInputStream.C.

References ASSERT, and MovieDecoder::readVideoFrame().

void InputMPEGStream::setConfigInfo ( const std::string filename  )  [virtual]

Override from FrameIstream; just calls setFileName().

Reimplemented from FrameIstream.

Definition at line 120 of file MpegInputStream.C.

References setFileName().

void InputMPEGStream::setFileName ( std::string  fname  ) 

Configure the MPEG Stream for decoding.

Parameters:
fname name of file from which frames are to be read from

Definition at line 151 of file MpegInputStream.C.

Referenced by setConfigInfo().

bool InputMPEGStream::setFrameNumber ( int  n  )  [virtual]

override the base class version so we can seek to the proper frame number

Reimplemented from FrameIstream.

Definition at line 130 of file MpegInputStream.C.

References MovieDecoder::apparentFrameNumber(), and MovieDecoder::setFrameNumber().

void InputMPEGStream::stop2 (  )  [protected, virtual]

get stopped; close any open write stream

Reimplemented from ModelComponent.

Definition at line 113 of file MpegInputStream.C.


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:23 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3