[gnome-remote-desktop] rdp: Track and use rdp_surface reference in stream class
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-remote-desktop] rdp: Track and use rdp_surface reference in stream class
- Date: Tue, 22 Feb 2022 23:10:23 +0000 (UTC)
commit 4cec9828fb8f6c4fd01104399c097009bc2199cc
Author: Pascal Nowack <Pascal Nowack gmx de>
Date: Sun Dec 5 14:19:38 2021 +0100
rdp: Track and use rdp_surface reference in stream class
An rdp-pipewire-stream will always correspond to an RDP surface.
To be able to track all frame buffers of the pipewire-stream later,
track a reference to the RDP surface.
This will be relevant in the future, when resizing pipewire streams
during a session, which is usually the case with virtual monitors.
src/grd-rdp-pipewire-stream.c | 7 +++++--
src/grd-rdp-pipewire-stream.h | 2 +-
src/grd-session-rdp.c | 6 +++---
3 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/grd-rdp-pipewire-stream.c b/src/grd-rdp-pipewire-stream.c
index a7024af3..4d2130f1 100644
--- a/src/grd-rdp-pipewire-stream.c
+++ b/src/grd-rdp-pipewire-stream.c
@@ -33,6 +33,7 @@
#include "grd-context.h"
#include "grd-egl-thread.h"
#include "grd-pipewire-utils.h"
+#include "grd-rdp-surface.h"
enum
{
@@ -76,6 +77,7 @@ struct _GrdRdpPipeWireStream
GObject parent;
GrdSessionRdp *session_rdp;
+ GrdRdpSurface *rdp_surface;
GSource *pipewire_source;
struct pw_context *pipewire_context;
@@ -794,8 +796,8 @@ static const struct pw_core_events core_events = {
GrdRdpPipeWireStream *
grd_rdp_pipewire_stream_new (GrdSessionRdp *session_rdp,
GMainContext *render_context,
+ GrdRdpSurface *rdp_surface,
uint32_t src_node_id,
- uint32_t refresh_rate,
GError **error)
{
g_autoptr (GrdRdpPipeWireStream) stream = NULL;
@@ -805,6 +807,7 @@ grd_rdp_pipewire_stream_new (GrdSessionRdp *session_rdp,
stream = g_object_new (GRD_TYPE_RDP_PIPEWIRE_STREAM, NULL);
stream->session_rdp = session_rdp;
+ stream->rdp_surface = rdp_surface;
stream->src_node_id = src_node_id;
create_render_source (stream, render_context);
@@ -840,7 +843,7 @@ grd_rdp_pipewire_stream_new (GrdSessionRdp *session_rdp,
&core_events,
stream);
- if (!connect_to_stream (stream, refresh_rate, error))
+ if (!connect_to_stream (stream, rdp_surface->refresh_rate, error))
return NULL;
return g_steal_pointer (&stream);
diff --git a/src/grd-rdp-pipewire-stream.h b/src/grd-rdp-pipewire-stream.h
index dcedf844..a9eec267 100644
--- a/src/grd-rdp-pipewire-stream.h
+++ b/src/grd-rdp-pipewire-stream.h
@@ -32,8 +32,8 @@ G_DECLARE_FINAL_TYPE (GrdRdpPipeWireStream, grd_rdp_pipewire_stream,
GrdRdpPipeWireStream *grd_rdp_pipewire_stream_new (GrdSessionRdp *session_rdp,
GMainContext *render_context,
+ GrdRdpSurface *rdp_surface,
uint32_t src_node_id,
- uint32_t refresh_rate,
GError **error);
#endif /* GRD_RDP_PIPEWIRE_STREAM_H */
diff --git a/src/grd-session-rdp.c b/src/grd-session-rdp.c
index 47620f64..a6ad22c0 100644
--- a/src/grd-session-rdp.c
+++ b/src/grd-session-rdp.c
@@ -2132,16 +2132,16 @@ grd_session_rdp_stream_ready (GrdSession *session,
{
GrdSessionRdp *session_rdp = GRD_SESSION_RDP (session);
GMainContext *graphics_context = session_rdp->graphics_context;
+ GrdRdpSurface *rdp_surface;
uint32_t pipewire_node_id;
- uint16_t refresh_rate;
g_autoptr (GError) error = NULL;
+ rdp_surface = session_rdp->rdp_surface;
pipewire_node_id = grd_stream_get_pipewire_node_id (stream);
- refresh_rate = session_rdp->rdp_surface->refresh_rate;
session_rdp->pipewire_stream = grd_rdp_pipewire_stream_new (session_rdp,
graphics_context,
+ rdp_surface,
pipewire_node_id,
- refresh_rate,
&error);
if (!session_rdp->pipewire_stream)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]