diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2011-11-10 00:27:51 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2011-11-11 22:01:07 +0800 |
commit | ffaa3afe49651493d0dcb01eba1b6dcd1134eed1 (patch) | |
tree | a44e87a363ca450b57d69e5d0f456759949bdef8 /src/empathy-call-handler.c | |
parent | 8f95b35828bbf37beda060ed25957599e4f50c5f (diff) | |
download | gsoc2013-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-handler.c')
-rw-r--r-- | src/empathy-call-handler.c | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/src/empathy-call-handler.c b/src/empathy-call-handler.c index ef07c503a..0477cd7c0 100644 --- a/src/empathy-call-handler.c +++ b/src/empathy-call-handler.c @@ -47,8 +47,8 @@ enum { CONFERENCE_ADDED, CONFERENCE_REMOVED, SRC_PAD_ADDED, - SINK_PAD_ADDED, - SINK_PAD_REMOVED, + CONTENT_ADDED, + CONTENT_REMOVED, CLOSED, CANDIDATES_CHANGED, STATE_CHANGED, @@ -481,19 +481,19 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass) G_TYPE_BOOLEAN, 2, GST_TYPE_PAD, G_TYPE_UINT); - signals[SINK_PAD_ADDED] = - g_signal_new ("sink-pad-added", G_TYPE_FROM_CLASS (klass), + signals[CONTENT_ADDED] = + g_signal_new ("content-added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, - 2, GST_TYPE_PAD, G_TYPE_UINT); + 1, TF_TYPE_CONTENT); - signals[SINK_PAD_REMOVED] = - g_signal_new ("sink-pad-removed", G_TYPE_FROM_CLASS (klass), + signals[CONTENT_REMOVED] = + g_signal_new ("content-removed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, - 2, GST_TYPE_PAD, G_TYPE_UINT); + 1, TF_TYPE_CONTENT); signals[CLOSED] = g_signal_new ("closed", G_TYPE_FROM_CLASS (klass), @@ -806,7 +806,6 @@ on_tf_channel_content_added_cb (TfChannel *tfchannel, EmpathyCallHandler *handler) { FsMediaType mtype; - GstPad *spad; FsSession *session; // FsStream *fs_stream; FsCodec *codec; @@ -822,11 +821,8 @@ on_tf_channel_content_added_cb (TfChannel *tfchannel, G_CALLBACK (on_tf_content_stop_sending_cb), handler); #endif - g_object_get (content, "media-type", &mtype, - "sink-pad", &spad, NULL); - - g_signal_emit (G_OBJECT (handler), signals[SINK_PAD_ADDED], 0, - spad, mtype, &retval); + g_signal_emit (G_OBJECT (handler), signals[CONTENT_ADDED], 0, + content, &retval); if (!retval) tf_content_error (content, 0 /* FIXME */, @@ -852,6 +848,8 @@ on_tf_channel_content_added_cb (TfChannel *tfchannel, tp_clear_object (&fs_stream); */ + g_object_get (content, "media-type", &mtype, NULL); + if (mtype == FS_MEDIA_TYPE_VIDEO) { guint framerate, width, height; @@ -878,8 +876,6 @@ on_tf_channel_content_added_cb (TfChannel *tfchannel, g_signal_emit (G_OBJECT (handler), signals[RESOLUTION_CHANGED], 0, width, height); } - - gst_object_unref (spad); } static void @@ -887,17 +883,12 @@ on_tf_channel_content_removed_cb (TfChannel *tfchannel, TfContent *content, EmpathyCallHandler *handler) { - FsMediaType mtype; - GstPad *spad; gboolean retval; DEBUG ("removing content"); - g_object_get (content, "media-type", &mtype, - "sink-pad", &spad, NULL); - - g_signal_emit (G_OBJECT (handler), signals[SINK_PAD_REMOVED], 0, - spad, mtype, &retval); + g_signal_emit (G_OBJECT (handler), signals[CONTENT_REMOVED], 0, + content, &retval); if (!retval) { |