Feeds a stream (the input buffer, as well as the output buffer) to the decoder for decoding. This API is asynchronous.
aclError aclvdecSendFrame(aclvdecChannelDesc *channelDesc,
acldvppStreamDesc *input,
acldvppPicDesc *output,
aclvdecFrameConfig *config,
void* userData)
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:
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. |
0 on success; else, failure.