FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
asfdec.c File Reference
#include <inttypes.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bswap.h"
#include "libavutil/common.h"
#include "libavutil/dict.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "avio_internal.h"
#include "avlanguage.h"
#include "id3v2.h"
#include "internal.h"
#include "riff.h"
#include "asf.h"
#include "asfcrypt.h"
#include <assert.h>

Go to the source code of this file.

Data Structures

struct  ASFContext
 

Macros

#define ASF_MAX_STREAMS   127
 
#define FRAME_HEADER_SIZE   16
 
#define print_guid(g)
 
#define LEN   22
 
#define DO_2BITS(bits, var, defval)
 

Functions

static int asf_probe (AVProbeData *pd)
 
static int get_value (AVIOContext *pb, int type, int type2_size)
 
static int asf_read_picture (AVFormatContext *s, int len)
 
static void get_id3_tag (AVFormatContext *s, int len)
 
static void get_tag (AVFormatContext *s, const char *key, int type, int len, int type2_size)
 
static int asf_read_file_properties (AVFormatContext *s, int64_t size)
 
static int asf_read_stream_properties (AVFormatContext *s, int64_t size)
 
static int asf_read_ext_stream_properties (AVFormatContext *s, int64_t size)
 
static int asf_read_content_desc (AVFormatContext *s, int64_t size)
 
static int asf_read_ext_content_desc (AVFormatContext *s, int64_t size)
 
static int asf_read_language_list (AVFormatContext *s, int64_t size)
 
static int asf_read_metadata (AVFormatContext *s, int64_t size)
 
static int asf_read_marker (AVFormatContext *s, int64_t size)
 
static int asf_read_header (AVFormatContext *s)
 
static int asf_get_packet (AVFormatContext *s, AVIOContext *pb)
 Load a single ASF packet into the demuxer.
 
static int asf_read_frame_header (AVFormatContext *s, AVIOContext *pb)
 
static int asf_parse_packet (AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
 Parse data from individual ASF packets (which were previously loaded with asf_get_packet()).
 
static int asf_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static void asf_reset_header (AVFormatContext *s)
 
static void skip_to_key (AVFormatContext *s)
 
static int asf_read_close (AVFormatContext *s)
 
static int64_t asf_read_pts (AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit)
 
static int asf_build_simple_index (AVFormatContext *s, int stream_index)
 
static int asf_read_seek (AVFormatContext *s, int stream_index, int64_t pts, int flags)
 

Variables

static const AVOption options []
 
static const AVClass asf_class
 
AVInputFormat ff_asf_demuxer
 

Macro Definition Documentation

#define ASF_MAX_STREAMS   127

Definition at line 100 of file asfdec.c.

Referenced by asf_read_pts(), and asf_read_stream_properties().

#define FRAME_HEADER_SIZE   16

Definition at line 101 of file asfdec.c.

Referenced by asf_parse_packet(), and asf_read_packet().

#define print_guid (   g)

Definition at line 149 of file asfdec.c.

Referenced by asf_read_header().

#define LEN   22

Referenced by build_filter(), and get_tag().

#define DO_2BITS (   bits,
  var,
  defval 
)
Value:
switch (bits & 3) { \
case 3: \
var = avio_rl32(pb); \
rsize += 4; \
break; \
case 2: \
var = avio_rl16(pb); \
rsize += 2; \
break; \
case 1: \
var = avio_r8(pb); \
rsize++; \
break; \
default: \
var = defval; \
break; \
}

Definition at line 870 of file asfdec.c.

Referenced by asf_get_packet(), and asf_read_frame_header().

Function Documentation

static int asf_probe ( AVProbeData pd)
static

Definition at line 152 of file asfdec.c.

static int get_value ( AVIOContext pb,
int  type,
int  type2_size 
)
static

Definition at line 163 of file asfdec.c.

Referenced by asf_read_ext_content_desc(), asf_read_metadata(), and get_tag().

static int asf_read_picture ( AVFormatContext s,
int  len 
)
static

Definition at line 181 of file asfdec.c.

Referenced by get_tag().

static void get_id3_tag ( AVFormatContext s,
int  len 
)
static

Definition at line 268 of file asfdec.c.

Referenced by get_tag().

static void get_tag ( AVFormatContext s,
const char *  key,
int  type,
int  len,
int  type2_size 
)
static
static int asf_read_file_properties ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 324 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_stream_properties ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 348 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_ext_stream_properties ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 515 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_content_desc ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 573 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_ext_content_desc ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 592 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_language_list ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 626 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_metadata ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 646 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_marker ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 685 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_header ( AVFormatContext s)
static

Definition at line 721 of file asfdec.c.

static int asf_get_packet ( AVFormatContext s,
AVIOContext pb 
)
static

Load a single ASF packet into the demuxer.

Parameters
sdemux context
pbcontext to read data from
Returns
0 on success, <0 on error

Definition at line 895 of file asfdec.c.

Referenced by asf_read_packet().

static int asf_read_frame_header ( AVFormatContext s,
AVIOContext pb 
)
static
Returns
<0 if error

Definition at line 994 of file asfdec.c.

Referenced by asf_parse_packet().

static int asf_parse_packet ( AVFormatContext s,
AVIOContext pb,
AVPacket pkt 
)
static

Parse data from individual ASF packets (which were previously loaded with asf_get_packet()).

Parameters
sdemux context
pbcontext to read data from
pktpointer to store packet data into
Returns
0 if data was stored in pkt, <0 on error or 1 if more ASF packets need to be loaded (through asf_get_packet())

Definition at line 1123 of file asfdec.c.

Referenced by asf_read_packet().

static int asf_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 1353 of file asfdec.c.

static void asf_reset_header ( AVFormatContext s)
static

Definition at line 1373 of file asfdec.c.

Referenced by asf_read_close(), asf_read_pts(), and asf_read_seek().

static void skip_to_key ( AVFormatContext s)
static

Definition at line 1406 of file asfdec.c.

Referenced by asf_read_seek().

static int asf_read_close ( AVFormatContext s)
static

Definition at line 1421 of file asfdec.c.

static int64_t asf_read_pts ( AVFormatContext s,
int  stream_index,
int64_t *  ppos,
int64_t  pos_limit 
)
static

Definition at line 1428 of file asfdec.c.

static int asf_build_simple_index ( AVFormatContext s,
int  stream_index 
)
static

Definition at line 1482 of file asfdec.c.

Referenced by asf_read_seek().

static int asf_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  pts,
int  flags 
)
static

Definition at line 1545 of file asfdec.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "no_resync_search", "Don't try to resynchronize by looking for a certain optional start code", 0x42, AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ NULL },
}

Definition at line 85 of file asfdec.c.

const AVClass asf_class
static
Initial value:
= {
.class_name = "asf demuxer",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 90 of file asfdec.c.

AVInputFormat ff_asf_demuxer
Initial value:
= {
.name = "asf",
.long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
.priv_data_size = sizeof(ASFContext),
.read_timestamp = asf_read_pts,
.priv_class = &asf_class,
}

Definition at line 1600 of file asfdec.c.