ges/ges-track-transition.c: factor out code which produces video bin into a

seprate routine
This commit is contained in:
Brandon Lewis 2010-05-28 02:31:42 +02:00 committed by Edward Hervey
parent 9de8dc2726
commit 280aef4f6e

View file

@ -136,22 +136,9 @@ link_element_to_mixer_with_smpte (GstBin * bin, GstElement * element,
return G_OBJECT (smptealpha);
}
static gboolean
ges_track_transition_create_gnl_object (GESTrackObject * object)
static GstElement *
create_video_bin (GESTrackTransition * self)
{
GESTrackTransition *self = GES_TRACK_TRANSITION (object);
static gint tnum = 0;
gchar *name = g_strdup_printf ("transition-operation%d", tnum++);
object->gnlobject = gst_element_factory_make ("gnloperation", name);
g_free (name);
g_object_set (object->gnlobject, "priority", 0, NULL);
g_signal_connect (G_OBJECT (object->gnlobject), "notify::duration",
G_CALLBACK (gnlobject_duration_cb), object);
if ((object->track->type) == GES_TRACK_TYPE_VIDEO) {
GstElement *topbin = gst_bin_new ("transition-bin");
GstElement *iconva = gst_element_factory_make ("ffmpegcolorspace",
"tr-csp-a");
@ -200,8 +187,6 @@ ges_track_transition_create_gnl_object (GESTrackObject * object)
gst_element_add_pad (topbin, sinka);
gst_element_add_pad (topbin, sinkb);
gst_bin_add (GST_BIN (object->gnlobject), topbin);
/* set up interpolation */
g_object_set (target, propname, (gfloat) 0.0, NULL);
@ -219,15 +204,36 @@ ges_track_transition_create_gnl_object (GESTrackObject * object)
self->control_source = control_source;
GST_LOG ("controller created, updating");
ges_track_transition_update_controller (self, object->gnlobject);
ges_track_transition_update_controller (self,
((GESTrackObject *) self)->gnlobject);
return topbin;
}
static gboolean
ges_track_transition_create_gnl_object (GESTrackObject * object)
{
GESTrackTransition *self = GES_TRACK_TRANSITION (object);
static gint tnum = 0;
gchar *name = g_strdup_printf ("transition-operation%d", tnum++);
object->gnlobject = gst_element_factory_make ("gnloperation", name);
g_free (name);
g_object_set (object->gnlobject, "priority", 0, NULL);
g_signal_connect (G_OBJECT (object->gnlobject), "notify::duration",
G_CALLBACK (gnlobject_duration_cb), object);
if ((object->track->type) == GES_TRACK_TYPE_VIDEO) {
gst_bin_add (GST_BIN (object->gnlobject), create_video_bin (self));
return TRUE;
}
return FALSE;
}
static void
ges_track_transition_class_init (GESTrackTransitionClass * klass)
{