GES: Switch to new fast pad linking

This commit is contained in:
Edward Hervey 2010-07-14 13:29:23 +02:00
parent e3dc2d58a0
commit b158c59202
4 changed files with 23 additions and 12 deletions

View file

@ -367,7 +367,7 @@ pad_added_cb (GstElement * timeline, GstPad * pad, GESTimelinePipeline * self)
/* Linking pad to tee */
sinkpad = gst_element_get_static_pad (chain->tee, "sink");
gst_pad_link (pad, sinkpad);
gst_pad_link_full (pad, sinkpad, GST_PAD_LINK_CHECK_NOTHING);
gst_object_unref (sinkpad);
/* Connect playsink */
@ -401,7 +401,8 @@ pad_added_cb (GstElement * timeline, GstPad * pad, GESTimelinePipeline * self)
}
tmppad = gst_element_get_request_pad (chain->tee, "src%d");
if (G_UNLIKELY (gst_pad_link (tmppad, sinkpad) != GST_PAD_LINK_OK)) {
if (G_UNLIKELY (gst_pad_link_full (tmppad, sinkpad,
GST_PAD_LINK_CHECK_NOTHING) != GST_PAD_LINK_OK)) {
GST_ERROR_OBJECT (self, "Couldn't link track pad to playsink");
gst_object_unref (tmppad);
goto error;
@ -441,8 +442,9 @@ pad_added_cb (GstElement * timeline, GstPad * pad, GESTimelinePipeline * self)
}
tmppad = gst_element_get_request_pad (chain->tee, "src%d");
if (G_UNLIKELY (gst_pad_link (tmppad,
chain->encodebinpad) != GST_PAD_LINK_OK)) {
if (G_UNLIKELY (gst_pad_link_full (tmppad,
chain->encodebinpad,
GST_PAD_LINK_CHECK_NOTHING) != GST_PAD_LINK_OK)) {
GST_WARNING_OBJECT (self, "Couldn't link track pad to playsink");
goto error;
}
@ -674,7 +676,8 @@ ges_timeline_pipeline_set_mode (GESTimelinePipeline * pipeline,
GST_ERROR_OBJECT (pipeline, "Couldn't add URI sink");
return FALSE;
}
gst_element_link (pipeline->encodebin, pipeline->urisink);
gst_element_link_pads_full (pipeline->encodebin, "src", pipeline->urisink,
"sink", GST_PAD_LINK_CHECK_NOTHING);
}
/* FIXUPS */

View file

@ -36,6 +36,8 @@ enum
};
#define fast_element_link(a,b) gst_element_link_pads_full((a),"src",(b),"sink",GST_PAD_LINK_CHECK_NOTHING)
static void
ges_track_audio_transition_duration_changed (GESTrackObject * self, guint64);
@ -143,7 +145,10 @@ link_element_to_mixer_with_volume (GstBin * bin, GstElement * element,
GstElement *volume = gst_element_factory_make ("volume", NULL);
gst_bin_add (bin, volume);
gst_element_link_many (element, volume, mixer, NULL);
if (!fast_element_link (element, volume) ||
!gst_element_link_pads_full (volume, "src", mixer, "sink%d",
GST_PAD_LINK_CHECK_NOTHING))
GST_ERROR_OBJECT (bin, "Error linking volume to mixer");
return G_OBJECT (volume);
}
@ -180,7 +185,7 @@ ges_track_audio_transition_create_element (GESTrackTransition * object)
g_assert (atarget && btarget);
gst_element_link (mixer, oconv);
fast_element_link (mixer, oconv);
sinka_target = gst_element_get_static_pad (iconva, "sink");
sinkb_target = gst_element_get_static_pad (iconvb, "sink");

View file

@ -152,7 +152,8 @@ ges_track_title_src_create_element (GESTrackSource * object)
gst_bin_add_many (GST_BIN (topbin), background, text, NULL);
gst_element_link (background, text);
gst_element_link_pads_full (background, "src", text, "sink",
GST_PAD_LINK_CHECK_NOTHING);
src = gst_ghost_pad_new ("src", gst_element_get_static_pad (text, "src"));
gst_element_add_pad (topbin, src);

View file

@ -36,6 +36,8 @@ enum
PROP_0,
};
#define fast_element_link(a,b) gst_element_link_pads_full((a),"src",(b),"sink",GST_PAD_LINK_CHECK_NOTHING)
static GObject *link_element_to_mixer (GstElement * element,
GstElement * mixer);
@ -205,7 +207,7 @@ ges_track_video_transition_create_element (GESTrackTransition * object)
self->mixer = gst_object_ref (mixer);
gst_element_link (mixer, oconv);
fast_element_link (mixer, oconv);
sinka_target = gst_element_get_static_pad (iconva, "sink");
sinkb_target = gst_element_get_static_pad (iconvb, "sink");
@ -247,7 +249,7 @@ link_element_to_mixer (GstElement * element, GstElement * mixer)
GstPad *sinkpad = gst_element_get_request_pad (mixer, "sink_%d");
GstPad *srcpad = gst_element_get_static_pad (element, "src");
gst_pad_link (srcpad, sinkpad);
gst_pad_link_full (srcpad, sinkpad, GST_PAD_LINK_CHECK_NOTHING);
gst_object_unref (srcpad);
return G_OBJECT (sinkpad);
@ -264,7 +266,7 @@ link_element_to_mixer_with_smpte (GstBin * bin, GstElement * element,
"type", (gint) type, "invert", (gboolean) TRUE, NULL);
gst_bin_add (bin, smptealpha);
gst_element_link (element, smptealpha);
fast_element_link (element, smptealpha);
/* crack */
if (smpteref) {
@ -273,7 +275,7 @@ link_element_to_mixer_with_smpte (GstBin * bin, GstElement * element,
srcpad = gst_element_get_static_pad (smptealpha, "src");
sinkpad = gst_element_get_request_pad (mixer, "sink_%d");
gst_pad_link (srcpad, sinkpad);
gst_pad_link_full (srcpad, sinkpad, GST_PAD_LINK_CHECK_NOTHING);
gst_object_unref (srcpad);
return G_OBJECT (sinkpad);