FFmpeg
Data Structures | Macros | Functions | Variables
vf_random.c File Reference
#include "libavutil/lfg.h"
#include "libavutil/opt.h"
#include "libavutil/random_seed.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  RandomContext
 

Macros

#define MAX_FRAMES   512
 
#define OFFSET(x)   offsetof(RandomContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (random)
 
static av_cold int init (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int request_frame (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption random_options []
 
static const AVFilterPad random_inputs []
 
static const AVFilterPad random_outputs []
 
const AVFilter ff_vf_random
 

Macro Definition Documentation

◆ MAX_FRAMES

#define MAX_FRAMES   512

Definition at line 27 of file vf_random.c.

◆ OFFSET

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

Definition at line 42 of file vf_random.c.

◆ FLAGS

Definition at line 43 of file vf_random.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( random  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 53 of file vf_random.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 66 of file vf_random.c.

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 95 of file vf_random.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 120 of file vf_random.c.

Variable Documentation

◆ random_options

const AVOption random_options[]
static
Initial value:
= {
{ "frames", "set number of frames in cache", OFFSET(nb_frames), AV_OPT_TYPE_INT, {.i64=30}, 2, MAX_FRAMES, FLAGS },
{ "seed", "set the seed", OFFSET(random_seed), AV_OPT_TYPE_INT64, {.i64=-1}, -1, UINT32_MAX, FLAGS },
{ NULL }
}

Definition at line 45 of file vf_random.c.

◆ random_inputs

const AVFilterPad random_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
}

Definition at line 128 of file vf_random.c.

◆ random_outputs

const AVFilterPad random_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
},
}

Definition at line 136 of file vf_random.c.

◆ ff_vf_random

const AVFilter ff_vf_random
Initial value:
= {
.name = "random",
.description = NULL_IF_CONFIG_SMALL("Return random frames."),
.priv_size = sizeof(RandomContext),
.priv_class = &random_class,
.init = init,
}

Definition at line 144 of file vf_random.c.

init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_random.c:53
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: vf_random.c:95
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_random.c:120
random_outputs
static const AVFilterPad random_outputs[]
Definition: vf_random.c:136
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:236
random_inputs
static const AVFilterPad random_inputs[]
Definition: vf_random.c:128
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
RandomContext
Definition: vf_random.c:29
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_random.c:66
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
OFFSET
#define OFFSET(x)
Definition: vf_random.c:42
FLAGS
#define FLAGS
Definition: vf_random.c:43
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
MAX_FRAMES
#define MAX_FRAMES
Definition: vf_random.c:27
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183