aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-call-window.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-11-10 00:27:51 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-11-11 22:01:07 +0800
commitffaa3afe49651493d0dcb01eba1b6dcd1134eed1 (patch)
treea44e87a363ca450b57d69e5d0f456759949bdef8 /src/empathy-call-window.c
parent8f95b35828bbf37beda060ed25957599e4f50c5f (diff)
downloadgsoc2013-empathy-ffaa3afe49651493d0dcb01eba1b6dcd1134eed1.tar
gsoc2013-empathy-ffaa3afe49651493d0dcb01eba1b6dcd1134eed1.tar.gz
gsoc2013-empathy-ffaa3afe49651493d0dcb01eba1b6dcd1134eed1.tar.bz2
gsoc2013-empathy-ffaa3afe49651493d0dcb01eba1b6dcd1134eed1.tar.lz
gsoc2013-empathy-ffaa3afe49651493d0dcb01eba1b6dcd1134eed1.tar.xz
gsoc2013-empathy-ffaa3afe49651493d0dcb01eba1b6dcd1134eed1.tar.zst
gsoc2013-empathy-ffaa3afe49651493d0dcb01eba1b6dcd1134eed1.zip
Call: Signal content-{added/removed} instead of sink-{added/removed}
Tp-Farstream signals contents, not sinks (like tp-farsight did). So lets mirror that, which allows us to make better decisions about what kind of contents we are given https://bugzilla.gnome.org/show_bug.cgi?id=663842
Diffstat (limited to 'src/empathy-call-window.c')
-rw-r--r--src/empathy-call-window.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index ab7dbeef8..8a4a3aa29 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -2691,15 +2691,17 @@ empathy_call_window_channel_closed_cb (EmpathyCallHandler *handler,
}
static gboolean
-empathy_call_window_sink_removed_cb (EmpathyCallHandler *handler,
- GstPad *sink,
- FsMediaType media_type,
+empathy_call_window_content_removed_cb (EmpathyCallHandler *handler,
+ TfContent *content,
EmpathyCallWindow *self)
{
EmpathyCallWindowPriv *priv = GET_PRIV (self);
+ FsMediaType media_type;
DEBUG ("removing content");
+ g_object_get (content, "media-type", &media_type, NULL);
+
/*
* This assumes that there is only one video stream per channel...
*/
@@ -2718,7 +2720,6 @@ empathy_call_window_sink_removed_cb (EmpathyCallHandler *handler,
gst_bin_remove (GST_BIN (priv->pipeline), output);
gst_bin_remove (GST_BIN (priv->pipeline), priv->funnel);
priv->funnel = NULL;
- return TRUE;
}
}
else if (media_type == FS_MEDIA_TYPE_AUDIO)
@@ -2729,11 +2730,14 @@ empathy_call_window_sink_removed_cb (EmpathyCallHandler *handler,
gst_bin_remove (GST_BIN (priv->pipeline), priv->audio_output);
priv->audio_output = NULL;
- return TRUE;
}
}
+ else
+ {
+ g_assert_not_reached ();
+ }
- return FALSE;
+ return TRUE;
}
static void
@@ -3401,14 +3405,18 @@ empathy_call_window_src_added_cb (EmpathyCallHandler *handler,
}
static gboolean
-empathy_call_window_sink_added_cb (EmpathyCallHandler *handler,
- GstPad *sink, FsMediaType media_type, gpointer user_data)
+empathy_call_window_content_added_cb (EmpathyCallHandler *handler,
+ TfContent *content, gpointer user_data)
{
EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
EmpathyCallWindowPriv *priv = GET_PRIV (self);
- GstPad *pad;
+ GstPad *sink, *pad;
+ FsMediaType media_type;
gboolean retval = FALSE;
+ g_object_get (content, "media-type", &media_type, "sink-pad", &sink, NULL);
+ g_assert (sink != NULL);
+
switch (media_type)
{
case FS_MEDIA_TYPE_AUDIO:
@@ -3461,6 +3469,7 @@ empathy_call_window_sink_added_cb (EmpathyCallHandler *handler,
g_assert_not_reached ();
}
+ gst_object_unref (sink);
return retval;
}
@@ -3705,10 +3714,10 @@ empathy_call_window_connect_handler (EmpathyCallWindow *self)
G_CALLBACK (empathy_call_window_channel_closed_cb), self);
g_signal_connect (priv->handler, "src-pad-added",
G_CALLBACK (empathy_call_window_src_added_cb), self);
- g_signal_connect (priv->handler, "sink-pad-added",
- G_CALLBACK (empathy_call_window_sink_added_cb), self);
- g_signal_connect (priv->handler, "sink-pad-removed",
- G_CALLBACK (empathy_call_window_sink_removed_cb), self);
+ g_signal_connect (priv->handler, "content-added",
+ G_CALLBACK (empathy_call_window_content_added_cb), self);
+ g_signal_connect (priv->handler, "content-removed",
+ G_CALLBACK (empathy_call_window_content_removed_cb), self);
/* We connect to ::call-channel unconditionally since we'll
* get new channels if we hangup and redial or if we reuse the