55 int waveformatextensible;
58 uint8_t *riff_extradata_start = temp;
72 if (waveformatextensible)
93 "requested bits_per_coded_sample (%d) " 94 "and actually stored (%d) differ\n",
101 blkalign = 576 * (par->
sample_rate <= 24000 ? 1 : 2);
123 bytestream_put_le16(&riff_extradata, 1);
124 bytestream_put_le32(&riff_extradata, 2);
125 bytestream_put_le16(&riff_extradata, 1152);
126 bytestream_put_le16(&riff_extradata, 1);
127 bytestream_put_le16(&riff_extradata, 1393);
131 bytestream_put_le16(&riff_extradata, 2);
133 bytestream_put_le32(&riff_extradata, par->
bit_rate);
135 bytestream_put_le16(&riff_extradata, par->
channels == 2 ? 1 : 8);
137 bytestream_put_le16(&riff_extradata, 0);
139 bytestream_put_le16(&riff_extradata, 1);
141 bytestream_put_le16(&riff_extradata, 16);
143 bytestream_put_le32(&riff_extradata, 0);
145 bytestream_put_le32(&riff_extradata, 0);
150 bytestream_put_le16(&riff_extradata, frame_size);
157 if (waveformatextensible) {
160 avio_wl16(pb, riff_extradata - riff_extradata_start + 22);
171 avio_wl16(pb, riff_extradata - riff_extradata_start);
173 avio_write(pb, riff_extradata_start, riff_extradata - riff_extradata_start);
210 int *au_ssize,
int *au_scale)
214 int audio_frame_size;
220 *au_scale = audio_frame_size;
232 gcd =
av_gcd(*au_scale, *au_rate);
239 int len = strlen(str);
251 "IARL",
"IART",
"ICMS",
"ICMT",
"ICOP",
"ICRD",
"ICRP",
"IDIM",
"IDPI",
252 "IENG",
"IGNR",
"IKEY",
"ILGT",
"ILNG",
"IMED",
"INAM",
"IPLT",
"IPRD",
253 "IPRT",
"ITRK",
"ISBJ",
"ISFT",
"ISHP",
"ISMP",
"ISRC",
"ISRF",
"ITCH",
void avio_wl16(AVIOContext *s, unsigned int val)
#define AV_LOG_WARNING
Something somehow does not look correct.
static const uint8_t frame_size[4]
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
This struct describes the properties of an encoded stream.
void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, const AVCodecTag *tags, int for_asf)
void ff_parse_specific_params(AVStream *st, int *au_rate, int *au_ssize, int *au_scale)
void avio_wl32(AVIOContext *s, unsigned int val)
Opaque data information usually continuous.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
uint64_t channel_layout
Audio only.
void ff_riff_write_info(AVFormatContext *s)
Write all recognized RIFF tags from s->metadata.
#define AV_DICT_MATCH_CASE
AVDictionary * metadata
Metadata that applies to the whole file.
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
enum AVMediaType codec_type
General type of the encoded data.
int64_t av_gcd(int64_t a, int64_t b)
Return the greatest common divisor of a and b.
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters in...
int extradata_size
Size of the extradata content in bytes.
int bit_rate
The average bitrate of the encoded data (in bits per second).
int block_align
Audio only.
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 ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par)
int avio_put_str(AVIOContext *s, const char *str)
Write a NULL-terminated string.
Libavcodec external API header.
int64_t ff_start_tag(AVIOContext *pb, const char *tag)
AVIOContext * pb
I/O context.
static const char riff_tags[][5]
void avio_w8(AVIOContext *s, int b)
static int riff_has_valid_tags(AVFormatContext *s)
const AVMetadataConv ff_riff_info_conv[]
int sample_rate
Audio only.
int bits_per_coded_sample
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
AVCodecParameters * codecpar
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...