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 "formats.h"
#include "internal.h"
#include "video.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 29 of file vf_random.c.

◆ OFFSET

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

Definition at line 44 of file vf_random.c.

◆ FLAGS

Definition at line 45 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 55 of file vf_random.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 68 of file vf_random.c.

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 97 of file vf_random.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 122 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 47 of file vf_random.c.

◆ random_inputs

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

Definition at line 130 of file vf_random.c.

◆ random_outputs

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

Definition at line 138 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 146 of file vf_random.c.

init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_random.c:55
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: vf_random.c:97
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_random.c:122
random_outputs
static const AVFilterPad random_outputs[]
Definition: vf_random.c:138
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:226
random_inputs
static const AVFilterPad random_inputs[]
Definition: vf_random.c:130
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:194
NULL
#define NULL
Definition: coverity.c:32
RandomContext
Definition: vf_random.c:31
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_random.c:68
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:115
OFFSET
#define OFFSET(x)
Definition: vf_random.c:44
FLAGS
#define FLAGS
Definition: vf_random.c:45
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
MAX_FRAMES
#define MAX_FRAMES
Definition: vf_random.c:29
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:195