screencopy: Attach pts to nvnc fbs

pull/137/head
Andri Yngvason 2022-04-14 17:08:21 +00:00
parent 5ed57b90b4
commit dfc34bbe9d
1 changed files with 5 additions and 4 deletions

View File

@ -23,6 +23,7 @@
#include <wayland-client.h>
#include <libdrm/drm_fourcc.h>
#include <aml.h>
#include <neatvnc.h>
#include "wlr-screencopy-unstable-v1.h"
#include "buffer.h"
@ -154,10 +155,6 @@ static void screencopy_ready(void* data,
struct zwlr_screencopy_frame_v1* frame,
uint32_t sec_hi, uint32_t sec_lo, uint32_t nsec)
{
(void)sec_hi;
(void)sec_lo;
(void)nsec;
struct screencopy* self = data;
DTRACE_PROBE1(wayvnc, screencopy_ready, self);
@ -177,6 +174,10 @@ static void screencopy_ready(void* data,
self->back = self->front;
self->front = NULL;
uint64_t sec = (uint64_t)sec_hi << 32 | (uint64_t)sec_lo;
uint64_t pts = sec * UINT64_C(1000000) + (uint64_t)nsec / UINT64_C(1000);
nvnc_fb_set_pts(self->back->nvnc_fb, pts);
self->status = SCREENCOPY_DONE;
self->on_done(self);
}