hi_vi_chn_attr

Description

Defines the attributes of a VI channel.

Prototype

typedef struct {
    hi_size              size;
    hi_pixel_format      pixel_format;
    hi_dynamic_range     dynamic_range;
    hi_video_format      video_format;
    hi_compress_mode     compress_mode;
    hi_u32               depth;
    hi_frame_rate_ctrl   frame_rate_ctrl;
    hi_u32               reserved[10];
} hi_vi_chn_attr;

Members

Member

Description

size

Target image size. It is a static attribute. That is, it cannot be changed after being set when a channel is created.

  • This member must be configured, and the size must be within the range supported by the VI module. For details about the range, see Restrictions.
  • The channel does not support image scaling. The channel size must be the same as the value of size configured in the pipe attributes.

pixel_format

Pixel format of the target image It is a static attribute. That is, it cannot be changed after being set when a channel is created.

When the DIS or LDC function is disabled, the supported pixel formats are HI_PIXEL_FORMAT_YVU_SEMIPLANAR_422, HI_PIXEL_FORMAT_YVU_SEMIPLANAR_420 and HI_PIXEL_FORMAT_YUV_400.

When the DIS or LDC is enabled, the supported pixel formats are HI_PIXEL_FORMAT_YVU_SEMIPLANAR_420 and HI_PIXEL_FORMAT_YUV_400.

dynamic_range

Dynamic range of the target image. It is a static attribute. That is, it cannot be changed after being set when a channel is created.

video_format

Target image or video format of the target image. The current version supports only the HI_VIDEO_FORMAT_LINEAR format.

compress_mode

Compression mode of the target image. It is a static attribute. That is, it cannot be changed after being set when a channel is created. It is not supported by the current version.

depth

Depth of the user picture queue. It is a static attribute. That is, it cannot be changed after being set when a channel is created.

Value range: [0, 8]

frame_rate_ctrl

Frame rate control

reserved

Reserved. To ensure compatibility in later versions, use the memset struct for resetting and initialization. Do not explicitly access the reserved field in the code.

  • In the current version, the VI channel does not support scaling. Therefore, ensure that the size in the channel attribute is the same as that in the pipe attribute.
  • Set a proper depth value based on the actual load and jitter. The actual number of memory blocks allocated internally is calculated as follows: depth in the depth - hi_vi_frame_dump_attr attribute of the hi_vi_pipe_attr attribute when the hi_mpi_vi_enable_chn API is called to enable the channel + depth value in the chn attribute. Therefore, you are advised to ensure that the pipe dump attributes have been configured before enabling a channel.