Vdec

Provides a simple interface to VIDDEC (XDM 0.9) based algorithms. For typical usage see the video_decode_io app. More...

Typedefs

typedef struct Vdec_Object * Vdec_Handle
 Handle through which to reference a Video Decode algorithm.

Functions

Vdec_Handle Vdec_create (Engine_Handle hEngine, Char *codecName, VIDDEC_Params *params, VIDDEC_DynamicParams *dynParams)
 Creates a Video Decode (XDM 0.9) algorithm instance.
Int Vdec_flush (Vdec_Handle hVd)
 Flushes the codec. Call Vdec_process (hInBuf is ignored) after this call and then Vdec_getDisplayBuf to obtain display buffers display.
Int Vdec_process (Vdec_Handle hVd, Buffer_Handle hInBuf, Buffer_Handle hDstBuf)
 Decodes a video buffer.
Int Vdec_delete (Vdec_Handle hVd)
 Deletes a Video Decode algorithm instance.
Void Vdec_setBufTab (Vdec_Handle hVd, BufTab_Handle hBufTab)
 After a Vdec_create call is made, this function should be called to hand a BufTab_Handle to the video decoder instance to be used to hold output buffers. Because of B-frames, the destination buffer given in the process call may not be the same as the output buffer to be displayed.
BufTab_Handle Vdec_getBufTab (Vdec_Handle hVd)
 Get the BufTab previously set using Vdec_setBufTab.
Int32 Vdec_getInBufSize (Vdec_Handle hVd)
 After a Vdec_create call is made, this function can be called to figure out the min total size of the required input buffers.
Int32 Vdec_getOutBufSize (Vdec_Handle hVd)
 After a Vdec_create call is made, this function can be called to figure out the min total size of the required output buffers.
Buffer_Handle Vdec_getDisplayBuf (Vdec_Handle hVd)
 After a Vdec_process call is made, this function should be called to obtain buffers to display. This function should be called consecutively until no more buffers are returned.
VIDDEC_Handle Vdec_getVisaHandle (Vdec_Handle hVd)
 Get the VIDDEC handle from the Vdec module instance.

Variables

const VIDDEC_Params Vdec_Params_DEFAULT
 Default XDM parameters for a Video Decode algorithm.
const VIDDEC_DynamicParams Vdec_DynamicParams_DEFAULT
 Default XDM dynamic parameters for a Video Decode algorithm.

Detailed Description

Provides a simple interface to VIDDEC (XDM 0.9) based algorithms. For typical usage see the video_decode_io app.


Typedef Documentation

typedef struct Vdec_Object* Vdec_Handle

Handle through which to reference a Video Decode algorithm.


Function Documentation

Vdec_Handle Vdec_create ( Engine_Handle  hEngine,
Char *  codecName,
VIDDEC_Params *  params,
VIDDEC_DynamicParams *  dynParams 
)

Creates a Video Decode (XDM 0.9) algorithm instance.

Parameters:
[in] hEngine An opened engine containing the algorithm to create.
[in] codecName The name of the algorithm to open. Corresponds to the string name given in the .cfg file.
[in] params XDM parameters to use while creating the codec.
[in] dynParams XDM dynamic parameters to use while creating the codec.
Return values:
Handle for use in subsequent operations (see Vdec_Handle).
NULL for failure.

Int Vdec_flush ( Vdec_Handle  hVd  ) 

Flushes the codec. Call Vdec_process (hInBuf is ignored) after this call and then Vdec_getDisplayBuf to obtain display buffers display.

Parameters:
[in] hVd The Vdec_Handle to of the decoder to flush.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Vdec_create must be called before this function.

Int Vdec_process ( Vdec_Handle  hVd,
Buffer_Handle  hInBuf,
Buffer_Handle  hDstBuf 
)

Decodes a video buffer.

Parameters:
[in] hVd The Vdec_Handle to use for decoding.
[in] hInBuf The Buffer_Handle for the buffer containing the encoded data.
[in] hDstBuf The Buffer_Handle of the buffer passed to the decoder to be filled with data. Depending on buffer reordering due to B-frames, this may or may not be the same buffer returned in subsequent Vdec_getDisplayBuf calls.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Vdec_create must be called before this function.

Vdec_setBufTab must be called before this function.

Due to the design of IVIDDEC the lineLength setting in the input buffer will be ignored. The frame pitch has to be set using IVIDDEC_DynamicParams::displayWidth instead.

Int Vdec_delete ( Vdec_Handle  hVd  ) 

Deletes a Video Decode algorithm instance.

Parameters:
[in] hVd The Vdec_Handle to delete.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Vdec_create must be called before this function.

Void Vdec_setBufTab ( Vdec_Handle  hVd,
BufTab_Handle  hBufTab 
)

After a Vdec_create call is made, this function should be called to hand a BufTab_Handle to the video decoder instance to be used to hold output buffers. Because of B-frames, the destination buffer given in the process call may not be the same as the output buffer to be displayed.

Parameters:
[in] hVd The Vdec_Handle to set the BufTab for.
[in] hBufTab The BufTab_Handle to give to the video decoder.
Remarks:
Vdec_create must be called before this function.

BufTab_Handle Vdec_getBufTab ( Vdec_Handle  hVd  ) 

Get the BufTab previously set using Vdec_setBufTab.

Parameters:
[in] hVd The Vdec_Handle for which to get the BufTab.
Return values:
Handle to the BufTab managing the codec buffers (see BufTab_Handle).
Remarks:
Vdec_create must be called before this function.

Vdec_setBufTab must be called before this function.

Int32 Vdec_getInBufSize ( Vdec_Handle  hVd  ) 

After a Vdec_create call is made, this function can be called to figure out the min total size of the required input buffers.

Parameters:
[in] hVd The Vdec_Handle to get the size for.
Return values:
Bytes in total for all input planes.
Remarks:
Vdec_create must be called before this function.

Int32 Vdec_getOutBufSize ( Vdec_Handle  hVd  ) 

After a Vdec_create call is made, this function can be called to figure out the min total size of the required output buffers.

Parameters:
[in] hVd The Vdec_Handle to get the size for.
Return values:
Bytes in total for all output planes.
Remarks:
Vdec_create must be called before this function.

Buffer_Handle Vdec_getDisplayBuf ( Vdec_Handle  hVd  ) 

After a Vdec_process call is made, this function should be called to obtain buffers to display. This function should be called consecutively until no more buffers are returned.

Parameters:
[in] hVd The Vdec_Handle to obtain display buffers from.
Return values:
Handle to a Buffer to display (see Buffer_Handle).
NULL if no more Buffers are available.
Remarks:
Vdec_create must be called before this function.

Vdec_process must be called before this function.

VIDDEC_Handle Vdec_getVisaHandle ( Vdec_Handle  hVd  ) 

Get the VIDDEC handle from the Vdec module instance.

Parameters:
[in] hVd The Vdec_Handle for which to get the VIDDEC handle.
Return values:
Handle to the video decode algorithm, see the XDM documentation for VIDDEC.
Remarks:
Vdec_create must be called before this function.


Variable Documentation

const VIDDEC_Params Vdec_Params_DEFAULT

Default XDM parameters for a Video Decode algorithm.

     size                 = sizeof(VIDDEC_Params),
     maxHeight            = 576,
     maxWidth             = 720,
     maxFrameRate         = 0,
     maxBitRate           = 0,
     dataEndianness       = XDM_BYTE,
     forceChromaFormat    = XDM_YUV_422ILE,

const VIDDEC_DynamicParams Vdec_DynamicParams_DEFAULT

Default XDM dynamic parameters for a Video Decode algorithm.

     size                 = sizeof(VIDDEC_DynamicParams),
     decodeHeader         = XDM_DECODE_AU,
     displayWidth         = XDM_DEFAULT,
     frameSkipMode        = IVIDEO_NO_SKIP,


Copyright 2011, Texas Instruments Incorporated