vdec_send_stream
Applicability
|
Product |
Supported (√/x) |
|---|---|
|
|
√ |
|
|
√ |
|
|
x |
|
|
√ |
|
|
√ |
Function Usage
Feeds the stream and decoding result buffer to a decoding channel.
Prototype
- C Prototype
1hi_s32 hi_mpi_vdec_send_stream(hi_vdec_chn chn, const hi_vdec_stream *stream, hi_vdec_pic_info *vdec_pic_info, hi_s32 milli_sec);
- Python Function
1ret = acl.himpi.vdec_send_stream(chn, stream, vdec_pic_info, milli_sec)
Parameter Description
|
Parameter |
Description |
|---|---|
|
chn |
Int, decoding channel ID.
|
|
stream |
Dict, input stream information. In the dictionary, addr is configured as the memory address on the device. For details, see hi_vdec_stream. |
|
vdec_pic_info |
Dict, output image information dictionary. For details, see hi_vdec_pic_info. |
|
milli_sec |
Int, timeout interval, in milliseconds.
|
Return Value Description
|
Return Value |
Description |
|---|---|
|
ret |
Int, error code.
|
Restrictions
- The channel passed to this API call must have started stream receiving by using the acl.himpi.vdec_start_recv_stream call. Otherwise, the error code HI_ERR_VDEC_NOT_PERM is returned. If stream receiving is stopped in the buffer feeding process, the error code HI_ERR_VDEC_NOT_PERM is returned.
- Ensure that a channel has been created. Otherwise, the error code HI_ERR_VDEC_UNEXIST is returned. If the channel is reset or destroyed in the buffer feeding process, the error code HI_ERR_VDEC_UNEXIST is returned.
- The buffer feeding mode follows the mode set in the decoding channel creation call. Currently, only the frame mode is supported. In this mode, a complete frame must be fed in every call to this API. Otherwise, a decoding error occurs.
- It is not supported to feed empty packets with end_of_stream set to 0 (the stream length is 0 or the stream address is empty) and attempts to do so result in errors. Feed an empty packet with end_of_stream set to 1 only when the stream has been fed completely. In this case, the decoder finishes stream decoding and outputs all resultant images. In other cases, set end_of_stream to 0.
- When the stream buffer is empty but is not enough to store the current stream, the error code HI_ERR_VDEC_ILLEGAL_PARAM is returned.
- In non-blocking mode, the error code HI_ERR_VDEC_BUF_FULL is returned if the stream buffer is full.
- In timeout mode, if the stream fails to be fed within the specified timeout interval, the error code HI_ERR_VDEC_BUF_FULL is returned.
- For video decoding, if need_display in hi_vdec_stream is set to 0, the stream decoding result is not written to the output buffer configured in the hi_vdec_pic_info dictionary. In this case, the output buffer address can be set to None. The acl.himpi.vdec_get_frame call can still obtain information about the hi_video_frame_info and hi_vdec_stream dictionaries. However, no decoding result data exists in the output buffer, so you need to free the output buffer. You do not need to free the output buffer when the output buffer address is set to None.
- During decoding, the input and output buffers can be freed only after acl.himpi.vdec_get_frame is called to obtain the result.
- For details about the input and output buffer requirements, input stream format, and output image format for video decoding, see VDEC Functions and Restrictions.
- For details about the input and output buffer requirements, input image format, and output image format for image decoding, see JPEGE Functions and Restrictions.