keep track of and release request pads for smpte also

This commit is contained in:
Brandon Lewis 2010-06-28 18:23:37 +02:00 committed by Edward Hervey
parent 0d4ff040d2
commit 560956ed24

View file

@ -181,10 +181,13 @@ ges_track_video_transition_create_element (GESTrackTransition * object)
gst_bin_add (GST_BIN (topbin), mixer); gst_bin_add (GST_BIN (topbin), mixer);
if (self->type != VTYPE_CROSSFADE) { if (self->type != VTYPE_CROSSFADE) {
link_element_to_mixer_with_smpte (GST_BIN (topbin), iconva, mixer, self->sinka =
self->type, NULL); (GstPad *) link_element_to_mixer_with_smpte (GST_BIN (topbin), iconva,
target = link_element_to_mixer_with_smpte (GST_BIN (topbin), iconvb, mixer, self->type, NULL);
self->sinkb =
(GstPad *) link_element_to_mixer_with_smpte (GST_BIN (topbin), iconvb,
mixer, self->type, &self->smpte); mixer, self->type, &self->smpte);
target = (GObject *) self->smpte;
propname = "position"; propname = "position";
self->start_value = 1.0; self->start_value = 1.0;
self->end_value = 0.0; self->end_value = 0.0;
@ -192,12 +195,13 @@ ges_track_video_transition_create_element (GESTrackTransition * object)
self->sinka = (GstPad *) link_element_to_mixer (iconva, mixer); self->sinka = (GstPad *) link_element_to_mixer (iconva, mixer);
self->sinkb = (GstPad *) link_element_to_mixer (iconvb, mixer); self->sinkb = (GstPad *) link_element_to_mixer (iconvb, mixer);
target = (GObject *) self->sinkb; target = (GObject *) self->sinkb;
self->mixer = gst_object_ref (mixer);
propname = "alpha"; propname = "alpha";
self->start_value = 0.0; self->start_value = 0.0;
self->end_value = 1.0; self->end_value = 1.0;
} }
self->mixer = gst_object_ref (mixer);
gst_element_link (mixer, oconv); gst_element_link (mixer, oconv);
sinka_target = gst_element_get_static_pad (iconva, "sink"); sinka_target = gst_element_get_static_pad (iconva, "sink");
@ -253,19 +257,26 @@ static GObject *
link_element_to_mixer_with_smpte (GstBin * bin, GstElement * element, link_element_to_mixer_with_smpte (GstBin * bin, GstElement * element,
GstElement * mixer, gint type, GstElement ** smpteref) GstElement * mixer, gint type, GstElement ** smpteref)
{ {
GstPad *srcpad, *sinkpad;
GstElement *smptealpha = gst_element_factory_make ("smptealpha", NULL); GstElement *smptealpha = gst_element_factory_make ("smptealpha", NULL);
g_object_set (G_OBJECT (smptealpha), g_object_set (G_OBJECT (smptealpha),
"type", (gint) type, "invert", (gboolean) TRUE, NULL); "type", (gint) type, "invert", (gboolean) TRUE, NULL);
gst_bin_add (bin, smptealpha); gst_bin_add (bin, smptealpha);
gst_element_link_many (element, smptealpha, mixer, NULL); gst_element_link (element, smptealpha);
/* crack */ /* crack */
if (smpteref) { if (smpteref) {
*smpteref = smptealpha; *smpteref = smptealpha;
} }
return G_OBJECT (smptealpha); srcpad = gst_element_get_static_pad (smptealpha, "src");
sinkpad = gst_element_get_request_pad (mixer, "sink_%d");
gst_pad_link (srcpad, sinkpad);
gst_object_unref (srcpad);
return G_OBJECT (sinkpad);
} }
static void static void