hi_venc_pack

Description

Defines the information of a packet.

Prototype

typedef struct {
    union {
        hi_u64 phys_addr;
        hi_u64 input_addr;
    };
    hi_u8 ATTRIBUTE* addr;
    hi_u32 ATTRIBUTE len;
    hi_u64 pts;
    hi_bool is_frame_end;
    hi_venc_data_type data_type;
    hi_u32 offset;
    hi_u32 data_num;
    hi_venc_pack_info pack_info[HI_VENC_MAX_PACK_INFO_NUM];
} hi_venc_pack;

Members

Member

Description

phys_addr

Physical address of a packet.

input_addr

Buffer address of the input stream.

If you need to reclaim the memory corresponding to the input stream data, you can use this parameter to obtain the user-mode virtual address of the data in the original YUV stream after obtaining the encoding stream result.

addr

Start address of a packet.

len

Length of a packet.

If the value of len is 0, video or image encoding fails.

pts

Timestamp (μs).

is_frame_end

End of frame flag.

Selected from:

  • HI_TRUE: The packet marks the end of the frame.
  • HI_FALSE: The packet does not mark the end of the frame.

data_type

Stream type. H.265, H.264, and JPEG packets are supported.

offset

Offset of the packet payload relative to the start address addr of the packet.

data_num

Number of packets in the stream, which is related to the data_type setting.

pack_info[HI_VENC_MAX_PACK_INFO_NUM]

Packet information.

#define HI_VENC_MAX_PACK_INFO_NUM 8