aclvdecSendSkippedFrame
Description
Feeds a stream (the input buffer) to the decoder for decoding. The callback function outputs nullptr when the decoding is complete, instead of the decoding result. This API is asynchronous.
Restrictions
- This API is asynchronous. The API call delivers a task rather than executes a task. After this API is called, call the synchronization API (for example, aclrtSynchronizeStream) to ensure that the task is complete.
- Ensure that a channel has 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 allowed to send an empty stream packet with eos = 0 (stream length is 0 or stream address is empty).
- It is not allowed to send frames with eos = 1.
- Due to stream exception or decoding timeout, the aclvdecSendFrame API may fail to send frames or the EOS frame. You are advised to obtain the return code of this API when writing code. If this API fails to be called, handle the exception.
- aclrtLaunchCallback is encapsulated in aclvdecSendSkippedFrame to insert a callback function that needs to be executed to the stream. When you implement the VDEC function, aclrtLaunchCallback does not need to be called separately.
Prototype
aclError aclvdecSendSkippedFrame(aclvdecChannelDesc *channelDesc,
acldvppStreamDesc *input,
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 |
input |
Input |
Pointer to the input stream description. The user needs to allocate input buffer in advance.
|
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
The value 0 indicates success, and other values indicate failure. For details, see aclError.