And they are not called anymore when I load the same video the second time, or a different video in the same ofVideoPlayer object.
Question: any of this objects should be recreated in the case I load some video with different pixel dimensions from the first video?
=======
Other thing I’ve noticed is initTextureCache() is being called every frame, so maybe we could avoid allocating a new texture every frame with the following:
if (!videoTexture.isAllocated()) {
int videoTextureW = getWidth();
int videoTextureH = getHeight();
videoTexture.allocate(videoTextureW, videoTextureH, GL_RGBA);
}
but probably had to ofTexture::clear after loading a different video. or better yet, after detecting we loaded a different video with different dimensions.
And I think each load is spawning a new thread, and new ones when video loops and get back to start position. with a quick test of a few minutes I could see more than 100 threads