FFmpeg
Data Structures | Macros | Functions | Variables
asfdec_f.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/mem.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "avio_internal.h"
#include "avlanguage.h"
#include "demux.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  ASFPayload
 
struct  ASFStream
 
struct  ASFContext
 

Macros

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

Functions

static int asf_probe (const AVProbeData *pd)
 
static int get_value (AVIOContext *pb, int type, int type2_size)
 
static void get_tag (AVFormatContext *s, const char *key, int type, int len, int type2_size)
 
static int asf_read_file_properties (AVFormatContext *s)
 
static int asf_read_stream_properties (AVFormatContext *s, int64_t size)
 
static int asf_read_ext_stream_properties (AVFormatContext *s)
 
static int asf_read_content_desc (AVFormatContext *s)
 
static int asf_read_ext_content_desc (AVFormatContext *s)
 
static int asf_read_language_list (AVFormatContext *s)
 
static int asf_read_metadata (AVFormatContext *s)
 
static int asf_read_marker (AVFormatContext *s)
 
static int asf_read_header (AVFormatContext *s)
 
static int 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 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 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
 
const FFInputFormat ff_asf_demuxer
 

Macro Definition Documentation

◆ ASF_MAX_STREAMS

#define ASF_MAX_STREAMS   127

Definition at line 137 of file asfdec_f.c.

◆ FRAME_HEADER_SIZE

#define FRAME_HEADER_SIZE   6

Definition at line 138 of file asfdec_f.c.

◆ print_guid

#define print_guid (   g)    while(0)

Definition at line 193 of file asfdec_f.c.

◆ LEN

#define LEN   22

◆ DO_2BITS

#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 857 of file asfdec_f.c.

Function Documentation

◆ asf_probe()

static int asf_probe ( const AVProbeData pd)
static

Definition at line 196 of file asfdec_f.c.

◆ get_value()

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

Definition at line 207 of file asfdec_f.c.

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

◆ get_tag()

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

◆ asf_read_file_properties()

static int asf_read_file_properties ( AVFormatContext s)
static

Definition at line 275 of file asfdec_f.c.

Referenced by asf_read_header().

◆ asf_read_stream_properties()

static int asf_read_stream_properties ( AVFormatContext s,
int64_t  size 
)
static

Definition at line 299 of file asfdec_f.c.

Referenced by asf_read_header().

◆ asf_read_ext_stream_properties()

static int asf_read_ext_stream_properties ( AVFormatContext s)
static

Definition at line 474 of file asfdec_f.c.

Referenced by asf_read_header().

◆ asf_read_content_desc()

static int asf_read_content_desc ( AVFormatContext s)
static

Definition at line 534 of file asfdec_f.c.

Referenced by asf_read_header().

◆ asf_read_ext_content_desc()

static int asf_read_ext_content_desc ( AVFormatContext s)
static

Definition at line 553 of file asfdec_f.c.

Referenced by asf_read_header().

◆ asf_read_language_list()

static int asf_read_language_list ( AVFormatContext s)
static

Definition at line 587 of file asfdec_f.c.

Referenced by asf_read_header().

◆ asf_read_metadata()

static int asf_read_metadata ( AVFormatContext s)
static

Definition at line 607 of file asfdec_f.c.

Referenced by asf_read_header().

◆ asf_read_marker()

static int asf_read_marker ( AVFormatContext s)
static

Definition at line 655 of file asfdec_f.c.

Referenced by asf_read_header().

◆ asf_read_header()

static int asf_read_header ( AVFormatContext s)
static

Definition at line 695 of file asfdec_f.c.

◆ asf_get_packet()

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 882 of file asfdec_f.c.

Referenced by asf_read_packet().

◆ asf_read_frame_header()

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

Definition at line 1004 of file asfdec_f.c.

Referenced by asf_parse_packet().

◆ 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 1133 of file asfdec_f.c.

Referenced by asf_read_packet().

◆ asf_read_packet()

static int asf_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 1364 of file asfdec_f.c.

◆ asf_reset_header()

static void asf_reset_header ( AVFormatContext s)
static

Definition at line 1384 of file asfdec_f.c.

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

◆ skip_to_key()

static void skip_to_key ( AVFormatContext s)
static

Definition at line 1417 of file asfdec_f.c.

Referenced by asf_read_seek().

◆ asf_read_close()

static int asf_read_close ( AVFormatContext s)
static

Definition at line 1432 of file asfdec_f.c.

◆ asf_read_pts()

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

Definition at line 1439 of file asfdec_f.c.

◆ asf_build_simple_index()

static int asf_build_simple_index ( AVFormatContext s,
int  stream_index 
)
static

Definition at line 1497 of file asfdec_f.c.

Referenced by asf_read_seek().

◆ asf_read_seek()

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

Definition at line 1565 of file asfdec_f.c.

Variable Documentation

◆ options

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_BOOL, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ "export_xmp", "Export full XMP metadata", 0x42, AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ NULL },
}

Definition at line 121 of file asfdec_f.c.

◆ asf_class

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

Definition at line 127 of file asfdec_f.c.

◆ ff_asf_demuxer

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

Definition at line 1621 of file asfdec_f.c.

asf_class
static const AVClass asf_class
Definition: asfdec_f.c:127
AVFMT_NOBINSEARCH
#define AVFMT_NOBINSEARCH
Format does not allow to fall back on binary search via read_timestamp.
Definition: avformat.h:485
read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:151
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:143
avio_rl16
unsigned int avio_rl16(AVIOContext *s)
Definition: aviobuf.c:714
asf_read_close
static int asf_read_close(AVFormatContext *s)
Definition: asfdec_f.c:1432
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
asf_read_seek
static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
Definition: asfdec_f.c:1565
bits
uint8_t bits
Definition: vp3data.h:128
asf_probe
static int asf_probe(const AVProbeData *pd)
Definition: asfdec_f.c:196
asf_read_packet
static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: asfdec_f.c:1364
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:540
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
options
static const AVOption options[]
Definition: asfdec_f.c:121
avio_rl32
unsigned int avio_rl32(AVIOContext *s)
Definition: aviobuf.c:730
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
avio_r8
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:603
asf_read_pts
static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit)
Definition: asfdec_f.c:1439
AVFMT_NOGENSEARCH
#define AVFMT_NOGENSEARCH
Format does not allow to fall back on generic search.
Definition: avformat.h:486
AV_OPT_FLAG_DECODING_PARAM
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
Definition: opt.h:356
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
ASFContext
Definition: asfdec_f.c:75
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
read_timestamp
static int64_t read_timestamp(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit, int64_t(*read_timestamp)(struct AVFormatContext *, int, int64_t *, int64_t))
Definition: seek.c:281
asf_read_header
static int asf_read_header(AVFormatContext *s)
Definition: asfdec_f.c:695