~ubuntu-branches/ubuntu/trusty/pitivi/trusty

« back to all changes in this revision

Viewing changes to pitivi/elements/singledecodebin.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-07-07 13:43:47 UTC
  • mto: (6.1.9 sid) (1.2.12)
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: james.westby@ubuntu.com-20110707134347-cari9kxjiakzej9z
Tags: upstream-0.14.1
ImportĀ upstreamĀ versionĀ 0.14.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#
17
17
# You should have received a copy of the GNU Lesser General Public
18
18
# License along with this program; if not, write to the
19
 
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
 
# Boston, MA 02111-1307, USA.
 
19
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 
20
# Boston, MA 02110-1301, USA.
21
21
 
22
22
"""
23
23
Single-stream queue-less decodebin
28
28
from pitivi.stream import get_pad_id, pad_compatible_stream
29
29
from pitivi.utils import CachedFactoryList
30
30
 
 
31
 
31
32
def is_raw(caps):
32
33
    """ returns True if the caps are RAW """
33
34
    rep = caps.to_string()
37
38
            return True
38
39
    return False
39
40
 
 
41
 
40
42
def factoryFilter(factory):
41
 
    if factory.get_rank() < 64 :
 
43
    if factory.get_rank() < 64:
42
44
        return False
43
45
 
44
46
    klass = factory.get_klass()
50
52
 
51
53
_factoryCache = CachedFactoryList(factoryFilter)
52
54
 
 
55
 
53
56
class SingleDecodeBin(gst.Bin):
54
57
    """
55
58
    A variant of decodebin.
61
64
    QUEUE_SIZE = 1 * gst.SECOND
62
65
 
63
66
    __gsttemplates__ = (
64
 
        gst.PadTemplate ("sinkpadtemplate",
 
67
        gst.PadTemplate("sinkpadtemplate",
65
68
                         gst.PAD_SINK,
66
69
                         gst.PAD_ALWAYS,
67
70
                         gst.caps_new_any()),
68
 
        gst.PadTemplate ("srcpadtemplate",
 
71
        gst.PadTemplate("srcpadtemplate",
69
72
                         gst.PAD_SRC,
70
73
                         gst.PAD_SOMETIMES,
71
74
                         gst.caps_new_any())
102
105
 
103
106
        self._dynamics = []
104
107
 
105
 
        self._validelements = [] #added elements
 
108
        self._validelements = []  # added elements
106
109
 
107
110
        self.debug("stream:%r" % self.stream)
108
111
 
258
261
            if not self._srcpad:
259
262
                self._wrapUp(element, pad)
260
263
        elif is_raw(caps) and pad_compatible_stream(pad, self.stream):
261
 
            self.log ("not the target stream, but compatible")
 
264
            self.log("not the target stream, but compatible")
262
265
            if not self._srcpad:
263
266
                self._wrapUp(element, pad)
264
267
        elif is_raw(caps):