mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 09:38:17 +00:00
media: add signal for new streams
This allows applications to listen for new streams and configure properties on them, like the address pool.
This commit is contained in:
parent
4168a67992
commit
c34f5d1c1a
2 changed files with 11 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue