FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
asfdec_o.c File Reference
#include "libavutil/attributes.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 "libavutil/time_internal.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"

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 (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 asf_read_picture (AVFormatContext *s, int len)
 
static void get_id3_tag (AVFormatContext *s, int len)
 
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 (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 []
 
AVInputFormat ff_asf_o_demuxer
 

Macro Definition Documentation

#define ASF_BOOL   0x2

Definition at line 41 of file asfdec_o.c.

Referenced by asf_read_ext_content(), and asf_read_generic_value().

#define ASF_WORD   0x5

Definition at line 42 of file asfdec_o.c.

Referenced by asf_read_generic_value().

#define ASF_GUID   0x6

Definition at line 43 of file asfdec_o.c.

Referenced by process_metadata().

#define ASF_DWORD   0x3

Definition at line 44 of file asfdec_o.c.

Referenced by asf_read_ext_content(), and asf_read_generic_value().

#define ASF_QWORD   0x4

Definition at line 45 of file asfdec_o.c.

Referenced by asf_read_generic_value().

#define ASF_UNICODE   0x0

Definition at line 46 of file asfdec_o.c.

Referenced by asf_read_value(), and process_metadata().

#define ASF_FLAG_BROADCAST   0x1

Definition at line 47 of file asfdec_o.c.

Referenced by asf_read_data(), asf_read_header(), asf_read_packet(), and asf_read_properties().

#define ASF_BYTE_ARRAY   0x1

Definition at line 48 of file asfdec_o.c.

Referenced by process_metadata().

#define ASF_TYPE_AUDIO   0x2

Definition at line 49 of file asfdec_o.c.

#define ASF_TYPE_VIDEO   0x1

Definition at line 50 of file asfdec_o.c.

#define ASF_STREAM_NUM   0x7F
#define ASF_MAX_STREAMS   128
#define BMP_HEADER_SIZE   40

Definition at line 53 of file asfdec_o.c.

Referenced by parse_video_info().

#define ASF_NUM_OF_PAYLOADS   0x3F

Definition at line 54 of file asfdec_o.c.

Referenced by asf_read_packet_header().

#define ASF_ERROR_CORRECTION_LENGTH_TYPE   0x60

Definition at line 55 of file asfdec_o.c.

Referenced by asf_read_packet_header().

#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE   0x2

Definition at line 56 of file asfdec_o.c.

Referenced by asf_read_packet_header().

#define READ_LEN (   flag,
  name,
  len 
)
Value:
do { \
if ((flag) == name ## IS_BYTE) \
len = avio_r8(pb); \
else if ((flag) == name ## IS_WORD) \
else if ((flag) == name ## IS_DWORD) \
len = 0; \
} while(0)
unsigned int avio_rl32(AVIOContext *s)
Definition: aviobuf.c:770
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:639
unsigned int avio_rl16(AVIOContext *s)
Definition: aviobuf.c:754
if(ret< 0)
Definition: vf_mcdeint.c:279
#define flag(name)
Definition: cbs_av1.c:588
int len
const char * name
Definition: opengl_enc.c:103

Definition at line 1073 of file asfdec_o.c.

Referenced by asf_read_packet_header(), and asf_read_payload().

Function Documentation

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

Definition at line 1674 of file asfdec_o.c.

Referenced by asf_read_unknown().

static const GUIDParseTable * find_guid ( ff_asf_guid  guid)
static
static int asf_probe ( AVProbeData pd)
static

Definition at line 150 of file asfdec_o.c.

static void swap_guid ( ff_asf_guid  guid)
static

Definition at line 159 of file asfdec_o.c.

Referenced by find_guid().

static void align_position ( AVIOContext pb,
int64_t  offset,
uint64_t  size 
)
static
static int asf_read_unknown ( AVFormatContext s,
const GUIDParseTable g 
)
static

Definition at line 173 of file asfdec_o.c.

Referenced by detect_unknown_subobject().

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

Definition at line 203 of file asfdec_o.c.

Referenced by asf_read_language_list(), and asf_read_value().

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

Definition at line 220 of file asfdec_o.c.

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

Definition at line 259 of file asfdec_o.c.

Referenced by asf_read_content_desc().

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

Definition at line 273 of file asfdec_o.c.

Referenced by process_metadata().

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

Definition at line 314 of file asfdec_o.c.

Referenced by asf_set_metadata(), and asf_store_aspect_ratio().

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

Definition at line 337 of file asfdec_o.c.

Referenced by process_metadata().

static int asf_read_picture ( AVFormatContext s,
int  len 
)
static

Definition at line 358 of file asfdec_o.c.

Referenced by process_metadata().

static void get_id3_tag ( AVFormatContext s,
int  len 
)
static

Definition at line 458 of file asfdec_o.c.

Referenced by 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 470 of file asfdec_o.c.

Referenced by asf_read_ext_content(), and asf_read_metadata_obj().

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

Definition at line 502 of file asfdec_o.c.

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

Definition at line 539 of file asfdec_o.c.

Referenced by asf_read_header().

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

Definition at line 555 of file asfdec_o.c.

Referenced by asf_read_metadata_obj().

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

Definition at line 575 of file asfdec_o.c.

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

Definition at line 622 of file asfdec_o.c.

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

Definition at line 651 of file asfdec_o.c.

static int parse_video_info ( AVIOContext pb,
AVStream st 
)
static

Definition at line 694 of file asfdec_o.c.

Referenced by asf_read_stream_properties().

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

Definition at line 727 of file asfdec_o.c.

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

Definition at line 831 of file asfdec_o.c.

Referenced by asf_read_header().

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

Definition at line 844 of file asfdec_o.c.

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

Definition at line 912 of file asfdec_o.c.

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

Definition at line 938 of file asfdec_o.c.

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

Definition at line 974 of file asfdec_o.c.

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

Definition at line 1085 of file asfdec_o.c.

Referenced by asf_read_multiple_payload(), and asf_read_payload().

static void reset_packet ( ASFPacket asf_pkt)
static

Definition at line 1140 of file asfdec_o.c.

Referenced by asf_read_payload().

static int asf_read_replicated_data ( AVFormatContext s,
ASFPacket asf_pkt 
)
static

Definition at line 1152 of file asfdec_o.c.

Referenced by asf_read_multiple_payload().

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

Definition at line 1174 of file asfdec_o.c.

Referenced by asf_read_payload().

static int asf_read_single_payload ( AVFormatContext s,
ASFPacket asf_pkt 
)
static

Definition at line 1225 of file asfdec_o.c.

Referenced by asf_read_payload().

static int asf_read_payload ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 1277 of file asfdec_o.c.

Referenced by asf_read_packet().

static int asf_read_packet_header ( AVFormatContext s)
static

Definition at line 1357 of file asfdec_o.c.

Referenced by asf_read_packet().

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

Definition at line 1392 of file asfdec_o.c.

Referenced by asf_read_packet().

static int asf_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 1434 of file asfdec_o.c.

Referenced by asf_read_timestamp().

static int asf_read_close ( AVFormatContext s)
static

Definition at line 1518 of file asfdec_o.c.

Referenced by asf_read_header().

static void reset_packet_state ( AVFormatContext s)
static

Definition at line 1535 of file asfdec_o.c.

Referenced by asf_read_seek(), and 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 1578 of file asfdec_o.c.

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

Definition at line 1637 of file asfdec_o.c.

static int asf_read_header ( AVFormatContext s)
static

Definition at line 1704 of file asfdec_o.c.

Variable Documentation

const GUIDParseTable gdef[]
static

Definition at line 1023 of file asfdec_o.c.

Referenced by find_guid().

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),
.read_timestamp = asf_read_timestamp,
}
#define AVFMT_NOBINSEARCH
Format does not allow to fall back on binary search via read_timestamp.
Definition: avformat.h:475
static int asf_read_close(AVFormatContext *s)
Definition: asfdec_o.c:1518
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
static int asf_probe(AVProbeData *pd)
Definition: asfdec_o.c:150
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static int read_probe(AVProbeData *pd)
Definition: jvdec.c:55
static int64_t asf_read_timestamp(AVFormatContext *s, int stream_index, int64_t *pos, int64_t pos_limit)
Definition: asfdec_o.c:1578
static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: asfdec_o.c:1637
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:530
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
#define AVFMT_NOGENSEARCH
Format does not allow to fall back on generic search.
Definition: avformat.h:476
static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: asfdec_o.c:1434
#define flags(name, subs,...)
Definition: cbs_av1.c:596
static int asf_read_header(AVFormatContext *s)
Definition: asfdec_o.c:1704

Definition at line 1787 of file asfdec_o.c.