Commit 1ea45017 authored by Wim Taymans's avatar Wim Taymans

media: emit prepared signal when prepared

Make a 'prepared' signal and emit it when we successfully prepared the element.
This signal can be used to configure the media object after it has been prepared
for streaming.
parent 7dfb91e2
......@@ -46,6 +46,7 @@ enum
enum
{
SIGNAL_PREPARED,
SIGNAL_UNPREPARED,
SIGNAL_LAST
};
......@@ -103,6 +104,11 @@ gst_rtsp_media_class_init (GstRTSPMediaClass * klass)
"Send an EOS event to the pipeline before unpreparing",
DEFAULT_EOS_SHUTDOWN, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_rtsp_media_signals[SIGNAL_PREPARED] =
g_signal_new ("prepared", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRTSPMediaClass, prepared), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE);
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,
......@@ -1592,6 +1598,8 @@ gst_rtsp_media_prepare (GstRTSPMedia * media)
if (status == GST_RTSP_MEDIA_STATUS_ERROR)
goto state_failed;
g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_PREPARED], 0, NULL);
GST_INFO ("object %p is prerolled", media);
return TRUE;
......
......@@ -250,6 +250,7 @@ struct _GstRTSPMediaClass {
gboolean (*unprepare) (GstRTSPMedia *media);
/* signals */
gboolean (*prepared) (GstRTSPMedia *media);
gboolean (*unprepared) (GstRTSPMedia *media);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment