From: Wim Taymans Date: Wed, 12 Jan 2011 14:35:51 +0000 (+0100) Subject: client: emit signal when closing X-Git-Tag: 1.19.3~495^2~1387^2~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a4a15077b67cc2374ab1df5b7e385949685cffb;p=platform%2Fupstream%2Fgstreamer.git client: emit signal when closing --- diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index b829ffa..8e9b026 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -50,9 +50,17 @@ enum PROP_LAST }; +enum +{ + SIGNAL_CLOSED, + SIGNAL_LAST +}; + GST_DEBUG_CATEGORY_STATIC (rtsp_client_debug); #define GST_CAT_DEFAULT rtsp_client_debug +static guint gst_rtsp_client_signals[SIGNAL_LAST] = { 0 }; + static void gst_rtsp_client_get_property (GObject * object, guint propid, GValue * value, GParamSpec * pspec); static void gst_rtsp_client_set_property (GObject * object, guint propid, @@ -89,6 +97,11 @@ gst_rtsp_client_class_init (GstRTSPClientClass * klass) GST_TYPE_RTSP_MEDIA_MAPPING, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + gst_rtsp_client_signals[SIGNAL_CLOSED] = + g_signal_new ("closed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstRTSPClientClass, closed), NULL, NULL, + g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE); + tunnels = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); tunnels_lock = g_mutex_new (); @@ -1882,6 +1895,7 @@ client_watch_notify (GstRTSPClient * client) GST_INFO ("client %p: watch destroyed", client); client->watchid = 0; client->watch = NULL; + g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_CLOSED], 0, NULL); g_object_unref (client); } diff --git a/gst/rtsp-server/rtsp-client.h b/gst/rtsp-server/rtsp-client.h index 710a7b3..dc2c79c 100644 --- a/gst/rtsp-server/rtsp-client.h +++ b/gst/rtsp-server/rtsp-client.h @@ -107,6 +107,9 @@ struct _GstRTSPClient { struct _GstRTSPClientClass { GObjectClass parent_class; + + /* signals */ + void (*closed) (GstRTSPClient *client); }; GType gst_rtsp_client_get_type (void);