1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Add Timestamps to MSMF Video Capture by index

Enable frame timestamp tests for MSMF

Add functional test for camera live timestamps

Remove trailing whitespace

Add timestamp test to all functional tests. Protect div by 0

Add Timestamps to MSMF Video Capture by index
This commit is contained in:
Jaime Rivera
2020-11-29 21:17:24 -08:00
parent aac30e772f
commit 2fa624aef0
3 changed files with 36 additions and 5 deletions
+3 -2
View File
@@ -346,8 +346,6 @@ public:
STDMETHODIMP OnReadSample(HRESULT hrStatus, DWORD dwStreamIndex, DWORD dwStreamFlags, LONGLONG llTimestamp, IMFSample *pSample) CV_OVERRIDE
{
CV_UNUSED(llTimestamp);
HRESULT hr = 0;
cv::AutoLock lock(m_mutex);
@@ -360,6 +358,7 @@ public:
{
CV_LOG_DEBUG(NULL, "videoio(MSMF): drop frame (not processed)");
}
m_lastSampleTimestamp = llTimestamp;
m_lastSample = pSample;
}
}
@@ -439,6 +438,7 @@ public:
IMFSourceReader *m_reader;
DWORD m_dwStreamIndex;
LONGLONG m_lastSampleTimestamp;
_ComPtr<IMFSample> m_lastSample;
};
@@ -912,6 +912,7 @@ bool CvCapture_MSMF::grabFrame()
CV_LOG_WARNING(NULL, "videoio(MSMF): EOS signal. Capture stream is lost");
return false;
}
sampleTime = reader->m_lastSampleTimestamp;
return true;
}
else if (isOpen)