Function: vdec_send_frame
|
C Prototype |
aclError aclvdecSendFrame(aclvdecChannelDesc *channelDesc, acldvppStreamDesc *input, acldvppPicDesc *output, aclvdecFrameConfig *config, void* userData) |
|---|---|
|
Python Function |
ret = acl.media.vdec_send_frame(vdec_channel_desc, dvpp_stream_desc, dvpp_pic_desc, vdec_frame_config, user_data) |
|
Function Usage |
Feeds a frame (the input buffer, as well as the output buffer) to the decoder for decoding. This API is asynchronous. |
|
Input Description |
vdec_channel_desc: int, pointer address of the channel description. It must be the same as the dvpp_channel_desc argument passed to the acl.media.dvpp_create_channel call. 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 coding protocol.
NOTE:
For the Atlas 200/300/500 Inference Product, due to software restrictions, it is not allowed to set the channel description attributes by calling acl.media.vdec_set_channel_desc_ref_frame_num. If the API is called, an error is returned. For the Atlas Training Series Product, due to software restrictions, it is not allowed to set the channel description attributes by calling acl.media.vdec_set_channel_desc_ref_frame_num. If the 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.
dvpp_pic_desc: int, pointer address of the output image description. You need to allocate the output buffer in advance. When dvpp_pic_desc is an input, the user needs to:
When dvpp_pic_desc is used as an output, the user need to call the acl.media.dvpp_get_pic_desc series in the callback function to obtain the decoded 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. 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 |
ret: int, error code.
|
|
Restrictions |
|
|
Reference |
For details about the API call sequence and example, see VDEC. |