diff options
author | Patricia Muscalu <patricia@axis.com> | 2017-10-16 11:35:10 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-11-15 17:46:00 +0200 |
commit | 5ec1b809895b35d103fbef5f20ebef0ddefd2c59 (patch) | |
tree | abeeaff911114f8b2fe763bed45cafefa2492f31 | |
parent | 51d670f73bb4d4fd8fbfde2daf191bc8f7a74218 (diff) |
rtsp-session-media: add function to get a list of transports
Change-Id: I817e10624da0f3200f24d1b232cff481099278e3
https://bugzilla.gnome.org/show_bug.cgi?id=788340
-rw-r--r-- | gst/rtsp-server/rtsp-session-media.c | 24 | ||||
-rw-r--r-- | gst/rtsp-server/rtsp-session-media.h | 3 |
2 files changed, 27 insertions, 0 deletions
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 @@ -408,6 +408,30 @@ gst_rtsp_session_media_get_transport (GstRTSPSessionMedia * media, guint idx) } /** + * 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 * @range: (out): a #GstRTSPRange 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 @@ -103,6 +103,9 @@ GstRTSPStreamTransport * gst_rtsp_session_media_get_transport (GstRTSPSessionMe 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); |