From: Wim Taymans Date: Fri, 3 Apr 2009 20:45:57 +0000 (+0200) Subject: media: add signal to notify of unprepare X-Git-Tag: 1.6.0~959 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c1df5e02372abb26c94719edd0cb610e4fbaa88;p=platform%2Fupstream%2Fgst-rtsp-server.git media: add signal to notify of unprepare --- diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index 57cf15b..b75662b 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -30,6 +30,12 @@ enum PROP_LAST }; +enum +{ + SIGNAL_UNPREPARED, + SIGNAL_LAST +}; + static void gst_rtsp_media_get_property (GObject *object, guint propid, GValue *value, GParamSpec *pspec); static void gst_rtsp_media_set_property (GObject *object, guint propid, @@ -40,6 +46,8 @@ static gpointer do_loop (GstRTSPMediaClass *klass); static gboolean default_handle_message (GstRTSPMedia *media, GstMessage *message); static void unlock_streams (GstRTSPMedia *media); +static guint gst_rtsp_media_signals[SIGNAL_LAST] = { 0 }; + G_DEFINE_TYPE (GstRTSPMedia, gst_rtsp_media, G_TYPE_OBJECT); static void @@ -63,6 +71,11 @@ gst_rtsp_media_class_init (GstRTSPMediaClass * klass) "If this media pipeline can be reused after an unprepare", DEFAULT_REUSABLE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + gst_rtsp_media_signals[SIGNAL_UNPREPARED] = + g_signal_new ("unprepared", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstRTSPMediaClass, unprepared), NULL, NULL, + g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE); + klass->context = g_main_context_new (); klass->loop = g_main_loop_new (klass->context, TRUE); diff --git a/gst/rtsp-server/rtsp-media.h b/gst/rtsp-server/rtsp-media.h index e4eafaa..3273f53 100644 --- a/gst/rtsp-server/rtsp-media.h +++ b/gst/rtsp-server/rtsp-media.h @@ -186,7 +186,11 @@ struct _GstRTSPMediaClass { GMainLoop *loop; GThread *thread; + /* vmethods */ gboolean (*handle_message) (GstRTSPMedia *media, GstMessage *message); + + /* signals */ + gboolean (*unprepared) (GstRTSPMedia *media); }; GType gst_rtsp_media_get_type (void);