Function: vdec_send_skipped_frame

Applicability

Product

Supported

Atlas 350 Accelerator Card

x

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Description

If you do not want to obtain the decoding result of a frame, you can call this API to transfer the stream (input memory) to be decoded to the decoder for decoding. In this case, the decoding result is not output, and the value of dvpp_pic_desc returned by the decoding callback function is 0. This API is asynchronous.

Prototype

  • C Prototype
    1
    aclError aclvdecSendSkippedFrame(aclvdecChannelDesc *channelDesc, acldvppStreamDesc *input, aclvdecFrameConfig *config, void *userData)
    
  • Python Function
    1
    ret = acl.media.vdec_send_skipped_frame(vdec_channel_desc, dvpp_stream_desc, vdec_frame_config, user_data)
    

Parameters

Parameter

Description

vdec_channel_desc

Int, pointer address of the channel description.

The value must be the same as that of dvpp_channel_desc specified when the acl.media.dvpp_create_channel API is called to create a stream.

Call the acl.media.vdec_set_channel_desc APIs to set attributes of the channel description, including the decoding channel ID, thread, callback function, and video encoding protocol.

NOTE:

For the Atlas training product , due to software restrictions, the acl.media.vdec_set_channel_desc_ref_frame_num API cannot be called to set the attributes of the channel description. If this API is called, an error is returned.

dvpp_stream_desc

Int, pointer address of the input stream description. You need to allocate the input buffer in advance.

vdec_frame_config

Int, pointer address of the decoding configuration. This parameter is reserved and can be set to 0 currently.

user_data

Python object, pointer address of the user-defined data.

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

Return Value

Return Value

Description

ret

Int, error code. 0 on success; else, failure.

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, acl.rt.synchronize_stream) to ensure that the task is complete.
  • Before sending data, ensure that a channel is created. Otherwise, an error code is returned.

  • Streams must be sent in the unit of frames. Only one complete frame of streams is sent at a time.

  • 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 a frame with eos = 1.

  • Due to stream exception or decoding timeout, the acl.media.vdec_send_frame 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.
  • The acl.rt.launch_callback API is encapsulated in the acl.media.vdec_send_skipped_frame API to add a callback function to be executed on the host to the stream task queue. When implementing the VDEC function, you do not need to call the acl.rt.launch_callback API separately.