38#define FORM_TAG MKBETAG('F', 'O', 'R', 'M')
39#define WVQA_TAG MKBETAG('W', 'V', 'Q', 'A')
40#define VQHD_TAG MKBETAG('V', 'Q', 'H', 'D')
41#define FINF_TAG MKBETAG('F', 'I', 'N', 'F')
42#define SND0_TAG MKBETAG('S', 'N', 'D', '0')
43#define SND1_TAG MKBETAG('S', 'N', 'D', '1')
44#define SND2_TAG MKBETAG('S', 'N', 'D', '2')
45#define VQFR_TAG MKBETAG('V', 'Q', 'F', 'R')
46#define VQFL_TAG MKBETAG('V', 'Q', 'F', 'L')
49#define CINF_TAG MKBETAG('C', 'I', 'N', 'F')
50#define CINH_TAG MKBETAG('C', 'I', 'N', 'H')
51#define CIND_TAG MKBETAG('C', 'I', 'N', 'D')
52#define LINF_TAG MKBETAG('L', 'I', 'N', 'F')
53#define PINF_TAG MKBETAG('P', 'I', 'N', 'F')
54#define PINH_TAG MKBETAG('P', 'I', 'N', 'H')
55#define PIND_TAG MKBETAG('P', 'I', 'N', 'D')
56#define CMDS_TAG MKBETAG('C', 'M', 'D', 'S')
57#define SN2J_TAG MKBETAG('S', 'N', '2', 'J')
58#define VIEW_TAG MKBETAG('V', 'I', 'E', 'W')
59#define ZBUF_TAG MKBETAG('Z', 'B', 'U', 'F')
61#define VQA_HEADER_SIZE 0x2A
62#define VQA_PREAMBLE_SIZE 8
122 if (fps < 1 || fps > 30) {
143 chunk_tag =
AV_RB32(&scratch[0]);
144 chunk_size =
AV_RB32(&scratch[4]);
185 chunk_type =
AV_RB32(&preamble[0]);
186 chunk_size =
AV_RB32(&preamble[4]);
190 skip_byte = chunk_size & 0x01;
198 if (chunk_size > 3 * (1 << 20))
216 switch (chunk_type) {
239 switch (chunk_type) {
241 if (wsvqa->
bps == 16)
259 switch (chunk_type) {
267 pkt->duration = (chunk_size * 2LL) / wsvqa->
channels;
287 if ((ret64 =
avio_seek(pb, current_pos, SEEK_SET)) < 0)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
Ensures that the requested seekback buffer size will be available.
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_probe(const AVProbeData *p)
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size)
Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end which is always set to 0 and f...
static int read_header(FFV1Context *f, RangeCoder *c)
@ AV_CODEC_ID_ADPCM_IMA_WS
@ AV_CODEC_ID_WESTWOOD_SND1
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define av_fourcc2str(fourcc)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static const uint8_t header[24]
int height
The height of the video frame in pixels.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t nb_frames
number of frames in this stream if known or 0
int64_t duration
Decoding: duration of the stream, in stream time base.
int index
stream index in AVFormatContext
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
static int wsvqa_probe(const AVProbeData *p)
static int wsvqa_read_header(AVFormatContext *s)
#define VQA_PREAMBLE_SIZE
static int wsvqa_read_packet(AVFormatContext *s, AVPacket *pkt)