[pitivi] factories: First round at making linking faster
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] factories: First round at making linking faster
- Date: Thu, 25 Nov 2010 09:39:29 +0000 (UTC)
commit 13d285d781849b43ed3d802d4b2aa8155a6fb60a
Author: Edward Hervey <bilboed bilboed com>
Date: Wed Nov 24 18:04:31 2010 +0100
factories: First round at making linking faster
https://bugzilla.gnome.org/show_bug.cgi?id=591427
pitivi/factories/base.py | 20 ++++++++++++--------
pitivi/factories/test.py | 8 +++++---
2 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/pitivi/factories/base.py b/pitivi/factories/base.py
index 1364b68..96d588a 100644
--- a/pitivi/factories/base.py
+++ b/pitivi/factories/base.py
@@ -313,7 +313,7 @@ class SourceFactory(ObjectFactory):
except:
dbin = gst.element_factory_make("decodebin")
bin.add(src, dbin)
- src.link(dbin)
+ src.link_pads_full("src", dbin, "sink", gst.PAD_LINK_CHECK_NOTHING)
dbin.connect("new-decoded-pad", self._binNewDecodedPadCb, bin)
dbin.connect("removed-decoded-pad", self._binRemovedDecodedPadCb, bin)
@@ -404,13 +404,13 @@ class SourceFactory(ObjectFactory):
for element in [topbin.aconv, topbin.ares, topbin.arate, topbin.volume]:
element.sync_state_with_parent()
- pad.link(topbin.aconv.get_pad("sink"))
+ pad.link_full(topbin.aconv.get_pad("sink"), gst.PAD_LINK_CHECK_NOTHING)
topbin.ghostpad = gst.GhostPad("src", topbin.volume.get_pad("src"))
elif hasattr(topbin, "alpha"):
for element in [topbin.queue, topbin.scale, topbin.csp, topbin.alpha, topbin.capsfilter]:
element.sync_state_with_parent()
- pad.link(topbin.queue.get_pad("sink"))
+ pad.link_full(topbin.queue.get_pad("sink"), gst.PAD_LINK_CHECK_NOTHING)
topbin.ghostpad = gst.GhostPad("src", topbin.capsfilter.get_pad("src"))
else:
topbin.ghostpad = gst.GhostPad("src", pad)
@@ -496,14 +496,16 @@ class SourceFactory(ObjectFactory):
video_bin.add(video_bin.queue, video_bin.scale, video_bin.csp,
video_bin.alpha, video_bin.capsfilter)
- gst.element_link_many(video_bin.queue, video_bin.csp, video_bin.scale)
+ video_bin.queue.link_pads_full("src", video_bin.csp, "sink", gst.PAD_LINK_CHECK_NOTHING)
+ video_bin.csp.link_pads_full("src", video_bin.scale, "sink", gst.PAD_LINK_CHECK_NOTHING)
if child_bin is not None:
gst.element_link_many(video_bin.scale, video_bin.child,
- video_bin.alpha, video_bin.capsfilter)
+ video_bin.alpha)
+ video_bin.alpha.link_pads_full("src", video_bin.capsfilter, "sink", gst.PAD_LINK_CHECK_NOTHING)
video_bin.child.sync_state_with_parent()
else:
- gst.element_link_many(video_bin.scale,
- video_bin.alpha, video_bin.capsfilter)
+ video_bin.scale.link_pads_full("src", video_bin.alpha, "sink", gst.PAD_LINK_CHECK_NOTHING)
+ video_bin.alpha.link_pads_full("src", video_bin.capsfilter, "sink", gst.PAD_LINK_CHECK_NOTHING)
video_bin.capsfilter.sync_state_with_parent()
video_bin.scale.sync_state_with_parent()
@@ -525,7 +527,9 @@ class SourceFactory(ObjectFactory):
# gst.element_link_many(audio_bin.aconv, audio_bin.ares, audio_bin.arate, audio_bin.child, audio_bin.volume)
# audio_bin.child.sync_state_with_parent()
#else:
- gst.element_link_many(audio_bin.aconv, audio_bin.ares, audio_bin.arate, audio_bin.volume)
+ audio_bin.aconv.link_pads_full("src", audio_bin.ares, "sink", gst.PAD_LINK_CHECK_NOTHING)
+ audio_bin.ares.link_pads_full("src", audio_bin.arate, "sink", gst.PAD_LINK_CHECK_NOTHING)
+ audio_bin.arate.link_pads_full("src", audio_bin.volume, "sink", gst.PAD_LINK_CHECK_NOTHING)
audio_bin.aconv.sync_state_with_parent()
audio_bin.ares.sync_state_with_parent()
diff --git a/pitivi/factories/test.py b/pitivi/factories/test.py
index 2815951..361a891 100644
--- a/pitivi/factories/test.py
+++ b/pitivi/factories/test.py
@@ -47,7 +47,7 @@ class VideoTestSourceFactory(SourceFactory):
bin.add(videotestsrc)
bin.add(capsfilter)
- videotestsrc.link(capsfilter)
+ videotestsrc.link_pads_full("src", capsfilter, "sink", gst.PAD_LINK_CHECK_NOTHING)
return bin
@@ -55,7 +55,7 @@ class VideoTestSourceFactory(SourceFactory):
video_bin = SourceFactory._makeStreamBin(self, output_stream)
capsfilter = video_bin.get_by_name("videotestsrc-capsfilter")
queue = video_bin.get_by_name("internal-queue")
- capsfilter.link(queue)
+ capsfilter.link_pads_full("src", queue, "sink", gst.PAD_LINK_CHECK_NOTHING)
capsfilter = video_bin.get_by_name("capsfilter-proj-settings")
target = capsfilter.get_pad("src")
@@ -91,7 +91,9 @@ class AudioTestSourceFactory(SourceFactory):
capsfilter.props.caps = output_stream.caps.copy()
bin.add(audiotestsrc, ares, aconv, capsfilter)
- gst.element_link_many(audiotestsrc, aconv, ares, capsfilter)
+ audiotestsrc.link_pads_full("src", aconv, "sink", gst.PAD_LINK_CHECK_NOTHING)
+ aconv.link_pads_full("src", ares, "sink", gst.PAD_LINK_CHECK_NOTHING)
+ ares.link_pads_full("src", capsfilter, "sink", gst.PAD_LINK_CHECK_NOTHING)
target = capsfilter.get_pad('src')
ghost = gst.GhostPad('src', target)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]