media: add signal to notify of unprepare

This commit is contained in:
Wim Taymans 2009-04-03 22:45:57 +02:00 committed by Wim Taymans
parent 5dab222089
commit 0c1df5e023
2 changed files with 17 additions and 0 deletions

View file

@ -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);

View file

@ -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);