opening and playing the movie is an asynchronous process. The operating system needs time to read the video and audio streams, detect their format, decode them, synchronize them and send them to display and audio output. Therefor, you’ll need to obtain the Surface in the update() method, because it will be called many times per second. Also, check if the Surface is valid before trying to access the pixels.
that’s a good way to do it. You’re creating a shared context for the QuickTime thread, allowing you to use textures created from the movie in both threads. Your code, however, is not creating any textures at the moment, so I am not sure you need a shared context at all.