[Spice-devel] [PATCH spice-gtk] Use same sink settings for direct rendering

Frediano Ziglio fziglio at redhat.com
Mon Nov 19 21:21:12 UTC 2018


From: Snir Sheriber <ssheribe at redhat.com>

Set "sync" and "drop" as normal streaming.
---
 src/channel-display-gst.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Well, I extracted this patch from a more bigger Snir sent, not much
changes so I kept the authorship.

diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
index 2c07f350..5f49c3bb 100644
--- a/src/channel-display-gst.c
+++ b/src/channel-display-gst.c
@@ -382,6 +382,24 @@ static void app_source_setup(GstElement *pipeline G_GNUC_UNUSED,
 }
 #endif
 
+// This function is used to set properties in dynamically added sink (if overlay is used)
+static void
+add_elem_cb(GstBin * pipeline, GstBin * bin, GstElement * element, SpiceGstDecoder *decoder)
+{
+    char *name = gst_element_get_name(element);
+
+    spice_debug("Adding element: %s", name);
+
+    if (GST_IS_BASE_SINK(element)) {
+        g_object_set(element,
+                     "sync", FALSE,
+                     "drop", FALSE,
+                     NULL);
+        spice_debug("^^^^SINK^^^^");
+    }
+    g_free(name);
+}
+
 static gboolean create_pipeline(SpiceGstDecoder *decoder)
 {
     GstBus *bus;
@@ -442,6 +460,7 @@ static gboolean create_pipeline(SpiceGstDecoder *decoder)
         }
     }
 
+    g_signal_connect(playbin, "deep-element-added", G_CALLBACK(add_elem_cb), decoder);
     g_signal_connect(playbin, "source-setup", G_CALLBACK(app_source_setup), decoder);
 
     g_object_set(playbin,
-- 
2.17.2



More information about the Spice-devel mailing list