Go to the documentation of this file.
50 #define MOVIE_SILENT 2
52 #define AUDIO_FORMAT_SIGNED 401
85 v = strtol(
s,
NULL, 10);
127 if (!strcmp(
name,
"__NUM_I_TRACKS")) {
129 }
else if (!strcmp(
name,
"__NUM_A_TRACKS")) {
131 }
else if (!strcmp(
name,
"COMMENT") || !strcmp(
name,
"TITLE")) {
133 }
else if (!strcmp(
name,
"LOOP_MODE") || !strcmp(
name,
"NUM_LOOPS") ||
134 !strcmp(
name,
"OPTIMIZED")) {
151 if (!strcmp(
name,
"__DIR_COUNT")) {
153 }
else if (!strcmp(
name,
"AUDIO_FORMAT")) {
155 }
else if (!strcmp(
name,
"COMPRESSION")) {
157 }
else if (!strcmp(
name,
"DEFAULT_VOL")) {
159 }
else if (!strcmp(
name,
"NUM_CHANNELS")) {
161 }
else if (!strcmp(
name,
"SAMPLE_RATE")) {
167 }
else if (!strcmp(
name,
"SAMPLE_WIDTH")) {
186 if (!strcmp(
name,
"__DIR_COUNT")) {
188 }
else if (!strcmp(
name,
"COMPRESSION")) {
192 if (!strcmp(str,
"1")) {
194 }
else if (!strcmp(str,
"2")) {
197 }
else if (!strcmp(str,
"3")) {
199 }
else if (!strcmp(str,
"10")) {
201 }
else if (!strcmp(str,
"MVC2")) {
207 }
else if (!strcmp(
name,
"FPS")) {
211 }
else if (!strcmp(
name,
"HEIGHT")) {
213 }
else if (!strcmp(
name,
"PIXEL_ASPECT")) {
218 }
else if (!strcmp(
name,
"WIDTH")) {
220 }
else if (!strcmp(
name,
"ORIENTATION")) {
229 }
else if (!strcmp(
name,
"Q_SPATIAL") || !strcmp(
name,
"Q_TEMPORAL")) {
231 }
else if (!strcmp(
name,
"INTERLACING") || !strcmp(
name,
"PACKING")) {
250 for (
i = 0;
i < count;
i++) {
274 uint64_t timestamp = 0;
305 uint32_t bytes_per_sample;
330 vst->avg_frame_rate = fps;
331 vst->duration = vst->nb_frames =
avio_rb32(pb);
345 vst->codecpar->codec_tag = 0;
364 switch (bytes_per_sample) {
379 if (bytes_per_sample == 0)
394 for (
i = 0;
i < vst->nb_frames;
i++) {
413 if (
mv->nb_audio_tracks < 0 ||
mv->nb_video_tracks < 0 ||
414 (
mv->nb_audio_tracks == 0 &&
mv->nb_video_tracks == 0)) {
419 if (
mv->nb_audio_tracks > 1) {
422 }
else if (
mv->nb_audio_tracks) {
429 if (
mv->acompression == 100 &&
435 "Audio compression %i (format %i, sr %i)",
436 mv->acompression,
mv->aformat,
446 if (
mv->nb_video_tracks > 1) {
449 }
else if (
mv->nb_video_tracks) {
458 if (
mv->nb_audio_tracks)
461 if (
mv->nb_video_tracks)
482 if (frame < sti->nb_index_entries) {
502 mv->frame[
mv->stream_index]++;
515 mv->stream_index = 0;
521 int64_t timestamp,
int flags)
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
int eof_count
number of streams that have finished
int frame[2]
frame nb for current stream
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_EOF
End of file.
static char * var_read_string(AVIOContext *pb, int size)
static av_always_inline double av_int2double(uint64_t i)
Reinterpret a 64-bit integer as a double.
static int set_channels(AVFormatContext *avctx, AVStream *st, int channels)
static const int8_t mv[256][2]
AVStream ** streams
A list of all streams in the file.
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
AVRational avg_frame_rate
Average framerate.
int nb_channels
Number of channels in this layout.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a it should return
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
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 AUDIO_FORMAT_SIGNED
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int64_t duration
Decoding: duration of the stream, in stream time base.
static int var_read_int(AVIOContext *pb, int size)
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
unsigned int avio_rb32(AVIOContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
static int parse_audio_var(AVFormatContext *avctx, AVStream *st, const char *name, int size)
Parse audio variable.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static void var_read_metadata(AVFormatContext *avctx, const char *tag, int size)
Rational number (pair of numerator and denominator).
static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt)
uint64_t avio_rb64(AVIOContext *s)
AVIOContext * pb
I/O context.
This structure contains the data a format has to probe a file.
static int parse_video_var(AVFormatContext *avctx, AVStream *st, const char *name, int size)
Parse video variable.
AVChannelLayout ch_layout
Audio only.
static int parse_global_var(AVFormatContext *avctx, AVStream *st, const char *name, int size)
Parse global variable.
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
int stream_index
current stream index
int sample_rate
Audio only.
int64_t nb_frames
number of frames in this stream if known or 0
int extradata_size
Size of the extradata content in bytes.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen)
Read a string from pb into buf.
const AVInputFormat ff_mv_demuxer
#define MKBETAG(a, b, c, d)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int flags
A combination of AV_PKT_FLAG values.
static int mv_probe(const AVProbeData *p)
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
static int mv_read_seek(AVFormatContext *avctx, int stream_index, int64_t timestamp, int flags)
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
static void read_index(AVIOContext *pb, AVStream *st)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
double av_strtod(const char *numstr, char **tail)
Parse the string in numstr and return its value as a double.
unsigned int avio_rb16(AVIOContext *s)
static int mv_read_header(AVFormatContext *avctx)
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
char * av_strdup(const char *s)
Duplicate a string.
static int read_probe(const AVProbeData *p)
int bits_per_coded_sample
The number of bits per sample in the codedwords.
#define avpriv_request_sample(...)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int acompression
compression level for audio stream
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
static int read_table(AVFormatContext *avctx, AVStream *st, int(*parse)(AVFormatContext *avctx, AVStream *st, const char *name, int size))
#define flags(name, subs,...)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static AVRational var_read_float(AVIOContext *pb, int size)
void * priv_data
Format private data.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.