[pitivi] pitivi: More linking speedups



commit e276e4656eb3dae4d84cf4775217e9d9a48e0ea1
Author: Edward Hervey <bilboed bilboed com>
Date:   Wed Nov 24 19:08:09 2010 +0100

    pitivi: More linking speedups
    
    https://bugzilla.gnome.org/show_bug.cgi?id=591427

 pitivi/factories/timeline.py |    2 +-
 pitivi/pipeline.py           |    5 +++--
 pitivi/plumber.py            |    6 +++---
 pitivi/utils.py              |    5 +++--
 4 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/pitivi/factories/timeline.py b/pitivi/factories/timeline.py
index 71aa0b7..ee00010 100644
--- a/pitivi/factories/timeline.py
+++ b/pitivi/factories/timeline.py
@@ -138,7 +138,7 @@ class TimelineSourceFactory(SourceFactory):
             seek = FixSeekStart(track)
         self.bin.add(seek)
         seek.sync_state_with_parent()
-        pad.link(seek.get_pad('sink'))
+        pad.link_full(seek.get_pad('sink'), gst.PAD_LINK_CHECK_NOTHING)
         ghost = gst.GhostPad('src%d' % self.pad_num + str(id(pad)), seek.get_pad('src'))
 
         # FixSeekStart has template caps ANY. Setting seek.caps here we make it
diff --git a/pitivi/pipeline.py b/pitivi/pipeline.py
index aa80bdb..92a9aaa 100644
--- a/pitivi/pipeline.py
+++ b/pitivi/pipeline.py
@@ -656,7 +656,8 @@ class Pipeline(Signallable, Loggable):
         stream_entry.tee_use_count += 1
         stream_entry.tee.set_state(STATE_PAUSED)
         self.debug("Linking pad %r to tee", pads[0])
-        srcpad.link(stream_entry.tee.get_pad("sink"))
+        srcpad.link_full(stream_entry.tee.get_pad("sink"),
+                         gst.PAD_LINK_CHECK_NOTHING)
 
         return stream_entry.tee
 
@@ -748,7 +749,7 @@ class Pipeline(Signallable, Loggable):
         stream_entry.queue.set_state(STATE_PAUSED)
 
         self.debug("Linking pad %r to queue", pads[0])
-        stream_entry.queue.get_pad("src").link(pads[0])
+        stream_entry.queue.get_pad("src").link_full(pads[0], gst.PAD_LINK_CHECK_NOTHING)
 
         stream_entry.queue_use_count += 1
         return stream_entry.queue
diff --git a/pitivi/plumber.py b/pitivi/plumber.py
index 6589a66..6181315 100644
--- a/pitivi/plumber.py
+++ b/pitivi/plumber.py
@@ -60,8 +60,8 @@ class DefaultVideoSink(SinkFactory):
         autovideosink.set_state(gst.STATE_READY)
 
         bin.add(ffmpegcolorspace, videoscale, autovideosink)
-        ffmpegcolorspace.link(videoscale)
-        videoscale.link(autovideosink)
+        ffmpegcolorspace.link_pads_full("src", videoscale, "sink", gst.PAD_LINK_CHECK_NOTHING)
+        videoscale.link_pads_full("src", autovideosink, "sink", gst.PAD_LINK_CHECK_NOTHING)
         pad = ffmpegcolorspace.get_pad("sink")
         ghost = gst.GhostPad("sink", pad)
         bin.add_pad(ghost)
@@ -137,7 +137,7 @@ class DefaultAudioSink(SinkFactory):
         ares = gst.element_factory_make("audioresample", "audiobin-resample")
 
         audiosink.add(aconv, ares, autoaudiosink)
-        aconv.link(ares)
+        aconv.link_pads_full("src", ares, "sink", gst.PAD_LINK_CHECK_NOTHING)
         # FIXME : This is really bad
         # For starters... it means we can't edit/preview multi-channel audio
         # Also, most hardware cards do internal resampling much better
diff --git a/pitivi/utils.py b/pitivi/utils.py
index 1cb0c38..6dc0bb8 100644
--- a/pitivi/utils.py
+++ b/pitivi/utils.py
@@ -189,8 +189,9 @@ def data_probe(pad, data, section=""):
 def linkDynamic(element, target):
 
     def pad_added(bin, pad, target):
-        if target.get_compatible_pad(pad):
-            element.link(target)
+        compatpad = target.get_compatible_pad(pad)
+        if compatpad:
+            pad.link_full(compatpad, gst.PAD_LINK_CHECK_NOTHING)
     element.connect("pad-added", pad_added, target)
 
 def element_make_many(*args):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]