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 []
 
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 43 of file vf_random.c.

◆ FLAGS

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

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 67 of file vf_random.c.

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 92 of file vf_random.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

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

◆ random_inputs

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

Definition at line 124 of file vf_random.c.

◆ random_outputs

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

Definition at line 133 of file vf_random.c.

◆ ff_vf_random

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 142 of file vf_random.c.

init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_random.c:54
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: vf_random.c:92
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_random.c:116
random_outputs
static const AVFilterPad random_outputs[]
Definition: vf_random.c:133
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:224
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
random_inputs
static const AVFilterPad random_inputs[]
Definition: vf_random.c:124
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:67
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
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:188
OFFSET
#define OFFSET(x)
Definition: vf_random.c:43
FLAGS
#define FLAGS
Definition: vf_random.c:44
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
MAX_FRAMES
#define MAX_FRAMES
Definition: vf_random.c:29