mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-02-18 02:55:46 +00:00
fps -> cps
This commit is contained in:
parent
6029408564
commit
ec738b18dc
10
src/http.c
10
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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
16
src/stream.c
16
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);
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user