FFmpeg
Data Structures | Macros | Typedefs | Functions
cbs_sei.h File Reference
#include <stddef.h>
#include <stdint.h>
#include "libavutil/buffer.h"
#include "cbs.h"
#include "sei.h"

Go to the source code of this file.

Data Structures

struct  SEIRawFillerPayload
 
struct  SEIRawUserDataRegistered
 
struct  SEIRawUserDataUnregistered
 
struct  SEIRawMasteringDisplayColourVolume
 
struct  SEIRawContentLightLevelInfo
 
struct  SEIRawAlternativeTransferCharacteristics
 
struct  SEIRawMessage
 
struct  SEIRawMessageList
 
struct  SEIMessageState
 
struct  SEIMessageTypeDescriptor
 

Macros

#define SEI_MESSAGE_RW(codec, name)
 
#define SEI_MESSAGE_TYPE_END   { .type = -1 }
 

Typedefs

typedef int(* SEIMessageReadFunction) (CodedBitstreamContext *ctx, struct GetBitContext *rw, void *current, SEIMessageState *sei)
 
typedef int(* SEIMessageWriteFunction) (CodedBitstreamContext *ctx, struct PutBitContext *rw, void *current, SEIMessageState *sei)
 

Functions

const SEIMessageTypeDescriptorff_cbs_sei_find_type (CodedBitstreamContext *ctx, int payload_type)
 Find the type descriptor for the given payload type. More...
 
int ff_cbs_sei_alloc_message_payload (SEIRawMessage *message, const SEIMessageTypeDescriptor *desc)
 Allocate a new payload for the given SEI message. More...
 
int ff_cbs_sei_list_add (SEIRawMessageList *list)
 Allocate a new empty SEI message in a message list. More...
 
void ff_cbs_sei_free_message_list (SEIRawMessageList *list)
 Free all SEI messages in a message list. More...
 
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. More...
 
int ff_cbs_sei_find_message (CodedBitstreamContext *ctx, CodedBitstreamFragment *au, uint32_t payload_type, SEIRawMessage **message)
 Iterate over messages with the given payload type in an access unit. More...
 
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. More...
 

Macro Definition Documentation

◆ SEI_MESSAGE_RW

#define SEI_MESSAGE_RW (   codec,
  name 
)
Value:
.read = (SEIMessageReadFunction) cbs_ ## codec ## _read_ ## name, \
.write = (SEIMessageWriteFunction)cbs_ ## codec ## _write_ ## name

Definition at line 131 of file cbs_sei.h.

◆ SEI_MESSAGE_TYPE_END

#define SEI_MESSAGE_TYPE_END   { .type = -1 }

Definition at line 136 of file cbs_sei.h.

Typedef Documentation

◆ SEIMessageReadFunction

typedef int(* SEIMessageReadFunction) (CodedBitstreamContext *ctx, struct GetBitContext *rw, void *current, SEIMessageState *sei)

Definition at line 103 of file cbs_sei.h.

◆ SEIMessageWriteFunction

typedef int(* SEIMessageWriteFunction) (CodedBitstreamContext *ctx, struct PutBitContext *rw, void *current, SEIMessageState *sei)

Definition at line 108 of file cbs_sei.h.

Function Documentation

◆ ff_cbs_sei_find_type()

const SEIMessageTypeDescriptor* ff_cbs_sei_find_type ( CodedBitstreamContext ctx,
int  payload_type 
)

Find the type descriptor for the given payload type.

Returns NULL if the payload type is not known.

Definition at line 1610 of file cbs_h2645.c.

Referenced by ff_cbs_sei_add_message(), and message().

◆ ff_cbs_sei_alloc_message_payload()

int ff_cbs_sei_alloc_message_payload ( SEIRawMessage message,
const SEIMessageTypeDescriptor desc 
)

Allocate a new payload for the given SEI message.

Definition at line 39 of file cbs_sei.c.

Referenced by message().

◆ ff_cbs_sei_list_add()

int ff_cbs_sei_list_add ( SEIRawMessageList list)

Allocate a new empty SEI message in a message list.

The new message is in place nb_messages - 1.

Definition at line 74 of file cbs_sei.c.

Referenced by ff_cbs_sei_add_message(), and message_list().

◆ ff_cbs_sei_free_message_list()

void ff_cbs_sei_free_message_list ( SEIRawMessageList list)

Free all SEI messages in a message list.

Definition at line 99 of file cbs_sei.c.

Referenced by cbs_h264_free_sei(), and cbs_h265_free_sei().

◆ ff_cbs_sei_add_message()

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.

Will add to an existing SEI NAL unit, or create a new one for the message if there is no suitable existing one.

Takes a new reference to payload_buf, if set. If payload_buf is NULL then the new message will not be reference counted.

Definition at line 247 of file cbs_sei.c.

Referenced by h264_metadata_handle_display_orientation(), h264_metadata_update_fragment(), vaapi_encode_h264_write_extra_header(), and vaapi_encode_h265_write_extra_header().

◆ ff_cbs_sei_find_message()

int ff_cbs_sei_find_message ( CodedBitstreamContext ctx,
CodedBitstreamFragment au,
uint32_t  payload_type,
SEIRawMessage **  message 
)

Iterate over messages with the given payload type in an access unit.

Set message to NULL in the first call. Returns 0 while more messages are available, AVERROR(ENOENT) when all messages have been found.

Definition at line 297 of file cbs_sei.c.

Referenced by h264_metadata_handle_display_orientation().

◆ ff_cbs_sei_delete_message_type()

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.

Definition at line 350 of file cbs_sei.c.

Referenced by h264_metadata_handle_display_orientation(), and h264_metadata_update_fragment().

name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
SEIMessageReadFunction
int(* SEIMessageReadFunction)(CodedBitstreamContext *ctx, struct GetBitContext *rw, void *current, SEIMessageState *sei)
Definition: cbs_sei.h:103
SEIMessageWriteFunction
int(* SEIMessageWriteFunction)(CodedBitstreamContext *ctx, struct PutBitContext *rw, void *current, SEIMessageState *sei)
Definition: cbs_sei.h:108