46 6000, 8000, 9600, 11025, 12000, 16000, 22050, 24000,
47 32000, 44100, 48000, 64000, 88200, 96000, 192000, -1
67 if (p->
buf[0] ==
'w' && p->
buf[1] ==
'v' &&
68 p->
buf[2] ==
'p' && p->
buf[3] ==
'k')
79 uint32_t chmask,
flags;
108 bpp = ((flags & 3) + 1) << 3;
111 rate =
wv_rates[(flags >> 23) & 0xF];
121 "Cannot determine additional parameters\n");
135 "Insufficient channel information\n");
154 chan |= (
avio_r8(pb) & 0xF) << 8;
159 "Invalid channel info size %d\n", size);
174 "Cannot determine custom sampling rate\n");
188 if (flags && bpp != wc->
bpp) {
190 "Bits per sample differ, this block: %i, header block: %i\n",
196 "Channels differ, this block: %i, header block: %i\n",
200 if (flags && rate != -1 && rate != wc->
rate) {
202 "Sampling rate differ, this block: %i, header block: %i\n",
257 uint32_t block_samples;
298 if (block_samples > INT32_MAX)
300 "Too many samples in block: %"PRIu32
"\n", block_samples);
309 int64_t timestamp,
int flags)
326 if (timestamp < 0 || timestamp >= s->
duration)
338 }
while(pts < timestamp);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
uint8_t block_header[WV_HEADER_SIZE]
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.
#define AV_LOG_WARNING
Something somehow does not look correct.
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.
static int wv_read_packet(AVFormatContext *s, AVPacket *pkt)
#define AV_CH_LAYOUT_STEREO
static int wv_probe(AVProbeData *p)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define AVERROR_EOF
End of file.
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.
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.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
AVInputFormat ff_wv_demuxer
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,...)
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.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
audio channel layout utility functions
static const int wv_rates[16]
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int ff_wv_parse_header(WvHeader *wv, const uint8_t *data)
Parse a WavPack block header.
static int read_header(FFV1Context *f)
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
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.
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.
static int wv_read_header(AVFormatContext *s)
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
int eof_reached
true if eof reached
int channels
number of audio channels
void * priv_data
Format private data.
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
#define AV_DICT_IGNORE_SUFFIX
int avio_feof(AVIOContext *s)
unsigned int avio_rl24(AVIOContext *s)
static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb)
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
#define WV_FLAG_FINAL_BLOCK
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...