From 650d9ae594acfcf5bab0cdf8de0477f9dc563fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 1 Sep 2006 16:12:35 +0000 Subject: [PATCH] gst/videotestsrc/: Add more uni-colour patterns ("white", "red", "green", and "blue"). Original commit message from CVS: * gst/videotestsrc/gstvideotestsrc.c: (gst_video_test_src_pattern_get_type), (gst_video_test_src_set_pattern): * gst/videotestsrc/gstvideotestsrc.h: * gst/videotestsrc/videotestsrc.c: (gst_video_test_src_unicolor), (gst_video_test_src_black), (gst_video_test_src_white), (gst_video_test_src_red), (gst_video_test_src_green), (gst_video_test_src_blue): * gst/videotestsrc/videotestsrc.h: Add more uni-colour patterns ("white", "red", "green", and "blue"). --- ChangeLog | 13 ++++++++++ gst/videotestsrc/gstvideotestsrc.c | 18 +++++++++++++- gst/videotestsrc/gstvideotestsrc.h | 8 +++++++ gst/videotestsrc/videotestsrc.c | 38 ++++++++++++++++++++++++++---- gst/videotestsrc/videotestsrc.h | 12 ++++++++-- 5 files changed, 82 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 704243f374..142432a4b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2006-09-01 Tim-Philipp Müller + + * gst/videotestsrc/gstvideotestsrc.c: + (gst_video_test_src_pattern_get_type), + (gst_video_test_src_set_pattern): + * gst/videotestsrc/gstvideotestsrc.h: + * gst/videotestsrc/videotestsrc.c: (gst_video_test_src_unicolor), + (gst_video_test_src_black), (gst_video_test_src_white), + (gst_video_test_src_red), (gst_video_test_src_green), + (gst_video_test_src_blue): + * gst/videotestsrc/videotestsrc.h: + Add more uni-colour patterns ("white", "red", "green", and "blue"). + 2006-09-01 Tim-Philipp Müller * gst/videotestsrc/videotestsrc.c: (paint_setup_YVYU): diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index f4796e693c..b5d58988b5 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -105,7 +105,11 @@ gst_video_test_src_pattern_get_type (void) {GST_VIDEO_TEST_SRC_SMPTE, "SMPTE 100% color bars", "smpte"}, {GST_VIDEO_TEST_SRC_SNOW, "Random (television snow)", "snow"}, {GST_VIDEO_TEST_SRC_BLACK, "100% Black", "black"}, - {0, NULL, NULL}, + {GST_VIDEO_TEST_SRC_WHITE, "100% White", "white"}, + {GST_VIDEO_TEST_SRC_RED, "Red", "red"}, + {GST_VIDEO_TEST_SRC_GREEN, "Green", "green"}, + {GST_VIDEO_TEST_SRC_BLUE, "Blue", "blue"}, + {0, NULL, NULL} }; if (!video_test_src_pattern_type) { @@ -211,6 +215,18 @@ gst_video_test_src_set_pattern (GstVideoTestSrc * videotestsrc, case GST_VIDEO_TEST_SRC_BLACK: videotestsrc->make_image = gst_video_test_src_black; break; + case GST_VIDEO_TEST_SRC_WHITE: + videotestsrc->make_image = gst_video_test_src_white; + break; + case GST_VIDEO_TEST_SRC_RED: + videotestsrc->make_image = gst_video_test_src_red; + break; + case GST_VIDEO_TEST_SRC_GREEN: + videotestsrc->make_image = gst_video_test_src_green; + break; + case GST_VIDEO_TEST_SRC_BLUE: + videotestsrc->make_image = gst_video_test_src_blue; + break; default: g_assert_not_reached (); } diff --git a/gst/videotestsrc/gstvideotestsrc.h b/gst/videotestsrc/gstvideotestsrc.h index 764288eec2..9d108024b5 100644 --- a/gst/videotestsrc/gstvideotestsrc.h +++ b/gst/videotestsrc/gstvideotestsrc.h @@ -42,6 +42,10 @@ G_BEGIN_DECLS * @GST_VIDEO_TEST_SRC_SMPTE: A standard SMPTE test pattern * @GST_VIDEO_TEST_SRC_SNOW: Random noise * @GST_VIDEO_TEST_SRC_BLACK: A black image + * @GST_VIDEO_TEST_SRC_WHITE: A white image + * @GST_VIDEO_TEST_SRC_RED: A red image + * @GST_VIDEO_TEST_SRC_GREEN: A green image + * @GST_VIDEO_TEST_SRC_BLUE: A blue image * * The test pattern to produce. */ @@ -49,6 +53,10 @@ typedef enum { GST_VIDEO_TEST_SRC_SMPTE, GST_VIDEO_TEST_SRC_SNOW, GST_VIDEO_TEST_SRC_BLACK, + GST_VIDEO_TEST_SRC_WHITE, + GST_VIDEO_TEST_SRC_RED, + GST_VIDEO_TEST_SRC_GREEN, + GST_VIDEO_TEST_SRC_BLUE } GstVideoTestSrcPattern; typedef struct _GstVideoTestSrc GstVideoTestSrc; diff --git a/gst/videotestsrc/videotestsrc.c b/gst/videotestsrc/videotestsrc.c index efc8a81375..7529749816 100644 --- a/gst/videotestsrc/videotestsrc.c +++ b/gst/videotestsrc/videotestsrc.c @@ -656,9 +656,9 @@ gst_video_test_src_snow (GstVideoTestSrc * v, unsigned char *dest, int w, int h) } } -void -gst_video_test_src_black (GstVideoTestSrc * v, unsigned char *dest, int w, - int h) +static void +gst_video_test_src_unicolor (GstVideoTestSrc * v, unsigned char *dest, int w, + int h, struct vts_color_struct *color) { int i; paintinfo pi; @@ -674,13 +674,43 @@ gst_video_test_src_black (GstVideoTestSrc * v, unsigned char *dest, int w, fourcc->paint_setup (p, dest); p->paint_hline = fourcc->paint_hline; - p->color = vts_colors + COLOR_BLACK; + p->color = color; for (i = 0; i < h; i++) { p->paint_hline (p, 0, i, w); } } +void +gst_video_test_src_black (GstVideoTestSrc * v, guchar * dest, int w, int h) +{ + gst_video_test_src_unicolor (v, dest, w, h, vts_colors + COLOR_BLACK); +} + +void +gst_video_test_src_white (GstVideoTestSrc * v, guchar * dest, int w, int h) +{ + gst_video_test_src_unicolor (v, dest, w, h, vts_colors + COLOR_WHITE); +} + +void +gst_video_test_src_red (GstVideoTestSrc * v, guchar * dest, int w, int h) +{ + gst_video_test_src_unicolor (v, dest, w, h, vts_colors + COLOR_RED); +} + +void +gst_video_test_src_green (GstVideoTestSrc * v, guchar * dest, int w, int h) +{ + gst_video_test_src_unicolor (v, dest, w, h, vts_colors + COLOR_GREEN); +} + +void +gst_video_test_src_blue (GstVideoTestSrc * v, guchar * dest, int w, int h) +{ + gst_video_test_src_unicolor (v, dest, w, h, vts_colors + COLOR_BLUE); +} + static void paint_setup_I420 (paintinfo * p, unsigned char *dest) { diff --git a/gst/videotestsrc/videotestsrc.h b/gst/videotestsrc/videotestsrc.h index e3059f8aba..f10e16f07b 100644 --- a/gst/videotestsrc/videotestsrc.h +++ b/gst/videotestsrc/videotestsrc.h @@ -67,11 +67,19 @@ struct fourcc_list_struct * GstStructure * paint_get_structure (struct fourcc_list_struct *format); int gst_video_test_src_get_size (GstVideoTestSrc * v, int w, int h); -void gst_video_test_src_smpte (GstVideoTestSrc * v, +void gst_video_test_src_smpte (GstVideoTestSrc * v, unsigned char *dest, int w, int h); void gst_video_test_src_snow (GstVideoTestSrc * v, unsigned char *dest, int w, int h); -void gst_video_test_src_black (GstVideoTestSrc * v, +void gst_video_test_src_black (GstVideoTestSrc * v, + unsigned char *dest, int w, int h); +void gst_video_test_src_white (GstVideoTestSrc * v, + unsigned char *dest, int w, int h); +void gst_video_test_src_red (GstVideoTestSrc * v, + unsigned char *dest, int w, int h); +void gst_video_test_src_green (GstVideoTestSrc * v, + unsigned char *dest, int w, int h); +void gst_video_test_src_blue (GstVideoTestSrc * v, unsigned char *dest, int w, int h); extern struct fourcc_list_struct fourcc_list[];