summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMikhail Burakov <mburakov@mailbox.org>2023-10-14 15:31:14 +0200
committerMikhail Burakov <mburakov@mailbox.org>2023-10-14 15:31:14 +0200
commit0e3c61abed24e2fec2148b22fe204e28074f1e90 (patch)
tree8c750d88499d21257fd93ffde557640482439417 /main.c
parent96840adcdc592d82a55f62c947786f0117fbcd67 (diff)
Track video frame encoding latencyv4
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.c b/main.c
index aa5a493..bc737fc 100644
--- a/main.c
+++ b/main.c
@@ -32,6 +32,7 @@
#include "gpu.h"
#include "input.h"
#include "toolbox/io_muxer.h"
+#include "toolbox/perf.h"
#include "toolbox/utils.h"
// TODO(mburakov): Currently zwp_linux_dmabuf_v1 has no way to provide
@@ -135,6 +136,7 @@ static void OnTimerExpire(void* user) {
return;
}
+ unsigned long long timestamp = MicrosNow();
const struct GpuFrame* captured_frame =
CaptureContextGetFrame(contexts->capture_context);
if (!captured_frame) {
@@ -163,8 +165,8 @@ static void OnTimerExpire(void* user) {
LOG("Failed to convert frame");
goto drop_client;
}
- if (!EncodeContextEncodeFrame(contexts->encode_context,
- contexts->client_fd)) {
+ if (!EncodeContextEncodeFrame(contexts->encode_context, contexts->client_fd,
+ timestamp)) {
LOG("Failed to encode frame");
goto drop_client;
}