InputMPEGStream is a wrapper class to read video frames from mpeg-1. More...
#include <Media/MpegInputStream.H>
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::string > | itsCodecName |
OModelParam< bool > | itsDoPreload |
std::string | itsFileName |
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.
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.
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().
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.
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.