[gnome-remote-desktop] vnc-pipewire-stream: Take frame data from pending frame, when needed



commit 6ea163ebc9b9455f12247239dbbccedb815cc3b9
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Tue Oct 19 20:29:06 2021 +0200

    vnc-pipewire-stream: Take frame data from pending frame, when needed
    
    Currently, when gnome-remote-desktop receives a new frame update via
    PipeWire and an already pending frame exists, then this frame will be
    replaced.
    However, not every frame contains all data. For example frame n can
    contain both actual frame data and a new mouse pointer bitmap, while
    frame n + 1 might contain only actual frame data.
    In that case, the mouse pointer bitmap update will be omitted.
    
    To prevent this behaviour, take the frame data of the previous frame.

 src/grd-vnc-pipewire-stream.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/grd-vnc-pipewire-stream.c b/src/grd-vnc-pipewire-stream.c
index 5085062..56ccea8 100644
--- a/src/grd-vnc-pipewire-stream.c
+++ b/src/grd-vnc-pipewire-stream.c
@@ -427,6 +427,17 @@ on_stream_process (void *user_data)
   g_mutex_lock (&stream->frame_mutex);
   if (stream->pending_frame)
     {
+      if (!frame->data && stream->pending_frame->data)
+        frame->data = g_steal_pointer (&stream->pending_frame->data);
+      if (!frame->rfb_cursor && stream->pending_frame->rfb_cursor)
+        frame->rfb_cursor = g_steal_pointer (&stream->pending_frame->rfb_cursor);
+      if (!frame->cursor_moved && stream->pending_frame->cursor_moved)
+        {
+          frame->cursor_x = stream->pending_frame->cursor_x;
+          frame->cursor_y = stream->pending_frame->cursor_y;
+          frame->cursor_moved = TRUE;
+        }
+
       g_free (stream->pending_frame->data);
       g_clear_pointer (&stream->pending_frame, g_free);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]