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;
}
object_class->finalize = ges_track_source_finalize;
track_class->create_gnl_object = ges_track_source_create_gnl_object;
+ klass->create_element = NULL;
}
static void
#define _GES_TRACK_SOURCE
#include <glib-object.h>
+#include <gst/gst.h>
#include <ges/ges-types.h>
#include <ges/ges-track-object.h>
*/
struct _GESTrackSource {
- /* <public> */
GESTrackObject parent;
+ GstElement *element;
+ /* <public> */
};
/**
struct _GESTrackSourceClass {
GESTrackObjectClass parent_class;
+ GstElement *(*create_element) (GESTrackSource *);
};
GType ges_track_source_get_type (void);