/* only used by rgbtest */
uint8_t rgba_map[4];
+ int complement;
int depth;
/* only used by haldclut */
{ NULL }
};
-AVFilter ff_vsrc_color = {
+const AVFilter ff_vsrc_color = {
.name = "color",
.description = NULL_IF_CONFIG_SMALL("Provide an uniformly colored input."),
.priv_class = &color_class,
{ NULL }
};
-AVFilter ff_vsrc_haldclutsrc = {
+const AVFilter ff_vsrc_haldclutsrc = {
.name = "haldclutsrc",
.description = NULL_IF_CONFIG_SMALL("Provide an identity Hald CLUT."),
.priv_class = &haldclutsrc_class,
{ NULL },
};
-AVFilter ff_vsrc_nullsrc = {
+const AVFilter ff_vsrc_nullsrc = {
.name = "nullsrc",
.description = NULL_IF_CONFIG_SMALL("Null video source, return unprocessed video frames."),
.init = nullsrc_init,
{ NULL }
};
-AVFilter ff_vsrc_testsrc = {
+const AVFilter ff_vsrc_testsrc = {
.name = "testsrc",
.description = NULL_IF_CONFIG_SMALL("Generate test pattern."),
.priv_size = sizeof(TestSourceContext),
{ NULL }
};
-AVFilter ff_vsrc_testsrc2 = {
+const AVFilter ff_vsrc_testsrc2 = {
.name = "testsrc2",
.description = NULL_IF_CONFIG_SMALL("Generate another test pattern."),
.priv_size = sizeof(TestSourceContext),
#if CONFIG_RGBTESTSRC_FILTER
-#define rgbtestsrc_options options
+static const AVOption rgbtestsrc_options[] = {
+ COMMON_OPTIONS
+ { "complement", "set complement colors", OFFSET(complement), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
+ { "co", "set complement colors", OFFSET(complement), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
+ { NULL }
+};
+
AVFILTER_DEFINE_CLASS(rgbtestsrc);
#define R 0
p[0] = b;
p = dstp[2] + x + y * dst_linesizep[2];
p[0] = r;
+ break;
case AV_PIX_FMT_GBRP9:
case AV_PIX_FMT_GBRP10:
case AV_PIX_FMT_GBRP12:
}
}
+static void rgbtest_fill_picture_complement(AVFilterContext *ctx, AVFrame *frame)
+{
+ TestSourceContext *test = ctx->priv;
+ int x, y, w = frame->width, h = frame->height;
+
+ for (y = 0; y < h; y++) {
+ for (x = 0; x < w; x++) {
+ int c = (1 << FFMAX(test->depth, 8))*x/w;
+ int r = 0, g = 0, b = 0;
+
+ if (6*y < h ) r = c;
+ else if (6*y < 2*h) g = c, b = c;
+ else if (6*y < 3*h) g = c;
+ else if (6*y < 4*h) r = c, b = c;
+ else if (6*y < 5*h) b = c;
+ else r = c, g = c;
+
+ rgbtest_put_pixel(frame->data, frame->linesize, x, y, r, g, b,
+ ctx->outputs[0]->format, test->rgba_map);
+ }
+ }
+}
+
static void rgbtest_fill_picture(AVFilterContext *ctx, AVFrame *frame)
{
TestSourceContext *test = ctx->priv;
TestSourceContext *test = ctx->priv;
test->draw_once = 1;
- test->fill_picture_fn = rgbtest_fill_picture;
+ test->fill_picture_fn = test->complement ? rgbtest_fill_picture_complement : rgbtest_fill_picture;
return init(ctx);
}
{ NULL }
};
-AVFilter ff_vsrc_rgbtestsrc = {
+const AVFilter ff_vsrc_rgbtestsrc = {
.name = "rgbtestsrc",
.description = NULL_IF_CONFIG_SMALL("Generate RGB test pattern."),
.priv_size = sizeof(TestSourceContext),
{ NULL }
};
-AVFilter ff_vsrc_yuvtestsrc = {
+const AVFilter ff_vsrc_yuvtestsrc = {
.name = "yuvtestsrc",
.description = NULL_IF_CONFIG_SMALL("Generate YUV test pattern."),
.priv_size = sizeof(TestSourceContext),
return init(ctx);
}
-AVFilter ff_vsrc_pal75bars = {
+const AVFilter ff_vsrc_pal75bars = {
.name = "pal75bars",
.description = NULL_IF_CONFIG_SMALL("Generate PAL 75% color bars."),
.priv_size = sizeof(TestSourceContext),
return init(ctx);
}
-AVFilter ff_vsrc_pal100bars = {
+const AVFilter ff_vsrc_pal100bars = {
.name = "pal100bars",
.description = NULL_IF_CONFIG_SMALL("Generate PAL 100% color bars."),
.priv_size = sizeof(TestSourceContext),
return init(ctx);
}
-AVFilter ff_vsrc_smptebars = {
+const AVFilter ff_vsrc_smptebars = {
.name = "smptebars",
.description = NULL_IF_CONFIG_SMALL("Generate SMPTE color bars."),
.priv_size = sizeof(TestSourceContext),
return init(ctx);
}
-AVFilter ff_vsrc_smptehdbars = {
+const AVFilter ff_vsrc_smptehdbars = {
.name = "smptehdbars",
.description = NULL_IF_CONFIG_SMALL("Generate SMPTE HD color bars."),
.priv_size = sizeof(TestSourceContext),
{ NULL }
};
-AVFilter ff_vsrc_allyuv = {
+const AVFilter ff_vsrc_allyuv = {
.name = "allyuv",
.description = NULL_IF_CONFIG_SMALL("Generate all yuv colors."),
.priv_size = sizeof(TestSourceContext),
{ NULL }
};
-AVFilter ff_vsrc_allrgb = {
+const AVFilter ff_vsrc_allrgb = {
.name = "allrgb",
.description = NULL_IF_CONFIG_SMALL("Generate all RGB colors."),
.priv_size = sizeof(TestSourceContext),