mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
overrides: make Gst.Pad.link raise Gst.LinkError
This commit is contained in:
parent
73fd67f6d3
commit
ec51f6bfd7
1 changed files with 13 additions and 0 deletions
|
@ -85,6 +85,10 @@ class AddError(Exception):
|
||||||
pass
|
pass
|
||||||
__all__.append('AddError')
|
__all__.append('AddError')
|
||||||
|
|
||||||
|
class LinkError(Exception):
|
||||||
|
pass
|
||||||
|
__all__.append('LinkError')
|
||||||
|
|
||||||
class Iterator(Gst.Iterator):
|
class Iterator(Gst.Iterator):
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
while True:
|
while True:
|
||||||
|
@ -114,6 +118,15 @@ class ElementFactory(Gst.ElementFactory):
|
||||||
return self.get_metadata("klass")
|
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):
|
class Pipeline(Gst.Pipeline):
|
||||||
def __init__(self, name=None):
|
def __init__(self, name=None):
|
||||||
Gst.Pipeline.__init__(self, name=name)
|
Gst.Pipeline.__init__(self, name=name)
|
||||||
|
|
Loading…
Reference in a new issue