FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
avidec.c File Reference
#include <inttypes.h>
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bswap.h"
#include "libavutil/opt.h"
#include "libavutil/dict.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "avformat.h"
#include "avi.h"
#include "dv.h"
#include "internal.h"
#include "riff.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/exif.h"

Go to the source code of this file.

Data Structures

struct  AVIStream
 
struct  AVIContext
 

Macros

#define MAX_ODML_DEPTH   1000
 
#define print_tag(str, tag, size)
 

Functions

static int avi_load_index (AVFormatContext *s)
 
static int guess_ni_flag (AVFormatContext *s)
 
static int get_duration (AVIStream *ast, int len)
 
static int get_riff (AVFormatContext *s, AVIOContext *pb)
 
static int read_braindead_odml_indx (AVFormatContext *s, int frame_num)
 
static void clean_index (AVFormatContext *s)
 
static int avi_read_tag (AVFormatContext *s, AVStream *st, uint32_t tag, uint32_t size)
 
static void avi_metadata_creation_time (AVDictionary **metadata, char *date)
 
static void avi_read_nikon (AVFormatContext *s, uint64_t end)
 
static int avi_extract_stream_metadata (AVStream *st)
 
static int calculate_bitrate (AVFormatContext *s)
 
static int avi_read_header (AVFormatContext *s)
 
static int read_gab2_sub (AVStream *st, AVPacket *pkt)
 
static AVStreamget_subtitle_pkt (AVFormatContext *s, AVStream *next_st, AVPacket *pkt)
 
static int get_stream_idx (unsigned *d)
 
static int avi_sync (AVFormatContext *s, int exit_early)
 
static int avi_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int avi_read_idx1 (AVFormatContext *s, int size)
 
static int check_stream_max_drift (AVFormatContext *s)
 
static void seek_subtitle (AVStream *st, AVStream *st2, int64_t timestamp)
 
static int avi_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
 
static int avi_read_close (AVFormatContext *s)
 
static int avi_probe (AVProbeData *p)
 

Variables

static const AVOption options []
 
static const AVClass demuxer_class
 
static const char avi_headers [][8]
 
static const AVMetadataConv avi_metadata_conv []
 
static const char months [12][4]
 
AVInputFormat ff_avi_demuxer
 

Macro Definition Documentation

#define MAX_ODML_DEPTH   1000

Definition at line 81 of file avidec.c.

Referenced by read_braindead_odml_indx().

#define print_tag (   str,
  tag,
  size 
)
Value:
av_dlog(NULL, "pos:%"PRIX64" %s: tag=%c%c%c%c size=0x%x\n", \
avio_tell(pb), str, tag & 0xff, \
(tag >> 8) & 0xff, \
(tag >> 16) & 0xff, \
(tag >> 24) & 0xff, \

Definition at line 117 of file avidec.c.

Referenced by avi_read_header().

Function Documentation

static int avi_load_index ( AVFormatContext s)
static

Definition at line 1650 of file avidec.c.

Referenced by avi_read_header(), and avi_read_seek().

static int guess_ni_flag ( AVFormatContext s)
static

Definition at line 1614 of file avidec.c.

Referenced by avi_read_header().

static int get_duration ( AVIStream ast,
int  len 
)
inlinestatic

Definition at line 125 of file avidec.c.

Referenced by avi_read_idx1(), avi_sync(), and read_braindead_odml_indx().

static int get_riff ( AVFormatContext s,
AVIOContext pb 
)
static

Definition at line 135 of file avidec.c.

Referenced by avi_read_header().

static int read_braindead_odml_indx ( AVFormatContext s,
int  frame_num 
)
static

Definition at line 160 of file avidec.c.

Referenced by avi_read_header().

static void clean_index ( AVFormatContext s)
static

Definition at line 268 of file avidec.c.

Referenced by avi_read_header().

static int avi_read_tag ( AVFormatContext s,
AVStream st,
uint32_t  tag,
uint32_t  size 
)
static

Definition at line 296 of file avidec.c.

Referenced by avi_read_header().

static void avi_metadata_creation_time ( AVDictionary **  metadata,
char *  date 
)
static

Definition at line 322 of file avidec.c.

Referenced by avi_read_header().

static void avi_read_nikon ( AVFormatContext s,
uint64_t  end 
)
static

Definition at line 341 of file avidec.c.

Referenced by avi_read_header().

static int avi_extract_stream_metadata ( AVStream st)
static

Definition at line 384 of file avidec.c.

Referenced by avi_read_header().

static int calculate_bitrate ( AVFormatContext s)
static

Definition at line 422 of file avidec.c.

Referenced by avi_read_header().

static int avi_read_header ( AVFormatContext s)
static

Definition at line 462 of file avidec.c.

static int read_gab2_sub ( AVStream st,
AVPacket pkt 
)
static

Definition at line 995 of file avidec.c.

static AVStream* get_subtitle_pkt ( AVFormatContext s,
AVStream next_st,
AVPacket pkt 
)
static

Definition at line 1055 of file avidec.c.

static int get_stream_idx ( unsigned *  d)
static

Definition at line 1089 of file avidec.c.

Referenced by avi_sync().

static int avi_sync ( AVFormatContext s,
int  exit_early 
)
static
Parameters
exit_earlyset to 1 to just gather packet position without making the changes needed to actually read & return the packet

Definition at line 1103 of file avidec.c.

Referenced by avi_read_idx1().

static int avi_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 1248 of file avidec.c.

static int avi_read_idx1 ( AVFormatContext s,
int  size 
)
static

Definition at line 1478 of file avidec.c.

Referenced by avi_load_index().

static int check_stream_max_drift ( AVFormatContext s)
static

Definition at line 1559 of file avidec.c.

Referenced by guess_ni_flag().

static void seek_subtitle ( AVStream st,
AVStream st2,
int64_t  timestamp 
)
static

Definition at line 1697 of file avidec.c.

Referenced by avi_read_seek().

static int avi_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  timestamp,
int  flags 
)
static

Definition at line 1707 of file avidec.c.

static int avi_read_close ( AVFormatContext s)
static

Definition at line 1825 of file avidec.c.

static int avi_probe ( AVProbeData p)
static

Definition at line 1848 of file avidec.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "use_odml", "use odml index", 0x42, AV_OPT_TYPE_INT, {.i64 = 1}, -1, 1, AV_OPT_FLAG_DECODING_PARAM},
{ NULL },
}

Definition at line 86 of file avidec.c.

const AVClass demuxer_class
static
Initial value:
= {
.class_name = "avi",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 91 of file avidec.c.

const char avi_headers[][8]
static
Initial value:
= {
{ 'R', 'I', 'F', 'F', 'A', 'V', 'I', ' ' },
{ 'R', 'I', 'F', 'F', 'A', 'V', 'I', 'X' },
{ 'R', 'I', 'F', 'F', 'A', 'V', 'I', 0x19 },
{ 'O', 'N', '2', ' ', 'O', 'N', '2', 'f' },
{ 'R', 'I', 'F', 'F', 'A', 'M', 'V', ' ' },
{ 0 }
}

Definition at line 100 of file avidec.c.

Referenced by avi_probe(), and get_riff().

const AVMetadataConv avi_metadata_conv[]
static
Initial value:
= {
{ "strn", "title" },
{ 0 },
}

Definition at line 109 of file avidec.c.

const char months[12][4]
static
Initial value:
= { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }

Definition at line 319 of file avidec.c.

Referenced by avi_metadata_creation_time().

AVInputFormat ff_avi_demuxer
Initial value:
= {
.name = "avi",
.long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
.priv_data_size = sizeof(AVIContext),
.extensions = "avi",
.priv_class = &demuxer_class,
}

Definition at line 1861 of file avidec.c.