def update(self, dt):
sample, self.sample = self.sample, None
if sample is None:
return
try:
buf = sample.get_buffer()
result, mapinfo = buf.map(Gst.MapFlags.READ)
addr = mapinfo.__hash__()
c_mapinfo = _MapInfo.from_address(addr)
sbuf = string_at(c_mapinfo.data, mapinfo.size)
self.texture.blit_buffer(sbuf, colorfmt = 'rgb')
finally:
if mapinfo is not None:
buf.unmap(mapinfo)
self.image.canvas.ask_update()
评论列表
文章目录