81 int new_count = 2 * old_count + 1;
92 memset(list->
messages + old_count, 0,
93 (new_count - old_count) *
sizeof(*list->
messages));
115 int sei_type, highest_vcl_type, err,
i, position;
117 switch (
ctx->codec->codec_id) {
179 unit = &au->
units[position];
180 unit->
type = sei_type;
186 switch (
ctx->codec->codec_id) {
192 .nal_unit_type = sei_type,
202 .nal_unit_type = sei_type,
204 .nuh_temporal_id_plus1 = 1,
222 switch (
ctx->codec->codec_id) {
228 *list = &
sei->message_list;
237 *list = &
sei->message_list;
250 uint32_t payload_type,
290 message->payload_type = payload_type;
291 message->payload = payload_data;
292 message->payload_ref = payload_ref;
299 uint32_t payload_type,
302 int err,
i, j, found;
316 if (
message->payload_type == payload_type) {
317 if (!*iter || found) {
335 av_assert0(0 <= position && position < list->nb_messages);
352 uint32_t payload_type)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_cbs_insert_unit_content(CodedBitstreamFragment *frag, int position, CodedBitstreamUnitType type, void *content, AVBufferRef *content_buf)
Insert a new unit into a fragment with the given content.
int ff_cbs_alloc_unit_content2(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Allocate a new internal content buffer matching the type of the unit.
const SEIMessageTypeDescriptor * ff_cbs_sei_find_type(CodedBitstreamContext *ctx, int payload_type)
Find the type descriptor for the given payload type.
static int FUNC() sei(CodedBitstreamContext *ctx, RWContext *rw, H264RawSEI *current)
static void cbs_sei_delete_message(SEIRawMessageList *list, int position)
static void cbs_free_user_data_registered(void *opaque, uint8_t *data)
void ff_cbs_sei_free_message_list(SEIRawMessageList *list)
Free all SEI messages in a message list.
int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, const SEIMessageTypeDescriptor *desc)
Allocate a new payload for the given SEI message.
static void cbs_free_user_data_unregistered(void *opaque, uint8_t *data)
void ff_cbs_sei_delete_message_type(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, uint32_t payload_type)
Delete all messages with the given payload type from an access unit.
static int cbs_sei_get_message_list(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, SEIRawMessageList **list)
int ff_cbs_sei_list_add(SEIRawMessageList *list)
Allocate a new empty SEI message in a message list.
int ff_cbs_sei_add_message(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, int prefix, uint32_t payload_type, void *payload_data, AVBufferRef *payload_buf)
Add an SEI message to an access unit.
static int cbs_sei_get_unit(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, int prefix, CodedBitstreamUnit **sei_unit)
int ff_cbs_sei_find_message(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, uint32_t payload_type, SEIRawMessage **iter)
Iterate over messages with the given payload type in an access unit.
static int FUNC() message(CodedBitstreamContext *ctx, RWContext *rw, SEIRawMessage *current)
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
AVBufferRef * av_buffer_create(uint8_t *data, buffer_size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
AVBufferRef * av_buffer_alloc(buffer_size_t size)
Allocate an AVBuffer of the given size using av_malloc().
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate, or free an array.
typedef void(RENAME(mix_any_func_type))
@ SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35
@ SEI_TYPE_USER_DATA_UNREGISTERED
A reference to a data buffer.
Context structure for coded bitstream operations.
Coded bitstream fragment structure, combining one or more units.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
int nb_units
Number of units in this fragment.
Coded bitstream unit structure.
void * content
Pointer to the decomposed form of this unit.
CodedBitstreamUnitType type
Codec-specific type of this unit.
int nb_messages_allocated