fix fps reporting

This commit is contained in:
Isaac Connor 2018-02-15 14:07:55 -05:00
parent 399b5159a4
commit 9fd2b6be52
1 changed files with 4 additions and 3 deletions

View File

@ -2942,8 +2942,9 @@ int Monitor::Capture() {
double new_capture_fps = double(fps_report_interval)/(now-last_fps_time); double new_capture_fps = double(fps_report_interval)/(now-last_fps_time);
//Info( "%d -> %d -> %d", fps_report_interval, now, last_fps_time ); //Info( "%d -> %d -> %d", fps_report_interval, now, last_fps_time );
//Info( "%d -> %d -> %lf -> %lf", now-last_fps_time, fps_report_interval/(now-last_fps_time), double(fps_report_interval)/(now-last_fps_time), fps ); //Info( "%d -> %d -> %lf -> %lf", now-last_fps_time, fps_report_interval/(now-last_fps_time), double(fps_report_interval)/(now-last_fps_time), fps );
Info("%s: %d - Capturing at %.2lf fps", name, image_count, capture_fps); Info("%s: %d - Capturing at %.2lf fps", name, image_count, new_capture_fps);
if ( new_capture_fps != capture_fps ) { if ( new_capture_fps != capture_fps ) {
capture_fps = new_capture_fps;
last_fps_time = now; last_fps_time = now;
static char sql[ZM_SQL_SML_BUFSIZ]; static char sql[ZM_SQL_SML_BUFSIZ];
snprintf(sql, sizeof(sql), "INSERT INTO Monitor_Status (MonitorId,CaptureFPS) VALUES (%d, %.2lf) ON DUPLICATE KEY UPDATE CaptureFPS = %.2lf", id, capture_fps, capture_fps); snprintf(sql, sizeof(sql), "INSERT INTO Monitor_Status (MonitorId,CaptureFPS) VALUES (%d, %.2lf) ON DUPLICATE KEY UPDATE CaptureFPS = %.2lf", id, capture_fps, capture_fps);
@ -3264,10 +3265,10 @@ int Monitor::PrimeCapture() {
return ret; return ret;
} }
int Monitor::PreCapture() { int Monitor::PreCapture() {
return( camera->PreCapture() ); return camera->PreCapture();
} }
int Monitor::PostCapture() { int Monitor::PostCapture() {
return( camera->PostCapture() ); return camera->PostCapture();
} }
Monitor::Orientation Monitor::getOrientation() const { return orientation; } Monitor::Orientation Monitor::getOrientation() const { return orientation; }