implement setting pattern on video background sources

This commit is contained in:
Brandon Lewis 2010-06-11 15:14:40 +02:00 committed by Edward Hervey
parent 2a351841cc
commit 12437967ba
2 changed files with 12 additions and 2 deletions

View file

@ -68,6 +68,7 @@ ges_track_vbg_src_class_init (GESTrackVideoBackgroundSourceClass * klass)
static void static void
ges_track_vbg_src_init (GESTrackVideoBackgroundSource * self) ges_track_vbg_src_init (GESTrackVideoBackgroundSource * self)
{ {
self->pattern = GES_TRACK_VIDEO_BG_SRC_BLACK;
} }
static void static void
@ -105,7 +106,14 @@ ges_track_vbg_src_set_property (GObject * object,
static GstElement * static GstElement *
ges_track_vbg_src_create_element (GESTrackBackgroundSource * self) 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 void
@ -114,6 +122,7 @@ ges_track_video_background_source_set_pattern (GESTrackVideoBackgroundSource
{ {
GstElement *element; GstElement *element;
element = GES_TRACK_BACKGROUND_SOURCE (self)->element; element = GES_TRACK_BACKGROUND_SOURCE (self)->element;
self->pattern = pattern;
if (element) if (element)
g_object_set (element, "pattern", (gint) pattern, NULL); g_object_set (element, "pattern", (gint) pattern, NULL);
} }

View file

@ -72,7 +72,8 @@ typedef enum {
struct _GESTrackVideoBackgroundSource { struct _GESTrackVideoBackgroundSource {
GESTrackBackgroundSource parent; GESTrackBackgroundSource parent;
/*< public >*/ /*< private >*/
GESTrackVideoBgSrcPattern pattern;
}; };
/** /**