[pitivi] singledecodebin: Small fixes to make it work with loaded Factories.



commit 9add87460bf5d8a124b0252533c223149851e449
Author: Edward Hervey <bilboed bilboed com>
Date:   Sun Apr 19 16:10:26 2009 +0200

    singledecodebin: Small fixes to make it work with loaded Factories.
    
    The detection for the requested pad is really really really unstable.
    
    We're relying on mystical pad names to figure out if the pad is the
    requested one....
---
 pitivi/elements/singledecodebin.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/pitivi/elements/singledecodebin.py b/pitivi/elements/singledecodebin.py
index 4261d0f..5d80346 100644
--- a/pitivi/elements/singledecodebin.py
+++ b/pitivi/elements/singledecodebin.py
@@ -25,7 +25,7 @@ Single-stream queue-less decodebin
 
 import gobject
 import gst
-from pitivi.stream import get_pad_id
+from pitivi.stream import get_pad_id, pad_compatible_stream
 
 def is_raw(caps):
     """ returns True if the caps are RAW """
@@ -58,7 +58,6 @@ class SingleDecodeBin(gst.Bin):
         )
     def __init__(self, caps=None, uri=None, stream=None, *args, **kwargs):
         gst.Bin.__init__(self, *args, **kwargs)
-
         if not caps:
             caps = gst.caps_new_any()
         self.caps = caps
@@ -88,6 +87,8 @@ class SingleDecodeBin(gst.Bin):
 
         self._factories = self._getSortedFactoryList()
 
+        self.debug("stream:%r" % self.stream)
+
 
     ## internal methods
 
@@ -247,11 +248,16 @@ class SingleDecodeBin(gst.Bin):
             self.log("type is not know yet, waiting")
             return
 
+        self.debug("stream %r" % (self.stream))
         if caps.intersect(self.caps) and (self.stream is None or
-                (self.stream.pad_id == get_pad_id(pad))):
+                (self.stream.pad_name == get_pad_id(pad))):
             # This is the desired caps
             if not self._srcpad:
                 self._wrapUp(element, pad)
+        elif is_raw(caps) and pad_compatible_stream(pad, self.stream):
+            self.log ("not the target stream, but compatible")
+            if not self._srcpad:
+                self._wrapUp(element, pad)
         elif is_raw(caps):
             self.log("We hit a raw caps which isn't the wanted one")
             # FIXME : recursively remove everything until demux/typefind



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