Go to the documentation of this file.
48 #define AUDIO_FORMAT_SIGNED 401
81 v = strtol(
s,
NULL, 10);
125 if (!strcmp(
name,
"__NUM_I_TRACKS")) {
127 }
else if (!strcmp(
name,
"__NUM_A_TRACKS")) {
129 }
else if (!strcmp(
name,
"COMMENT") || !strcmp(
name,
"TITLE")) {
131 }
else if (!strcmp(
name,
"LOOP_MODE") || !strcmp(
name,
"NUM_LOOPS") ||
132 !strcmp(
name,
"OPTIMIZED")) {
149 if (!strcmp(
name,
"__DIR_COUNT")) {
151 }
else if (!strcmp(
name,
"AUDIO_FORMAT")) {
153 }
else if (!strcmp(
name,
"COMPRESSION")) {
155 }
else if (!strcmp(
name,
"DEFAULT_VOL")) {
157 }
else if (!strcmp(
name,
"NUM_CHANNELS")) {
159 }
else if (!strcmp(
name,
"SAMPLE_RATE")) {
165 }
else if (!strcmp(
name,
"SAMPLE_WIDTH")) {
184 if (!strcmp(
name,
"__DIR_COUNT")) {
186 }
else if (!strcmp(
name,
"COMPRESSION")) {
190 if (!strcmp(
str,
"1")) {
192 }
else if (!strcmp(
str,
"2")) {
195 }
else if (!strcmp(
str,
"3")) {
197 }
else if (!strcmp(
str,
"10")) {
199 }
else if (!strcmp(
str,
"MVC2")) {
205 }
else if (!strcmp(
name,
"FPS")) {
209 }
else if (!strcmp(
name,
"HEIGHT")) {
211 }
else if (!strcmp(
name,
"PIXEL_ASPECT")) {
216 }
else if (!strcmp(
name,
"WIDTH")) {
218 }
else if (!strcmp(
name,
"ORIENTATION")) {
227 }
else if (!strcmp(
name,
"Q_SPATIAL") || !strcmp(
name,
"Q_TEMPORAL")) {
229 }
else if (!strcmp(
name,
"INTERLACING") || !strcmp(
name,
"PACKING")) {
248 for (
i = 0;
i < count;
i++) {
272 uint64_t timestamp = 0;
303 uint32_t bytes_per_sample;
321 vst->avg_frame_rate = fps;
322 vst->duration = vst->nb_frames =
avio_rb32(pb);
336 vst->codecpar->codec_tag = 0;
354 switch (bytes_per_sample) {
369 if (bytes_per_sample == 0)
382 for (
i = 0;
i < vst->nb_frames;
i++) {
391 timestamp += asize / (ast->
codecpar->
channels * (uint64_t)bytes_per_sample);
399 if (
mv->nb_audio_tracks < 0 ||
mv->nb_video_tracks < 0 ||
400 (
mv->nb_audio_tracks == 0 &&
mv->nb_video_tracks == 0)) {
405 if (
mv->nb_audio_tracks > 1) {
408 }
else if (
mv->nb_audio_tracks) {
415 if (
mv->acompression == 100 &&
421 "Audio compression %i (format %i, sr %i)",
422 mv->acompression,
mv->aformat,
432 if (
mv->nb_video_tracks > 1) {
435 }
else if (
mv->nb_video_tracks) {
444 if (
mv->nb_audio_tracks)
447 if (
mv->nb_video_tracks)
468 if (frame < sti->nb_index_entries) {
488 mv->frame[
mv->stream_index]++;
501 mv->stream_index = 0;
507 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
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
enum AVMediaType codec_type
General type of the encoded data.
#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.
#define AV_CH_LAYOUT_MONO
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.
#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_CH_LAYOUT_STEREO
#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.
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.
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...
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)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
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 frame
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.
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.
uint64_t channel_layout
Audio only.
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.