From b7c5ae7a1ae29b6acedfffde3d4319d3cfe15bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Tue, 1 Sep 2009 15:12:25 -0400 Subject: Add stream-closed signal to EmpathyCallHandler for when a stream is closed --- libempathy/empathy-call-handler.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libempathy') diff --git a/libempathy/empathy-call-handler.c b/libempathy/empathy-call-handler.c index 1c6e53c6c..0c2a84a05 100644 --- a/libempathy/empathy-call-handler.c +++ b/libempathy/empathy-call-handler.c @@ -42,6 +42,7 @@ enum { SINK_PAD_ADDED, REQUEST_RESOURCE, CLOSED, + STREAM_CLOSED, LAST_SIGNAL }; @@ -254,6 +255,12 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + + signals[STREAM_CLOSED] = + g_signal_new ("stream-closed", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, 0, NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, TF_TYPE_STREAM); } /** @@ -350,6 +357,13 @@ empathy_call_handler_tf_stream_request_resource_cb (TfStream *stream, return ret; } +static void +empathy_call_handler_tf_stream_closed_cb (TfStream *stream, + EmpathyCallHandler *handler) +{ + g_signal_emit (handler, signals[STREAM_CLOSED], 0, stream); +} + static void empathy_call_handler_tf_channel_stream_created_cb (TfChannel *tfchannel, TfStream *stream, EmpathyCallHandler *handler) @@ -362,6 +376,8 @@ empathy_call_handler_tf_channel_stream_created_cb (TfChannel *tfchannel, g_signal_connect (stream, "request-resource", G_CALLBACK (empathy_call_handler_tf_stream_request_resource_cb), handler); + g_signal_connect (stream, "closed", + G_CALLBACK (empathy_call_handler_tf_stream_closed_cb), handler); g_object_get (stream, "media-type", &media_type, "sink-pad", &spad, NULL); -- cgit v1.2.3