play.py 文件源码

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

项目:python-mediadecoder 作者: dschreij 项目源码 文件源码
def __init__(self, dimensions, fullscreen = False, soundrenderer="pyaudio",
        loop=False):
        """ Constructor.

        Parameters
        ----------
        dimensions : tuple (width, height)
            The dimension of the window in which the video should be shown. Aspect
            ratio is maintained.
        fullscreen : bool, optional
            Indicates whether the video should be displayed in fullscreen.
        soundrenderer : {'pyaudio','pygame'}
            Designates which sound backend should render the sound. 
        """

        pygame.init()
        (windowWidth, windowHeight) = dimensions
        flags = pygame.DOUBLEBUF|pygame.OPENGL|pygame.HWSURFACE
        self.fullscreen = fullscreen
        if fullscreen:
            flags = flags | pygame.FULLSCREEN
        pygame.display.set_mode((windowWidth,windowHeight), flags)
        self.windowSize = (windowWidth, windowHeight)

        self.soundrenderer=soundrenderer        
        self.loop = loop
        self.texUpdated = False

        self.__initGL()

        self.decoder = Decoder(
            videorenderfunc=self.__texUpdate,
        )
        self.texture_locked = False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号