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++)
147 .p.priv_class = &random_class,
static int request_frame(AVFilterLink *outlink)
const FFFilter ff_vf_random
static AVFormatContext * ctx
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
Main libavfilter public API header.
#define i(width, name, range_min, range_max)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
int(* init)(AVBSFContext *ctx)
@ AV_OPT_TYPE_INT64
Underlying C type is int64_t.
@ AV_OPT_TYPE_INT
Underlying C type is int.
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
#define AVERROR_EOF
End of file.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
static av_cold void uninit(AVBitStreamFilterContext *ctx)
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define AVFILTER_DEFINE_CLASS(fname)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * src
source filter
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
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).
int64_t duration
Duration of the frame, in the same units as pts.
Context structure for the Lagged Fibonacci PRNG.
int64_t duration[MAX_FRAMES]
AVFrame * frames[MAX_FRAMES]
static const AVFilterPad random_inputs[]
static int request_frame(AVFilterLink *outlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static const AVOption random_options[]
static const AVFilterPad random_outputs[]
static av_cold void uninit(AVFilterContext *ctx)