overrides: implement caps[i] and len(caps)
This commit is contained in:
parent
50db685aef
commit
0b0202cfbe
@ -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…
x
Reference in New Issue
Block a user