Go to the documentation of this file.
61 int waveformatextensible;
63 uint8_t *riff_extradata =
temp;
64 uint8_t *riff_extradata_start =
temp;
87 if (waveformatextensible)
110 "requested bits_per_coded_sample (%d) "
111 "and actually stored (%d) differ\n",
118 blkalign = 576 * (par->
sample_rate <= (24000 + 32000)/2 ? 1 : 2);
145 bytestream_put_le16(&riff_extradata, 1);
146 bytestream_put_le32(&riff_extradata, 2);
147 bytestream_put_le16(&riff_extradata, 1152);
148 bytestream_put_le16(&riff_extradata, 1);
149 bytestream_put_le16(&riff_extradata, 1393);
152 bytestream_put_le16(&riff_extradata, 2);
154 bytestream_put_le32(&riff_extradata, par->
bit_rate);
156 bytestream_put_le16(&riff_extradata, par->
channels == 2 ? 1 : 8);
158 bytestream_put_le16(&riff_extradata, 0);
160 bytestream_put_le16(&riff_extradata, 1);
162 bytestream_put_le16(&riff_extradata, 16);
164 bytestream_put_le32(&riff_extradata, 0);
166 bytestream_put_le32(&riff_extradata, 0);
168 bytestream_put_le32(&riff_extradata, 0x9ace0002);
169 bytestream_put_le32(&riff_extradata, 0xaea2f732);
170 bytestream_put_le16(&riff_extradata, 0xacde);
174 bytestream_put_le16(&riff_extradata,
frame_size);
180 if (waveformatextensible) {
185 avio_wl16(pb, riff_extradata - riff_extradata_start + 22);
201 riff_extradata - riff_extradata_start) {
203 avio_wl16(pb, riff_extradata - riff_extradata_start);
205 avio_write(pb, riff_extradata_start, riff_extradata - riff_extradata_start);
217 int for_asf,
int ignore_extradata,
int rgb_frame_is_flipped)
221 int keep_height = flipped_extradata || rgb_frame_is_flipped;
228 pal_avi = !for_asf &&
234 avio_wl32(pb, 40 + (ignore_extradata || pal_avi ? 0 : extradata_size));
253 if (!ignore_extradata) {
256 if (!for_asf && extradata_size & 1)
258 }
else if (pal_avi) {
274 int *au_ssize,
int *au_scale)
278 int audio_frame_size;
281 if (!audio_frame_size)
286 *au_scale = audio_frame_size;
298 gcd =
av_gcd(*au_scale, *au_rate);
306 if (
len > 0 &&
len < UINT32_MAX) {
317 "IARL",
"IART",
"IAS1",
"IAS2",
"IAS3",
"IAS4",
"IAS5",
"IAS6",
"IAS7",
318 "IAS8",
"IAS9",
"ICMS",
"ICMT",
"ICOP",
"ICRD",
"ICRP",
"IDIM",
"IDPI",
319 "IENG",
"IGNR",
"IKEY",
"ILGT",
"ILNG",
"IMED",
"INAM",
"IPLT",
"IPRD",
320 "IPRT",
"ITRK",
"ISBJ",
"ISFT",
"ISHP",
"ISMP",
"ISRC",
"ISRF",
"ITCH",
367 if (
id == av_guid[
i].
id)
368 return &(av_guid[
i].
guid);
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
AVPixelFormat
Pixel format.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
This struct describes the properties of an encoded stream.
#define AV_CH_LAYOUT_MONO
void ff_parse_specific_params(AVStream *st, int *au_rate, int *au_ssize, int *au_scale)
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
void ff_put_guid(AVIOContext *s, const ff_asf_guid *g)
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...
void avio_wl16(AVIOContext *s, unsigned int val)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
#define AV_CH_LAYOUT_STEREO
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const ff_asf_guid * ff_get_codec_guid(enum AVCodecID id, const AVCodecGuid *av_guid)
int frame_size
Audio only.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static enum AVPixelFormat pix_fmt
@ AVMEDIA_TYPE_DATA
Opaque data information usually continuous.
void ff_riff_write_info(AVFormatContext *s)
Write all recognized RIFF tags from s->metadata.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, int for_asf, int ignore_extradata, int rgb_frame_is_flipped)
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
void avio_w8(AVIOContext *s, int b)
int sample_rate
Audio only.
AVCodecID
Identify the syntax and semantics of the bitstream.
int extradata_size
Size of the extradata content in bytes.
void ff_end_tag(AVIOContext *pb, int64_t start)
#define FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX
Tell ff_put_wav_header() to use WAVEFORMATEX even for PCM codecs.
const AVMetadataConv ff_riff_info_conv[]
#define FF_PUT_WAV_HEADER_SKIP_CHANNELMASK
Tell ff_put_wav_header() to write an empty channel mask.
void ff_riff_write_info_tag(AVIOContext *pb, const char *tag, const char *str)
Write a single RIFF info tag.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void avio_wl32(AVIOContext *s, unsigned int val)
#define FF_COMPLIANCE_NORMAL
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
static const char riff_tags[][5]
#define i(width, name, range_min, range_max)
int64_t ff_start_tag(AVIOContext *pb, const char *tag)
int block_align
Audio only.
static int riff_has_valid_tags(AVFormatContext *s)
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AV_DICT_MATCH_CASE
Only get an entry with exact-case key match.
int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int flags)
Write WAVEFORMAT header structure.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
@ AV_CODEC_ID_ADPCM_IMA_WAV
uint64_t channel_layout
Audio only.
const AVCodecGuid ff_codec_wav_guids[]
#define flags(name, subs,...)
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
int avio_put_str(AVIOContext *s, const char *str)
Write a NULL-terminated string.