MCPcopy Create free account
hub / github.com/GStreamer/gst-python / MapInfo

Class MapInfo

gi/overrides/Gst.py:599–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597 return zip(a, b)
598
599class MapInfo:
600 def __init__(self):
601 self.memory = None
602 self.flags = Gst.MapFlags(0)
603 self.size = 0
604 self.maxsize = 0
605 self.data = None
606 self.user_data = None
607 self.__parent__ = None
608
609 def __iter__(self):
610 # Make it behave like a tuple similar to the PyGObject generated API for
611 # the `Gst.Buffer.map()` and friends.
612 for i in (self.__parent__ is not None, self):
613 yield i
614
615 def __enter__(self):
616 if not self.__parent__:
617 raise MapError('MappingError', 'Mapping was not successful')
618
619 return self
620
621 def __exit__(self, type, value, tb):
622 if not self.__parent__.unmap(self):
623 raise MapError('MappingError', 'Unmapping was not successful')
624
625__all__.append("MapInfo")
626

Callers 3

map_rangeMethod · 0.85
mapMethod · 0.85
mapMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected