Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

MPEGSource Class Reference

A class which implements the ImageSource interface as a source of MPEG movie Images. More...

#include <MPEGSource.h>

Inheritance diagram for MPEGSource::

ImageSource List of all members.

Public Methods

 MPEGSource (char *path)
 Initialise an MPEG movie source. More...

 ~MPEGSource ()
 Close MPEG file and free up the memory.

virtual ImageSourceoperator>> (ImageRGB &)
 Extract a frame of the MPEG movie to the colour Images data buffer. More...

virtual ImageSourceoperator>> (ImageGrey &)
 Extract a frame of the MPEG movie to the greyscale Images brightness buffer. More...

virtual ImageSourceoperator>> (Image &)
 Extract a frame of the MPEG movie. More...

void get_size (unsigned int &, unsigned int &)
 Return the width and height of the MPEG. More...

int get_no_frames ()
 Get number of frames.

int set_frame (long frame_no)
 Seek to point in file. More...

void get_framerate (float &)
 Return the frame rate of the MPEG. More...

bool eof (void) const
 Test for end of file. More...


Protected Attributes

mpeg3_t* file
 MPEG file handle.

unsigned char** buff
 Buffer for decoded data.

char* Y
 Buffer for decoded YUV Y data.

char* U
 Buffer for decoded YUV U data.

char* V
 Buffer for decoded YUV V data.

unsigned int width
 MPEG width.

unsigned int height
 MPEG height.

long frames
 Number of frames in movie.

float framerate
 Frame rate of the movie.


Detailed Description

A class which implements the ImageSource interface as a source of MPEG movie Images.

Each image that is extracted from the MPEGSource class is a frame of the MPEG movie.

Note:
Assumes only one stream

Definition at line 30 of file MPEGSource.h.


Constructor & Destructor Documentation

MPEGSource::MPEGSource ( char * path )
 

Initialise an MPEG movie source.

Parameters:
path   The path and filename of the MPEG file to use.

Definition at line 30 of file MPEGSource.cpp.


Member Function Documentation

bool MPEGSource::eof ( void ) const
 

Test for end of file.

Returns 1 if end of file, 0 otherwise.

Definition at line 196 of file MPEGSource.cpp.

void MPEGSource::get_framerate ( float & fr_rate )
 

Return the frame rate of the MPEG.

Parameters:
framerate   The framerate of the MPEG.

Definition at line 186 of file MPEGSource.cpp.

void MPEGSource::get_size ( unsigned int & w,
unsigned int & h ) [virtual]
 

Return the width and height of the MPEG.

Parameters:
w   The width of the MPEG frame.
h   The height of the MPEG frame.

Reimplemented from ImageSource.

Definition at line 164 of file MPEGSource.cpp.

ImageSource & MPEGSource::operator>> ( Image & img ) [virtual]
 

Extract a frame of the MPEG movie.

The Image could be colour or greyscale depending on the default palette type for this class.

Parameters:
img   The Image to be extracted to.

Reimplemented from ImageSource.

Definition at line 143 of file MPEGSource.cpp.

ImageSource & MPEGSource::operator>> ( ImageGrey & img ) [virtual]
 

Extract a frame of the MPEG movie to the greyscale Images brightness buffer.

Parameters:
img   The greyscale Image to be extracted to.

Reimplemented from ImageSource.

Definition at line 111 of file MPEGSource.cpp.

ImageSource & MPEGSource::operator>> ( ImageRGB & img ) [virtual]
 

Extract a frame of the MPEG movie to the colour Images data buffer.

Parameters:
img   The colour Image to be extracted to.

Reimplemented from ImageSource.

Definition at line 90 of file MPEGSource.cpp.

int MPEGSource::set_frame ( long frame_no )
 

Seek to point in file.

Returns 0 if OK and -1 otherwise.

Parameters:
frame_no   frame number to set file pointer to

Definition at line 176 of file MPEGSource.cpp.


The documentation for this class was generated from the following files:
Generated at Fri Aug 13 17:29:22 2004 for libRTImage by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001