Go to the documentation of this file.
29 #define MAX_FRAMES 512
43 #define OFFSET(x) offsetof(RandomContext, x)
44 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
59 if (
s->random_seed < 0)
61 seed =
s->random_seed;
75 if (
s->nb_frames_filled <
s->nb_frames) {
76 s->frames[
s->nb_frames_filled] = in;
77 s->pts[
s->nb_frames_filled++] = in->
pts;
85 memmove(&
s->pts[0], &
s->pts[1], (
s->nb_frames - 1) *
sizeof(
s->pts[0]));
87 s->pts[
s->nb_frames - 1] = in->
pts;
107 out->pts =
s->pts[
s->flush_idx++];
109 s->frames[
s->nb_frames - 1] =
NULL;
120 for (
int i = 0;
i <
s->nb_frames;
i++)
144 .priv_class = &random_class,
static av_cold int init(AVFilterContext *ctx)
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
#define AVERROR_EOF
End of file.
static int request_frame(AVFilterLink *outlink)
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad random_outputs[]
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
const char * name
Filter name.
A link between two filters.
const AVFilter ff_vf_random
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
A filter pad used for either input or output.
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
static const AVFilterPad random_inputs[]
#define FILTER_INPUTS(array)
Describe the class of an AVClass context structure.
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Context structure for the Lagged Fibonacci PRNG.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
AVFilterContext * src
source filter
#define i(width, name, range_min, range_max)
static const AVOption random_options[]
AVFILTER_DEFINE_CLASS(random)
const char * name
Pad name.
#define FILTER_OUTPUTS(array)
AVFrame * frames[MAX_FRAMES]