[gnome-network-displays] media-factory: Do not register a bus watch on the pipeline



commit 0ad503b767b990cf9fb5ebde546f154668a597f5
Author: Benjamin Berg <bberg redhat com>
Date:   Mon Apr 19 23:58:46 2021 +0200

    media-factory: Do not register a bus watch on the pipeline
    
    The RTSP server code must be able to register a bus watch for the
    pipeline. Doing so ourselves prevents this bus watch to be registered
    and breaks the RTSP server code.
    
    Thanks to Nicolas Dufresne for pointing this out!

 src/wfd/wfd-media-factory.c | 66 ---------------------------------------------
 1 file changed, 66 deletions(-)
---
diff --git a/src/wfd/wfd-media-factory.c b/src/wfd/wfd-media-factory.c
index 88e783d..fcf7598 100644
--- a/src/wfd/wfd-media-factory.c
+++ b/src/wfd/wfd-media-factory.c
@@ -450,74 +450,11 @@ wfd_media_factory_create_element (GstRTSPMediaFactory *factory, const GstRTSPUrl
   return (GstElement *) g_steal_pointer (&bin);
 }
 
-static gboolean
-pipeline_bus_watch_cb (GstBus     *bus,
-                       GstMessage *message,
-                       gpointer    data)
-{
-  switch (GST_MESSAGE_TYPE (message))
-    {
-    case GST_MESSAGE_ERROR: {
-        GError *err;
-        gchar *debug;
-
-        gst_message_parse_error (message, &err, &debug);
-        g_print ("Error from %s: %s\n", GST_MESSAGE_SRC_NAME (message), err->message);
-        g_error_free (err);
-        g_free (debug);
-
-        break;
-      }
-
-    case GST_MESSAGE_WARNING: {
-        GError *err;
-        gchar *debug;
-
-        gst_message_parse_warning (message, &err, &debug);
-        g_print ("Warning from %s: %s\n", GST_MESSAGE_SRC_NAME (message), err->message);
-        g_error_free (err);
-        g_free (debug);
-
-        break;
-      }
-
-    case GST_MESSAGE_QOS: {
-        gboolean live;
-        guint64 running_time, stream_time, timestamp, duration;
-        guint64 processed, dropped;
-        gint64 jitter;
-        gdouble proportion;
-        gint quality;
-
-        gst_message_parse_qos (message, &live, &running_time, &stream_time, &timestamp, &duration);
-        gst_message_parse_qos_stats (message, NULL, &processed, &dropped);
-        gst_message_parse_qos_values (message, &jitter, &proportion, &quality);
-
-        g_debug ("QOS: proportion: %.3f, processed: %" G_GUINT64_FORMAT ", dropped: %" G_GUINT64_FORMAT "",
-                 proportion, processed, dropped);
-        break;
-      }
-
-    case GST_MESSAGE_EOS:
-      /* end-of-stream */
-      g_debug ("reached EOS");
-      break;
-
-    default:
-      /* unhandled message */
-      break;
-    }
-
-  return TRUE;
-}
-
 static GstElement *
 wfd_media_factory_create_pipeline (GstRTSPMediaFactory *factory, GstRTSPMedia *media)
 {
   GstElement *pipeline;
 
-  g_autoptr(GstBus) bus = NULL;
-
   pipeline = GST_RTSP_MEDIA_FACTORY_CLASS (wfd_media_factory_parent_class)->create_pipeline (factory, media);
 
   /* We need a high latency for the openh264 encoder at least when the
@@ -525,9 +462,6 @@ wfd_media_factory_create_pipeline (GstRTSPMediaFactory *factory, GstRTSPMedia *m
    * be very high for short periods of time, and this prevents further issues. */
   gst_pipeline_set_latency (GST_PIPELINE (pipeline), 500 * GST_MSECOND);
 
-  bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
-  gst_bus_add_watch (bus, pipeline_bus_watch_cb, NULL);
-
   return pipeline;
 }
 


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