25 #include "libavutil/dict.h"
26 #include "libavutil/common.h"
27 #include "libavutil/mathematics.h"
28 #include "libavutil/opt.h"
52 len = strlen(tag->
value);
53 len =
FFMIN(len, maxlen);
63 uint64_t time_reference = 0;
73 time_reference = strtoll(tmp_tag->
value,
NULL, 10);
78 unsigned char umidpart_str[17] = {0};
83 for (i = 0; i < len/16; i++) {
84 memcpy(umidpart_str, tmp_tag->
value + 2 + (i*16), 16);
85 umidpart = strtoll(umidpart_str,
NULL, 16);
115 desc ? desc->
name :
"unknown");
173 avio_wl32(pb, (uint32_t)(file_size - 8));
180 int number_of_samples;
193 #define OFFSET(x) offsetof(WAVMuxContext, x)
194 #define ENC AV_OPT_FLAG_ENCODING_PARAM
210 .mime_type =
"audio/x-wav",
AVOutputFormat ff_wav_muxer
void ff_end_tag(AVIOContext *pb, int64_t start)
int64_t ff_start_tag(AVIOContext *pb, const char *tag)
const char * name
Name of the codec described by this descriptor.
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
AVCodecContext * codec
Codec context associated with this stream.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static int wav_write_trailer(AVFormatContext *s)
static int wav_write_header(AVFormatContext *s)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
static int wav_write_packet(AVFormatContext *s, AVPacket *pkt)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * priv_data
Format private data.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static void bwf_write_bext_chunk(AVFormatContext *s)
const AVCodecTag ff_codec_wav_tags[]
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const
Rescale a 64-bit integer with rounding to nearest.
void ffio_fill(AVIOContext *s, int b, int count)
AVStream ** streams
A list of all streams in the file.
static const AVClass wav_muxer_class
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
int sample_rate
samples per second
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
static void bwf_write_bext_string(AVFormatContext *s, const char *key, int maxlen)
AVIOContext * pb
I/O context.
void ff_riff_write_info(AVFormatContext *s)
Write all recognized RIFF tags from s->metadata.
Describe the class of an AVClass context structure.
AVDictionary * metadata
Metadata that applies to the whole file.
This struct describes the properties of a single codec described by an AVCodecID. ...
static const AVOption options[]
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
static void write_header(FFV1Context *f)
av_default_item_name
Return the context name.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.