[transmageddon/gtk3] Fix muxer element checking for 0.11



commit f31c9ca26af32eef6fc6ff1b04020511915a7e68
Author: Christian Fredrik Kalager Schaller <christian schaller collabora co uk>
Date:   Sat Jan 7 19:34:06 2012 +0000

    Fix muxer element checking for 0.11

 src/codecfinder.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/codecfinder.py b/src/codecfinder.py
index 3892d2f..5c40c65 100644
--- a/src/codecfinder.py
+++ b/src/codecfinder.py
@@ -136,15 +136,16 @@ def get_muxer_element(containercaps):
            features.append(fact)
    muxerfeature = dict(zip(muxers, features))
    incomingcaps = Gst.caps_from_string(containercaps)
-   print "containercaps is " + str(containercaps)
+   print "incomingcaps is " + str(containercaps)
    for muxer in muxers:
            element = muxer
            factory = Gst.Registry.get().lookup_feature(str(muxer))
            sinkcaps = [x.get_caps() for x in factory.get_static_pad_templates() \
                    if x.direction == Gst.PadDirection.SRC]
-           print "sinkcaps are " + str(sinkcaps)
            for caps in sinkcaps:
-               if caps.intersect(incomingcaps):
+               intersect = caps.intersect(incomingcaps).to_string()
+               # intersect is EMPTY, not FALSE is this a bindings bug?
+               if intersect != "EMPTY":
                    if elementname == False:
                        elementname = element
                    else:
@@ -152,6 +153,8 @@ def get_muxer_element(containercaps):
                        original = Gst.PluginFeature.get_rank(muxerfeature[elementname])
                        if mostrecent >= original:
                            elementname = element
+   # This is just a test of if an element exist that can mux this format now, 
+   # so elementname doesn't really matter any more.
    return elementname
 
 ######



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