mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-29 12:25:37 +00:00
overrides: implement Gst.Pipeline.add(e1, e2, ...)
This commit is contained in:
parent
501db56597
commit
73fd67f6d3
1 changed files with 17 additions and 0 deletions
|
@ -81,6 +81,10 @@ class IteratorError(Exception):
|
|||
pass
|
||||
__all__.append('IteratorError')
|
||||
|
||||
class AddError(Exception):
|
||||
pass
|
||||
__all__.append('AddError')
|
||||
|
||||
class Iterator(Gst.Iterator):
|
||||
def __iter__(self):
|
||||
while True:
|
||||
|
@ -109,6 +113,19 @@ class ElementFactory(Gst.ElementFactory):
|
|||
def get_klass(self):
|
||||
return self.get_metadata("klass")
|
||||
|
||||
|
||||
class Pipeline(Gst.Pipeline):
|
||||
def __init__(self, name=None):
|
||||
Gst.Pipeline.__init__(self, name=name)
|
||||
|
||||
def add(self, *args):
|
||||
for arg in args:
|
||||
if not Gst.Pipeline.add(self, arg):
|
||||
raise AddError(arg)
|
||||
|
||||
Pipeline = override(Pipeline)
|
||||
__all__.append('Pipeline')
|
||||
|
||||
ElementFactory = override(ElementFactory)
|
||||
__all__.append('ElementFactory')
|
||||
|
||||
|
|
Loading…
Reference in a new issue