#include "libavutil/xga_font_data.h"
#include "avfilter.h"
#include "drawutils.h"
+#include "filters.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
return 0;
}
-static int request_frame(AVFilterLink *outlink)
+static int activate(AVFilterContext *ctx)
{
- TestSourceContext *test = outlink->src->priv;
+ AVFilterLink *outlink = ctx->outputs[0];
+ TestSourceContext *test = ctx->priv;
AVFrame *frame;
+ if (!ff_outlink_frame_wanted(outlink))
+ return FFERROR_NOT_READY;
if (test->duration >= 0 &&
- av_rescale_q(test->pts, test->time_base, AV_TIME_BASE_Q) >= test->duration)
- return AVERROR_EOF;
+ av_rescale_q(test->pts, test->time_base, AV_TIME_BASE_Q) >= test->duration) {
+ ff_outlink_set_status(outlink, AVERROR_EOF, test->pts);
+ return 0;
+ }
if (test->draw_once) {
if (test->draw_once_reset) {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
.config_props = color_config_props,
},
{ NULL }
.priv_size = sizeof(TestSourceContext),
.init = color_init,
.uninit = uninit,
+ .activate = activate,
.query_formats = color_query_formats,
.inputs = NULL,
.outputs = color_outputs,
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
.config_props = haldclutsrc_config_props,
},
{ NULL }
.init = haldclutsrc_init,
.uninit = uninit,
.query_formats = haldclutsrc_query_formats,
+ .activate = activate,
.inputs = NULL,
.outputs = haldclutsrc_outputs,
};
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
.config_props = config_props,
},
{ NULL },
.description = NULL_IF_CONFIG_SMALL("Null video source, return unprocessed video frames."),
.init = nullsrc_init,
.uninit = uninit,
+ .activate = activate,
.priv_size = sizeof(TestSourceContext),
.priv_class = &nullsrc_class,
.inputs = NULL,
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
.config_props = config_props,
},
{ NULL }
.init = test_init,
.uninit = uninit,
.query_formats = test_query_formats,
+ .activate = activate,
.inputs = NULL,
.outputs = avfilter_vsrc_testsrc_outputs,
};
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
.config_props = test2_config_props,
},
{ NULL }
.init = test2_init,
.uninit = uninit,
.query_formats = test2_query_formats,
+ .activate = activate,
.inputs = NULL,
.outputs = avfilter_vsrc_testsrc2_outputs,
};
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
.config_props = rgbtest_config_props,
},
{ NULL }
.init = rgbtest_init,
.uninit = uninit,
.query_formats = rgbtest_query_formats,
+ .activate = activate,
.inputs = NULL,
.outputs = avfilter_vsrc_rgbtestsrc_outputs,
};
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
.config_props = yuvtest_config_props,
},
{ NULL }
.init = yuvtest_init,
.uninit = uninit,
.query_formats = yuvtest_query_formats,
+ .activate = activate,
.inputs = NULL,
.outputs = avfilter_vsrc_yuvtestsrc_outputs,
};
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
.config_props = config_props,
},
{ NULL }
.init = pal75bars_init,
.uninit = uninit,
.query_formats = smptebars_query_formats,
+ .activate = activate,
.inputs = NULL,
.outputs = smptebars_outputs,
};
.init = pal100bars_init,
.uninit = uninit,
.query_formats = smptebars_query_formats,
+ .activate = activate,
.inputs = NULL,
.outputs = smptebars_outputs,
};
.init = smptebars_init,
.uninit = uninit,
.query_formats = smptebars_query_formats,
+ .activate = activate,
.inputs = NULL,
.outputs = smptebars_outputs,
};
.init = smptehdbars_init,
.uninit = uninit,
.query_formats = smptebars_query_formats,
+ .activate = activate,
.inputs = NULL,
.outputs = smptebars_outputs,
};
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
.config_props = config_props,
},
{ NULL }
.init = allyuv_init,
.uninit = uninit,
.query_formats = allyuv_query_formats,
+ .activate = activate,
.inputs = NULL,
.outputs = avfilter_vsrc_allyuv_outputs,
};
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .request_frame = request_frame,
.config_props = allrgb_config_props,
},
{ NULL }
.init = allrgb_init,
.uninit = uninit,
.query_formats = allrgb_query_formats,
+ .activate = activate,
.inputs = NULL,
.outputs = avfilter_vsrc_allrgb_outputs,
};