Commit c34f5d1c authored by Wim Taymans's avatar Wim Taymans

media: add signal for new streams

This allows applications to listen for new streams and configure properties on
them, like the address pool.
parent 4168a679
......@@ -48,6 +48,7 @@ enum
enum
{
SIGNAL_NEW_STREAM,
SIGNAL_PREPARED,
SIGNAL_UNPREPARED,
SIGNAL_NEW_STATE,
......@@ -109,6 +110,11 @@ gst_rtsp_media_class_init (GstRTSPMediaClass * klass)
"The kernel UDP buffer size to use", 0, G_MAXUINT,
DEFAULT_BUFFER_SIZE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_rtsp_media_signals[SIGNAL_NEW_STREAM] =
g_signal_new ("new-stream", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRTSPMediaClass, new_stream), NULL, NULL,
g_cclosure_marshal_generic, G_TYPE_NONE, 1, GST_TYPE_RTSP_STREAM);
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,
......@@ -715,6 +721,9 @@ gst_rtsp_media_create_stream (GstRTSPMedia * media, GstElement * payloader,
g_ptr_array_add (media->streams, stream);
g_mutex_unlock (&media->lock);
g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_NEW_STREAM], 0, stream,
NULL);
return stream;
}
......
......@@ -164,6 +164,8 @@ struct _GstRTSPMediaClass {
gboolean (*unprepare) (GstRTSPMedia *media);
/* signals */
gboolean (*new_stream) (GstRTSPMedia *media, GstRTSPStream * stream);
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