Libav
Data Structures | Macros | Functions | Variables
flvdec.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/dict.h"
#include "libavutil/opt.h"
#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/mpeg4audio.h"
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"
#include "flv.h"

Go to the source code of this file.

Data Structures

struct  FLVContext
 

Macros

#define KEYFRAMES_TAG   "keyframes"
 
#define KEYFRAMES_TIMESTAMP_TAG   "times"
 
#define KEYFRAMES_BYTEOFFSET_TAG   "filepositions"
 
#define VALIDATE_INDEX_TS_THRESH   2500
 
#define OFFSET(x)   offsetof(FLVContext, x)
 
#define VD   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Functions

static int flv_probe (AVProbeData *p)
 
static AVStreamcreate_stream (AVFormatContext *s, int codec_type)
 
static int flv_same_audio_codec (AVCodecParameters *apar, int flags)
 
static void flv_set_audio_codec (AVFormatContext *s, AVStream *astream, AVCodecParameters *apar, int flv_codecid)
 
static int flv_same_video_codec (AVCodecParameters *vpar, int flags)
 
static int flv_set_video_codec (AVFormatContext *s, AVStream *vstream, int flv_codecid, int read)
 
static int amf_get_string (AVIOContext *ioc, char *buffer, int buffsize)
 
static int parse_keyframes_index (AVFormatContext *s, AVIOContext *ioc, AVStream *vstream, int64_t max_pos)
 
static int amf_parse_object (AVFormatContext *s, AVStream *astream, AVStream *vstream, const char *key, int64_t max_pos, int depth)
 
static int flv_read_metabody (AVFormatContext *s, int64_t next_pos)
 
static int flv_read_header (AVFormatContext *s)
 
static int flv_read_close (AVFormatContext *s)
 
static int flv_get_extradata (AVFormatContext *s, AVStream *st, int size)
 
static int flv_queue_extradata (FLVContext *flv, AVIOContext *pb, int stream, int size)
 
static void clear_index_entries (AVFormatContext *s, int64_t pos)
 
static int amf_skip_tag (AVIOContext *pb, AMFDataType type)
 
static int flv_data_packet (AVFormatContext *s, AVPacket *pkt, int64_t dts, int64_t next)
 
static int flv_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int flv_read_seek (AVFormatContext *s, int stream_index, int64_t ts, int flags)
 

Variables

static const AVOption options []
 
class {
      class_name = "flvdec"
 
      item_name = av_default_item_name
 
      option = options
 
      version = LIBAVUTIL_VERSION_INT
 
}; 
 
AVInputFormat ff_flv_demuxer
 

Macro Definition Documentation

◆ KEYFRAMES_TAG

#define KEYFRAMES_TAG   "keyframes"

Definition at line 40 of file flvdec.c.

Referenced by amf_parse_object().

◆ KEYFRAMES_TIMESTAMP_TAG

#define KEYFRAMES_TIMESTAMP_TAG   "times"

Definition at line 41 of file flvdec.c.

Referenced by parse_keyframes_index().

◆ KEYFRAMES_BYTEOFFSET_TAG

#define KEYFRAMES_BYTEOFFSET_TAG   "filepositions"

Definition at line 42 of file flvdec.c.

Referenced by parse_keyframes_index().

◆ VALIDATE_INDEX_TS_THRESH

#define VALIDATE_INDEX_TS_THRESH   2500

Definition at line 44 of file flvdec.c.

Referenced by flv_read_packet().

◆ OFFSET

#define OFFSET (   x)    offsetof(FLVContext, x)

Definition at line 1003 of file flvdec.c.

◆ VD

Definition at line 1004 of file flvdec.c.

Function Documentation

◆ flv_probe()

static int flv_probe ( AVProbeData p)
static

Definition at line 63 of file flvdec.c.

◆ create_stream()

static AVStream* create_stream ( AVFormatContext s,
int  codec_type 
)
static

Definition at line 78 of file flvdec.c.

Referenced by amf_parse_object(), flv_data_packet(), and flv_read_packet().

◆ flv_same_audio_codec()

static int flv_same_audio_codec ( AVCodecParameters apar,
int  flags 
)
static

Definition at line 88 of file flvdec.c.

Referenced by flv_read_packet().

◆ flv_set_audio_codec()

static void flv_set_audio_codec ( AVFormatContext s,
AVStream astream,
AVCodecParameters apar,
int  flv_codecid 
)
static

Definition at line 139 of file flvdec.c.

Referenced by amf_parse_object(), and flv_read_packet().

◆ flv_same_video_codec()

static int flv_same_video_codec ( AVCodecParameters vpar,
int  flags 
)
static

Definition at line 199 of file flvdec.c.

Referenced by flv_read_packet().

◆ flv_set_video_codec()

static int flv_set_video_codec ( AVFormatContext s,
AVStream vstream,
int  flv_codecid,
int  read 
)
static

Definition at line 224 of file flvdec.c.

Referenced by amf_parse_object(), and flv_read_packet().

◆ amf_get_string()

static int amf_get_string ( AVIOContext ioc,
char *  buffer,
int  buffsize 
)
static

◆ parse_keyframes_index()

static int parse_keyframes_index ( AVFormatContext s,
AVIOContext ioc,
AVStream vstream,
int64_t  max_pos 
)
static

Definition at line 281 of file flvdec.c.

Referenced by amf_parse_object().

◆ amf_parse_object()

static int amf_parse_object ( AVFormatContext s,
AVStream astream,
AVStream vstream,
const char *  key,
int64_t  max_pos,
int  depth 
)
static

Definition at line 367 of file flvdec.c.

Referenced by flv_read_metabody().

◆ flv_read_metabody()

static int flv_read_metabody ( AVFormatContext s,
int64_t  next_pos 
)
static

Definition at line 517 of file flvdec.c.

Referenced by flv_read_packet().

◆ flv_read_header()

static int flv_read_header ( AVFormatContext s)
static

Definition at line 560 of file flvdec.c.

◆ flv_read_close()

static int flv_read_close ( AVFormatContext s)
static

Definition at line 578 of file flvdec.c.

◆ flv_get_extradata()

static int flv_get_extradata ( AVFormatContext s,
AVStream st,
int  size 
)
static

Definition at line 586 of file flvdec.c.

Referenced by flv_read_packet().

◆ flv_queue_extradata()

static int flv_queue_extradata ( FLVContext flv,
AVIOContext pb,
int  stream,
int  size 
)
static

Definition at line 597 of file flvdec.c.

Referenced by flv_read_packet().

◆ clear_index_entries()

static void clear_index_entries ( AVFormatContext s,
int64_t  pos 
)
static

Definition at line 610 of file flvdec.c.

Referenced by flv_read_packet().

◆ amf_skip_tag()

static int amf_skip_tag ( AVIOContext pb,
AMFDataType  type 
)
static

Definition at line 626 of file flvdec.c.

Referenced by flv_data_packet().

◆ flv_data_packet()

static int flv_data_packet ( AVFormatContext s,
AVPacket pkt,
int64_t  dts,
int64_t  next 
)
static

Definition at line 667 of file flvdec.c.

Referenced by flv_read_packet().

◆ flv_read_packet()

static int flv_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 731 of file flvdec.c.

◆ flv_read_seek()

static int flv_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  ts,
int  flags 
)
static

Definition at line 995 of file flvdec.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "flv_metadata", "Allocate streams according to the onMetaData array", OFFSET(trust_metadata), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VD },
{ NULL }
}
#define OFFSET(x)
Definition: flvdec.c:1003
#define VD
Definition: flvdec.c:1004
NULL
Definition: eval.c:55

Definition at line 1005 of file flvdec.c.

◆ class_name

class_name = "flvdec"
private

Definition at line 1011 of file flvdec.c.

◆ item_name

item_name = av_default_item_name
private

Definition at line 1012 of file flvdec.c.

◆ option

option = options
private

Definition at line 1013 of file flvdec.c.

◆ version

version = LIBAVUTIL_VERSION_INT
private

Definition at line 1014 of file flvdec.c.

◆ @134

const { ... }

◆ ff_flv_demuxer

AVInputFormat ff_flv_demuxer
Initial value:
= {
.name = "flv",
.long_name = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
.priv_data_size = sizeof(FLVContext),
.extensions = "flv",
.priv_class = &class,
}
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:153
static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: flvdec.c:731
static int flv_read_seek(AVFormatContext *s, int stream_index, int64_t ts, int flags)
Definition: flvdec.c:995
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
static int flv_read_close(AVFormatContext *s)
Definition: flvdec.c:578
static int flv_read_header(AVFormatContext *s)
Definition: flvdec.c:560
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:148
static int read_probe(AVProbeData *pd)
Definition: jvdec.c:55
static int flv_probe(AVProbeData *p)
Definition: flvdec.c:63
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:546
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: libcdio.c:114

Definition at line 1017 of file flvdec.c.