[Spice-commits] src/channel-display.c src/channel-display-mjpeg.c src/spice-widget.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 3 06:21:14 UTC 2019


 src/channel-display-mjpeg.c |    3 +++
 src/channel-display.c       |    4 +++-
 src/spice-widget.c          |   11 +++++++++--
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit f9d54ada796f48ca1d1764f955290db22a9542f9
Author: Kevin Pouget <kpouget at redhat.com>
Date:   Wed Aug 7 17:14:03 2019 +0200

    streaming: make draw-area visible on MJPEG encoder creation
    
    This patch allows the MJPEG encoder to inform the spice-widget that
    its video drawing area (draw-area) should be made visible on screen.
    
    This is required to switch from GST video decoding to native MJPEG
    decoding, otherwise the gst-area remained on top and the MJPEG video
    stream was never shown.
    
    Signed-off-by: Kevin Pouget <kpouget at redhat.com>
    Acked-by: Snir Sheriber <ssheribe at redhat.com>

diff --git a/src/channel-display-mjpeg.c b/src/channel-display-mjpeg.c
index 647d31b..636a98b 100644
--- a/src/channel-display-mjpeg.c
+++ b/src/channel-display-mjpeg.c
@@ -300,5 +300,8 @@ VideoDecoder* create_mjpeg_decoder(int codec_type, display_stream *stream)
 
     /* All the other fields are initialized to zero by g_new0(). */
 
+    /* makes the draw-area visible */
+    hand_pipeline_to_widget(stream, NULL);
+
     return (VideoDecoder*)decoder;
 }
diff --git a/src/channel-display.c b/src/channel-display.c
index 59c809d..cd87c7c 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -485,7 +485,9 @@ static void spice_display_channel_class_init(SpiceDisplayChannelClass *klass)
      *
      * The #SpiceDisplayChannel::gst-video-overlay signal is emitted when
      * pipeline is ready and can be passed to widget to register GStreamer
-     * overlay interface and other GStreamer callbacks.
+     * overlay interface and other GStreamer callbacks. If the pipeline
+     * pointer is NULL, the drawing area of the native renderer is set
+     * visible.
      *
      * Returns: %TRUE if the overlay is being set
      *
diff --git a/src/spice-widget.c b/src/spice-widget.c
index a9ba1f1..d73e02f 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -2780,13 +2780,20 @@ static void gst_size_allocate(GtkWidget *widget, GdkRectangle *a, gpointer data)
 }
 
 /* This callback should pass to the widget a pointer of the pipeline
- * so that we can set pipeline and overlay related calls from here.
+ * so that we can the set GST pipeline and overlay related calls from
+ * here.  If the pipeline pointer is NULL, the drawing area of the
+ * native renderer is set visible.
  */
 static gboolean set_overlay(SpiceChannel *channel, void* pipeline_ptr, SpiceDisplay *display)
 {
-#if defined(GDK_WINDOWING_X11)
     SpiceDisplayPrivate *d = display->priv;
 
+    if (pipeline_ptr == NULL) {
+        gtk_stack_set_visible_child_name(d->stack, "draw-area");
+        return true;
+    }
+
+#if defined(GDK_WINDOWING_X11)
     /* GstVideoOverlay is currently used only under x */
     if (!g_getenv("DISABLE_GSTVIDEOOVERLAY") &&
         GDK_IS_X11_DISPLAY(gdk_display_get_default())) {


More information about the Spice-commits mailing list