implement setting pattern on video background sources
authorBrandon Lewis <brandon@collabora.co.uk>
Fri, 11 Jun 2010 13:14:40 +0000 (15:14 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Fri, 9 Jul 2010 11:21:07 +0000 (13:21 +0200)
ges/ges-track-video-background-source.c
ges/ges-track-video-background-source.h

index fdc2ed36b86bfb78ce2ea3095b6b1565893cfa63..5e20e2100e6f0b08d84b7bd2adf76b4dbf9a205b 100644 (file)
@@ -68,6 +68,7 @@ ges_track_vbg_src_class_init (GESTrackVideoBackgroundSourceClass * klass)
 static void
 ges_track_vbg_src_init (GESTrackVideoBackgroundSource * self)
 {
+  self->pattern = GES_TRACK_VIDEO_BG_SRC_BLACK;
 }
 
 static void
@@ -105,7 +106,14 @@ ges_track_vbg_src_set_property (GObject * object,
 static GstElement *
 ges_track_vbg_src_create_element (GESTrackBackgroundSource * self)
 {
-  return gst_element_factory_make ("videotestsrc", NULL);
+  GstElement *ret;
+  gint pattern;
+
+  pattern = ((GESTrackVideoBackgroundSource *) self)->pattern;
+
+  ret = gst_element_factory_make ("videotestsrc", NULL);
+  g_object_set (ret, "pattern", (gint) pattern, NULL);
+  return ret;
 }
 
 void
@@ -114,6 +122,7 @@ ges_track_video_background_source_set_pattern (GESTrackVideoBackgroundSource
 {
   GstElement *element;
   element = GES_TRACK_BACKGROUND_SOURCE (self)->element;
+  self->pattern = pattern;
   if (element)
     g_object_set (element, "pattern", (gint) pattern, NULL);
 }
index 25821b81c9557a8188489b49ab6377cad95ac848..5d2f759144e0224f1e07f7968eb8250fa1bd4c20 100644 (file)
@@ -72,7 +72,8 @@ typedef enum {
 struct _GESTrackVideoBackgroundSource {
   GESTrackBackgroundSource parent;
 
-  /*< public >*/
+  /*< private >*/
+  GESTrackVideoBgSrcPattern pattern;
 };
 
 /**