1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

videoio(MSMF): add queue for async ReadSample()

This commit is contained in:
Alexander Alekhin
2021-12-06 09:54:48 +03:00
parent 16b674b984
commit 7620456486
2 changed files with 72 additions and 30 deletions
+13 -2
View File
@@ -25,15 +25,26 @@ static void test_readFrames(/*const*/ VideoCapture& capture, const int N = 100,
const bool validTickAndFps = cvTickFreq != 0 && fps != 0.;
testTimestamps &= validTickAndFps;
double frame0ts = 0;
for (int i = 0; i < N; i++)
{
SCOPED_TRACE(cv::format("frame=%d", i));
capture >> frame;
const int64 sysTimeCurr = cv::getTickCount();
const double camTimeCurr = capture.get(cv::CAP_PROP_POS_MSEC);
ASSERT_FALSE(frame.empty());
const int64 sysTimeCurr = cv::getTickCount();
double camTimeCurr = capture.get(cv::CAP_PROP_POS_MSEC);
if (i == 0)
frame0ts = camTimeCurr;
camTimeCurr -= frame0ts; // normalized timestamp based on the first frame
if (cvtest::debugLevel > 0)
{
std::cout << i << ": " << camTimeCurr << std::endl;
}
// Do we have a previous frame?
if (i > 0 && testTimestamps)
{