Add GetNextFrame timeout to CvSink and MjpegServer.

MjpegServer uses the timeout to generate keep-alives to any clients
(which helps detect disconnects and avoid stale client threads).

CvSink GrabFrame now defaults to a timeout, but the timeout can be
changed by the user, or the old no-timeout version is now available
as GrabFrameNoTimeout.
This commit is contained in:
Peter Johnson
2017-02-17 01:17:12 -08:00
parent 5e9575de66
commit 61e34621cc
14 changed files with 126 additions and 5 deletions

View File

@@ -82,6 +82,10 @@ class SourceImpl {
// Blocking function that waits for the next frame and returns it.
Frame GetNextFrame();
// Blocking function that waits for the next frame and returns it (with
// timeout in seconds). If timeout expires, returns empty frame.
Frame GetNextFrame(double timeout);
// Force a wakeup of all GetNextFrame() callers by sending an empty frame.
void Wakeup();