Go to the documentation of this file.
27 #define MAX_FRAMES 512
42 #define OFFSET(x) offsetof(RandomContext, x)
43 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
58 if (
s->random_seed < 0)
60 seed =
s->random_seed;
74 if (
s->nb_frames_filled <
s->nb_frames) {
75 s->frames[
s->nb_frames_filled] = in;
76 s->duration[
s->nb_frames_filled] = in->
duration;
77 s->pts[
s->nb_frames_filled++] = in->
pts;
85 out->duration =
s->duration[0];
86 memmove(&
s->pts[0], &
s->pts[1], (
s->nb_frames - 1) *
sizeof(
s->pts[0]));
87 memmove(&
s->duration[0], &
s->duration[1], (
s->nb_frames - 1) *
sizeof(
s->duration[0]));
89 s->pts[
s->nb_frames - 1] = in->
pts;
110 out->duration =
s->duration[
s->flush_idx];
111 out->pts =
s->pts[
s->flush_idx++];
113 s->frames[
s->nb_frames - 1] =
NULL;
124 for (
int i = 0;
i <
s->nb_frames;
i++)
148 .priv_class = &random_class,
int64_t duration[MAX_FRAMES]
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.
int64_t duration
Duration of the frame, in the same units as pts.
#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.
#define FILTER_INPUTS(array)
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.
@ AV_OPT_TYPE_INT64
Underlying C type is int64_t.
static const AVFilterPad random_inputs[]
#define FILTER_OUTPUTS(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.
@ AV_OPT_TYPE_INT
Underlying C type is int.
AVFrame * frames[MAX_FRAMES]