aclvdecSendFrame
Applicability
|
Product |
Supported |
|---|---|
|
Atlas 350 Accelerator Card |
☓ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Function Description
Transmit the input buffer and output buffer to the decoder for decoding. This API is asynchronous.
Prototype
1 2 3 4 5 |
aclError aclvdecSendFrame(aclvdecChannelDesc *channelDesc, acldvppStreamDesc *input, acldvppPicDesc *output, aclvdecFrameConfig *config, void *userData) |
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
channelDesc |
Input |
Pointer to the channel description. The value must be the same as that of channelDesc specified when the aclvdecCreateChannel API is called to create a channel. Call aclvdecSetChannelDesc series to set attributes of the channel description, including the decoding channel ID, thread, callback function, and video encoding protocol. Due to software restrictions, the aclvdecSetChannelDescRefFrameNum API cannot be called to set the attributes of the channel description only on |
|
input |
Input |
Pointer to the input stream description. You need to allocate the input buffer in advance.
|
|
output |
Input/Output |
Pointer to the description of the output image. You need to allocate the output buffer in advance. When output is an input, the user needs to:
When the output parameter is used as output, you need to call acldvppGetPicDesc series APIs in the callback function to obtain the decoded output image data. 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 field is reserved and can be set to NULL. |
|
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; otherwise, failure. For details, see aclError.
Restrictions
- The channel passed to this call must have been created. Otherwise, an error code is returned.
- A stream must be fed in frame mode, which means that a complete frame must be fed in every call to this API.
- It is not supported to feed empty packets with eos set to 0 (the stream length is 0 or the stream address is empty).
- When the stream is completely fed to the decoder, feed a frame with eos set to 1 to inform the decoder of the completion of the stream file. After the EOS frame is fed to the decoder, this API call returns the decoding result only after all transmitted frames are decoded and the user-defined callback function handling is complete.
- Due to stream exceptions or decoding timeout, the aclvdecSendFrame API may fail to send frames or EOS. You are advised to obtain the return code of this API when writing code. If this API fails to be called, handle the exception.
- aclvdecSendFrame encapsulates the aclrtLaunchCallback API to add a callback function to be executed to the stream task queue. When implementing the VDEC function, <cf id="Bold">aclrtLaunchCallback</cf> does not need to be called separately.