stream: allow access to the rtp session
authorAleix Conchillo Flaque <aleix@oblong.com>
Mon, 24 Jun 2013 18:41:27 +0000 (11:41 -0700)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 24 Jun 2013 21:42:58 +0000 (23:42 +0200)
  https://bugzilla.gnome.org/show_bug.cgi?id=703004

gst/rtsp-server/rtsp-stream.c
gst/rtsp-server/rtsp-stream.h

index 11486e5..f992048 100644 (file)
@@ -271,7 +271,7 @@ gst_rtsp_stream_get_mtu (GstRTSPStream * stream)
 
 /* Update the dscp qos property on the udp sinks */
 static void
-update_dscp_qos (GstRTSPStream *stream)
+update_dscp_qos (GstRTSPStream * stream)
 {
   GstRTSPStreamPrivate *priv;
 
@@ -298,7 +298,7 @@ update_dscp_qos (GstRTSPStream *stream)
  * Configure the dscp qos of the outgoing sockets to @dscp_qos.
  */
 void
-gst_rtsp_stream_set_dscp_qos (GstRTSPStream *stream, gint dscp_qos)
+gst_rtsp_stream_set_dscp_qos (GstRTSPStream * stream, gint dscp_qos)
 {
   GstRTSPStreamPrivate *priv;
 
@@ -327,7 +327,7 @@ gst_rtsp_stream_set_dscp_qos (GstRTSPStream *stream, gint dscp_qos)
  * Returns: the DSCP QoS value of the outgoing sockets, or -1 if disbled.
  */
 gint
-gst_rtsp_stream_get_dscp_qos (GstRTSPStream *stream)
+gst_rtsp_stream_get_dscp_qos (GstRTSPStream * stream)
 {
   GstRTSPStreamPrivate *priv;
 
@@ -806,6 +806,32 @@ gst_rtsp_stream_get_server_port (GstRTSPStream * stream,
 }
 
 /**
+ * gst_rtsp_stream_get_rtpsession:
+ * @stream: a #GstRTSPStream
+ *
+ * Get the RTP session of this stream.
+ *
+ * Returns: The RTP session of this stream. Unref after usage.
+ */
+GObject *
+gst_rtsp_stream_get_rtpsession (GstRTSPStream * stream)
+{
+  GstRTSPStreamPrivate *priv;
+  GObject *session;
+
+  g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL);
+
+  priv = stream->priv;
+
+  g_mutex_lock (&priv->lock);
+  if ((session = priv->session))
+    g_object_ref (session);
+  g_mutex_unlock (&priv->lock);
+
+  return session;
+}
+
+/**
  * gst_rtsp_stream_get_ssrc:
  * @stream: a #GstRTSPStream
  * @ssrc: (out): result ssrc
index 4b8e53e..1060a05 100644 (file)
@@ -94,6 +94,9 @@ gboolean          gst_rtsp_stream_leave_bin        (GstRTSPStream *stream,
 void              gst_rtsp_stream_get_server_port  (GstRTSPStream *stream,
                                                     GstRTSPRange *server_port,
                                                     GSocketFamily family);
+
+GObject *         gst_rtsp_stream_get_rtpsession   (GstRTSPStream *stream);
+
 void              gst_rtsp_stream_get_ssrc         (GstRTSPStream *stream,
                                                     guint *ssrc);