From 5ec1b809895b35d103fbef5f20ebef0ddefd2c59 Mon Sep 17 00:00:00 2001 From: Patricia Muscalu Date: Mon, 16 Oct 2017 11:35:10 +0200 Subject: rtsp-session-media: add function to get a list of transports Change-Id: I817e10624da0f3200f24d1b232cff481099278e3 https://bugzilla.gnome.org/show_bug.cgi?id=788340 --- gst/rtsp-server/rtsp-session-media.c | 24 ++++++++++++++++++++++++ gst/rtsp-server/rtsp-session-media.h | 3 +++ 2 files changed, 27 insertions(+) diff --git a/gst/rtsp-server/rtsp-session-media.c b/gst/rtsp-server/rtsp-session-media.c index 0fffbca..96ad1b6 100644 --- a/gst/rtsp-server/rtsp-session-media.c +++ b/gst/rtsp-server/rtsp-session-media.c @@ -407,6 +407,30 @@ gst_rtsp_session_media_get_transport (GstRTSPSessionMedia * media, guint idx) return result; } +/** + * gst_rtsp_session_media_get_transports: + * @media: a #GstRTSPSessionMedia + * + * Get a list of all available #GstRTSPStreamTransport in this session. + * + * Returns: (transfer full): a list of #GstRTSPStreamTransport, + * g_ptr_array_unref () after usage. + */ +GPtrArray * +gst_rtsp_session_media_get_transports (GstRTSPSessionMedia * media) +{ + GstRTSPSessionMediaPrivate *priv; + GPtrArray *result; + + g_return_val_if_fail (GST_IS_RTSP_SESSION_MEDIA (media), NULL); + priv = media->priv; + + g_mutex_lock (&priv->lock); + result = g_ptr_array_ref (priv->transports); + g_mutex_unlock (&priv->lock); + + return result; +} /** * gst_rtsp_session_media_alloc_channels: * @media: a #GstRTSPSessionMedia diff --git a/gst/rtsp-server/rtsp-session-media.h b/gst/rtsp-server/rtsp-session-media.h index 612173b..2a6fe2a 100644 --- a/gst/rtsp-server/rtsp-session-media.h +++ b/gst/rtsp-server/rtsp-session-media.h @@ -102,6 +102,9 @@ GST_EXPORT GstRTSPStreamTransport * gst_rtsp_session_media_get_transport (GstRTSPSessionMedia *media, guint idx); +GST_EXPORT +GPtrArray * gst_rtsp_session_media_get_transports (GstRTSPSessionMedia *media); + GST_EXPORT gboolean gst_rtsp_session_media_alloc_channels (GstRTSPSessionMedia *media, GstRTSPRange *range); -- cgit v1.2.3