FFmpeg
Data Structures | Macros | Functions | Variables
lavfi.c File Reference
#include <float.h>
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/file.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavfilter/avfilter.h"
#include "libavfilter/buffersink.h"
#include "libavformat/avio_internal.h"
#include "libavformat/internal.h"
#include "avdevice.h"

Go to the source code of this file.

Data Structures

struct  LavfiContext
 

Macros

#define FAIL(ERR)   { ret = ERR; goto end; }
 
#define OFFSET(x)   offsetof(LavfiContext, x)
 
#define DEC   AV_OPT_FLAG_DECODING_PARAM
 

Functions

static intcreate_all_formats (int n)
 
static av_cold int lavfi_read_close (AVFormatContext *avctx)
 
static int create_subcc_streams (AVFormatContext *avctx)
 
static av_cold int lavfi_read_header (AVFormatContext *avctx)
 
static int create_subcc_packet (AVFormatContext *avctx, AVFrame *frame, int sink_idx)
 
static int lavfi_read_packet (AVFormatContext *avctx, AVPacket *pkt)
 

Variables

static const AVOption options []
 
static const AVClass lavfi_class
 
const AVInputFormat ff_lavfi_demuxer
 

Detailed Description

libavfilter virtual input device

Definition in file lavfi.c.

Macro Definition Documentation

◆ FAIL

#define FAIL (   ERR)    { ret = ERR; goto end; }

◆ OFFSET

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

Definition at line 478 of file lavfi.c.

◆ DEC

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 480 of file lavfi.c.

Function Documentation

◆ create_all_formats()

static int* create_all_formats ( int  n)
static

Definition at line 62 of file lavfi.c.

Referenced by lavfi_read_header().

◆ lavfi_read_close()

static av_cold int lavfi_read_close ( AVFormatContext avctx)
static

Definition at line 83 of file lavfi.c.

◆ create_subcc_streams()

static int create_subcc_streams ( AVFormatContext avctx)
static

Definition at line 98 of file lavfi.c.

Referenced by lavfi_read_header().

◆ lavfi_read_header()

static av_cold int lavfi_read_header ( AVFormatContext avctx)
static

Definition at line 123 of file lavfi.c.

◆ create_subcc_packet()

static int create_subcc_packet ( AVFormatContext avctx,
AVFrame frame,
int  sink_idx 
)
static

Definition at line 360 of file lavfi.c.

Referenced by lavfi_read_packet().

◆ lavfi_read_packet()

static int lavfi_read_packet ( AVFormatContext avctx,
AVPacket pkt 
)
static

Definition at line 380 of file lavfi.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "graph", "set libavfilter graph", OFFSET(graph_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "graph_file","set libavfilter graph filename", OFFSET(graph_filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC},
{ "dumpgraph", "dump graph to stderr", OFFSET(dump_graph), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ NULL },
}

Definition at line 482 of file lavfi.c.

Referenced by lavfi_read_header().

◆ lavfi_class

const AVClass lavfi_class
static
Initial value:
= {
.class_name = "lavfi indev",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 489 of file lavfi.c.

◆ ff_lavfi_demuxer

const AVInputFormat ff_lavfi_demuxer
Initial value:
= {
.name = "lavfi",
.long_name = NULL_IF_CONFIG_SMALL("Libavfilter virtual input device"),
.priv_data_size = sizeof(LavfiContext),
.priv_class = &lavfi_class,
.flags_internal = FF_FMT_INIT_CLEANUP,
}

Definition at line 497 of file lavfi.c.

lavfi_read_header
static av_cold int lavfi_read_header(AVFormatContext *avctx)
Definition: lavfi.c:123
FF_FMT_INIT_CLEANUP
#define FF_FMT_INIT_CLEANUP
For an AVInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
Definition: internal.h:49
lavfi_read_packet
static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
Definition: lavfi.c:380
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:141
AV_CLASS_CATEGORY_DEVICE_INPUT
@ AV_CLASS_CATEGORY_DEVICE_INPUT
Definition: log.h:45
LavfiContext
Definition: lavfi.c:46
lavfi_class
static const AVClass lavfi_class
Definition: lavfi.c:489
options
static const AVOption options[]
Definition: lavfi.c:482
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:527
NULL
#define NULL
Definition: coverity.c:32
DEC
#define DEC
Definition: lavfi.c:480
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
OFFSET
#define OFFSET(x)
Definition: lavfi.c:478
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:117
AVFMT_NOFILE
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:464
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
lavfi_read_close
static av_cold int lavfi_read_close(AVFormatContext *avctx)
Definition: lavfi.c:83
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228