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

fl::VideoInFileFFMPEG Class Reference

#include <video.h>

Inheritance diagram for fl::VideoInFileFFMPEG:

fl::VideoInFile List of all members.

Public Methods

 VideoInFileFFMPEG (const std::string &fileName, const PixelFormat &hint)
virtual ~VideoInFileFFMPEG ()
virtual void seekFrame (int frame)
 Position stream just before the given frame. Numbers follow same convention as Video class.

virtual void seekTime (double timestamp)
virtual void readNext (Image &image)
 Reads the next frame and stores it in image. image may end up attached to a buffer used internally by the video device or library, so it may be freed unexpectedly. However, this clss guarantees that the memory will not be freed before the next call to a method of this class.

virtual bool good () const
virtual void setTimestampMode (bool frames=false)
 Changes image.timestamp from presentation time to frame number.

virtual void get (const std::string &name, double &value)
 Retrieve values of stream attributes (such as duration in seconds).

void open (const std::string &fileName)
void close ()
void readNext (Image *image)
 same as readNext() above, except if image is null, then don't do extraction step

void extractImage (Image &image)

Public Attributes

AVFormatContext * fc
AVCodecContext * cc
AVStream * stream
AVCodec * codec
AVFrame picture
AVPacket packet
 Ensure that if nextImage() attaches image to packet, the memory won't be freed before next read.

int size
unsigned char * data
int gotPicture
 indicates that picture contains a full image

int state
 state == 0 means good; anything else means we can't read more frames

bool timestampMode
 Indicates that image.timestamp should be frame number rather than presentation time.

double expectedSkew
 Compensates for difference between PTS and DTS when seeking. Units = frames.

bool seekLinear
 Indicates that the file only supports linear seeking, not random seeking. Generally due to lack of timestamps in stream.

const PixelFormathint
std::string fileName

Constructor & Destructor Documentation

VideoInFileFFMPEG::VideoInFileFFMPEG const std::string &    fileName,
const PixelFormat   hint
 

VideoInFileFFMPEG::~VideoInFileFFMPEG   [virtual]
 


Member Function Documentation

void VideoInFileFFMPEG::close  
 

void VideoInFileFFMPEG::extractImage Image   image
 

void VideoInFileFFMPEG::get const std::string &    name,
double &    value
[virtual]
 

Retrieve values of stream attributes (such as duration in seconds).

Implements fl::VideoInFile.

bool VideoInFileFFMPEG::good   const [virtual]
 

Registry of states: 0 = everything good [-7,-1] = FFMPEG libavformat errors, see avformat.h -10 = did not find a video stream -11 = did not find a codec -12 = VideoInFile is closed

Implements fl::VideoInFile.

void VideoInFileFFMPEG::open const std::string &    fileName
 

void VideoInFileFFMPEG::readNext Image   image
 

same as readNext() above, except if image is null, then don't do extraction step

void VideoInFileFFMPEG::readNext Image   image [virtual]
 

Reads the next frame and stores it in image. image may end up attached to a buffer used internally by the video device or library, so it may be freed unexpectedly. However, this clss guarantees that the memory will not be freed before the next call to a method of this class.

Implements fl::VideoInFile.

void VideoInFileFFMPEG::seekFrame int    frame [virtual]
 

Position stream just before the given frame. Numbers follow same convention as Video class.

Implements fl::VideoInFile.

void VideoInFileFFMPEG::seekTime double    timestamp [virtual]
 

Todo:
Seek in c.avi (bear and dog rotating) is screwed up at the FFMPEG level. It has more index than video, and the index seems to be on a different time base than the video itself.

Implements fl::VideoInFile.

void VideoInFileFFMPEG::setTimestampMode bool    frames = false [virtual]
 

Changes image.timestamp from presentation time to frame number.

Implements fl::VideoInFile.


Member Data Documentation

AVCodecContext* fl::VideoInFileFFMPEG::cc
 

AVCodec* fl::VideoInFileFFMPEG::codec
 

unsigned char* fl::VideoInFileFFMPEG::data
 

double fl::VideoInFileFFMPEG::expectedSkew
 

Compensates for difference between PTS and DTS when seeking. Units = frames.

AVFormatContext* fl::VideoInFileFFMPEG::fc
 

std::string fl::VideoInFileFFMPEG::fileName
 

int fl::VideoInFileFFMPEG::gotPicture
 

indicates that picture contains a full image

const PixelFormat* fl::VideoInFileFFMPEG::hint
 

AVPacket fl::VideoInFileFFMPEG::packet
 

Ensure that if nextImage() attaches image to packet, the memory won't be freed before next read.

AVFrame fl::VideoInFileFFMPEG::picture
 

bool fl::VideoInFileFFMPEG::seekLinear
 

Indicates that the file only supports linear seeking, not random seeking. Generally due to lack of timestamps in stream.

int fl::VideoInFileFFMPEG::size
 

int fl::VideoInFileFFMPEG::state
 

state == 0 means good; anything else means we can't read more frames

AVStream* fl::VideoInFileFFMPEG::stream
 

bool fl::VideoInFileFFMPEG::timestampMode
 

Indicates that image.timestamp should be frame number rather than presentation time.


The documentation for this class was generated from the following files:
Generated on Thu Dec 9 17:13:27 2004 for fl by doxygen1.2.18