27 #include "libavutil/eval.h"
28 #include "libavutil/intreadwrite.h"
29 #include "libavutil/rational.h"
42 #define AUDIO_FORMAT_SIGNED 401
67 if (!s || sscanf(s,
"%d", &v) != 1)
109 if (!strcmp(name,
"__NUM_I_TRACKS")) {
111 }
else if (!strcmp(name,
"__NUM_A_TRACKS")) {
113 }
else if (!strcmp(name,
"COMMENT") || !strcmp(name,
"TITLE")) {
115 }
else if (!strcmp(name,
"LOOP_MODE") || !strcmp(name,
"NUM_LOOPS") || !strcmp(name,
"OPTIMIZED")) {
130 if (!strcmp(name,
"__DIR_COUNT")) {
132 }
else if (!strcmp(name,
"AUDIO_FORMAT")) {
134 }
else if (!strcmp(name,
"COMPRESSION")) {
136 }
else if (!strcmp(name,
"DEFAULT_VOL")) {
138 }
else if (!strcmp(name,
"NUM_CHANNELS")) {
140 }
else if (!strcmp(name,
"SAMPLE_RATE")) {
143 }
else if (!strcmp(name,
"SAMPLE_WIDTH")) {
157 if (!strcmp(name,
"__DIR_COUNT")) {
159 }
else if (!strcmp(name,
"COMPRESSION")) {
163 if (!strcmp(str,
"1")) {
165 }
else if (!strcmp(str,
"2")) {
168 }
else if (!strcmp(str,
"3")) {
170 }
else if (!strcmp(str,
"10")) {
172 }
else if (!strcmp(str,
"MVC2")) {
178 }
else if (!strcmp(name,
"FPS")) {
181 }
else if (!strcmp(name,
"HEIGHT")) {
183 }
else if (!strcmp(name,
"PIXEL_ASPECT")) {
187 }
else if (!strcmp(name,
"WIDTH")) {
189 }
else if (!strcmp(name,
"ORIENTATION")) {
194 }
else if (!strcmp(name,
"Q_SPATIAL") || !strcmp(name,
"Q_TEMPORAL")) {
196 }
else if (!strcmp(name,
"INTERLACING") || !strcmp(name,
"PACKING")) {
210 for (i = 0; i <
count; i++) {
214 name[
sizeof(
name) - 1] = 0;
216 if (
parse(avctx, st, name, size) < 0) {
225 uint64_t timestamp = 0;
280 vst->codec->codec_tag = 0;
305 for (i = 0; i < vst->nb_frames; i++) {
314 }
else if (!version &&
avio_rb16(pb) == 3) {
377 if (frame < st->nb_index_entries) {
380 if (index->
pos > pos)
382 else if (index->
pos < pos) {
429 mv->
frame[i] = frame;
#define AVERROR_PATCHWELCOME
static int mv_read_header(AVFormatContext *avctx)
static int parse_video_var(AVFormatContext *avctx, AVStream *st, const char *name, int size)
Parse video variable.
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 char * var_read_string(AVIOContext *pb, int size)
int stream_index
current stream index
char * av_strdup(const char *s) av_malloc_attrib
Duplicate the string s.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
AVCodecContext * codec
Codec context associated with this stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
static AVRational var_read_float(AVIOContext *pb, int size)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
#define AV_CH_LAYOUT_STEREO
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt)
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
static void var_read_metadata(AVFormatContext *avctx, const char *tag, int size)
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
static void read_table(AVFormatContext *avctx, AVStream *st, int(*parse)(AVFormatContext *avctx, AVStream *st, const char *name, int size))
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
double av_strtod(const char *numstr, char **tail)
Parse the string in numstr and return its value as a double.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int eof_count
number of streams that have finished
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
void * priv_data
Format private data.
static int mv_read_seek(AVFormatContext *avctx, int stream_index, int64_t timestamp, int flags)
int64_t timestamp
Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int flags
A combination of AV_PKT_FLAG values.
uint64_t channel_layout
Audio channel layout.
static void read_index(AVIOContext *pb, AVStream *st)
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
int frame[2]
frame nb for current stream
unsigned int nb_streams
A list of all streams in the file.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
AVRational av_d2q(double d, int max) av_const
Convert a double precision floating point number to a rational.
#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.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AUDIO_FORMAT_SIGNED
static int parse_audio_var(AVFormatContext *avctx, AVStream *st, const char *name, int size)
Parse audio variable.
static int read_header(FFV1Context *f)
static const int8_t mv[256][2]
enum AVMediaType codec_type
int sample_rate
samples per second
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
AVIOContext * pb
I/O context.
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.
rational number numerator/denominator
This structure contains the data a format has to probe a file.
#define MKBETAG(a, b, c, d)
AVInputFormat ff_mv_demuxer
static int var_read_int(AVIOContext *pb, int size)
static int parse_global_var(AVFormatContext *avctx, AVStream *st, const char *name, int size)
Parse global variable.
int64_t duration
Decoding: duration of the stream, in stream time base.
int64_t nb_frames
number of frames in this stream if known or 0
#define AVERROR_INVALIDDATA
int channels
number of audio channels
static int mv_probe(AVProbeData *p)
static int set_channels(AVFormatContext *avctx, AVStream *st, int channels)
#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...