hi_venc_pack

Function

Defines the information of a packet.

Definition

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;

For details about basic data types hi_u64, hi_u8, hi_u32, and hi_bool, see Basic Data Types.

Members

Member

Description

phys_addr

Physical address of the stream packet.

input_addr

Buffer address of the input stream.

If you need to reclaim the buffer 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

Header address of the stream packet.

len

Length of a packet.

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

pts

Presentation time stamp (PTS). Unit: μs

is_frame_end

End of frame flag.

Value range:

  • 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. For details, see hi_venc_data_type.

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. For details, see hi_venc_pack_info.

#define HI_VENC_MAX_PACK_INFO_NUM 8