Go to the documentation of this file.
70 int old_count =
list->nb_messages_allocated;
73 if (
list->nb_messages + 1 > old_count) {
74 int new_count = 2 * old_count + 1;
77 new_count,
sizeof(*
list->messages));
82 list->nb_messages_allocated = new_count;
85 memset(
list->messages + old_count, 0,
86 (new_count - old_count) *
sizeof(*
list->messages));
94 for (
int i = 0;
i <
list->nb_messages;
i++) {
108 int sei_type, highest_vcl_type, err,
i, position;
110 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,
214 .nal_unit_type = sei_type,
216 .nuh_temporal_id_plus1 = 1,
234 switch (
ctx->codec->codec_id) {
271 uint32_t payload_type,
308 message->payload_type = payload_type;
309 message->payload = payload_data;
310 message->payload_ref = payload_ref;
317 uint32_t payload_type,
320 int err,
i, j, found;
331 for (j = 0; j <
list->nb_messages; j++) {
334 if (
message->payload_type == payload_type) {
335 if (!*iter || found) {
353 av_assert0(0 <= position && position < list->nb_messages);
361 if (
list->nb_messages > 0) {
362 memmove(
list->messages + position,
363 list->messages + position + 1,
364 (
list->nb_messages - position) *
sizeof(*
list->messages));
370 uint32_t payload_type)
382 for (j =
list->nb_messages - 1; j >= 0; j--) {
383 if (
list->messages[j].payload_type == payload_type)
void * ff_refstruct_ref(void *obj)
Create a new reference to an object managed via this API, i.e.
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
int ff_cbs_sei_add_message(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, int prefix, uint32_t payload_type, void *payload_data, void *payload_ref)
Add an SEI message to an access unit.
void * content
Pointer to the decomposed form of this unit.
int ff_cbs_insert_unit_content(CodedBitstreamFragment *frag, int position, CodedBitstreamUnitType type, void *content, void *content_ref)
Insert a new unit into a fragment with the given content.
static void * ff_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque, void(*free_cb)(FFRefStructOpaque opaque, void *obj))
A wrapper around ff_refstruct_alloc_ext_c() for the common case of a non-const qualified opaque.
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)
CodedBitstreamUnitType type
Codec-specific type of this unit.
RefStruct is an API for creating reference-counted objects with minimal overhead.
Coded bitstream unit structure.
uint8_t * data
RefStruct reference.
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)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
@ SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35
int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, const SEIMessageTypeDescriptor *desc)
Allocate a new payload for the given SEI message.
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)
uint8_t * data
RefStruct reference.
static void cbs_free_user_data_unregistered(FFRefStructOpaque unused, void *obj)
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.
int ff_cbs_alloc_unit_content(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Allocate a new internal content buffer matching the type of the unit.
@ SEI_TYPE_USER_DATA_UNREGISTERED
static void cbs_free_user_data_registered(FFRefStructOpaque unused, void *obj)
static int cbs_sei_get_unit(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, int prefix, CodedBitstreamUnit **sei_unit)
#define FF_REFSTRUCT_FLAG_NO_ZEROING
If this flag is set in ff_refstruct_alloc_ext_c(), the object will not be initially zeroed.
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.
#define flags(name, subs,...)
void ff_cbs_sei_free_message_list(SEIRawMessageList *list)
Free all SEI messages in a message list.
void ff_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
int nb_units
Number of units in this fragment.