FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 VALIDATE_INDEX_TS_THRESH   2500
 
#define RESYNC_BUFFER_SIZE   (1<<20)
 
#define TYPE_ONTEXTDATA   1
 
#define TYPE_ONCAPTION   2
 
#define TYPE_ONCAPTIONINFO   3
 
#define TYPE_UNKNOWN   9
 
#define OFFSET(x)   offsetof(FLVContext, x)
 
#define VD   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Functions

static int probe (AVProbeData *p, int live)
 
static int flv_probe (AVProbeData *p)
 
static int live_flv_probe (AVProbeData *p)
 
static void add_keyframes_index (AVFormatContext *s)
 
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, 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 resync (AVFormatContext *s)
 
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 []
 
static const AVClass flv_class
 
AVInputFormat ff_flv_demuxer
 
static const AVClass live_flv_class
 
AVInputFormat ff_live_flv_demuxer
 

Macro Definition Documentation

#define VALIDATE_INDEX_TS_THRESH   2500

Definition at line 40 of file flvdec.c.

Referenced by flv_read_packet().

#define RESYNC_BUFFER_SIZE   (1<<20)

Definition at line 42 of file flvdec.c.

Referenced by resync().

#define TYPE_ONTEXTDATA   1

Definition at line 642 of file flvdec.c.

Referenced by flv_read_metabody(), and flv_read_packet().

#define TYPE_ONCAPTION   2

Definition at line 643 of file flvdec.c.

Referenced by flv_read_metabody(), and flv_read_packet().

#define TYPE_ONCAPTIONINFO   3

Definition at line 644 of file flvdec.c.

Referenced by flv_read_metabody().

#define TYPE_UNKNOWN   9

Definition at line 645 of file flvdec.c.

Referenced by flv_read_metabody(), and flv_read_packet().

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

Definition at line 1263 of file flvdec.c.

Definition at line 1264 of file flvdec.c.

Function Documentation

static int probe ( AVProbeData p,
int  live 
)
static

Definition at line 75 of file flvdec.c.

Referenced by flv_probe(), and live_flv_probe().

static int flv_probe ( AVProbeData p)
static

Definition at line 94 of file flvdec.c.

static int live_flv_probe ( AVProbeData p)
static

Definition at line 99 of file flvdec.c.

static void add_keyframes_index ( AVFormatContext s)
static

Definition at line 104 of file flvdec.c.

Referenced by amf_parse_object(), and create_stream().

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

Definition at line 135 of file flvdec.c.

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

static int flv_same_audio_codec ( AVCodecParameters apar,
int  flags 
)
static

Definition at line 163 of file flvdec.c.

Referenced by flv_read_packet().

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

Definition at line 214 of file flvdec.c.

Referenced by amf_parse_object(), and flv_read_packet().

static int flv_same_video_codec ( AVCodecParameters vpar,
int  flags 
)
static

Definition at line 274 of file flvdec.c.

Referenced by flv_read_packet().

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

Definition at line 299 of file flvdec.c.

Referenced by amf_parse_object(), and flv_read_packet().

static int amf_get_string ( AVIOContext ioc,
char *  buffer,
int  buffsize 
)
static
static int parse_keyframes_index ( AVFormatContext s,
AVIOContext ioc,
int64_t  max_pos 
)
static

Definition at line 371 of file flvdec.c.

Referenced by 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 457 of file flvdec.c.

Referenced by flv_read_metabody().

static int flv_read_metabody ( AVFormatContext s,
int64_t  next_pos 
)
static

Definition at line 647 of file flvdec.c.

Referenced by flv_read_packet().

static int flv_read_header ( AVFormatContext s)
static

Definition at line 707 of file flvdec.c.

static int flv_read_close ( AVFormatContext s)
static

Definition at line 741 of file flvdec.c.

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

Definition at line 752 of file flvdec.c.

Referenced by flv_read_packet().

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

Definition at line 760 of file flvdec.c.

Referenced by flv_read_packet().

static void clear_index_entries ( AVFormatContext s,
int64_t  pos 
)
static

Definition at line 773 of file flvdec.c.

Referenced by flv_read_packet().

static int amf_skip_tag ( AVIOContext pb,
AMFDataType  type 
)
static

Definition at line 789 of file flvdec.c.

Referenced by flv_data_packet().

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

Definition at line 830 of file flvdec.c.

Referenced by flv_read_packet().

static int resync ( AVFormatContext s)
static

Definition at line 897 of file flvdec.c.

Referenced by avi_read_packet(), flv_read_packet(), and nut_read_packet().

static int flv_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 927 of file flvdec.c.

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

Definition at line 1255 of file flvdec.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "flv_metadata", "Allocate streams according to the onMetaData array", OFFSET(trust_metadata), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
{ "missing_streams", "", OFFSET(missing_streams), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 0xFF, VD | AV_OPT_FLAG_EXPORT | AV_OPT_FLAG_READONLY },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define AV_OPT_FLAG_EXPORT
The option is intended for exporting values to the caller.
Definition: opt.h:287
#define OFFSET(x)
Definition: flvdec.c:1263
#define VD
Definition: flvdec.c:1264
#define AV_OPT_FLAG_READONLY
The option may not be set through the AVOptions API, only read.
Definition: opt.h:292

Definition at line 1265 of file flvdec.c.

const AVClass flv_class
static
Initial value:
= {
.class_name = "flvdec",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
static const AVOption options[]
Definition: flvdec.c:1265
av_default_item_name

Definition at line 1271 of file flvdec.c.

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 = &flv_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:927
static int flv_read_seek(AVFormatContext *s, int stream_index, int64_t ts, int flags)
Definition: flvdec.c:1255
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
static int flv_read_close(AVFormatContext *s)
Definition: flvdec.c:741
static int flv_read_header(AVFormatContext *s)
Definition: flvdec.c:707
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static int read_probe(AVProbeData *pd)
Definition: jvdec.c:55
static int flv_probe(AVProbeData *p)
Definition: flvdec.c:94
static const AVClass flv_class
Definition: flvdec.c:1271
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:510
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42

Definition at line 1278 of file flvdec.c.

const AVClass live_flv_class
static
Initial value:
= {
.class_name = "live_flvdec",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
static const AVOption options[]
Definition: flvdec.c:1265
av_default_item_name

Definition at line 1291 of file flvdec.c.

AVInputFormat ff_live_flv_demuxer
Initial value:
= {
.name = "live_flv",
.long_name = NULL_IF_CONFIG_SMALL("live RTMP FLV (Flash Video)"),
.priv_data_size = sizeof(FLVContext),
.extensions = "flv",
.priv_class = &live_flv_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:927
static int flv_read_seek(AVFormatContext *s, int stream_index, int64_t ts, int flags)
Definition: flvdec.c:1255
static int flags
Definition: log.c:57
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
static int live_flv_probe(AVProbeData *p)
Definition: flvdec.c:99
#define AVFMT_TS_DISCONT
Format allows timestamp discontinuities.
Definition: avformat.h:488
static int flv_read_close(AVFormatContext *s)
Definition: flvdec.c:741
static int flv_read_header(AVFormatContext *s)
Definition: flvdec.c:707
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static int read_probe(AVProbeData *pd)
Definition: jvdec.c:55
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:510
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
static const AVClass live_flv_class
Definition: flvdec.c:1291

Definition at line 1298 of file flvdec.c.