347 {
"IART",
"artist" },
348 {
"ICMT",
"comment" },
349 {
"ICOP",
"copyright" },
352 {
"ILNG",
"language" },
356 {
"ISFT",
"encoder" },
357 {
"ITCH",
"encoded_by"},
362 "IARL",
"IART",
"ICMS",
"ICMT",
"ICOP",
"ICRD",
"ICRP",
"IDIM",
"IDPI",
363 "IENG",
"IGNR",
"IKEY",
"ILGT",
"ILNG",
"IMED",
"INAM",
"IPLT",
"IPRD",
364 "IPRT",
"ISBJ",
"ISFT",
"ISHP",
"ISRC",
"ISRF",
"ITCH",
390 int bps, blkalign, bytespersec;
392 int waveformatextensible;
394 uint8_t *riff_extradata= temp;
395 uint8_t *riff_extradata_start= temp;
403 if (waveformatextensible) {
448 bytestream_put_le16(&riff_extradata, 1);
449 bytestream_put_le32(&riff_extradata, 2);
450 bytestream_put_le16(&riff_extradata, 1152);
451 bytestream_put_le16(&riff_extradata, 1);
452 bytestream_put_le16(&riff_extradata, 1393);
455 bytestream_put_le16(&riff_extradata, 2);
456 bytestream_put_le32(&riff_extradata, enc->
bit_rate);
457 bytestream_put_le16(&riff_extradata, enc->
channels == 2 ? 1 : 8);
458 bytestream_put_le16(&riff_extradata, 0);
459 bytestream_put_le16(&riff_extradata, 1);
460 bytestream_put_le16(&riff_extradata, 16);
461 bytestream_put_le32(&riff_extradata, 0);
462 bytestream_put_le32(&riff_extradata, 0);
465 bytestream_put_le16(&riff_extradata, enc->
frame_size);
471 if(waveformatextensible) {
473 avio_wl16(pb, riff_extradata - riff_extradata_start + 22);
481 avio_wl16(pb, riff_extradata - riff_extradata_start);
483 avio_write(pb, riff_extradata_start, riff_extradata - riff_extradata_start);
515 #endif //CONFIG_MUXERS
543 cbSize =
FFMIN(size, cbSize);
544 if (cbSize >= 22 &&
id == 0xfffe) {
621 #endif // CONFIG_DEMUXERS
640 gcd=
av_gcd(*au_scale, *au_rate);
647 int64_t start, end, cur;
653 while ((cur =
avio_tell(pb)) >= 0 && cur <= end - 8 ) {
661 if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
666 chunk_size += (chunk_size & 1);
676 if (
avio_read(pb, value, chunk_size) != chunk_size) {
683 value[chunk_size] = 0;
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
void avio_wl16(AVIOContext *s, unsigned int val)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void ff_end_tag(AVIOContext *pb, int64_t start)
int64_t ff_start_tag(AVIOContext *pb, const char *tag)
#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.
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 av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
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.
void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale)
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 av_get_bits_per_sample(enum CodecID codec_id)
Return codec bits per sample.
enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
preferred ID for MPEG-1/2 video decoding
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
unsigned int avio_rl32(AVIOContext *s)
int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
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,...)
const AVCodecTag ff_codec_wav_tags[]
uint64_t channel_layout
Audio channel layout.
AVCodecContext * codec
codec context
int bit_rate
the average bitrate
const AVCodecTag ff_codec_bmp_tags[]
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() and chilren.
int width
picture width / height.
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
const char ff_riff_tags[][5]
int frame_size
Samples per packet, initialized when calling 'init'.
enum AVMediaType codec_type
int sample_rate
samples per second
void avio_w8(AVIOContext *s, int b)
main external API structure.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf)
const AVMetadataConv ff_riff_info_conv[]
unsigned int avio_rl16(AVIOContext *s)
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
CodecID
Identify the syntax and semantics of the bitstream.
int channels
number of audio channels
int ff_get_bmp_header(AVIOContext *pb, AVStream *st)
Read BITMAPINFOHEADER structure and set AVStream codec width, height and bits_per_encoded_sample fiel...
enum CodecID ff_wav_codec_get_id(unsigned int tag, int bps)
#define MKTAG(a, b, c, d)
int ff_read_riff_info(AVFormatContext *s, int64_t size)
preferred ID for decoding MPEG audio layer 1, 2 or 3