How force GLMediaPlayer not to depend on machine time
Posted by Ertong on Dec 29, 2013; 3:24pm
URL: https://forum.jogamp.org/How-force-GLMediaPlayer-not-to-depend-on-machine-time-tp4031077.html
I'm trying to build a video renderer using jogl.
The target FPS of the video is fixed (25, for example).
But rendering speed can be different.
So, for example, if rendering FPS is 100, I can render 60 sec video in 60*25/100=15 sec.
In this case I cannot rely on the system time, and my display() method should calculate it's own "time".
E.g. if we are rendering the frame #100, display() should build the scene that is expected to be seen at 100/25=4th second of the resulting video.
Well, now I'm trying to use GLMediaPlayer for including embedded video to the scene.
But getNextTexture is hard-coded to use system time.
And in the end, the resulting video contains the embedded video with wrong playing speed.
There is setPlaySpeed() method, but it is good only if rendering FPS is constant, but it is not true in reality.
I've tried to use seek(), but it is not working properly being called on every display().
I've tried to subclass FFMPEGMediaPlayer, but there are too much private fields.
In this case it would be logical to implement getNextTexture(long time) somehow, where time is the time form embedded video beginning.
Is it possible to do without affecting library code?