[gnome-remote-desktop] rdp-graphics-pipeline: Add API to notify new round trip time



commit d9fe34255679470b3df57fd4d2b24132a1cf8397
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Fri May 21 08:02:08 2021 +0200

    rdp-graphics-pipeline: Add API to notify new round trip time
    
    Since the throttling mechanism lies in the GFX surface, just pass the
    round trip time to the GFX surfaces.

 src/grd-rdp-graphics-pipeline.c | 14 ++++++++++++++
 src/grd-rdp-graphics-pipeline.h |  3 +++
 2 files changed, 17 insertions(+)
---
diff --git a/src/grd-rdp-graphics-pipeline.c b/src/grd-rdp-graphics-pipeline.c
index 36a3c6f..8be23b7 100644
--- a/src/grd-rdp-graphics-pipeline.c
+++ b/src/grd-rdp-graphics-pipeline.c
@@ -209,6 +209,20 @@ grd_rdp_graphics_pipeline_reset_graphics (GrdRdpGraphicsPipeline *graphics_pipel
   rdpgfx_context->ResetGraphics (rdpgfx_context, &reset_graphics);
 }
 
+void
+grd_rdp_graphics_pipeline_notify_new_round_trip_time (GrdRdpGraphicsPipeline *graphics_pipeline,
+                                                      uint64_t                round_trip_time_us)
+{
+  GrdRdpGfxSurface *gfx_surface;
+  GHashTableIter iter;
+
+  g_mutex_lock (&graphics_pipeline->gfx_mutex);
+  g_hash_table_iter_init (&iter, graphics_pipeline->surface_table);
+  while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &gfx_surface))
+    grd_rdp_gfx_surface_notify_new_round_trip_time (gfx_surface, round_trip_time_us);
+  g_mutex_unlock (&graphics_pipeline->gfx_mutex);
+}
+
 static uint32_t
 get_next_free_frame_id (GrdRdpGraphicsPipeline *graphics_pipeline)
 {
diff --git a/src/grd-rdp-graphics-pipeline.h b/src/grd-rdp-graphics-pipeline.h
index 2e123a3..40be87a 100644
--- a/src/grd-rdp-graphics-pipeline.h
+++ b/src/grd-rdp-graphics-pipeline.h
@@ -51,6 +51,9 @@ void grd_rdp_graphics_pipeline_reset_graphics (GrdRdpGraphicsPipeline *graphics_
                                                MONITOR_DEF            *monitors,
                                                uint32_t                n_monitors);
 
+void grd_rdp_graphics_pipeline_notify_new_round_trip_time (GrdRdpGraphicsPipeline *graphics_pipeline,
+                                                           uint64_t                round_trip_time_us);
+
 void grd_rdp_graphics_pipeline_refresh_gfx (GrdRdpGraphicsPipeline *graphics_pipeline,
                                             GrdRdpSurface          *rdp_surface,
                                             cairo_region_t         *region,


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