[gnome-remote-desktop] rdp: Add RDP surface



commit 2b3e89fb26a7e4e37f5b496e3dd0f6f5bcdf2247
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Sun Mar 14 18:50:00 2021 +0100

    rdp: Add RDP surface
    
    This is a preparatory step for the graphics pipeline.
    While in the legacy path frame updates happen directly in the graphics
    output buffer, that is visible to the user, the graphics pipeline
    handles frame updates differently:
    
    Instead of updating one chunk of area in the graphics output buffer,
    the graphics pipeline only updates an offscreen surface.
    That surface can be mapped to the user-visible graphics output
    buffer (to become an onscreen surface) for the usage as a monitor or
    window (RAIL), but is not limited to that.
    The graphics pipeline also allows using offscreen surfaces to e.g.
    composite frames with the usage of the blitting PDUs or to cache frame
    content using them.
    
    Each RDP surface can later correspond to a GFX surface, but does not
    have to, to remain compatible with the legacy path.
    In the next step, gnome-remote-desktop will be adapted to use RDP
    surfaces, when handling frame updates.

 src/grd-rdp-surface.c | 30 ++++++++++++++++++++++++++++++
 src/grd-rdp-surface.h | 40 ++++++++++++++++++++++++++++++++++++++++
 src/grd-types.h       |  1 +
 src/meson.build       |  2 ++
 4 files changed, 73 insertions(+)
---
diff --git a/src/grd-rdp-surface.c b/src/grd-rdp-surface.c
new file mode 100644
index 0000000..d8597f6
--- /dev/null
+++ b/src/grd-rdp-surface.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2021 Pascal Nowack
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include "grd-rdp-surface.h"
+
+void
+grd_rdp_surface_free (GrdRdpSurface *rdp_surface)
+{
+  g_clear_pointer (&rdp_surface->last_frame, g_free);
+
+  g_free (rdp_surface);
+}
diff --git a/src/grd-rdp-surface.h b/src/grd-rdp-surface.h
new file mode 100644
index 0000000..7e771b1
--- /dev/null
+++ b/src/grd-rdp-surface.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2021 Pascal Nowack
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef GRD_RDP_SURFACE_H
+#define GRD_RDP_SURFACE_H
+
+#include <gio/gio.h>
+#include <stdint.h>
+
+struct _GrdRdpSurface
+{
+  uint16_t output_origin_x;
+  uint16_t output_origin_y;
+  uint16_t width;
+  uint16_t height;
+
+  uint8_t *last_frame;
+
+  gboolean valid;
+};
+
+void grd_rdp_surface_free (GrdRdpSurface *rdp_surface);
+
+#endif /* GRD_RDP_SURFACE_H */
diff --git a/src/grd-types.h b/src/grd-types.h
index f54f114..abc7b94 100644
--- a/src/grd-types.h
+++ b/src/grd-types.h
@@ -30,6 +30,7 @@ typedef struct _GrdClipboardVnc GrdClipboardVnc;
 typedef struct _GrdRdpEventQueue GrdRdpEventQueue;
 typedef struct _GrdRdpSAMFile GrdRdpSAMFile;
 typedef struct _GrdRdpServer GrdRdpServer;
+typedef struct _GrdRdpSurface GrdRdpSurface;
 typedef struct _GrdSession GrdSession;
 typedef struct _GrdSessionRdp GrdSessionRdp;
 typedef struct _GrdSessionVnc GrdSessionVnc;
diff --git a/src/meson.build b/src/meson.build
index 8dc284d..ae2a5f2 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -47,6 +47,8 @@ if have_rdp
     'grd-rdp-sam.h',
     'grd-rdp-server.c',
     'grd-rdp-server.h',
+    'grd-rdp-surface.c',
+    'grd-rdp-surface.h',
     'grd-session-rdp.c',
     'grd-session-rdp.h',
   ])


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