+typedef struct H265RawSEIBufferingPeriod {
+ uint8_t bp_seq_parameter_set_id;
+ uint8_t irap_cpb_params_present_flag;
+ uint32_t cpb_delay_offset;
+ uint32_t dpb_delay_offset;
+ uint8_t concatenation_flag;
+ uint32_t au_cpb_removal_delay_delta_minus1;
+
+ uint32_t nal_initial_cpb_removal_delay[HEVC_MAX_CPB_CNT];
+ uint32_t nal_initial_cpb_removal_offset[HEVC_MAX_CPB_CNT];
+ uint32_t nal_initial_alt_cpb_removal_delay[HEVC_MAX_CPB_CNT];
+ uint32_t nal_initial_alt_cpb_removal_offset[HEVC_MAX_CPB_CNT];
+
+ uint32_t vcl_initial_cpb_removal_delay[HEVC_MAX_CPB_CNT];
+ uint32_t vcl_initial_cpb_removal_offset[HEVC_MAX_CPB_CNT];
+ uint32_t vcl_initial_alt_cpb_removal_delay[HEVC_MAX_CPB_CNT];
+ uint32_t vcl_initial_alt_cpb_removal_offset[HEVC_MAX_CPB_CNT];
+
+ uint8_t use_alt_cpb_params_flag;
+} H265RawSEIBufferingPeriod;
+
+typedef struct H265RawSEIPicTiming {
+ uint8_t pic_struct;
+ uint8_t source_scan_type;
+ uint8_t duplicate_flag;
+
+ uint32_t au_cpb_removal_delay_minus1;
+ uint32_t pic_dpb_output_delay;
+ uint32_t pic_dpb_output_du_delay;
+
+ uint16_t num_decoding_units_minus1;
+ uint8_t du_common_cpb_removal_delay_flag;
+ uint32_t du_common_cpb_removal_delay_increment_minus1;
+ uint16_t num_nalus_in_du_minus1[HEVC_MAX_SLICE_SEGMENTS];
+ uint32_t du_cpb_removal_delay_increment_minus1[HEVC_MAX_SLICE_SEGMENTS];
+} H265RawSEIPicTiming;
+
+typedef struct H265RawSEIPanScanRect {
+ uint32_t pan_scan_rect_id;
+ uint8_t pan_scan_rect_cancel_flag;
+ uint8_t pan_scan_cnt_minus1;
+ int32_t pan_scan_rect_left_offset[3];
+ int32_t pan_scan_rect_right_offset[3];
+ int32_t pan_scan_rect_top_offset[3];
+ int32_t pan_scan_rect_bottom_offset[3];
+ uint16_t pan_scan_rect_persistence_flag;
+} H265RawSEIPanScanRect;
+
+typedef struct H265RawSEIUserDataRegistered {
+ uint8_t itu_t_t35_country_code;
+ uint8_t itu_t_t35_country_code_extension_byte;
+ uint8_t *data;
+ size_t data_length;
+ AVBufferRef *data_ref;
+} H265RawSEIUserDataRegistered;
+
+typedef struct H265RawSEIUserDataUnregistered {
+ uint8_t uuid_iso_iec_11578[16];
+ uint8_t *data;
+ size_t data_length;
+ AVBufferRef *data_ref;
+} H265RawSEIUserDataUnregistered;
+
+typedef struct H265RawSEIRecoveryPoint {
+ int16_t recovery_poc_cnt;
+ uint8_t exact_match_flag;
+ uint8_t broken_link_flag;
+} H265RawSEIRecoveryPoint;
+
+typedef struct H265RawSEIDisplayOrientation {
+ uint8_t display_orientation_cancel_flag;
+ uint8_t hor_flip;
+ uint8_t ver_flip;
+ uint16_t anticlockwise_rotation;
+ uint16_t display_orientation_repetition_period;
+ uint8_t display_orientation_persistence_flag;
+} H265RawSEIDisplayOrientation;
+
+typedef struct H265RawSEIActiveParameterSets {
+ uint8_t active_video_parameter_set_id;
+ uint8_t self_contained_cvs_flag;
+ uint8_t no_parameter_set_update_flag;
+ uint8_t num_sps_ids_minus1;
+ uint8_t active_seq_parameter_set_id[HEVC_MAX_SPS_COUNT];
+ uint8_t layer_sps_idx[HEVC_MAX_LAYERS];
+} H265RawSEIActiveParameterSets;
+
+typedef struct H265RawSEIDecodedPictureHash {
+ uint8_t hash_type;
+ uint8_t picture_md5[3][16];
+ uint16_t picture_crc[3];
+ uint32_t picture_checksum[3];
+} H265RawSEIDecodedPictureHash;
+
+typedef struct H265RawSEITimeCode {
+ uint8_t num_clock_ts;
+ uint8_t clock_timestamp_flag[3];
+ uint8_t units_field_based_flag[3];
+ uint8_t counting_type[3];
+ uint8_t full_timestamp_flag[3];
+ uint8_t discontinuity_flag[3];
+ uint8_t cnt_dropped_flag[3];
+ uint16_t n_frames[3];
+ uint8_t seconds_value[3];
+ uint8_t minutes_value[3];
+ uint8_t hours_value[3];
+ uint8_t seconds_flag[3];
+ uint8_t minutes_flag[3];
+ uint8_t hours_flag[3];
+ uint8_t time_offset_length[3];
+ uint32_t time_offset_value[3];
+} H265RawSEITimeCode;
+
+typedef struct H265RawSEIMasteringDisplayColourVolume {
+ uint16_t display_primaries_x[3];
+ uint16_t display_primaries_y[3];
+ uint16_t white_point_x;
+ uint16_t white_point_y;
+ uint32_t max_display_mastering_luminance;
+ uint32_t min_display_mastering_luminance;
+} H265RawSEIMasteringDisplayColourVolume;
+
+typedef struct H265RawSEIContentLightLevelInfo {
+ uint16_t max_content_light_level;
+ uint16_t max_pic_average_light_level;
+} H265RawSEIContentLightLevelInfo;
+
+typedef struct H265RawSEIAlternativeTransferCharacteristics {
+ uint8_t preferred_transfer_characteristics;
+} H265RawSEIAlternativeTransferCharacteristics;
+
+typedef struct H265RawSEIPayload {
+ uint32_t payload_type;
+ uint32_t payload_size;
+ union {
+ H265RawSEIBufferingPeriod buffering_period;
+ H265RawSEIPicTiming pic_timing;
+ H265RawSEIPanScanRect pan_scan_rect;
+ H265RawSEIUserDataRegistered user_data_registered;
+ H265RawSEIUserDataUnregistered user_data_unregistered;
+ H265RawSEIRecoveryPoint recovery_point;
+ H265RawSEIDisplayOrientation display_orientation;
+ H265RawSEIActiveParameterSets active_parameter_sets;
+ H265RawSEIDecodedPictureHash decoded_picture_hash;
+ H265RawSEITimeCode time_code;
+ H265RawSEIMasteringDisplayColourVolume mastering_display;
+ H265RawSEIContentLightLevelInfo content_light_level;
+ H265RawSEIAlternativeTransferCharacteristics
+ alternative_transfer_characteristics;
+ struct {
+ uint8_t *data;
+ size_t data_length;
+ AVBufferRef *data_ref;
+ } other;
+ } payload;
+} H265RawSEIPayload;
+
+typedef struct H265RawSEI {
+ H265RawNALUnitHeader nal_unit_header;
+
+ H265RawSEIPayload payload[H265_MAX_SEI_PAYLOADS];
+ uint8_t payload_count;
+} H265RawSEI;
+