overrides: make Gst.Pad.link raise Gst.LinkError

This commit is contained in:
Alessandro Decina 2012-10-15 09:13:44 +02:00
parent 73fd67f6d3
commit ec51f6bfd7

View file

@ -85,6 +85,10 @@ class AddError(Exception):
pass
__all__.append('AddError')
class LinkError(Exception):
pass
__all__.append('LinkError')
class Iterator(Gst.Iterator):
def __iter__(self):
while True:
@ -114,6 +118,15 @@ class ElementFactory(Gst.ElementFactory):
return self.get_metadata("klass")
class Pad(Gst.Pad):
def link(self, pad):
ret = Gst.Pad.link(self, pad)
if ret != Gst.PadLinkReturn.OK:
raise LinkError(ret)
Pad = override(Pad)
__all__.append('Pad')
class Pipeline(Gst.Pipeline):
def __init__(self, name=None):
Gst.Pipeline.__init__(self, name=name)