vdec_set_display_mode

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

x

Atlas A2 training products/Atlas A2 inference products

x

Atlas training products

x

Atlas inference products

x

Atlas 200I/500 A2 inference products

Function Usage

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)
    

Parameter Description

Parameter

Description

chn

Int, decoding channel ID.

  • Atlas inference products: The value range of this parameter is [0, 256). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 256.
  • Atlas A2 training products/Atlas A2 inference products: The value range of this parameter is [0, 256). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 256. Among them, a maximum of 256 JPEGD decoding channels and 32 VDEC decoding channels are supported.
  • Atlas 200I/500 A2 inference products: The value range of this parameter is [0, 128). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 128.
  • Atlas A3 training products/Atlas A3 inference products: The value range of this parameter is [0, 256). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 256. Among them, a maximum of 256 JPEGD decoding channels and 32 VDEC decoding channels are supported.

display_mode

Int, display mode. For details, see hi_video_display_mode.

Return Value Description

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 back-end 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 back-end 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 back-end module exerts backpressure on VDEC, ensuring that each decoded picture is displayed.