rtsp-session-media: add function to get a list of transports

Change-Id: I817e10624da0f3200f24d1b232cff481099278e3

https://bugzilla.gnome.org/show_bug.cgi?id=788340
This commit is contained in:
Patricia Muscalu 2017-10-16 11:35:10 +02:00 committed by Sebastian Dröge
parent 51d670f73b
commit 5ec1b80989
2 changed files with 27 additions and 0 deletions

View file

@ -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

View file

@ -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);