1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-06-26 14:05:33 -04:00

ATV Modulator: count actual number of frames read for camera FPS estimation

This commit is contained in:
f4exb 2017-03-13 22:52:49 +01:00
parent 0fa8fc486a
commit 14e27dc4b3

View File

@ -304,17 +304,20 @@ void ATVMod::pullVideo(Real& sample)
camera.m_videoHeight, camera.m_videoHeight,
1); // open splash screen on GUI side 1); // open splash screen on GUI side
getOutputMessageQueue()->push(report); getOutputMessageQueue()->push(report);
int nbFrames = 0;
time(&start); time(&start);
for (int i = 0; i < 120; i++) { for (int i = 0; i < 120; i++)
{
camera.m_camera >> frame; camera.m_camera >> frame;
if (!frame.empty()) nbFrames++;
} }
time(&end); time(&end);
double seconds = difftime (end, start); double seconds = difftime (end, start);
camera.m_videoFPS = (120 / seconds) * 0.95; // take a 5% guard camera.m_videoFPS = (nbFrames / seconds) * 0.95; // take a 5% guard
camera.m_videoFPSq = camera.m_videoFPS / m_fps; camera.m_videoFPSq = camera.m_videoFPS / m_fps;
camera.m_videoFPSCount = camera.m_videoFPSq; camera.m_videoFPSCount = camera.m_videoFPSq;
camera.m_videoPrevFPSCount = 0; camera.m_videoPrevFPSCount = 0;