1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-08-26 09:22:28 -04:00

ATV Modulator: use exclusively operator>> to retrieve camera frames

This commit is contained in:
f4exb 2017-03-13 22:45:00 +01:00
parent 09e3a0fd8e
commit 0fa8fc486a

View File

@ -328,23 +328,18 @@ void ATVMod::pullVideo(Real& sample)
getOutputMessageQueue()->push(report); getOutputMessageQueue()->push(report);
} }
int grabOK;
int fpsIncrement = (int) camera.m_videoFPSCount - camera.m_videoPrevFPSCount; int fpsIncrement = (int) camera.m_videoFPSCount - camera.m_videoPrevFPSCount;
// move a number of frames according to increment // move a number of frames according to increment
// use grab to test for EOF then retrieve to preserve last valid frame as the current original frame // use grab to test for EOF then retrieve to preserve last valid frame as the current original frame
// TODO: handle pause (no move) cv::Mat colorFrame;
for (int i = 0; i < fpsIncrement; i++) for (int i = 0; i < fpsIncrement; i++)
{ {
grabOK = camera.m_camera.grab(); camera.m_camera >> colorFrame;
if (!grabOK) break; if (colorFrame.empty()) break;
} }
if (grabOK)
{
cv::Mat colorFrame;
camera.m_camera.retrieve(colorFrame);
if (!colorFrame.empty()) // some frames may not come out properly if (!colorFrame.empty()) // some frames may not come out properly
{ {
if (m_showOverlayText) { if (m_showOverlayText) {
@ -367,7 +362,6 @@ void ATVMod::pullVideo(Real& sample)
} }
} }
} }
}
m_horizontalCount = 0; m_horizontalCount = 0;
} }