Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

vetCodec Class Reference

Abstract class for all VetLib de-coders, inherits (as vetFilter) vetInput, vetOutput and vetObject, some more virtual methods are imposed. Internal buffering implementation is left to inherited class. More...

#include <vetCodec.h>

Inheritance diagram for vetCodec:

vetInput vetOutput vetObject vetCodec_BMP vetCodec_BMP vetCodec_IMG vetCodec_MOV vetCodec_MPEG vetCodec_XVID

Public Types

enum  
 Ignore this, it's a class-type definition, mostly used by VETLib WorkShop, sintax is a bit more complex than usual because of a VC6 BUG, it's the same as: const int vetClassType = VETCLASS_TYPE_CODER;.

Public Member Functions

 vetCodec (float fps=0)
 Default constructor is protected because this is an abstract class and instance cannot be created directly.
virtual ~vetCodec ()
 Destructor currenly clear only filters description strings.
virtual VETRESULT reset ()=0
 Inherited class must implement this function, should reset all filters' parameters, something like constructor initialization.
virtual int getAudioStreamCount (int stream=-1)=0
 Get movie's audio streams count.
virtual int getVideoStreamCount (int stream=-1)=0
 Get movie's video streams count.
virtual bool EoF ()=0
 Get the state of current data source.
virtual bool isEncodingAvailable ()=0
 Check ability to encode data.
virtual bool isDecodingAvailable ()=0
 Check ability to decode data.
virtual long getVideoStreamLength (int stream=-1)=0
 Get movie's video stream frame count.
virtual long getAudioStreamLength (int stream=-1)=0
 Get movie's video stream sample count.
virtual bool hasAudio (int stream=-1)=0
 Check if loaded movie has an audio stream.
virtual bool hasVideo (int stream=-1)=0
 Check if loaded movie has a video stream.
virtual VETRESULT close ()=0
 Close current movie (close file access).
virtual VETRESULT load (char *filename, int stream=-1)=0
 Load a movie from a file.
virtual VETRESULT save (char *filename, int stream=-1)=0
 Save current movie to file.
virtual VETRESULT extractTo (vetFrameYUV420 &img)=0
 Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.
virtual VETRESULT extractTo (vetFrameRGB24 &img)=0
 Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.
virtual VETRESULT extractTo (vetFrameT< unsigned char > &img)=0
 Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.
virtual VETRESULT importFrom (vetFrameYUV420 &img)=0
 Inherited class must implement this function, processing frames to specific output (device or stream).
virtual VETRESULT importFrom (vetFrameRGB24 &img)=0
 Inherited class must implement this function, processing frames to specific output (device or stream).
virtual VETRESULT importFrom (vetFrameT< unsigned char > &img)=0
 Inherited class must implement this function, processing frames to specific output (device or stream).

Detailed Description

Abstract class for all VetLib de-coders, inherits (as vetFilter) vetInput, vetOutput and vetObject, some more virtual methods are imposed. Internal buffering implementation is left to inherited class.

See also:
vetInput, vetOuput, vetObject
Version:
1.0.2
Date:
23/12/2005
Author:
Alessandro Polo

Definition at line 54 of file vetCodec.h.


Constructor & Destructor Documentation

vetCodec::vetCodec float  fps = 0  )  [inline]
 

Default constructor is protected because this is an abstract class and instance cannot be created directly.

Parameters:
fps Frame per second value, default is 0, the max input+processing rate.

Definition at line 72 of file vetCodec.h.

References vetInput::v_sleeptime.


Member Function Documentation

virtual VETRESULT vetCodec::close  )  [pure virtual]
 

Close current movie (close file access).

Returns:
VETRET_ILLEGAL_USE if movie was not loaded, VETRET_OK else.

Implemented in vetCodec_XVID.

virtual bool vetCodec::EoF  )  [pure virtual]
 

Get the state of current data source.

Returns:
true is there are no more frames to load, false else.

Implements vetInput.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual VETRESULT vetCodec::extractTo vetFrameT< unsigned char > &  img  )  [pure virtual]
 

Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.

Parameters:
[out] img Greyscale VETLib Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameT&)

Implements vetInput.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual VETRESULT vetCodec::extractTo vetFrameRGB24 img  )  [pure virtual]
 

Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.

Parameters:
[out] img VETLib Cache24 Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameRGB24&)

Implements vetInput.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual VETRESULT vetCodec::extractTo vetFrameYUV420 img  )  [pure virtual]
 

Inherited class must implement this function, processing hardware/format specific stream to standard VETLib frame formats.

Parameters:
[out] img VETLib Cache Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameYUV420&)

Implements vetInput.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual int vetCodec::getAudioStreamCount int  stream = -1  )  [pure virtual]
 

Get movie's audio streams count.

Parameters:
[in] stream select stream, default is current stream.
Returns:
number of audio streams.

Implemented in vetCodec_XVID.

virtual long vetCodec::getAudioStreamLength int  stream = -1  )  [pure virtual]
 

Get movie's video stream sample count.

Parameters:
[in] stream select stream, default is current stream.
Returns:
number of samples in selected video stream.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual int vetCodec::getVideoStreamCount int  stream = -1  )  [pure virtual]
 

Get movie's video streams count.

Parameters:
[in] stream select stream, default is current stream.
Returns:
number of video streams.

Implemented in vetCodec_XVID.

virtual long vetCodec::getVideoStreamLength int  stream = -1  )  [pure virtual]
 

Get movie's video stream frame count.

Parameters:
[in] stream select stream, default is current stream.
Returns:
number of frames in selected video stream.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual bool vetCodec::hasAudio int  stream = -1  )  [pure virtual]
 

Check if loaded movie has an audio stream.

Parameters:
[in] stream select stream, default is current stream.
Returns:
true if there is at least one video stream, false else.

Implemented in vetCodec_XVID.

virtual bool vetCodec::hasVideo int  stream = -1  )  [pure virtual]
 

Check if loaded movie has a video stream.

Parameters:
[in] stream select stream, default is current stream.
Returns:
true if there is at least one video stream, false else.

Implemented in vetCodec_XVID.

virtual VETRESULT vetCodec::importFrom vetFrameT< unsigned char > &  img  )  [pure virtual]
 

Inherited class must implement this function, processing frames to specific output (device or stream).

Parameters:
[in] img Greyscale VETLib Frame to be processed (encoded for example)
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Input operator (<<) call directly this function.
See also:
operator << (vetFrameT&)

Implements vetOutput.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual VETRESULT vetCodec::importFrom vetFrameRGB24 img  )  [pure virtual]
 

Inherited class must implement this function, processing frames to specific output (device or stream).

Parameters:
[in] img VETLib Cache24 Frame to be processed (encoded for example)
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Input operator (<<) call directly this function.
See also:
operator << (vetFrameRGB24&)

Implements vetOutput.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual VETRESULT vetCodec::importFrom vetFrameYUV420 img  )  [pure virtual]
 

Inherited class must implement this function, processing frames to specific output (device or stream).

Parameters:
[in] img VETLib Cache Frame to be processed (encoded for example)
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.
Note:
Input operator (<<) call directly this function.
See also:
operator << (vetFrameYUV420&)

Implements vetOutput.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual bool vetCodec::isDecodingAvailable  )  [pure virtual]
 

Check ability to decode data.

Returns:
true is class is able to decode video data, flase else.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual bool vetCodec::isEncodingAvailable  )  [pure virtual]
 

Check ability to encode data.

Returns:
true is class is able to encode video data, flase else.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual VETRESULT vetCodec::load char *  filename,
int  stream = -1
[pure virtual]
 

Load a movie from a file.

Parameters:
[in] filename input movie filename
[in] stream video stream to load (default is first: 0)
Returns:
VETRET_ILLEGAL_USE if file is not correctly loaded, VETRET_OK else.

Implemented in vetCodec_BMP, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual VETRESULT vetCodec::reset  )  [pure virtual]
 

Inherited class must implement this function, should reset all filters' parameters, something like constructor initialization.

Returns:
VETRET_OK if everything is fine, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Implements vetInput.

Implemented in vetCodec_BMP, vetCodec_BMP, vetCodec_IMG, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.

virtual VETRESULT vetCodec::save char *  filename,
int  stream = -1
[pure virtual]
 

Save current movie to file.

Parameters:
[in] filenameoutput movie filename
[in] stream video stream to load (default is first: 0)
Returns:
VETRET_ILLEGAL_USE if file is not correctly loaded, VETRET_OK else.

Implemented in vetCodec_BMP, vetCodec_MOV, vetCodec_MPEG, and vetCodec_XVID.


The documentation for this class was generated from the following file:
Generated on Tue Jan 24 11:59:21 2006 for VETLib by  doxygen 1.4.4