Re: [PATCH spice-gtk] Use same sink settings for direct rendering

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

 



Hi,


On 11/19/2018 11:21 PM, Frediano Ziglio wrote:
From: Snir Sheriber <ssheribe@xxxxxxxxxx>

Set "sync" and "drop" as normal streaming.

Well, It is not the same case, with appsink we mark those two as false
since we handle the presenting of the decoded frames ourselves so frames
are still being synchronized with audio.
In the overlay case this will actually avoid synchronization (which I'm currently
in favor)

---
  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,
If we doing it here this possibly can be removed from the other place we set it.
+                     "drop", FALSE,
I'd remove "drop", i don't think it's available for most sinks.
+                     NULL);
+        spice_debug("^^^^SINK^^^^");
I'd remove this, (not sure about the printing the elements names).
+    }
+    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,

So if the consequences of doing it are agreed I'd do it.


Snir.
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]