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
74 if (p->
buf[0] ==
'w' && p->
buf[1] ==
'v' &&
75 p->
buf[2] ==
'p' && p->
buf[3] ==
'k')
92 if (tag !=
MKTAG(
'w',
'v',
'p',
'k'))
101 if(ver < 0x402 || ver > 0x410){
118 bpp = ((wc->
flags & 3) + 1) << 3;
162 chan |= (
avio_r8(pb) & 0xF) << 8;
185 if(!wc->
bpp) wc->
bpp = bpp;
191 av_log(ctx,
AV_LOG_ERROR,
"Bits per sample differ, this block: %i, header block: %i\n", bpp, wc->
bpp);
198 if(wc->
flags && rate != -1 && rate != wc->
rate){
292 if(ver < 0x402 || ver > 0x410){
341 if(timestamp < 0 || timestamp >= s->
duration)
353 }
while(pts < timestamp);
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)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
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)
static int read_header(FFV1Context *f)
void av_free_packet(AVPacket *pkt)
Free a packet.
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 avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
audio conversion routines
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.
uint64_t channel_layout
Audio channel layout.
int avio_r8(AVIOContext *s)
AVCodecContext * codec
codec context
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.
static int wv_read_header(AVFormatContext *s, AVFormatParameters *ap)
void ff_ape_parse_tag(AVFormatContext *s)
Read and parse an APE tag.
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int read_probe(AVProbeData *p)
AVInputFormat ff_wv_demuxer
enum AVMediaType codec_type
int sample_rate
samples per second
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
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.
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.
#define AV_DICT_IGNORE_SUFFIX
unsigned int avio_rl24(AVIOContext *s)
#define AV_CH_LAYOUT_MONO
#define MKTAG(a, b, c, d)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...