{GST_VIDEO_TEST_SRC_PINWHEEL, "Pinwheel", "pinwheel"},
{GST_VIDEO_TEST_SRC_SPOKES, "Spokes", "spokes"},
{GST_VIDEO_TEST_SRC_GRADIENT, "Gradient", "gradient"},
+ {GST_VIDEO_TEST_SRC_COLORS, "Colors", "colors"},
{0, NULL, NULL}
};
case GST_VIDEO_TEST_SRC_GRADIENT:
videotestsrc->make_image = gst_video_test_src_gradient;
break;
+ case GST_VIDEO_TEST_SRC_COLORS:
+ videotestsrc->make_image = gst_video_test_src_colors;
+ break;
default:
g_assert_not_reached ();
}
* @GST_VIDEO_TEST_SRC_BAR: Bar with foreground color
* @GST_VIDEO_TEST_SRC_PINWHEEL: Pinwheel
* @GST_VIDEO_TEST_SRC_SPOKES: Spokes
+ * @GST_VIDEO_TEST_SRC_GRADIENT: Gradient
+ * @GST_VIDEO_TEST_SRC_COLORS: All colors
*
* The test pattern to produce.
*
GST_VIDEO_TEST_SRC_BAR,
GST_VIDEO_TEST_SRC_PINWHEEL,
GST_VIDEO_TEST_SRC_SPOKES,
- GST_VIDEO_TEST_SRC_GRADIENT
+ GST_VIDEO_TEST_SRC_GRADIENT,
+ GST_VIDEO_TEST_SRC_COLORS
} GstVideoTestSrcPattern;
typedef struct _GstVideoTestSrc GstVideoTestSrc;
videotestsrc_convert_tmpline (p, frame, j);
}
}
+
+void
+gst_video_test_src_colors (GstVideoTestSrc * v, GstVideoFrame * frame)
+{
+ int i;
+ int j;
+ paintinfo pi = PAINT_INFO_INIT;
+ paintinfo *p = π
+ struct vts_color_struct color;
+ int w = frame->info.width, h = frame->info.height;
+
+ videotestsrc_setup_paintinfo (v, p, w, h);
+
+ color = p->colors[COLOR_BLACK];
+ p->color = &color;
+
+ for (j = 0; j < h; j++) {
+ for (i = 0; i < w; i++) {
+ p->tmpline[i * 4 + 0] = 0xff;
+ p->tmpline[i * 4 + 1] = ((i * 4096) / w) % 256;
+ p->tmpline[i * 4 + 2] = (((j * 16) / h) << 4) | ((i * 16) / w);
+ p->tmpline[i * 4 + 3] = ((j * 4096) / h) % 256;
+ }
+ videotestsrc_convert_tmpline (p, frame, j);
+ }
+}
void gst_video_test_src_pinwheel (GstVideoTestSrc * v, GstVideoFrame * frame);
void gst_video_test_src_spokes (GstVideoTestSrc * v, GstVideoFrame * frame);
void gst_video_test_src_gradient (GstVideoTestSrc * v, GstVideoFrame * frame);
+void gst_video_test_src_colors (GstVideoTestSrc * v, GstVideoFrame * frame);
#endif