Go to the documentation of this file.
51 int seq = 0, cnt = 0, start_pos;
56 &obu_size, &start_pos, &
type,
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++) {
187 .p.extensions =
"iamf",
union AVStreamGroup::@365 params
Group type-specific parameters.
AVIAMFSubmixElement ** elements
Array of submix elements.
int64_t id
Group type-specific group ID.
static int mix(int c0, int c1)
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
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
unsigned int nb_substreams
static int iamf_probe(const AVProbeData *p)
void av_iamf_mix_presentation_free(AVIAMFMixPresentation **pmix_presentation)
Free an AVIAMFMixPresentation and all its contents.
static int iamf_read_header(AVFormatContext *s)
int buf_size
Size of buf except extra allocated bytes.
const AVIAMFMixPresentation * cmix
int ff_iamf_read_packet(AVFormatContext *s, IAMFDemuxContext *c, AVIOContext *pb, int max_size, AVPacket *pkt)
void av_iamf_audio_element_free(AVIAMFAudioElement **paudio_element)
Free an AVIAMFAudioElement and all its contents.
static av_cold int read_close(AVFormatContext *ctx)
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 type
AVIAMFAudioElement * element
element backs celement iff the AVIAMFAudioElement is owned by this structure.
IAMFAudioElement ** audio_elements
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
unsigned int audio_substream_id
unsigned int substream_count
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_iamfdec_read_descriptors(IAMFContext *c, AVIOContext *pb, int max_size, void *log_ctx)
#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...
unsigned int audio_element_id
static int iamf_read_packet(AVFormatContext *s, AVPacket *pkt)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
This structure contains the data a format has to probe a file.
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
int sample_rate
Audio only.
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)
unsigned int audio_element_id
The id of the Audio Element this submix element references.
int avformat_stream_group_add_stream(AVStreamGroup *stg, AVStream *st)
Add an already allocated stream to a stream group.
Submix layout as defined in section 3.7 of IAMF.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define MKBETAG(a, b, c, d)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
struct AVIAMFAudioElement * iamf_audio_element
IAMFSubStream * substreams
AVStream ** streams
A list of streams in the group.
struct AVIAMFMixPresentation * iamf_mix_presentation
#define i(width, name, range_min, range_max)
static int get_score(const uint8_t *buf, int buf_size, enum IAMF_OBU_Type type, int *seq)
Information on how to render and mix one or more AVIAMFAudioElement to generate the final audio outpu...
int disposition
Stream disposition - a combination of AV_DISPOSITION_* flags.
int id
Format-specific stream ID.
const FFInputFormat ff_iamf_demuxer
static int iamf_read_close(AVFormatContext *s)
unsigned int nb_streams
Number of elements in AVStreamGroup.streams.
unsigned int nb_elements
Number of elements in the submix.
static int read_probe(const AVProbeData *p)
IAMFMixPresentation ** mix_presentations
AVStreamGroup * avformat_stream_group_create(AVFormatContext *s, enum AVStreamGroupParamsType type, AVDictionary **options)
Add a new empty stream group to a media file.
This structure stores compressed data.
Submix element as defined in section 3.7 of IAMF.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
AVIAMFMixPresentation * mix
mix backs cmix iff the AVIAMFMixPresentation is owned by this structure.
AVCodecParameters * codecpar
unsigned int mix_presentation_id
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
void ff_iamf_read_deinit(IAMFDemuxContext *c)