Vdec2

Provides a simple interface to VIDDEC2 (XDM 1.2) based algorithms. For typical usage see the video_decode_io2 app. More...

Typedefs

typedef struct Vdec2_Object * Vdec2_Handle
 Handle through which to reference a Video Decode algorithm.

Functions

Vdec2_Handle Vdec2_create (Engine_Handle hEngine, Char *codecName, VIDDEC2_Params *params, VIDDEC2_DynamicParams *dynParams)
 Creates a Video Decode (XDM 1.2) algorithm instance.
Int Vdec2_flush (Vdec2_Handle hVd)
 Flushes the codec. Call Vdec2_process (hInBuf is ignored) after this call and then Vdec2_getDisplayBuf to obtain display buffers display, and Vdec2_getFreeBuf to obtain buffers to free.
Int Vdec2_process (Vdec2_Handle hVd, Buffer_Handle hInBuf, Buffer_Handle hDstBuf)
 Decodes a video buffer. Call Vdec2_getDisplayBuf after this call to obtain buffers to display, and Vdec2_getFreeBuf to obtain buffers to free.
Int Vdec2_delete (Vdec2_Handle hVd)
 Deletes a Video Decode algorithm instance.
Int32 Vdec2_getMinOutBufs (Vdec2_Handle hVd)
 Figures out the actual output buffer requirements of the codec after the first Vdec2_process call. Also updates the buffer requirements for subsequent Vdec2_getInBufSize and Vdec2_getOutBufSize calls.
Void Vdec2_setBufTab (Vdec2_Handle hVd, BufTab_Handle hBufTab)
 After a Vdec2_create call is made, this function should be called to hand a BufTab_Handle to the video decoder instance. Because of B-frames, the destination buffer given may not be the same as the output buffer returned, so the Vdec2 class needs a full array of buffers to work with.
BufTab_Handle Vdec2_getBufTab (Vdec2_Handle hVd)
 Get the BufTab previously set using Vdec2_setBufTab.
VIDDEC2_Handle Vdec2_getVisaHandle (Vdec2_Handle hVd)
 Get the VIDDEC2 handle from the Vdec2 module instance.
Int32 Vdec2_getInBufSize (Vdec2_Handle hVd)
 Get the input buffer size required by the codec.
Int32 Vdec2_getOutBufSize (Vdec2_Handle hVd)
 Get the output buffer size required by the codec.
Buffer_Handle Vdec2_getDisplayBuf (Vdec2_Handle hVd)
 After a Vdec2_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.
Buffer_Handle Vdec2_getFreeBuf (Vdec2_Handle hVd)
 After a Vdec2_process call is made, this function should be called to obtain buffers to free. This function should be called consecutively until no more buffers are returned.

Variables

const VIDDEC2_Params Vdec2_Params_DEFAULT
 Default XDM parameters for a Video Decode (XDM 1.2) algorithm.
const VIDDEC2_DynamicParams Vdec2_DynamicParams_DEFAULT
 Default XDM dynamic parameters for a Video Decode (XDM 1.2) algorithm.

Detailed Description

Provides a simple interface to VIDDEC2 (XDM 1.2) based algorithms. For typical usage see the video_decode_io2 app.


Typedef Documentation

typedef struct Vdec2_Object* Vdec2_Handle

Handle through which to reference a Video Decode algorithm.


Function Documentation

Vdec2_Handle Vdec2_create ( Engine_Handle  hEngine,
Char *  codecName,
VIDDEC2_Params *  params,
VIDDEC2_DynamicParams *  dynParams 
)

Creates a Video Decode (XDM 1.2) 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 Vdec2_Handle).
NULL for failure.

Int Vdec2_flush ( Vdec2_Handle  hVd  ) 

Flushes the codec. Call Vdec2_process (hInBuf is ignored) after this call and then Vdec2_getDisplayBuf to obtain display buffers display, and Vdec2_getFreeBuf to obtain buffers to free.

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

Int Vdec2_process ( Vdec2_Handle  hVd,
Buffer_Handle  hInBuf,
Buffer_Handle  hDstBuf 
)

Decodes a video buffer. Call Vdec2_getDisplayBuf after this call to obtain buffers to display, and Vdec2_getFreeBuf to obtain buffers to free.

Parameters:
[in] hVd The Vdec2_Handle to use for decoding.
[in] hInBuf The Buffer_Handle of the buffer containing the encoded data.
[in] hDstBuf The Buffer_Handle of the buffer passed to the decoder to be filled with data.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Vdec2_create must be called before this function.

Vdec2_setBufTab must be called before this function.

Due to the design of IVIDDEC2 the lineLength setting in the destination buffer will be ignored. The frame pitch has to be set using IVIDDEC2_DynamicParams::displayWidth instead.

Int Vdec2_delete ( Vdec2_Handle  hVd  ) 

Deletes a Video Decode algorithm instance.

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

Int32 Vdec2_getMinOutBufs ( Vdec2_Handle  hVd  ) 

Figures out the actual output buffer requirements of the codec after the first Vdec2_process call. Also updates the buffer requirements for subsequent Vdec2_getInBufSize and Vdec2_getOutBufSize calls.

Parameters:
[in] hVd The Vdec2_Handle to use for decoding.
Return values:
Number of required output buffers on success.
Negative value for failure, see Dmai.h.
Remarks:
Vdec2_create must be called before this function.

Vdec2_process must be called before this function.

Void Vdec2_setBufTab ( Vdec2_Handle  hVd,
BufTab_Handle  hBufTab 
)

After a Vdec2_create call is made, this function should be called to hand a BufTab_Handle to the video decoder instance. Because of B-frames, the destination buffer given may not be the same as the output buffer returned, so the Vdec2 class needs a full array of buffers to work with.

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

BufTab_Handle Vdec2_getBufTab ( Vdec2_Handle  hVd  ) 

Get the BufTab previously set using Vdec2_setBufTab.

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

Vdec2_setBufTab must be called before this function.

VIDDEC2_Handle Vdec2_getVisaHandle ( Vdec2_Handle  hVd  ) 

Get the VIDDEC2 handle from the Vdec2 module instance.

Parameters:
[in] hVd The Vdec2_Handle for which to get the VIDDEC2 handle.
Return values:
Handle to the audio decode algorithm, see the XDM documentation for VIDDEC2.
Remarks:
Vdec2_create must be called before this function.

Int32 Vdec2_getInBufSize ( Vdec2_Handle  hVd  ) 

Get the input buffer size required by the codec.

Parameters:
[in] hVd The Vdec2_Handle for which to get the buffer size.
Return values:
Size in bytes of the input buffer required.
Remarks:
Vdec2_create must be called before this function.

Int32 Vdec2_getOutBufSize ( Vdec2_Handle  hVd  ) 

Get the output buffer size required by the codec.

Parameters:
[in] hVd The Vdec2_Handle for which to get the buffer size.
Return values:
Size in bytes of the output buffer required.
Remarks:
Vdec2_create must be called before this function.

Buffer_Handle Vdec2_getDisplayBuf ( Vdec2_Handle  hVd  ) 

After a Vdec2_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 Vdec2_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:
Vdec2_create must be called before this function.

Vdec2_process must be called before this function.

Buffer_Handle Vdec2_getFreeBuf ( Vdec2_Handle  hVd  ) 

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

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

Vdec2_process must be called before this function.


Variable Documentation

const VIDDEC2_Params Vdec2_Params_DEFAULT

Default XDM parameters for a Video Decode (XDM 1.2) algorithm.

     size                 = sizeof(VIDDEC2_Params),
     maxHeight            = 576,
     maxWidth             = 720,
     maxFrameRate         = 30000,
     maxBitRate           = 6000000,
     dataEndianness       = XDM_BYTE,
     forceChromaFormat    = XDM_YUV_420P

const VIDDEC2_DynamicParams Vdec2_DynamicParams_DEFAULT

Default XDM dynamic parameters for a Video Decode (XDM 1.2) algorithm.

     size                 = sizeof(VIDDEC2_DynamicParams),
     decodeHeader         = XDM_DECODE_AU,
     displayWidth         = 0,
     frameSkipMode        = IVIDEO_NO_SKIP,
     frameOrder           = IVIDDEC2_DISPLAY_ORDER,
     newFrameFlag         = 0,
     mbDataFlag           = 0


Copyright 2011, Texas Instruments Incorporated