Greetings,
To make a long story short, I’m working on a video player using SFML and I found what appears to be the bottle neck of rendering HD video. So far, I found that the problem reside within Swapping OpenGL buffers.
My application does its work on time, no delay, without using Window->Display(). But when turned on, I’m getting about 10%-30% latency when playing 1080p video, which is unacceptable. I’ve tried about any combinations of Window->EnableVerticalSync() and Window->SetFramerateLimit():
EnableVerticalSync(true) and SetFramerateLimit(30): (60hz LCD monitor) seams to give de best result. Playing fullscreen also helps. But still need optimization.
My first concern is the OpenGL context. ContextSettings offers very limited tweaking and I’m wondering what’s under the hood. Maybe someone can help clear a few questions:
How can we turn off double buffering?
How is the SwapBuffers handled? Are the buffers being swap or the back buffer is being copied to the front buffer? I’d like to test which one offers the best performance. (In Windows, this means setting the dwFlags in the PIXELFORMATDESCRIPTOR to PFD_SWAP_COPY.) I’m guessing it is a copy because playing 720p is very smooth.
Is there a way to optimize and/or synchronize the SwapBuffers to get minimal pipe blocking?
EDIT: Using SFML 2.0 on windows 7 x64 + GForce 8800
Thx,