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

AVISource Class Reference

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

#include <AVISource.h>

Inheritance diagram for AVISource::

ImageSource List of all members.

Public Methods

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

 ~AVISource ()
 Close AVI file and free up the memory.

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

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

virtual ImageSourceoperator>> (Image &)
 Extract a frame of the AVI 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

AVFormatContext* pFormatCtx
int i
int videoStream
AVCodecContext* pCodecCtx
 codec context for the video stream.

AVCodec* pCodec
 decoder for the video stream.

AVFrame* pFrame
 YUV video frame.

AVFrame* pFrameRGB
int numBytes
uint8_t* buffer
unsigned char** buff
 Buffer for decoded 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 AVISource class is a frame of the MPEG movie.

Note:
Assumes only one stream

Definition at line 30 of file AVISource.h.


Constructor & Destructor Documentation

AVISource::AVISource ( char * path )
 

Initialise an MPEG movie source.

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

Definition at line 32 of file AVISource.cpp.


Member Function Documentation

bool AVISource::eof ( void ) const
 

Test for end of file.

Returns 1 if end of file, 0 otherwise.

Definition at line 359 of file AVISource.cpp.

void AVISource::get_framerate ( float & fr_rate )
 

Return the frame rate of the MPEG.

Parameters:
framerate   The framerate of the AVI.

Definition at line 349 of file AVISource.cpp.

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

Return the width and height of the MPEG.

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

Reimplemented from ImageSource.

Definition at line 325 of file AVISource.cpp.

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

Extract a frame of the AVI 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 304 of file AVISource.cpp.

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

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

Parameters:
img   The greyscale Image to be extracted to.

Reimplemented from ImageSource.

Definition at line 288 of file AVISource.cpp.

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

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

Parameters:
img   The colour Image to be extracted to.

Reimplemented from ImageSource.

Definition at line 156 of file AVISource.cpp.

int AVISource::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 337 of file AVISource.cpp.


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