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

#define MAX_FRAMES   512

Definition at line 29 of file vf_random.c.

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

Definition at line 43 of file vf_random.c.

Definition at line 44 of file vf_random.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( random  )
static av_cold int init ( AVFilterContext ctx)
static

Definition at line 54 of file vf_random.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 67 of file vf_random.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 92 of file vf_random.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 116 of file vf_random.c.

Variable Documentation

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 }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_random.c:43
#define FLAGS
Definition: vf_random.c:44
#define MAX_FRAMES
Definition: vf_random.c:29

Definition at line 46 of file vf_random.c.

const AVFilterPad random_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_random.c:67

Definition at line 124 of file vf_random.c.

const AVFilterPad random_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *outlink)
Definition: vf_random.c:92

Definition at line 133 of file vf_random.c.

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,
}
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
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
static av_cold int init(AVFilterContext *ctx)
Definition: vf_random.c:54
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_random.c:116
static const AVFilterPad random_outputs[]
Definition: vf_random.c:133
static const AVFilterPad random_inputs[]
Definition: vf_random.c:124

Definition at line 142 of file vf_random.c.