1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05: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,
1); // open splash screen on GUI side
getOutputMessageQueue()->push(report);
int nbFrames = 0;
time(&start);
for (int i = 0; i < 120; i++) {
for (int i = 0; i < 120; i++)
{
camera.m_camera >> frame;
if (!frame.empty()) nbFrames++;
}
time(&end);
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_videoFPSCount = camera.m_videoFPSq;
camera.m_videoPrevFPSCount = 0;