Go to the documentation of this file.
43 int nb_audio_elements = 0, nb_mix_presentations = 0;
46 for (
int i = 0;
i <
s->nb_streams;
i++) {
48 (
s->streams[
i]->codecpar->codec_tag !=
MKTAG(
'm',
'p',
'4',
'a') &&
49 s->streams[
i]->codecpar->codec_tag !=
MKTAG(
'O',
'p',
'u',
's') &&
50 s->streams[
i]->codecpar->codec_tag !=
MKTAG(
'f',
'L',
'a',
'C') &&
51 s->streams[
i]->codecpar->codec_tag !=
MKTAG(
'i',
'p',
'c',
'm'))) {
57 if (
s->streams[
i]->codecpar->ch_layout.nb_channels > 2) {
62 for (
int j = 0; j <
i; j++) {
63 if (
s->streams[
i]->id ==
s->streams[j]->id) {
70 if (
s->nb_stream_groups <= 1) {
75 for (
int i = 0;
i <
s->nb_stream_groups;
i++) {
81 nb_mix_presentations++;
83 if ((nb_audio_elements < 1 || nb_audio_elements > 2) || nb_mix_presentations < 1) {
85 "one IAMF_MIX_PRESENTATION stream groups\n");
89 for (
int i = 0;
i <
s->nb_stream_groups;
i++) {
99 for (
int i = 0;
i <
s->nb_stream_groups;
i++) {
109 c->first_stream_id =
s->streams[0]->id;
125 c->first_stream_id =
s->streams[0]->id;
136 if (st->
id ==
c->first_stream_id)
141 c->update_extradata = 1;
191 .p.extensions =
"iamf",
static int iamf_write_header(AVFormatContext *s)
int64_t descriptors_offset
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 av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int iamf_write_packet(AVFormatContext *s, AVPacket *pkt)
int ff_iamf_add_audio_element(IAMFContext *iamf, const AVStreamGroup *stg, void *log_ctx)
int ff_iamf_add_mix_presentation(IAMFContext *iamf, const AVStreamGroup *stg, void *log_ctx)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int ff_iamf_write_parameter_blocks(const IAMFContext *iamf, AVIOContext *pb, const AVPacket *pkt, void *log_ctx)
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
#define i(width, name, range_min, range_max)
static int iamf_write_trailer(AVFormatContext *s)
int ff_iamf_write_audio_frame(const IAMFContext *iamf, AVIOContext *pb, unsigned audio_substream_id, const AVPacket *pkt)
int ff_iamf_write_descriptors(const IAMFContext *iamf, AVIOContext *pb, void *log_ctx)
int id
Format-specific stream ID.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
const FFOutputFormat ff_iamf_muxer
static void iamf_deinit(AVFormatContext *s)
static const AVCodecTag iamf_codec_tags[]
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
enum AVStreamGroupParamsType type
Group type.
static int iamf_init(AVFormatContext *s)
This structure stores compressed data.
#define MKTAG(a, b, c, d)