31 #define WV_BLOCK_LIMIT 1047576
33 #define WV_EXTRA_SIZE 12
35 #define WV_START_BLOCK 0x0800
36 #define WV_END_BLOCK 0x1000
37 #define WV_SINGLE_BLOCK (WV_START_BLOCK | WV_END_BLOCK)
54 6000, 8000, 9600, 11025, 12000, 16000, 22050, 24000,
55 32000, 44100, 48000, 64000, 88200, 96000, 192000, -1
76 if (p->
buf[0] ==
'w' && p->
buf[1] ==
'v' &&
77 p->
buf[2] ==
'p' && p->
buf[3] ==
'k')
100 if (tag !=
MKTAG(
'w',
'v',
'p',
'k'))
109 if (ver < 0x402 || ver > 0x410) {
127 bpp = ((wc->
flags & 3) + 1) << 3;
140 "Cannot determine additional parameters\n");
154 "Insufficient channel information\n");
173 chan |= (
avio_r8(pb) & 0xF) << 8;
178 "Invalid channel info size %d\n", size);
193 "Cannot determine custom sampling rate\n");
209 "Bits per sample differ, this block: %i, header block: %i\n",
215 "Channels differ, this block: %i, header block: %i\n",
219 if (wc->
flags && rate != -1 && rate != wc->
rate) {
221 "Sampling rate differ, this block: %i, header block: %i\n",
277 uint32_t block_samples;
315 if (ver < 0x402 || ver > 0x410) {
344 if (block_samples > INT32_MAX)
346 "Too many samples in block: %"PRIu32
"\n", block_samples);
355 int64_t timestamp,
int flags)
372 if (timestamp < 0 || timestamp >= s->
duration)
384 }
while(pts < timestamp);
void av_free_packet(AVPacket *pkt)
Free a packet.
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
static int wv_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
void ff_id3v1_read(AVFormatContext *s)
Read an ID3v1 tag.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
#define AV_CH_LAYOUT_STEREO
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb, int append)
static uint8_t * append(uint8_t *buf, const uint8_t *src, int size)
#define MKTAG(a, b, c, d)
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).
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
int64_t ff_ape_parse_tag(AVFormatContext *s)
Read and parse an APE tag.
uint64_t channel_layout
Audio channel layout.
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
uint8_t extra[WV_EXTRA_SIZE]
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
audio channel layout utility functions
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
AVInputFormat ff_wv_demuxer
static int read_header(FFV1Context *f)
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
#define AV_DICT_IGNORE_SUFFIX
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
static int wv_read_header(AVFormatContext *s)
static int wv_probe(AVProbeData *p)
This structure contains the data a format has to probe a file.
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
Return the next frame of a stream.
static int wv_read_packet(AVFormatContext *s, AVPacket *pkt)
static const int wv_rates[16]
int64_t duration
Decoding: duration of the stream, in stream time base.
unsigned int avio_rl16(AVIOContext *s)
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
#define AVERROR_INVALIDDATA
#define AVPROBE_SCORE_MAX
#define AVERROR_PATCHWELCOME
int eof_reached
true if eof reached
int channels
number of audio channels
void * priv_data
Format private data.
int64_t duration
Decoding: duration of the stream, in AV_TIME_BASE fractional seconds.
unsigned int avio_rl24(AVIOContext *s)
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...