mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 21:21:12 +00:00
overrides: implement caps[i] and len(caps)
This commit is contained in:
parent
50db685aef
commit
0b0202cfbe
1 changed files with 8 additions and 0 deletions
|
@ -66,6 +66,14 @@ class Caps(Gst.Caps):
|
|||
def __str__(self):
|
||||
return self.to_string()
|
||||
|
||||
def __getitem__(self, index):
|
||||
if index >= self.get_size():
|
||||
raise IndexError('structure index out of range')
|
||||
return self.get_structure(index)
|
||||
|
||||
def __len__(self):
|
||||
return self.get_size()
|
||||
|
||||
Caps = override(Caps)
|
||||
__all__.append('Caps')
|
||||
|
||||
|
|
Loading…
Reference in a new issue