60 int waveformatextensible;
80 if (waveformatextensible)
103 "requested bits_per_coded_sample (%d) " 104 "and actually stored (%d) differ\n",
111 blkalign = 576 * (par->
sample_rate <= (24000 + 32000)/2 ? 1 : 2);
138 bytestream_put_le16(&riff_extradata, 1);
139 bytestream_put_le32(&riff_extradata, 2);
140 bytestream_put_le16(&riff_extradata, 1152);
141 bytestream_put_le16(&riff_extradata, 1);
142 bytestream_put_le16(&riff_extradata, 1393);
145 bytestream_put_le16(&riff_extradata, 2);
147 bytestream_put_le32(&riff_extradata, par->
bit_rate);
149 bytestream_put_le16(&riff_extradata, par->
channels == 2 ? 1 : 8);
151 bytestream_put_le16(&riff_extradata, 0);
153 bytestream_put_le16(&riff_extradata, 1);
155 bytestream_put_le16(&riff_extradata, 16);
157 bytestream_put_le32(&riff_extradata, 0);
159 bytestream_put_le32(&riff_extradata, 0);
161 bytestream_put_le32(&riff_extradata, 0x9ace0002);
162 bytestream_put_le32(&riff_extradata, 0xaea2f732);
163 bytestream_put_le16(&riff_extradata, 0xacde);
167 bytestream_put_le16(&riff_extradata, frame_size);
173 if (waveformatextensible) {
178 avio_wl16(pb, riff_extradata - riff_extradata_start + 22);
194 riff_extradata - riff_extradata_start) {
196 avio_wl16(pb, riff_extradata - riff_extradata_start);
198 avio_write(pb, riff_extradata_start, riff_extradata - riff_extradata_start);
210 int for_asf,
int ignore_extradata)
220 pal_avi = !for_asf &&
226 avio_wl32(pb, 40 + (ignore_extradata || pal_avi ? 0 : extradata_size));
245 if (!ignore_extradata) {
248 if (!for_asf && extradata_size & 1)
250 }
else if (pal_avi) {
266 int *au_ssize,
int *au_scale)
270 int audio_frame_size;
273 if (!audio_frame_size)
278 *au_scale = audio_frame_size;
290 gcd =
av_gcd(*au_scale, *au_rate);
297 size_t len = strlen(str);
298 if (len > 0 && len < UINT32_MAX) {
309 "IARL",
"IART",
"IAS1",
"IAS2",
"IAS3",
"IAS4",
"IAS5",
"IAS6",
"IAS7",
310 "IAS8",
"IAS9",
"ICMS",
"ICMT",
"ICOP",
"ICRD",
"ICRP",
"IDIM",
"IDPI",
311 "IENG",
"IGNR",
"IKEY",
"ILGT",
"ILNG",
"IMED",
"INAM",
"IPLT",
"IPRD",
312 "IPRT",
"ITRK",
"ISBJ",
"ISFT",
"ISHP",
"ISMP",
"ISRC",
"ISRF",
"ITCH",
359 if (
id == av_guid[i].
id)
360 return &(av_guid[i].
guid);
void avio_wl16(AVIOContext *s, unsigned int val)
static enum AVPixelFormat pix_fmt
#define AV_LOG_WARNING
Something somehow does not look correct.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AV_CH_LAYOUT_STEREO
int strict_std_compliance
Allow non-standard and experimental extension.
This struct describes the properties of an encoded stream.
void ff_parse_specific_params(AVStream *st, int *au_rate, int *au_ssize, int *au_scale)
int frame_size
Audio only.
const AVCodecGuid ff_codec_wav_guids[]
#define av_assert0(cond)
assert() equivalent, that is always enabled.
void ff_put_guid(AVIOContext *s, const ff_asf_guid *g)
void avio_wl32(AVIOContext *s, unsigned int val)
Opaque data information usually continuous.
8 bits with AV_PIX_FMT_RGB32 palette
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.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
const ff_asf_guid * ff_get_codec_guid(enum AVCodecID id, const AVCodecGuid *av_guid)
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_DICT_MATCH_CASE
Only get an entry with exact-case key match.
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)
Compute the greatest common divisor of two integer operands.
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 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 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)
#define FF_COMPLIANCE_NORMAL
const AVMetadataConv ff_riff_info_conv[]
int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int flags)
Write WAVEFORMAT header structure.
int sample_rate
Audio only.
void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, int for_asf, int ignore_extradata)
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
#define FF_PUT_WAV_HEADER_SKIP_CHANNELMASK
Tell ff_put_wav_header() to write an empty channel mask.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
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...
#define AV_CH_LAYOUT_MONO
AVPixelFormat
Pixel format.
#define FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX
Tell ff_put_wav_header() to use WAVEFORMATEX even for PCM codecs.