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
评论列表
文章目录