diff --git a/src/psmoveservice/PSMoveTracker/PSEye/PSEyeVideoCapture.cpp b/src/psmoveservice/PSMoveTracker/PSEye/PSEyeVideoCapture.cpp index ea62bf78..d66a13b3 100644 --- a/src/psmoveservice/PSMoveTracker/PSEye/PSEyeVideoCapture.cpp +++ b/src/psmoveservice/PSMoveTracker/PSEye/PSEyeVideoCapture.cpp @@ -523,6 +523,14 @@ class PSEYECaptureCAM_VIRTUAL : public cv::IVideoCapture bool grabFrame() { + const std::chrono::time_point now = std::chrono::high_resolution_clock::now(); + const std::chrono::duration timeSinceLast = now - m_lastRequest; + if (timeSinceLast.count() < 2.f) + { + return true; + } + + m_lastRequest = now; if (capturePipe == INVALID_HANDLE_VALUE) { @@ -715,6 +723,7 @@ class PSEYECaptureCAM_VIRTUAL : public cv::IVideoCapture HANDLE capturePipe; char pipeBuffer[VRIT_BUFF_SIZE]; cv::Mat capFrame; + std::chrono::time_point m_lastRequest; }; static bool usingCLEyeDriver()