From ea4543efc810f9347196ece13e8c2168b82073eb Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 1 May 2014 06:17:06 +0200 Subject: [PATCH] client: emit a signal before sending a message Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728970 --- gst/rtsp-server/rtsp-client.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index fc58b16..d42f933 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -114,6 +114,7 @@ enum SIGNAL_SET_PARAMETER_REQUEST, SIGNAL_GET_PARAMETER_REQUEST, SIGNAL_HANDLE_RESPONSE, + SIGNAL_SEND_MESSAGE, SIGNAL_LAST }; @@ -247,6 +248,11 @@ gst_rtsp_client_class_init (GstRTSPClientClass * klass) handle_response), NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); + gst_rtsp_client_signals[SIGNAL_SEND_MESSAGE] = + g_signal_new ("send-message", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER); + tunnels = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); g_mutex_init (&tunnels_lock); @@ -473,6 +479,9 @@ send_message (GstRTSPClient * client, GstRTSPContext * ctx, if (close) gst_rtsp_message_add_header (message, GST_RTSP_HDR_CONNECTION, "close"); + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_SEND_MESSAGE], + 0, ctx, message); + g_mutex_lock (&priv->send_lock); if (priv->send_func) priv->send_func (client, message, close, priv->send_data); -- 2.7.4