ofxHTTP
ofxHTTP copied to clipboard
Dynamic frame delay based on maxClientFrameRate in IPVideoRoute
In regards to:
TODO: smarter ways of doing for rate / fps limiting
The code in this PR updates the way the handleRequest thread sleeps to attempt to keep a steady fps with shorter waits for an empty queue.
I looked at the vars in IPVideoConnection and tried to guess at what the original design was, but saw that a few of them aren't being used anyway.
With this code I get smoother streaming with less delay. For many frames, the sending takes more time than 1000 / FPS ms, so the wait() is skipped entirely; this in contrast to the old code that always waits 30ms.