Index: gstvideotestsrc.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst/videotestsrc/gstvideotestsrc.h,v
retrieving revision 1.34
diff -u -r1.34 gstvideotestsrc.h
--- gstvideotestsrc.h	4 Apr 2007 02:45:03 -0000	1.34
+++ gstvideotestsrc.h	28 Nov 2007 08:17:05 -0000
@@ -100,6 +100,9 @@
   gint64 n_frames;                      /* total frames sent */
 
   void (*make_image) (GstVideoTestSrc *v, unsigned char *dest, int w, int h);
+  
+  guint8 *unicolor_buffer;
+  guint unicolor_buffer_size;
 };
 
 struct _GstVideoTestSrcClass {
Index: gstvideotestsrc.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst/videotestsrc/gstvideotestsrc.c,v
retrieving revision 1.110
diff -u -r1.110 gstvideotestsrc.c
--- gstvideotestsrc.c	17 May 2007 11:16:14 -0000	1.110
+++ gstvideotestsrc.c	28 Nov 2007 08:17:05 -0000
@@ -96,6 +96,8 @@
     GstBuffer ** buffer);
 static gboolean gst_video_test_src_start (GstBaseSrc * basesrc);
 
+static void gst_video_test_src_finalize(GObject *object);
+
 #define GST_TYPE_VIDEO_TEST_SRC_PATTERN (gst_video_test_src_pattern_get_type ())
 static GType
 gst_video_test_src_pattern_get_type (void)
@@ -163,6 +165,8 @@
       g_param_spec_boolean ("is-live", "Is Live",
           "Whether to act as a live source", FALSE, G_PARAM_READWRITE));
 
+  gobject_class->finalize = gst_video_test_src_finalize;
+
   gstbasesrc_class->get_caps = gst_video_test_src_getcaps;
   gstbasesrc_class->set_caps = gst_video_test_src_setcaps;
   gstbasesrc_class->is_seekable = gst_video_test_src_is_seekable;
@@ -184,6 +188,10 @@
   gst_video_test_src_set_pattern (src, GST_VIDEO_TEST_SRC_SMPTE);
 
   src->timestamp_offset = 0;
+  
+  GST_DEBUG_OBJECT (src, "setting unicolor_buffer to NULL");
+  src->unicolor_buffer = NULL;
+  src->unicolor_buffer_size = 0;
 
   /* we operate in time */
   gst_base_src_set_format (GST_BASE_SRC (src), GST_FORMAT_TIME);
@@ -191,6 +199,23 @@
 }
 
 static void
+gst_video_test_src_finalize(GObject *object)
+{
+	GstVideoTestSrc * src;
+	
+	src = GST_VIDEO_TEST_SRC (object);
+	
+	if (src->unicolor_buffer) {
+		GST_DEBUG_OBJECT (src, "deleting unicolor_buffer ");
+		g_free(src->unicolor_buffer);
+		src->unicolor_buffer_size = 0;
+		src->unicolor_buffer = NULL;
+	}	
+	GST_DEBUG_OBJECT (src, "finalizing parent class");
+	G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
 gst_video_test_src_src_fixate (GstPad * pad, GstCaps * caps)
 {
   GstStructure *structure;
Index: videotestsrc.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst/videotestsrc/videotestsrc.c,v
retrieving revision 1.39
diff -u -r1.39 videotestsrc.c
--- videotestsrc.c	1 Nov 2007 12:51:57 -0000	1.39
+++ videotestsrc.c	28 Nov 2007 08:17:06 -0000
@@ -737,9 +737,26 @@
 
   p->color = color;
 
-  for (i = 0; i < h; i++) {
-    p->paint_hline (p, 0, i, w);
-  }
+  if (v->unicolor_buffer == NULL || (v->unicolor_buffer_size != ((guint) (p->endptr - p->yp)))) {
+  	if (v->unicolor_buffer != NULL) {
+		g_free(v->unicolor_buffer);
+		v->unicolor_buffer = NULL;
+		v->unicolor_buffer_size = 0;
+	}
+	
+	if (p->up && p->vp) {	
+	  	v->unicolor_buffer = g_malloc((guint)(p->endptr - p->yp));
+		v->unicolor_buffer_size = (guint)(p->endptr - p->yp);
+		for (i = 0; i < h; i++) {
+		   p->paint_hline (p, 0, i, w);
+		}
+		memcpy(v->unicolor_buffer, dest, (guint)(p->endptr - p->yp));
+	}	
+	return;
+  }
+  
+  memcpy(dest, v->unicolor_buffer, (guint)(p->endptr - p->yp));
+  
 }
 
 void
