|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef AVCODEC_CBS_SEI_H |
|
#define AVCODEC_CBS_SEI_H |
|
|
|
#include <stddef.h> |
|
#include <stdint.h> |
|
|
|
#include "libavutil/buffer.h" |
|
|
|
#include "cbs.h" |
|
#include "sei.h" |
|
|
|
|
|
typedef struct SEIRawFillerPayload { |
|
uint32_t payload_size; |
|
} SEIRawFillerPayload; |
|
|
|
typedef struct SEIRawUserDataRegistered { |
|
uint8_t itu_t_t35_country_code; |
|
uint8_t itu_t_t35_country_code_extension_byte; |
|
uint8_t *data; |
|
AVBufferRef *data_ref; |
|
size_t data_length; |
|
} SEIRawUserDataRegistered; |
|
|
|
typedef struct SEIRawUserDataUnregistered { |
|
uint8_t uuid_iso_iec_11578[16]; |
|
uint8_t *data; |
|
AVBufferRef *data_ref; |
|
size_t data_length; |
|
} SEIRawUserDataUnregistered; |
|
|
|
typedef struct SEIRawMasteringDisplayColourVolume { |
|
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; |
|
} SEIRawMasteringDisplayColourVolume; |
|
|
|
typedef struct SEIRawContentLightLevelInfo { |
|
uint16_t max_content_light_level; |
|
uint16_t max_pic_average_light_level; |
|
} SEIRawContentLightLevelInfo; |
|
|
|
typedef struct SEIRawAlternativeTransferCharacteristics { |
|
uint8_t preferred_transfer_characteristics; |
|
} SEIRawAlternativeTransferCharacteristics; |
|
|
|
typedef struct SEIRawAmbientViewingEnvironment { |
|
uint32_t ambient_illuminance; |
|
uint16_t ambient_light_x; |
|
uint16_t ambient_light_y; |
|
} SEIRawAmbientViewingEnvironment; |
|
|
|
typedef struct SEIRawMessage { |
|
uint32_t payload_type; |
|
uint32_t payload_size; |
|
void *payload; |
|
AVBufferRef *payload_ref; |
|
uint8_t *extension_data; |
|
AVBufferRef *extension_data_ref; |
|
size_t extension_bit_length; |
|
} SEIRawMessage; |
|
|
|
typedef struct SEIRawMessageList { |
|
SEIRawMessage *messages; |
|
int nb_messages; |
|
int nb_messages_allocated; |
|
} SEIRawMessageList; |
|
|
|
|
|
typedef struct SEIMessageState { |
|
|
|
uint32_t payload_type; |
|
|
|
|
|
|
|
|
|
uint32_t payload_size; |
|
|
|
|
|
|
|
|
|
uint8_t extension_present; |
|
} SEIMessageState; |
|
|
|
struct GetBitContext; |
|
struct PutBitContext; |
|
|
|
typedef int (*SEIMessageReadFunction)(CodedBitstreamContext *ctx, |
|
struct GetBitContext *rw, |
|
void *current, |
|
SEIMessageState *sei); |
|
|
|
typedef int (*SEIMessageWriteFunction)(CodedBitstreamContext *ctx, |
|
struct PutBitContext *rw, |
|
void *current, |
|
SEIMessageState *sei); |
|
|
|
typedef struct SEIMessageTypeDescriptor { |
|
|
|
int type; |
|
|
|
uint8_t prefix; |
|
|
|
uint8_t suffix; |
|
|
|
size_t size; |
|
|
|
SEIMessageReadFunction read; |
|
|
|
SEIMessageWriteFunction write; |
|
} SEIMessageTypeDescriptor; |
|
|
|
|
|
|
|
|
|
#define SEI_MESSAGE_RW(codec, name) \ |
|
.read = (SEIMessageReadFunction) cbs_ ## codec ## _read_ ## name, \ |
|
.write = (SEIMessageWriteFunction)cbs_ ## codec ## _write_ ## name |
|
|
|
|
|
#define SEI_MESSAGE_TYPE_END { .type = -1 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SEIMessageTypeDescriptor *ff_cbs_sei_find_type(CodedBitstreamContext *ctx, |
|
int payload_type); |
|
|
|
|
|
|
|
|
|
int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, |
|
const SEIMessageTypeDescriptor *desc); |
|
|
|
|
|
|
|
|
|
|
|
|
|
int ff_cbs_sei_list_add(SEIRawMessageList *list); |
|
|
|
|
|
|
|
|
|
void ff_cbs_sei_free_message_list(SEIRawMessageList *list); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int ff_cbs_sei_add_message(CodedBitstreamContext *ctx, |
|
CodedBitstreamFragment *au, |
|
int prefix, |
|
uint32_t payload_type, |
|
void *payload_data, |
|
AVBufferRef *payload_buf); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int ff_cbs_sei_find_message(CodedBitstreamContext *ctx, |
|
CodedBitstreamFragment *au, |
|
uint32_t payload_type, |
|
SEIRawMessage **message); |
|
|
|
|
|
|
|
|
|
void ff_cbs_sei_delete_message_type(CodedBitstreamContext *ctx, |
|
CodedBitstreamFragment *au, |
|
uint32_t payload_type); |
|
|
|
#endif |
|
|