asfdec.c File Reference
#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/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>
Include dependency graph for asfdec.c:

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 ff_asf_get_packet (AVFormatContext *s, AVIOContext *pb)
 Load a single ASF packet into the demuxer. More...
 
static int asf_read_frame_header (AVFormatContext *s, AVIOContext *pb)
 
static int ff_asf_parse_packet (AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
 Parse data from individual ASF packets (which were previously loaded with asf_get_packet()). More...
 
static int asf_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static void asf_reset_header (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 void 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 99 of file asfdec.c.

Referenced by asf_read_pts(), and asf_read_stream_properties().

#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; \
var = defval; \
break; \
}
uint8_t bits
Definition: crc.c:216
unsigned int avio_rl32(AVIOContext *s)
Definition: aviobuf.c:579
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:469
unsigned int avio_rl16(AVIOContext *s)
Definition: aviobuf.c:563
default
Definition: start.py:60

Definition at line 861 of file asfdec.c.

Referenced by asf_read_frame_header(), and ff_asf_get_packet().

#define FRAME_HEADER_SIZE   16

Definition at line 100 of file asfdec.c.

Referenced by asf_read_packet(), and ff_asf_parse_packet().

#define LEN   22
#define print_guid (   g)

Definition at line 148 of file asfdec.c.

Referenced by asf_read_header().

Function Documentation

static void asf_build_simple_index ( AVFormatContext s,
int  stream_index 
)
static

Definition at line 1442 of file asfdec.c.

Referenced by asf_read_seek().

static int asf_probe ( AVProbeData pd)
static

Definition at line 151 of file asfdec.c.

static int asf_read_close ( AVFormatContext s)
static

Definition at line 1382 of file asfdec.c.

static int asf_read_content_desc ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 572 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 591 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 514 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_file_properties ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 323 of file asfdec.c.

Referenced by asf_read_header().

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

Definition at line 985 of file asfdec.c.

Referenced by ff_asf_parse_packet().

static int asf_read_header ( AVFormatContext s)
static

Definition at line 718 of file asfdec.c.

static int asf_read_language_list ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 625 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_marker ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 684 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_metadata ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 645 of file asfdec.c.

Referenced by asf_read_header().

static int asf_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 1326 of file asfdec.c.

static int asf_read_picture ( AVFormatContext s,
int  len 
)
static

Definition at line 180 of file asfdec.c.

Referenced by get_tag().

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

Definition at line 1389 of file asfdec.c.

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

Definition at line 1499 of file asfdec.c.

static int asf_read_stream_properties ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 347 of file asfdec.c.

Referenced by asf_read_header().

static void asf_reset_header ( AVFormatContext s)
static

Definition at line 1346 of file asfdec.c.

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

static int ff_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 886 of file asfdec.c.

Referenced by asf_read_packet().

static int ff_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 1113 of file asfdec.c.

Referenced by asf_read_packet().

static void get_id3_tag ( AVFormatContext s,
int  len 
)
static

Definition at line 267 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 get_value ( AVIOContext pb,
int  type,
int  type2_size 
)
static

Definition at line 162 of file asfdec.c.

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

Variable Documentation

const AVClass asf_class
static
Initial value:
= {
.class_name = "asf demuxer",
.item_name = av_default_item_name,
.option = options,
}
av_default_item_name
static const AVOption options[]
Definition: asfdec.c:84
LIBAVUTIL_VERSION_INT
Definition: eval.c:55

Definition at line 89 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,
}
#define AVFMT_NOBINSEARCH
Format does not allow to fallback to binary search via read_timestamp.
Definition: avformat.h:358
static const AVClass asf_class
Definition: asfdec.c:89
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:153
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int asf_read_header(AVFormatContext *s)
Definition: asfdec.c:718
static int read_probe(AVProbeData *pd)
static int asf_probe(AVProbeData *pd)
Definition: asfdec.c:151
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:517
static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit)
Definition: asfdec.c:1389
static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
Definition: asfdec.c:1499
#define AVFMT_NOGENSEARCH
Format does not allow to fallback to generic search.
Definition: avformat.h:359
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: libcdio.c:114
static int asf_read_close(AVFormatContext *s)
Definition: asfdec.c:1382
static int flags
Definition: cpu.c:23
static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: asfdec.c:1326

Definition at line 1541 of file asfdec.c.

Referenced by ff_wms_parse_sdp_a_line().

const AVOption options[]
static
Initial value:
= {
{ "no_resync_search", "Don't try to resynchronize by looking for a certain optional start code", offsetof(ASFContext, no_resync_search), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ NULL },
}
NULL
Definition: eval.c:55
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Definition: opt.h:282

Definition at line 84 of file asfdec.c.