22 #include "libavutil/dict.h"
23 #include "libavutil/log.h"
24 #include "libavutil/mathematics.h"
25 #include "libavcodec/avcodec.h"
54 int waveformatextensible;
57 uint8_t *riff_extradata_start = temp;
73 if (waveformatextensible)
94 "requested bits_per_coded_sample (%d) "
95 "and actually stored (%d) differ\n",
126 bytestream_put_le16(&riff_extradata, 1);
127 bytestream_put_le32(&riff_extradata, 2);
128 bytestream_put_le16(&riff_extradata, 1152);
129 bytestream_put_le16(&riff_extradata, 1);
130 bytestream_put_le16(&riff_extradata, 1393);
134 bytestream_put_le16(&riff_extradata, 2);
136 bytestream_put_le32(&riff_extradata, enc->
bit_rate);
138 bytestream_put_le16(&riff_extradata, enc->
channels == 2 ? 1 : 8);
140 bytestream_put_le16(&riff_extradata, 0);
142 bytestream_put_le16(&riff_extradata, 1);
144 bytestream_put_le16(&riff_extradata, 16);
146 bytestream_put_le32(&riff_extradata, 0);
148 bytestream_put_le32(&riff_extradata, 0);
153 bytestream_put_le16(&riff_extradata, frame_size);
160 if (waveformatextensible) {
163 avio_wl16(pb, riff_extradata - riff_extradata_start + 22);
174 avio_wl16(pb, riff_extradata - riff_extradata_start);
176 avio_write(pb, riff_extradata_start, riff_extradata - riff_extradata_start);
213 int *au_ssize,
int *au_scale)
217 int audio_frame_size;
223 if (!audio_frame_size)
228 *au_scale = audio_frame_size;
240 gcd =
av_gcd(*au_scale, *au_rate);
247 int len = strlen(str);
259 "IARL",
"IART",
"ICMS",
"ICMT",
"ICOP",
"ICRD",
"ICRP",
"IDIM",
"IDPI",
260 "IENG",
"IGNR",
"IKEY",
"ILGT",
"ILNG",
"IMED",
"INAM",
"IPLT",
"IPRD",
261 "IPRT",
"ITRK",
"ISBJ",
"ISFT",
"ISHP",
"ISMP",
"ISRC",
"ISRF",
"ITCH",
#define AV_LOG_WARNING
Something somehow does not look correct.
AVCodecContext * codec
Codec context associated with this stream.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void ff_parse_specific_params(AVStream *st, int *au_rate, int *au_ssize, int *au_scale)
Opaque data information usually continuous.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
void ff_riff_write_info(AVFormatContext *s)
Write all recognized RIFF tags from s->metadata.
static const uint8_t frame_size[4]
#define AV_DICT_MATCH_CASE
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
preferred ID for decoding MPEG audio layer 1, 2 or 3
int64_t av_const av_gcd(int64_t a, int64_t b)
Return the greatest common divisor of a and b.
uint64_t channel_layout
Audio channel layout.
int bit_rate
the average bitrate
int width
picture width / height.
void ff_end_tag(AVIOContext *pb, int64_t start)
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
void ff_riff_write_info_tag(AVIOContext *pb, const char *tag, const char *str)
Write a single RIFF info tag.
int frame_size
Number of samples per channel in an audio frame.
enum AVMediaType codec_type
int64_t ff_start_tag(AVIOContext *pb, const char *tag)
int sample_rate
samples per second
static const char riff_tags[][5]
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
static int riff_has_valid_tags(AVFormatContext *s)
AVIOContext * pb
I/O context.
AVDictionary * metadata
Metadata that applies to the whole file.
int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
Return audio frame duration.
const AVMetadataConv ff_riff_info_conv[]
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf)
int channels
number of audio channels
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...