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;
141 for (i = 0; i < au->
nb_units; i++) {
156 for (i = 0; i < au->
nb_units; i++) {
157 if (au->
units[i].
type < highest_vcl_type)
163 for (i = au->
nb_units - 1; i >= 0; i--) {
164 if (au->
units[i].
type < highest_vcl_type)
179 unit = &au->
units[position];
180 unit->
type = sei_type;
192 .nal_unit_type = sei_type,
195 memcpy(unit->
content, &sei,
sizeof(sei));
202 .nal_unit_type = sei_type,
204 .nuh_temporal_id_plus1 = 1,
207 memcpy(unit->
content, &sei,
sizeof(sei));
250 uint32_t payload_type,
291 message->
payload = payload_data;
299 uint32_t payload_type,
302 int err,
i, j, found;
305 for (i = 0; i < au->
nb_units; i++) {
317 if (!*iter || found) {
321 if (message == *iter)
335 av_assert0(0 <= position && position < list->nb_messages);
337 message = &list->
messages[position];
352 uint32_t payload_type)
356 for (i = 0; i < au->
nb_units; i++) {
int ff_cbs_alloc_unit_content2(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Allocate a new internal content buffer matching the type of the unit.
int nb_units
Number of units in this fragment.
static void cbs_free_user_data_registered(void *opaque, uint8_t *data)
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
ptrdiff_t const GLvoid * data
CodedBitstreamUnitType type
Codec-specific type of this unit.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
AVBufferRef * extension_data_ref
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.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
SEIRawMessageList message_list
static void cbs_sei_delete_message(SEIRawMessageList *list, int position)
const SEIMessageTypeDescriptor * ff_cbs_sei_find_type(CodedBitstreamContext *ctx, int payload_type)
Find the type descriptor for the given payload type.
static int cbs_sei_get_message_list(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, SEIRawMessageList **list)
Coded bitstream unit structure.
void * content
Pointer to the decomposed form of this unit.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
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.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
AVBufferRef * av_buffer_create(uint8_t *data, int size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
void ff_cbs_sei_free_message_list(SEIRawMessageList *list)
Free all SEI messages in a message list.
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
static int FUNC() message(CodedBitstreamContext *ctx, RWContext *rw, SEIRawMessage *current)
AVBufferRef * payload_ref
AVBufferRef * av_buffer_alloc(int size)
Allocate an AVBuffer of the given size using av_malloc().
static int cbs_sei_get_unit(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, int prefix, CodedBitstreamUnit **sei_unit)
Coded bitstream fragment structure, combining one or more units.
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
uint8_t * data
The data buffer.
SEIRawMessageList message_list
int nb_messages_allocated
int ff_cbs_sei_list_add(SEIRawMessageList *list)
Allocate a new empty SEI message in a message list.
Context structure for coded bitstream operations.
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.
A reference to a data buffer.
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
static int FUNC() sei(CodedBitstreamContext *ctx, RWContext *rw, H264RawSEI *current)
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.
const struct CodedBitstreamType * codec
Internal codec-specific hooks.
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
static void cbs_free_user_data_unregistered(void *opaque, uint8_t *data)
int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, const SEIMessageTypeDescriptor *desc)
Allocate a new payload for the given SEI message.