51 int seq = 0, cnt = 0, start_pos;
56 &obu_size, &start_pos, &
type,
62 p->buf_size - cnt - start_pos,
133 for (
int j = 0; j <
mix->nb_submixes; j++) {
140 for (
int l = 0; l <
s->nb_stream_groups; l++)
143 audio_element =
s->stream_groups[l];
148 for (
int l = 0; l < audio_element->
nb_streams; l++) {
150 if (ret < 0 && ret !=
AVERROR(EEXIST))
187 .p.extensions =
"iamf",
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define i(width, name, range_min, range_max)
static int read_probe(const AVProbeData *p)
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
static int read_header(FFV1Context *f, RangeCoder *c)
AVStreamGroup * avformat_stream_group_create(AVFormatContext *s, enum AVStreamGroupParamsType type, AVDictionary **options)
Add a new empty stream group to a media file.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
int avformat_stream_group_add_stream(AVStreamGroup *stg, AVStream *st)
Add an already allocated stream to a stream group.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_iamf_audio_element_free(AVIAMFAudioElement **paudio_element)
Free an AVIAMFAudioElement and all its contents.
void av_iamf_mix_presentation_free(AVIAMFMixPresentation **pmix_presentation)
Free an AVIAMFMixPresentation and all its contents.
int ff_iamf_parse_obu_header(const uint8_t *buf, int buf_size, unsigned *obu_size, int *start_pos, enum IAMF_OBU_Type *type, unsigned *skip_samples, unsigned *discard_padding)
int ff_iamfdec_read_descriptors(IAMFContext *c, AVIOContext *pb, int max_size, void *log_ctx)
int ff_iamf_read_packet(AVFormatContext *s, IAMFDemuxContext *c, AVIOContext *pb, int max_size, int stream_id_offset, AVPacket *pkt)
void ff_iamf_read_deinit(IAMFDemuxContext *c)
static int get_score(const uint8_t *buf, int buf_size, enum IAMF_OBU_Type type, int *seq)
static int iamf_probe(const AVProbeData *p)
static int iamf_read_header(AVFormatContext *s)
static int iamf_read_close(AVFormatContext *s)
static int iamf_read_packet(AVFormatContext *s, AVPacket *pkt)
static int mix(int c0, int c1)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static av_cold int read_close(AVFormatContext *ctx)
#define MKBETAG(a, b, c, d)
int sample_rate
The number of audio samples per second.
Information on how to render and mix one or more AVIAMFAudioElement to generate the final audio outpu...
Submix element as defined in section 3.7 of IAMF.
unsigned int audio_element_id
The id of the Audio Element this submix element references.
Submix layout as defined in section 3.7 of IAMF.
unsigned int nb_elements
Number of elements in the submix.
AVIAMFSubmixElement ** elements
Array of submix elements.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
union AVStreamGroup::@166361102046003066253145020066347265153020354020 params
Group type-specific parameters.
struct AVIAMFMixPresentation * iamf_mix_presentation
unsigned int nb_streams
Number of elements in AVStreamGroup.streams.
struct AVIAMFAudioElement * iamf_audio_element
int64_t id
Group type-specific group ID.
AVStream ** streams
A list of streams in the group.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int id
Format-specific stream ID.
int disposition
Stream disposition - a combination of AV_DISPOSITION_* flags.
unsigned int audio_element_id
AVIAMFAudioElement * element
element backs celement iff the AVIAMFAudioElement is owned by this structure.
unsigned int nb_substreams
IAMFSubStream * substreams
IAMFMixPresentation ** mix_presentations
IAMFAudioElement ** audio_elements
unsigned int substream_count
AVIAMFMixPresentation * mix
mix backs cmix iff the AVIAMFMixPresentation is owned by this structure.
const AVIAMFMixPresentation * cmix
unsigned int mix_presentation_id
AVCodecParameters * codecpar
unsigned int audio_substream_id