return text;
}
+static gboolean
+bus_watch_cb (GstBus * bus, GstMessage * message, gpointer user_data)
+{
+ switch (GST_MESSAGE_TYPE (message)) {
+ case GST_MESSAGE_ERROR:
+ {
+ GError *error = NULL;
+ gchar *debug = NULL;
+
+ gst_message_parse_error (message, &error, &debug);
+ g_error ("Error on bus: %s (debug: %s)", error->message, debug);
+ g_error_free (error);
+ g_free (debug);
+ break;
+ }
+ case GST_MESSAGE_WARNING:
+ {
+ GError *error = NULL;
+ gchar *debug = NULL;
+
+ gst_message_parse_warning (message, &error, &debug);
+ g_warning ("Warning on bus: %s (debug: %s)", error->message, debug);
+ g_error_free (error);
+ g_free (debug);
+ break;
+ }
+ default:
+ break;
+ }
+
+ return G_SOURCE_CONTINUE;
+}
+
static void
handle_media_stream (GstPad * pad, GstElement * pipe, const char *convert_name,
const char *sink_name)
{
GstStateChangeReturn ret;
GError *error = NULL;
+ GstBus *bus = NULL;
/* NOTE: webrtcbin currently does not support dynamic addition/removal of
* streams, so we use a separate webrtcbin for each peer, but all of them are
goto err;
}
+ bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
+ gst_bus_add_watch (bus, bus_watch_cb, NULL);
+ gst_object_unref (bus);
+
gst_print ("Starting pipeline, not transmitting yet\n");
ret = gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
if (ret == GST_STATE_CHANGE_FAILURE)