From: Brandon Lewis Date: Wed, 30 Jun 2010 13:40:31 +0000 (+0200) Subject: move create_element virtual method up to TimelineSource class X-Git-Tag: 1.19.3~493^2~2830 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71df7618e06a51e2bf6b0cb9d14b2e1e5db74bed;p=platform%2Fupstream%2Fgstreamer.git move create_element virtual method up to TimelineSource class --- diff --git a/ges/ges-track-source.c b/ges/ges-track-source.c index dcc50f8..7418c75 100644 --- a/ges/ges-track-source.c +++ b/ges/ges-track-source.c @@ -64,7 +64,29 @@ ges_track_source_finalize (GObject * object) static gboolean ges_track_source_create_gnl_object (GESTrackObject * object) { - object->gnlobject = gst_element_factory_make ("gnlsource", NULL); + GESTrackSourceClass *klass = NULL; + GESTrackSource *self = NULL; + GstElement *child = NULL; + GstElement *gnlobject; + + self = GES_TRACK_SOURCE (object); + klass = GES_TRACK_SOURCE_GET_CLASS (self); + + gnlobject = gst_element_factory_make ("gnlsource", NULL); + + if (klass->create_element) { + child = klass->create_element (self); + + if (G_UNLIKELY (!child)) { + GST_ERROR ("create_element returned NULL"); + return TRUE; + } + + gst_bin_add (GST_BIN (gnlobject), child); + self->element = child; + } + + object->gnlobject = gnlobject; return TRUE; } @@ -81,6 +103,7 @@ ges_track_source_class_init (GESTrackSourceClass * klass) object_class->finalize = ges_track_source_finalize; track_class->create_gnl_object = ges_track_source_create_gnl_object; + klass->create_element = NULL; } static void diff --git a/ges/ges-track-source.h b/ges/ges-track-source.h index 89b164e..b02802c 100644 --- a/ges/ges-track-source.h +++ b/ges/ges-track-source.h @@ -22,6 +22,7 @@ #define _GES_TRACK_SOURCE #include +#include #include #include @@ -53,8 +54,9 @@ G_BEGIN_DECLS */ struct _GESTrackSource { - /* */ GESTrackObject parent; + GstElement *element; + /* */ }; /** @@ -67,6 +69,7 @@ struct _GESTrackSource { struct _GESTrackSourceClass { GESTrackObjectClass parent_class; + GstElement *(*create_element) (GESTrackSource *); }; GType ges_track_source_get_type (void);