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

vetCodec_XVID Class Reference

Inheritance diagram for vetCodec_XVID:

vetCodec vetInput vetOutput vetObject

Public Member Functions

 vetCodec_XVID (vetCodec_XVIDParameters *initParams=NULL)
 Default constructor, initializa parameters and superclasses.
 vetCodec_XVID (char *filename, int stream=0)
 Creates a new frame from given dimensions, call superclass vetFrameRGB constructor.
 ~vetCodec_XVID ()
VETRESULT setParameters (vetCodec_XVIDParameters *initParams)
 Set parameters for this filter.
vetCodec_XVIDParametersgetParameters ()
 Get parameters for this filter.
VETRESULT setFilterParameters (vetFilterParameters *initParams)
vetFilterParametersgetFilterParameters ()
VETRESULT save ()
 Save current buffered image to current filename, first setup current filename and format then call this function.
VETRESULT load ()
 Load a BMP format image into current buffer (vetFrameRGB), first setup current filename and format then call this function.
VETRESULT load (char *filename, int stream=0)
 Load a BMP format image into current buffer (vetFrameRGB).
VETRESULT save (char *filename, int stream=0)
 Save current movie to file.
VETRESULT reset ()
 Reset filename related setup.
bool EoF ()
 Get the state of current data source.
VETRESULT extractTo (vetFrameYUV420 &img)
 Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.
VETRESULT extractTo (vetFrameRGB24 &img)
 Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.
VETRESULT extractTo (vetFrameT< unsigned char > &img)
 Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.
VETRESULT importFrom (vetFrameYUV420 &img)
 Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.
VETRESULT importFrom (vetFrameRGB24 &img)
 Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.
VETRESULT importFrom (vetFrameT< unsigned char > &img)
 Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.
unsigned int getHeight () const
 Get current canvas' height.
unsigned int getWidth () const
 Get current canvas' width.
long getVideoStreamLength (int stream=0)
 Get movie's video stream frame count.
long getAudioStreamLength (int stream=-1)
 Get movie's video stream sample count.
int getVideoStreamPosition (int stream=0)
double getVideoStreamDecodedTotalTime (int stream=0)
bool hasAudio (int stream=-1)
 Check if loaded movie has an audio stream.
bool hasVideo (int stream=-1)
 Check if loaded movie has a video stream.
int getAudioStreamCount (int stream=-1)
 Get movie's audio streams count.
int getVideoStreamCount (int stream=-1)
 Get movie's video streams count.
VETRESULT doDecode (long frameCount=0)
 get movie's video frame rate.
VETRESULT setHeight (unsigned int value)
 Set current canvas' height.
VETRESULT setWidth (unsigned int value)
 Set current canvas' width.
bool isEncodingAvailable ()
 Input operator, import standard VETLib frame formats, current implementation calls directly importFrom() method.Ouput operator, export to standard VETLib frame formats, current implementation calls directly extractTo() method and if framerate isn't zero waits untill clock is syncronized, if elaboration time is greater than sleeptime, no delay is applied.
bool isDecodingAvailable ()
 Check ability to decode data.

Protected Member Functions

VETRESULT doDecodeFrame ()
VETRESULT init ()
VETRESULT close ()
 Close current movie (close file access).
VETRESULT flush ()
VETRESULT release ()
VETRESULT updateBuffer (unsigned int width, unsigned int height)
VETRESULT dec_init (int use_assembler, int debug_level)
VETRESULT dec_main (unsigned char *istream, unsigned char *ostream, int istream_size, xvid_dec_stats_t *xvid_dec_stats)
VETRESULT write_image (char *prefix, unsigned char *image)
VETRESULT write_pnm (char *filename, unsigned char *image)

Protected Attributes

void * stream_handle
unsigned char * mp4_buffer
unsigned char * mp4_ptr
unsigned char * buffer
FILE * file
int use_assembler
int debug_level
int useful_bytes
int chunk
xvid_dec_stats_t xvid_dec_stats
double totaldectime
long totalsize
int status
int filenr
vetCodec_XVIDParametersmyParams
unsigned int width
 XVID width.
unsigned int height
 XVID height.

Detailed Description

Definition at line 83 of file vetCodec_XVID.h.


Constructor & Destructor Documentation

vetCodec_XVID::vetCodec_XVID char *  filename,
int  stream = 0
 

Creates a new frame from given dimensions, call superclass vetFrameRGB constructor.

Parameters:
[in] filename Input BMP filename.
[in] format BMP Encoding Format, default auto-selection.

Definition at line 24 of file vetCodec_XVID.cpp.

References buffer, DEBUGMSG, init(), load(), mp4_buffer, reset(), setParameters(), and stream_handle.


Member Function Documentation

VETRESULT vetCodec_XVID::close  )  [protected, virtual]
 

Close current movie (close file access).

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

Implements vetCodec.

Definition at line 303 of file vetCodec_XVID.cpp.

References INFO, and stream_handle.

Referenced by init(), reset(), and ~vetCodec_XVID().

VETRESULT vetCodec_XVID::doDecode long  frameCount = 0  ) 
 

get movie's video frame rate.

Parameters:
[in] stream select stream index. default is -1: current active stream.
Returns:
number of frame per second.

Definition at line 586 of file vetCodec_XVID.cpp.

References doDecodeFrame(), file, filenr, flush(), and useful_bytes.

bool vetCodec_XVID::EoF  )  [virtual]
 

Get the state of current data source.

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

Implements vetCodec.

Definition at line 122 of file vetCodec_XVID.cpp.

References stream_handle.

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

Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.

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&)

AutoInput

Implements vetCodec.

Definition at line 185 of file vetCodec_XVID.cpp.

References buffer, vetFrameT< T >::data, DEBUGMSG, doDecodeFrame(), vetFrameT< T >::height, height, vetFrameT< T >::profile, vetFrameT< T >::reAllocCanvas(), stream_handle, VETRET_ILLEGAL_USE, VETRET_NOT_IMPLEMENTED, VETRET_OK, vetFrameT< T >::width, and width.

VETRESULT vetCodec_XVID::extractTo vetFrameRGB24 img  )  [virtual]
 

Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.

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&)

AutoInput

Implements vetCodec.

Definition at line 144 of file vetCodec_XVID.cpp.

References buffer, vetUtility::conv_bgr_rgb(), vetFrameRGB24::data, DEBUGMSG, doDecodeFrame(), vetFrame::height, height, vetFrameRGB24::reAllocCanvas(), stream_handle, VETRET_ILLEGAL_USE, vetFrame::width, and width.

VETRESULT vetCodec_XVID::extractTo vetFrameYUV420 img  )  [virtual]
 

Load bmp data into image parameter, if AutoInput is enabled try to load next filename, else just copy current data to img.

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&)

AutoInput

Implements vetCodec.

Definition at line 133 of file vetCodec_XVID.cpp.

References DEBUGMSG, stream_handle, VETRET_ILLEGAL_USE, and VETRET_NOT_IMPLEMENTED.

int vetCodec_XVID::getAudioStreamCount int  stream = -1  )  [inline, virtual]
 

Get movie's audio streams count.

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

Implements vetCodec.

Definition at line 357 of file vetCodec_XVID.h.

long vetCodec_XVID::getAudioStreamLength int  stream = -1  )  [inline, 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.

Implements vetCodec.

Definition at line 347 of file vetCodec_XVID.h.

unsigned int vetCodec_XVID::getHeight  )  const [inline, virtual]
 

Get current canvas' height.

Returns:
height in pixel.

Implements vetInput.

Definition at line 342 of file vetCodec_XVID.h.

References height.

vetCodec_XVIDParameters& vetCodec_XVID::getParameters  )  [inline]
 

Get parameters for this filter.

Returns:
pointer to vetFilterColorParameters instance.

Definition at line 172 of file vetCodec_XVID.h.

References myParams.

int vetCodec_XVID::getVideoStreamCount int  stream = -1  )  [inline, virtual]
 

Get movie's video streams count.

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

Implements vetCodec.

Definition at line 358 of file vetCodec_XVID.h.

long vetCodec_XVID::getVideoStreamLength int  stream = 0  )  [inline, 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.

Implements vetCodec.

Definition at line 346 of file vetCodec_XVID.h.

References totalsize.

unsigned int vetCodec_XVID::getWidth  )  const [inline, virtual]
 

Get current canvas' width.

Returns:
width in pixel.

Implements vetInput.

Definition at line 344 of file vetCodec_XVID.h.

References width.

bool vetCodec_XVID::hasAudio int  stream = -1  )  [inline, 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.

Implements vetCodec.

Definition at line 353 of file vetCodec_XVID.h.

bool vetCodec_XVID::hasVideo int  stream = -1  )  [inline, 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.

Implements vetCodec.

Definition at line 354 of file vetCodec_XVID.h.

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

Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.

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 vetCodec.

Definition at line 230 of file vetCodec_XVID.cpp.

References DEBUGMSG, and VETRET_NOT_IMPLEMENTED.

VETRESULT vetCodec_XVID::importFrom vetFrameRGB24 img  )  [virtual]
 

Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.

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 vetCodec.

Definition at line 221 of file vetCodec_XVID.cpp.

References DEBUGMSG, and VETRET_NOT_IMPLEMENTED.

VETRESULT vetCodec_XVID::importFrom vetFrameYUV420 img  )  [virtual]
 

Load given image into memory, if AutoOutput is enabled image data will be saved as a BMP format file.

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 vetCodec.

Definition at line 212 of file vetCodec_XVID.cpp.

References DEBUGMSG, and VETRET_NOT_IMPLEMENTED.

bool vetCodec_XVID::isDecodingAvailable  )  [inline, virtual]
 

Check ability to decode data.

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

Implements vetCodec.

Definition at line 480 of file vetCodec_XVID.h.

bool vetCodec_XVID::isEncodingAvailable  )  [inline, virtual]
 

Input operator, import standard VETLib frame formats, current implementation calls directly importFrom() method.Ouput operator, export to standard VETLib frame formats, current implementation calls directly extractTo() method and if framerate isn't zero waits untill clock is syncronized, if elaboration time is greater than sleeptime, no delay is applied.

Parameters:
[out] img VETLib Cache Frame to store data.
Returns:
Address of current instance.
See also:
importFrom(vetFrameYUV420&)

vetsleep()

setElaborationStart()

getElaborationTime()

Implements vetCodec.

Definition at line 479 of file vetCodec_XVID.h.

VETRESULT vetCodec_XVID::load char *  filename,
int  stream = 0
[virtual]
 

Load a BMP format image into current buffer (vetFrameRGB).

Parameters:
[in] filename Input BMP filename.
[in] format BMP Encoding Format.
Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Implements vetCodec.

Definition at line 255 of file vetCodec_XVID.cpp.

References DEBUGMSG, load(), myParams, vetCodec_XVIDParameters::setFileName(), and vetCodec_XVIDParameters::setStream().

VETRESULT vetCodec_XVID::load  ) 
 

Load a BMP format image into current buffer (vetFrameRGB), first setup current filename and format then call this function.

Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 366 of file vetCodec_XVID.cpp.

References chunk, doDecodeFrame(), file, vetCodec_XVIDParameters::fileName, filenr, INFO, mp4_buffer, mp4_ptr, myParams, totaldectime, totalsize, useful_bytes, VETRET_ILLEGAL_USE, VETRET_OK, and VETRET_PARAM_ERR.

Referenced by load(), and vetCodec_XVID().

VETRESULT vetCodec_XVID::reset  )  [virtual]
 

Reset filename related setup.

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

Implements vetCodec.

Definition at line 63 of file vetCodec_XVID.cpp.

References buffer, chunk, close(), debug_level, filenr, height, INFO, mp4_buffer, mp4_ptr, myParams, release(), vetCodec_XVIDParameters::reset(), vetObject::setDescription(), vetObject::setName(), vetObject::setVersion(), stream_handle, totaldectime, totalsize, use_assembler, VETRET_OK, and width.

Referenced by vetCodec_XVID().

VETRESULT vetCodec_XVID::save char *  filename,
int  stream = 0
[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.

Implements vetCodec.

Definition at line 240 of file vetCodec_XVID.cpp.

References INFO, and VETRET_NOT_IMPLEMENTED.

VETRESULT vetCodec_XVID::save  ) 
 

Save current buffered image to current filename, first setup current filename and format then call this function.

Returns:
VETRET_OK if everything is fine, VETRET_PARAM_ERR if frame is not valid, VETRET_INTERNAL_ERR or VETRET_ILLEGAL_USE else.

Definition at line 247 of file vetCodec_XVID.cpp.

References INFO, and VETRET_NOT_IMPLEMENTED.

VETRESULT vetCodec_XVID::setHeight unsigned int  value  )  [inline, virtual]
 

Set current canvas' height.

Returns:
height in pixel.

Implements vetOutput.

Definition at line 425 of file vetCodec_XVID.h.

References height, and VETRET_OK.

VETRESULT vetCodec_XVID::setParameters vetCodec_XVIDParameters initParams  ) 
 

Set parameters for this filter.

Parameters:
[in] initParams Instance of vetFilterColorParameters or NULL, NULL argument make function to create a new instance with default parameters.
Returns:
VETRET_OK

Definition at line 100 of file vetCodec_XVID.cpp.

References myParams, and VETRET_OK.

Referenced by setFilterParameters(), and vetCodec_XVID().

VETRESULT vetCodec_XVID::setWidth unsigned int  value  )  [inline, virtual]
 

Set current canvas' width.

Returns:
width in pixel.

Implements vetOutput.

Definition at line 436 of file vetCodec_XVID.h.

References VETRET_OK, and width.


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