35 #define FORM_TAG MKTAG('F', 'O', 'R', 'M')
36 #define MOVE_TAG MKTAG('M', 'O', 'V', 'E')
37 #define PC__TAG MKTAG('_', 'P', 'C', '_')
38 #define SOND_TAG MKTAG('S', 'O', 'N', 'D')
39 #define BNAM_TAG MKTAG('B', 'N', 'A', 'M')
40 #define SIZE_TAG MKTAG('S', 'I', 'Z', 'E')
41 #define PALT_TAG MKTAG('P', 'A', 'L', 'T')
42 #define INDX_TAG MKTAG('I', 'N', 'D', 'X')
43 #define BRCH_TAG MKTAG('B', 'R', 'C', 'H')
44 #define SHOT_TAG MKTAG('S', 'H', 'O', 'T')
45 #define VGA__TAG MKTAG('V', 'G', 'A', ' ')
46 #define TEXT_TAG MKTAG('T', 'E', 'X', 'T')
47 #define AUDI_TAG MKTAG('A', 'U', 'D', 'I')
50 #define WC3_DEFAULT_WIDTH 320
51 #define WC3_DEFAULT_HEIGHT 165
54 #define WC3_SAMPLE_RATE 22050
55 #define WC3_AUDIO_CHANNELS 1
56 #define WC3_AUDIO_BITS 16
59 #define WC3_FRAME_FPS 15
61 #define PALETTE_SIZE (256 * 3)
91 unsigned int fourcc_tag;
114 switch (fourcc_tag) {
132 if ((ret =
avio_read(pb, buffer, size)) != size)
153 (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24),
154 (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24));
201 unsigned int fourcc_tag;
205 unsigned char text[1024];
207 while (!packet_read) {
215 switch (fourcc_tag) {
246 if ((
unsigned)size >
sizeof(text) || (ret =
avio_read(pb, text, size)) != size)
274 (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24),
275 (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24));
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
struct Wc3DemuxContext Wc3DemuxContext
int index
stream index in AVFormatContext
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define WC3_DEFAULT_HEIGHT
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int wc3_read_header(AVFormatContext *s, AVFormatParameters *ap)
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
static int wc3_read_close(AVFormatContext *s)
unsigned int avio_rb32(AVIOContext *s)
AVInputFormat ff_wc3_demuxer
static int read_header(FFV1Context *f)
void av_free_packet(AVPacket *pkt)
Free a packet.
static av_cold int read_close(AVFormatContext *ctx)
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.
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.
AVCodecContext * codec
codec context
#define WC3_DEFAULT_WIDTH
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 bit_rate
the average bitrate
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() and chilren.
int width
picture width / height.
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)
enum AVMediaType codec_type
int sample_rate
samples per second
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
static int wc3_read_packet(AVFormatContext *s, AVPacket *pkt)
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
This structure contains the data a format has to probe a file.
#define WC3_AUDIO_CHANNELS
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int wc3_probe(AVProbeData *p)
int eof_reached
true if eof reached
int channels
number of audio channels
void * priv_data
Format private data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...