vdec_set_display_mode

Applicability

Product

Supported

Atlas 350 Accelerator Card

x

Atlas A3 training product/Atlas A3 inference product

x

Atlas A2 training product/Atlas A2 inference product

x

Atlas training product

x

Atlas inference product

x

Atlas 200I/500 A2 inference product

Description

This API does not support the setting of the display mode. The playback mode is used by default.

Prototype

  • C Prototype
    1
    hi_s32 hi_mpi_vdec_set_display_mode(hi_vdec_chn chn, hi_video_display_mode display_mode)
    
  • Python Function
    1
    ret = acl.himpi.vdec_set_display_mode(chn, display_mode)
    

Parameters

Parameter

Description

chn

Int, decoding channel ID.

display_mode

int, display mode. For details, see hi_video_display_mode.

Return Value

Return Value

Description

ret

int.

Restrictions

  • Before setting the display mode, ensure that a channel is created. Otherwise, the error code HI_ERR_VDEC_UNEXIT is returned, indicating that no channel is created.
  • Preview mode (HI_VIDEO_DISPLAY_MODE_PREVIEW): In this mode, the backend module (such as the VPSS) bound to the VDEC receives decoded pictures in non-blocking mode. That is, when the image buffer of the VPSS is full (or when the number of decoding frame buffers is larger than that of VPSS buffer queues), the VPSS discards the new images received from the VDEC. This prevents backpressure on VDEC and implements real-time preview. Note that when the number of decoding frame buffers is smaller than that of VPSS buffer queues, the VPSS still performs backpressure on VDEC even if the preview mode is enabled.
  • Playback mode (HI_VIDEO_DISPLAY_MODE_PLAYBACK): In this mode, the backend module (such as the VPSS) bound to the VDEC receives decoded images in blocking mode. That is, when the image buffer of the VPSS is full, the VPSS refuses to receive new images from the VDEC. When the VDEC detects that the current image fails to be transmitted, it starts the retransmission mechanism until the image is successfully transmitted. The backend module exerts backpressure on VDEC, ensuring that each decoded picture is displayed.