aclvdecSendFrame

Description

Feeds a stream (the input buffer, as well as the output buffer) to the decoder for decoding. This API is asynchronous.

Restrictions

Prototype

aclError aclvdecSendFrame(aclvdecChannelDesc *channelDesc,

acldvppStreamDesc *input,

acldvppPicDesc *output,

aclvdecFrameConfig *config,

void* userData)

Parameters

Parameter

Input/Output

Description

channelDesc

Input

Pointer to the channel description.

Must be the same as the channelDesc argument passed to the aclvdecCreateChannel call.

Call aclvdecSetChannelDesc series to set the decoding channel description, including the channel ID, thread, callback function, and video coding protocol.

NOTE:

For the Ascend 310 AI Processor, due to software restrictions, it is not allowed to set the channel description by using the aclvdecSetChannelDescRefFrameNum call. Doing so results in an error return.

For the Ascend 910 AI Processor, due to software restrictions, it is not allowed to set the channel description by using the aclvdecSetChannelDescRefFrameNum call. Doing so results in an error return.

For the Ascend 310P AI Processor, the corresponding attributes of the channel description can be set by calling aclvdecSetChannelDescRefFrameNum.

input

Input

Pointer to the input stream description. The user needs to allocate input buffer in advance.

output

Input/Output

Pointer to the output image description. The user needs to allocate output buffer in advance.

When output is used as an input, the user needs to:

  • Call acldvppCreatePicDesc to create an image description.
  • Call acldvppSetPicDesc series to set the data buffer, buffer size, width, height, and format of the output image.
    • The output width and height correspond to four parameters: width, height, widthStride, and heightStride. When the width is less than 16, widthStride must be a multiple of 32 instead of 16. If none of the four parameters are set, the input width and height are used. If only some of the four parameters are set, the API returns an error.
    • If the output image format is set in this API call, the setting is applied. Otherwise, the setting in the channel description is applied.
    • For details about the requirements on the output image format, see Functions and Restrictions.

When output is used as an output, the user must obtain the decoding output by calling the acldvppGetPicDesc series in the callback function. For an interlaced stream, two fields are transmitted every frame. It is normal that one of two transmitted fields has no decoding output and the error code ERR_DECODE_NOPIC = 0x20000 is returned. The decoding output of the interlaced stream is stored in the output buffer corresponding to the odd field.

config

Input

Pointer to the decoding configuration. This parameter is reserved and can be set to NULL currently.

userData

Input

Pointer to the user-defined data.

If you want to obtain the sequence number of the decoded frame, define the userData parameter. Then, the sequence number can be passed to the VDEC callback function to determine the frame to be processed.

Returns

0 on success; else, failure.

See Also