From ec738b18dcb59312cf3ae93423d1d4e172d69448 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Thu, 4 Oct 2018 09:20:36 +0300 Subject: [PATCH] fps -> cps --- src/http.c | 10 +++++----- src/http.h | 4 ++-- src/stream.c | 16 ++++++++-------- src/stream.h | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/http.c b/src/http.c index 4e390e4..0815ad3 100644 --- a/src/http.c +++ b/src/http.c @@ -174,12 +174,12 @@ static void _http_callback_ping(struct evhttp_request *request, void *v_server) assert(evbuffer_add_printf(buf, "{\"stream\": {\"resolution\":" " {\"width\": %u, \"height\": %u}," - " \"fps\": %u, \"eps\": %u," + " \"cps\": %u, \"eps\": %u," " \"online\": %s, \"clients\": %u}}", (server->fake_width ? server->fake_width : server->run->exposed->width), (server->fake_height ? server->fake_height : server->run->exposed->height), - server->run->exposed->fps, // frame per second (capturing) - server->run->exposed->eps, // expose per second (server) + server->run->exposed->cps, // Captured per second + server->run->exposed->eps, // Exposed per second (server) (server->run->exposed->online ? "true" : "false"), server->run->stream_clients_count )); @@ -453,7 +453,7 @@ static bool _expose_new_picture(struct http_server_t *server) { # define EXPOSED(_next) server->run->exposed->_next assert(STREAM(picture.size) > 0); - EXPOSED(fps) = STREAM(fps); + EXPOSED(cps) = STREAM(cps); EXPOSED(expose_begin_time) = get_now_monotonic(); # define MEM_STREAM_TO_EXPOSED \ @@ -536,7 +536,7 @@ static bool _expose_blank_picture(struct http_server_t *server) { EXPOSED(width) = BLANK_JPG_WIDTH; EXPOSED(height) = BLANK_JPG_HEIGHT; - EXPOSED(fps) = 0; + EXPOSED(cps) = 0; EXPOSED(online) = false; goto updated; } diff --git a/src/http.h b/src/http.h index 7acba9e..8414f6c 100644 --- a/src/http.h +++ b/src/http.h @@ -42,10 +42,10 @@ struct exposed_t { struct picture_t picture; unsigned width; unsigned height; - unsigned fps; + unsigned cps; // Captured per second + unsigned eps; // Exposed per second bool online; unsigned dropped; - unsigned eps; long double expose_begin_time; long double expose_cmp_time; long double expose_end_time; diff --git a/src/stream.c b/src/stream.c index 11252b7..d0be767 100644 --- a/src/stream.c +++ b/src/stream.c @@ -85,8 +85,8 @@ void stream_loop(struct stream_t *stream) { unsigned frames_count = 0; long double grab_after = 0; unsigned fluency_passed = 0; - unsigned fps = 0; - long long fps_second = 0; + unsigned cps = 0; // Captured per second + long long cps_second = 0; LOG_DEBUG("Allocation memory for stream picture ..."); A_CALLOC(stream->picture.data, stream->dev->run->max_picture_size); @@ -197,13 +197,13 @@ void stream_loop(struct stream_t *stream) { } fluency_passed = 0; - if (now_second != fps_second) { - LOG_PERF("Oldest worker complete, encoding FPS = %u", fps); - stream->fps = fps; - fps = 0; - fps_second = now_second; + if (now_second != cps_second) { + LOG_PERF("Oldest worker complete, CPS = %u", cps); + stream->cps = cps; + cps = 0; + cps_second = now_second; } - fps += 1; + cps += 1; long double fluency_delay = _stream_get_fluency_delay(stream->dev, &pool); diff --git a/src/stream.h b/src/stream.h index 9a5ec17..94fc53a 100644 --- a/src/stream.h +++ b/src/stream.h @@ -86,7 +86,7 @@ struct stream_t { struct picture_t picture; unsigned width; unsigned height; - unsigned fps; + unsigned cps; // Captured per second bool updated; pthread_mutex_t mutex; struct device_t *dev;