GStreamerAction.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:displayminion 作者: cedarsuite 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号