Go to the documentation of this file.
42 void (*free_func)(
void*, uint8_t*);
77 int old_count =
list->nb_messages_allocated;
80 if (
list->nb_messages + 1 > old_count) {
81 int new_count = 2 * old_count + 1;
84 new_count,
sizeof(*
list->messages));
89 list->nb_messages_allocated = new_count;
92 memset(
list->messages + old_count, 0,
93 (new_count - old_count) *
sizeof(*
list->messages));
101 for (
int i = 0;
i <
list->nb_messages;
i++) {
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) {
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;
313 for (j = 0; j <
list->nb_messages; j++) {
316 if (
message->payload_type == payload_type) {
317 if (!*iter || found) {
335 av_assert0(0 <= position && position < list->nb_messages);
343 if (
list->nb_messages > 0) {
344 memmove(
list->messages + position,
345 list->messages + position + 1,
346 (
list->nb_messages - position) *
sizeof(*
list->messages));
352 uint32_t payload_type)
364 for (j =
list->nb_messages - 1; j >= 0; j--) {
365 if (
list->messages[j].payload_type == payload_type)
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.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
void * content
Pointer to the decomposed form of this unit.
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.
Context structure for coded bitstream operations.
static int cbs_sei_get_message_list(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, SEIRawMessageList **list)
int ff_cbs_alloc_unit_content2(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Allocate a new internal content buffer matching the type of the unit.
CodedBitstreamUnitType type
Codec-specific type of this unit.
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
@ SEI_TYPE_USER_DATA_UNREGISTERED
static void cbs_free_user_data_registered(void *opaque, uint8_t *data)
Coded bitstream unit structure.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
Coded bitstream fragment structure, combining one or more units.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
@ SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, const SEIMessageTypeDescriptor *desc)
Allocate a new payload for the given SEI message.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
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.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining list
static int FUNC() sei(CodedBitstreamContext *ctx, RWContext *rw, H264RawSEI *current)
AVBufferRef * av_buffer_create(uint8_t *data, 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(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
const SEIMessageTypeDescriptor * ff_cbs_sei_find_type(CodedBitstreamContext *ctx, int payload_type)
Find the type descriptor for the given payload type.
static void cbs_sei_delete_message(SEIRawMessageList *list, int position)
#define i(width, name, range_min, range_max)
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.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static int cbs_sei_get_unit(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, int prefix, CodedBitstreamUnit **sei_unit)
A reference to a data buffer.
static int FUNC() message(CodedBitstreamContext *ctx, RWContext *rw, SEIRawMessage *current)
int ff_cbs_sei_list_add(SEIRawMessageList *list)
Allocate a new empty SEI message in a message list.
void ff_cbs_sei_free_message_list(SEIRawMessageList *list)
Free all SEI messages in a message list.
int nb_units
Number of units in this fragment.