FFmpeg
Data Structures | Macros | Functions | Variables
asfdec_o.c File Reference
#include <time.h>
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/dict.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/time_internal.h"
#include "avformat.h"
#include "avlanguage.h"
#include "demux.h"
#include "internal.h"
#include "riff.h"
#include "asf.h"
#include "asfcrypt.h"

Go to the source code of this file.

Data Structures

struct  GUIDParseTable
 
struct  ASFPacket
 
struct  ASFStream
 
struct  ASFStreamData
 
struct  ASFContext
 

Macros

#define ASF_BOOL   0x2
 
#define ASF_WORD   0x5
 
#define ASF_GUID   0x6
 
#define ASF_DWORD   0x3
 
#define ASF_QWORD   0x4
 
#define ASF_UNICODE   0x0
 
#define ASF_FLAG_BROADCAST   0x1
 
#define ASF_BYTE_ARRAY   0x1
 
#define ASF_TYPE_AUDIO   0x2
 
#define ASF_TYPE_VIDEO   0x1
 
#define ASF_STREAM_NUM   0x7F
 
#define ASF_MAX_STREAMS   128
 
#define BMP_HEADER_SIZE   40
 
#define ASF_NUM_OF_PAYLOADS   0x3F
 
#define ASF_ERROR_CORRECTION_LENGTH_TYPE   0x60
 
#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE   0x2
 
#define READ_LEN(flag, name, len)
 

Functions

static int detect_unknown_subobject (AVFormatContext *s, int64_t offset, int64_t size)
 
static const GUIDParseTablefind_guid (ff_asf_guid guid)
 
static int asf_probe (const AVProbeData *pd)
 
static void swap_guid (ff_asf_guid guid)
 
static void align_position (AVIOContext *pb, int64_t offset, uint64_t size)
 
static int asf_read_unknown (AVFormatContext *s, const GUIDParseTable *g)
 
static int get_asf_string (AVIOContext *pb, int maxlen, char *buf, int buflen)
 
static int asf_read_marker (AVFormatContext *s, const GUIDParseTable *g)
 
static int asf_read_metadata (AVFormatContext *s, const char *title, uint16_t len, unsigned char *ch, uint16_t buflen)
 
static int asf_read_value (AVFormatContext *s, const uint8_t *name, uint16_t val_len, int type, AVDictionary **met)
 
static int asf_read_generic_value (AVIOContext *pb, int type, uint64_t *value)
 
static int asf_set_metadata (AVFormatContext *s, const uint8_t *name, int type, AVDictionary **met)
 
static int process_metadata (AVFormatContext *s, const uint8_t *name, uint16_t name_len, uint16_t val_len, uint16_t type, AVDictionary **met)
 
static int asf_read_ext_content (AVFormatContext *s, const GUIDParseTable *g)
 
static AVStreamfind_stream (AVFormatContext *s, uint16_t st_num)
 
static int asf_store_aspect_ratio (AVFormatContext *s, uint8_t st_num, uint8_t *name, int type)
 
static int asf_read_metadata_obj (AVFormatContext *s, const GUIDParseTable *g)
 
static int asf_read_content_desc (AVFormatContext *s, const GUIDParseTable *g)
 
static int asf_read_properties (AVFormatContext *s, const GUIDParseTable *g)
 
static int parse_video_info (AVFormatContext *avfmt, AVIOContext *pb, AVStream *st)
 
static int asf_read_stream_properties (AVFormatContext *s, const GUIDParseTable *g)
 
static void set_language (AVFormatContext *s, const char *rfc1766, AVDictionary **met)
 
static int asf_read_ext_stream_properties (AVFormatContext *s, const GUIDParseTable *g)
 
static int asf_read_language_list (AVFormatContext *s, const GUIDParseTable *g)
 
static int asf_read_data (AVFormatContext *s, const GUIDParseTable *g)
 
static int asf_read_simple_index (AVFormatContext *s, const GUIDParseTable *g)
 
static int asf_read_subpayload (AVFormatContext *s, AVPacket *pkt, int is_header)
 
static void reset_packet (ASFPacket *asf_pkt)
 
static int asf_read_replicated_data (AVFormatContext *s, ASFPacket *asf_pkt)
 
static int asf_read_multiple_payload (AVFormatContext *s, AVPacket *pkt, ASFPacket *asf_pkt)
 
static int asf_read_single_payload (AVFormatContext *s, ASFPacket *asf_pkt)
 
static int asf_read_payload (AVFormatContext *s, AVPacket *pkt)
 
static int asf_read_packet_header (AVFormatContext *s)
 
static int asf_deinterleave (AVFormatContext *s, ASFPacket *asf_pkt, int st_num)
 
static int asf_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int asf_read_close (AVFormatContext *s)
 
static void reset_packet_state (AVFormatContext *s)
 
static int64_t asf_read_timestamp (AVFormatContext *s, int stream_index, int64_t *pos, int64_t pos_limit)
 
static int asf_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
 
static int asf_read_header (AVFormatContext *s)
 

Variables

static const GUIDParseTable gdef []
 
const AVInputFormat ff_asf_o_demuxer
 

Macro Definition Documentation

◆ ASF_BOOL

#define ASF_BOOL   0x2

Definition at line 39 of file asfdec_o.c.

◆ ASF_WORD

#define ASF_WORD   0x5

Definition at line 40 of file asfdec_o.c.

◆ ASF_GUID

#define ASF_GUID   0x6

Definition at line 41 of file asfdec_o.c.

◆ ASF_DWORD

#define ASF_DWORD   0x3

Definition at line 42 of file asfdec_o.c.

◆ ASF_QWORD

#define ASF_QWORD   0x4

Definition at line 43 of file asfdec_o.c.

◆ ASF_UNICODE

#define ASF_UNICODE   0x0

Definition at line 44 of file asfdec_o.c.

◆ ASF_FLAG_BROADCAST

#define ASF_FLAG_BROADCAST   0x1

Definition at line 45 of file asfdec_o.c.

◆ ASF_BYTE_ARRAY

#define ASF_BYTE_ARRAY   0x1

Definition at line 46 of file asfdec_o.c.

◆ ASF_TYPE_AUDIO

#define ASF_TYPE_AUDIO   0x2

Definition at line 47 of file asfdec_o.c.

◆ ASF_TYPE_VIDEO

#define ASF_TYPE_VIDEO   0x1

Definition at line 48 of file asfdec_o.c.

◆ ASF_STREAM_NUM

#define ASF_STREAM_NUM   0x7F

Definition at line 49 of file asfdec_o.c.

◆ ASF_MAX_STREAMS

#define ASF_MAX_STREAMS   128

Definition at line 50 of file asfdec_o.c.

◆ BMP_HEADER_SIZE

#define BMP_HEADER_SIZE   40

Definition at line 51 of file asfdec_o.c.

◆ ASF_NUM_OF_PAYLOADS

#define ASF_NUM_OF_PAYLOADS   0x3F

Definition at line 52 of file asfdec_o.c.

◆ ASF_ERROR_CORRECTION_LENGTH_TYPE

#define ASF_ERROR_CORRECTION_LENGTH_TYPE   0x60

Definition at line 53 of file asfdec_o.c.

◆ ASF_PACKET_ERROR_CORRECTION_DATA_SIZE

#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE   0x2

Definition at line 54 of file asfdec_o.c.

◆ READ_LEN

#define READ_LEN (   flag,
  name,
  len 
)
Value:
do { \
if ((flag) == name ## IS_BYTE) \
len = avio_r8(pb); \
else if ((flag) == name ## IS_WORD) \
len = avio_rl16(pb); \
else if ((flag) == name ## IS_DWORD) \
len = avio_rl32(pb); \
else \
len = 0; \
} while(0)

Definition at line 958 of file asfdec_o.c.

Function Documentation

◆ detect_unknown_subobject()

static int detect_unknown_subobject ( AVFormatContext s,
int64_t  offset,
int64_t  size 
)
static

Definition at line 1561 of file asfdec_o.c.

Referenced by asf_read_unknown().

◆ find_guid()

static const GUIDParseTable * find_guid ( ff_asf_guid  guid)
static

◆ asf_probe()

static int asf_probe ( const AVProbeData pd)
static

Definition at line 149 of file asfdec_o.c.

◆ swap_guid()

static void swap_guid ( ff_asf_guid  guid)
static

Definition at line 158 of file asfdec_o.c.

Referenced by find_guid().

◆ align_position()

static void align_position ( AVIOContext pb,
int64_t  offset,
uint64_t  size 
)
static

◆ asf_read_unknown()

static int asf_read_unknown ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 172 of file asfdec_o.c.

Referenced by detect_unknown_subobject().

◆ get_asf_string()

static int get_asf_string ( AVIOContext pb,
int  maxlen,
char *  buf,
int  buflen 
)
static

Definition at line 205 of file asfdec_o.c.

Referenced by asf_read_language_list(), and asf_read_value().

◆ asf_read_marker()

static int asf_read_marker ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 222 of file asfdec_o.c.

◆ asf_read_metadata()

static int asf_read_metadata ( AVFormatContext s,
const char *  title,
uint16_t  len,
unsigned char *  ch,
uint16_t  buflen 
)
static

Definition at line 264 of file asfdec_o.c.

Referenced by asf_read_content_desc().

◆ asf_read_value()

static int asf_read_value ( AVFormatContext s,
const uint8_t *  name,
uint16_t  val_len,
int  type,
AVDictionary **  met 
)
static

Definition at line 278 of file asfdec_o.c.

Referenced by process_metadata().

◆ asf_read_generic_value()

static int asf_read_generic_value ( AVIOContext pb,
int  type,
uint64_t *  value 
)
static

Definition at line 319 of file asfdec_o.c.

Referenced by asf_set_metadata(), and asf_store_aspect_ratio().

◆ asf_set_metadata()

static int asf_set_metadata ( AVFormatContext s,
const uint8_t *  name,
int  type,
AVDictionary **  met 
)
static

Definition at line 342 of file asfdec_o.c.

Referenced by process_metadata().

◆ process_metadata()

static int process_metadata ( AVFormatContext s,
const uint8_t *  name,
uint16_t  name_len,
uint16_t  val_len,
uint16_t  type,
AVDictionary **  met 
)
static

Definition at line 361 of file asfdec_o.c.

Referenced by asf_read_ext_content(), and asf_read_metadata_obj().

◆ asf_read_ext_content()

static int asf_read_ext_content ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 389 of file asfdec_o.c.

◆ find_stream()

static AVStream* find_stream ( AVFormatContext s,
uint16_t  st_num 
)
static

Definition at line 426 of file asfdec_o.c.

Referenced by asf_read_header().

◆ asf_store_aspect_ratio()

static int asf_store_aspect_ratio ( AVFormatContext s,
uint8_t  st_num,
uint8_t *  name,
int  type 
)
static

Definition at line 442 of file asfdec_o.c.

Referenced by asf_read_metadata_obj().

◆ asf_read_metadata_obj()

static int asf_read_metadata_obj ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 462 of file asfdec_o.c.

◆ asf_read_content_desc()

static int asf_read_content_desc ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 510 of file asfdec_o.c.

◆ asf_read_properties()

static int asf_read_properties ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 539 of file asfdec_o.c.

◆ parse_video_info()

static int parse_video_info ( AVFormatContext avfmt,
AVIOContext pb,
AVStream st 
)
static

Definition at line 582 of file asfdec_o.c.

Referenced by asf_read_stream_properties().

◆ asf_read_stream_properties()

static int asf_read_stream_properties ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 606 of file asfdec_o.c.

◆ set_language()

static void set_language ( AVFormatContext s,
const char *  rfc1766,
AVDictionary **  met 
)
static

Definition at line 712 of file asfdec_o.c.

Referenced by asf_read_header().

◆ asf_read_ext_stream_properties()

static int asf_read_ext_stream_properties ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 725 of file asfdec_o.c.

◆ asf_read_language_list()

static int asf_read_language_list ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 795 of file asfdec_o.c.

◆ asf_read_data()

static int asf_read_data ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 821 of file asfdec_o.c.

◆ asf_read_simple_index()

static int asf_read_simple_index ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 857 of file asfdec_o.c.

◆ asf_read_subpayload()

static int asf_read_subpayload ( AVFormatContext s,
AVPacket pkt,
int  is_header 
)
static

Definition at line 970 of file asfdec_o.c.

Referenced by asf_read_multiple_payload(), and asf_read_payload().

◆ reset_packet()

static void reset_packet ( ASFPacket asf_pkt)
static

Definition at line 1025 of file asfdec_o.c.

Referenced by asf_read_payload(), and reset_packet_state().

◆ asf_read_replicated_data()

static int asf_read_replicated_data ( AVFormatContext s,
ASFPacket asf_pkt 
)
static

Definition at line 1035 of file asfdec_o.c.

Referenced by asf_read_multiple_payload().

◆ asf_read_multiple_payload()

static int asf_read_multiple_payload ( AVFormatContext s,
AVPacket pkt,
ASFPacket asf_pkt 
)
static

Definition at line 1057 of file asfdec_o.c.

Referenced by asf_read_payload().

◆ asf_read_single_payload()

static int asf_read_single_payload ( AVFormatContext s,
ASFPacket asf_pkt 
)
static

Definition at line 1108 of file asfdec_o.c.

Referenced by asf_read_payload().

◆ asf_read_payload()

static int asf_read_payload ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 1160 of file asfdec_o.c.

Referenced by asf_read_packet().

◆ asf_read_packet_header()

static int asf_read_packet_header ( AVFormatContext s)
static

Definition at line 1240 of file asfdec_o.c.

Referenced by asf_read_packet().

◆ asf_deinterleave()

static int asf_deinterleave ( AVFormatContext s,
ASFPacket asf_pkt,
int  st_num 
)
static

Definition at line 1277 of file asfdec_o.c.

Referenced by asf_read_packet().

◆ asf_read_packet()

static int asf_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 1323 of file asfdec_o.c.

Referenced by asf_read_timestamp().

◆ asf_read_close()

static int asf_read_close ( AVFormatContext s)
static

Definition at line 1407 of file asfdec_o.c.

Referenced by asf_read_header().

◆ reset_packet_state()

static void reset_packet_state ( AVFormatContext s)
static

Definition at line 1424 of file asfdec_o.c.

Referenced by asf_read_seek(), and asf_read_timestamp().

◆ asf_read_timestamp()

static int64_t asf_read_timestamp ( AVFormatContext s,
int  stream_index,
int64_t *  pos,
int64_t  pos_limit 
)
static

Definition at line 1460 of file asfdec_o.c.

◆ asf_read_seek()

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

Definition at line 1522 of file asfdec_o.c.

◆ asf_read_header()

static int asf_read_header ( AVFormatContext s)
static

Definition at line 1594 of file asfdec_o.c.

Variable Documentation

◆ gdef

const GUIDParseTable gdef[]
static

Definition at line 908 of file asfdec_o.c.

Referenced by find_guid().

◆ ff_asf_o_demuxer

const AVInputFormat ff_asf_o_demuxer
Initial value:
= {
.name = "asf_o",
.long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
.priv_data_size = sizeof(ASFContext),
}

Definition at line 1677 of file asfdec_o.c.

name
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
Definition: writing_filters.txt:88
asf_read_header
static int asf_read_header(AVFormatContext *s)
Definition: asfdec_o.c:1594
AVFMT_NOBINSEARCH
#define AVFMT_NOBINSEARCH
Format does not allow to fall back on binary search via read_timestamp.
Definition: avformat.h:486
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:761
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:41
asf_read_seek
static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: asfdec_o.c:1522
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:550
avio_rl32
unsigned int avio_rl32(AVIOContext *s)
Definition: aviobuf.c:777
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:106
avio_r8
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:650
flag
#define flag(name)
Definition: cbs_av1.c:466
asf_read_timestamp
static int64_t asf_read_timestamp(AVFormatContext *s, int stream_index, int64_t *pos, int64_t pos_limit)
Definition: asfdec_o.c:1460
AVFMT_NOGENSEARCH
#define AVFMT_NOGENSEARCH
Format does not allow to fall back on generic search.
Definition: avformat.h:487
asf_probe
static int asf_probe(const AVProbeData *pd)
Definition: asfdec_o.c:149
asf_read_packet
static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: asfdec_o.c:1323
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:29
asf_read_close
static int asf_read_close(AVFormatContext *s)
Definition: asfdec_o.c:1407
ASFContext
Definition: asfdec_f.c:74
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
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:279