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)
216 int audio_frame_size;
222 if (!audio_frame_size)
227 *au_scale = audio_frame_size;
239 gcd =
av_gcd(*au_scale, *au_rate);
246 int len = strlen(str);
258 "IARL",
"IART",
"ICMS",
"ICMT",
"ICOP",
"ICRD",
"ICRP",
"IDIM",
"IDPI",
259 "IENG",
"IGNR",
"IKEY",
"ILGT",
"ILNG",
"IMED",
"INAM",
"IPLT",
"IPRD",
260 "IPRT",
"ISBJ",
"ISFT",
"ISHP",
"ISRC",
"ISRF",
"ITCH",
void avio_wl16(AVIOContext *s, unsigned int val)
#define AV_LOG_WARNING
Something somehow does not look correct.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void avio_wl32(AVIOContext *s, unsigned int val)
Opaque data information usually continuous.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
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
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
int64_t av_gcd(int64_t a, int64_t b)
Return the greatest common divisor of a and b.
void av_log(void *avcl, int level, const char *fmt,...)
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 avio_put_str(AVIOContext *s, const char *str)
Write a NULL-terminated string.
int frame_size
Number of samples per channel in an audio frame.
Libavcodec external API header.
enum AVMediaType codec_type
int64_t ff_start_tag(AVIOContext *pb, const char *tag)
int sample_rate
samples per second
AVIOContext * pb
I/O context.
static const char riff_tags[][5]
void avio_w8(AVIOContext *s, int b)
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)
int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
Return audio frame duration.
const AVMetadataConv ff_riff_info_conv[]
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf)
int channels
number of audio channels
void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale)