[empathy] Send stream error when the src pad can't be linked



commit 4a4a8f89579147d1e712d5da257c83786f86439f
Author: Olivier Crête <olivier crete collabora co uk>
Date:   Sat Mar 6 17:02:32 2010 -0500

    Send stream error when the src pad can't be linked

 libempathy/empathy-call-handler.c |   11 ++++++++---
 src/empathy-call-window.c         |    4 +++-
 2 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/libempathy/empathy-call-handler.c b/libempathy/empathy-call-handler.c
index 3be5eda..9cfee1d 100644
--- a/libempathy/empathy-call-handler.c
+++ b/libempathy/empathy-call-handler.c
@@ -231,8 +231,8 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass)
   signals[SRC_PAD_ADDED] =
     g_signal_new ("src-pad-added", G_TYPE_FROM_CLASS (klass),
       G_SIGNAL_RUN_LAST, 0, NULL, NULL,
-      _empathy_marshal_VOID__OBJECT_UINT,
-      G_TYPE_NONE,
+      _empathy_marshal_BOOLEAN__OBJECT_UINT,
+      G_TYPE_BOOLEAN,
       2, GST_TYPE_PAD, G_TYPE_UINT);
 
   signals[SINK_PAD_ADDED] =
@@ -334,11 +334,16 @@ empathy_call_handler_tf_stream_src_pad_added_cb (TfStream *stream,
   GstPad *pad, FsCodec *codec, EmpathyCallHandler  *handler)
 {
   guint media_type;
+  gboolean retval;
 
   g_object_get (stream, "media-type", &media_type, NULL);
 
   g_signal_emit (G_OBJECT (handler), signals[SRC_PAD_ADDED], 0,
-    pad, media_type);
+      pad, media_type, &retval);
+
+  if (!retval)
+      tf_stream_error (stream, TP_MEDIA_STREAM_ERROR_MEDIA_ERROR,
+          "Could not link sink");
 }
 
 
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 5a157ab..09197bf 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -1993,7 +1993,7 @@ empathy_call_window_connected (gpointer user_data)
 
 
 /* Called from the streaming thread */
-static void
+static gboolean
 empathy_call_window_src_added_cb (EmpathyCallHandler *handler,
   GstPad *src, guint media_type, gpointer user_data)
 {
@@ -2029,6 +2029,8 @@ empathy_call_window_src_added_cb (EmpathyCallHandler *handler,
   gst_object_unref (pad);
 
   g_mutex_unlock (priv->lock);
+
+  return TRUE;
 }
 
 /* Called from the streaming thread */



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