hi_vdec_stream

Description

Defines the dictionary of a video or image decoding stream.

Prototype

hi_vdec_stream = {"end_of_frame": end_of_frame, # W; is the end of a frame.
                  "end_of_stream": end_of_stream, # W; is the end of all stream.
                  "need_display": need_display, # W; is the current frame displayed. Only valid by HI_VDEC_SEND_MODE_FRAME.
                  "pts": pts, # W; time stamp
                  "private_data": private_data, # W; private data,reserved
                  "len": len, # W; length of stream
                  "addr": addr} # W; stream address

Members

Member

Description

end_of_frame

Int, whether the current frame is complete. (Does not work currently)

end_of_stream

Int, whether all streams are sent.

need_display

Int, whether the current frame needs to be displayed.

  • 0: Not display. If this parameter is set to 0, the output buffer has no decoding result, and non-display frames are output in the display or decoding sequence.
  • 1: Display. The decoding result can be output only when this parameter is set to 1, and the display frames are output in the display or decoding sequence.

If both non-display and display frames exist in a decoded stream, the system does not ensure that the non-display and display frames are output in the display or decoding sequence.

pts

Int, timestamp of a stream packet, in μs. Valid only in frame mode.

private_data

Private data. Reserved.

len

Int, end of a frame, in bytes.

addr

Int, address of a stream packet.

Precautions

  • For stream feeding in frame mode, the PTS of the decoded image is the same as that of the packet.
  • For stream feeding in stream mode, the PTS of the decoded image is 0.
  • When the streams are completely fed to the decoder and end_of_stream is set to 1, the decoder decodes the streams and outputs the decoded images. When the streams are completely fed to the decoder but end_of_stream is set to 0, one or more frames may be left in the decoder. The decoder can detect the end of the current frame only when the next frame is received.
  • It is allowed to feed an empty packet (whose length is 0 or address is empty) with end_of_stream = 1 to VDEC.