avbin.py 文件源码

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

项目:FightstickDisplay 作者: calexil 项目源码 文件源码
def _decode_video_packet(self, packet):
        width = self.video_format.width
        height = self.video_format.height
        pitch = width * 3
        buffer = (ctypes.c_uint8 * (pitch * height))()
        result = av.avbin_decode_video(self._video_stream, 
                                       packet.data, packet.size, 
                                       buffer)
        if result < 0:
            image_data = None
        else:
            image_data = image.ImageData(width, height, 'RGB', buffer, pitch)

        packet.image = image_data

        # Notify get_next_video_frame() that another one is ready.
        self._condition.acquire()
        self._condition.notify()
        self._condition.release()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号