Well Mac might be the one thing it could be hacked to work on. Asked because was going to suggest Syphon or Spout, but not cross platform then. Could also draw to an (ideally small) offscreen graphics and grab the pixel array from that to transfer. Your control window isn’t using GL anyway.
It’s interesting that if I try to simplify it and remove the intermediate PGraphics and use .copy() to copy the video into the thumbnail it still works, but the playback frame rate of the large video drops below 1 fps, drawing a frame every few seconds. Maybe caused by some kind of locking issue?
With the proposed approach it works on Linux. Useful if you’re creating a video mixing tool with two windows (the gui and the rendered view).
ps. the updating of the thumbnail can be moved into if statement for better performance.
@neilcsmith Yes I thought so. And I thought that by copying pixels it might avoid issues of two graphics threads accessing the same texture in memory. But I guess my intuition doesn’t help
Clarifying the weird behavior: the original video fps becomes extremely slow, but the thumbnail updates at the normal rate.
If you re-read the code posted you’ll notice that it specifically doesn’t do that - all texture access is in the main animation thread. What you’re doing will force the full size texture to be downloaded from the GPU to the pixel array. This scales into an intermediate graphics on the GPU, then downloads just the scaled down pixel array. That’s not to say this couldn’t be improved to not create lots of small images. And myMovieIcon should in theory be marked volatile.