stream-transport: add method to get/set url
authorWim Taymans <wtaymans@redhat.com>
Thu, 28 Nov 2013 16:35:45 +0000 (17:35 +0100)
committerWim Taymans <wtaymans@redhat.com>
Thu, 28 Nov 2013 16:35:45 +0000 (17:35 +0100)
gst/rtsp-server/rtsp-stream-transport.c
gst/rtsp-server/rtsp-stream-transport.h

index c71c8ea7c7eb9f11b6c49d2f259c1d9c420dc049..bade2a61d25983f5f70563237d75cb24f43663d0 100644 (file)
@@ -62,6 +62,7 @@ struct _GstRTSPStreamTransportPrivate
   gboolean timed_out;
 
   GstRTSPTransport *transport;
+  GstRTSPUrl *url;
 
   GObject *rtpsource;
 };
@@ -266,6 +267,46 @@ gst_rtsp_stream_transport_get_transport (GstRTSPStreamTransport * trans)
   return trans->priv->transport;
 }
 
+/**
+ * gst_rtsp_stream_transport_set_url:
+ * @trans: a #GstRTSPStreamTransport
+ * @url: (transfer none): a client #GstRTSPUrl
+ *
+ * Set @url as the client url.
+ */
+void
+gst_rtsp_stream_transport_set_url (GstRTSPStreamTransport * trans,
+    const GstRTSPUrl * url)
+{
+  GstRTSPStreamTransportPrivate *priv;
+
+  g_return_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans));
+
+  priv = trans->priv;
+
+  /* keep track of the transports in the stream. */
+  if (priv->url)
+    gst_rtsp_url_free (priv->url);
+  priv->url = (url ? gst_rtsp_url_copy (url) : NULL);
+}
+
+/**
+ * gst_rtsp_stream_transport_get_url:
+ * @trans: a #GstRTSPStreamTransport
+ *
+ * Get the url configured in @trans.
+ *
+ * Returns: (transfer none): the url configured in @trans. It remains
+ *     valid for as long as @trans is valid.
+ */
+const GstRTSPUrl *
+gst_rtsp_stream_transport_get_url (GstRTSPStreamTransport * trans)
+{
+  g_return_val_if_fail (GST_IS_RTSP_STREAM_TRANSPORT (trans), NULL);
+
+  return trans->priv->url;
+}
+
 /**
  * gst_rtsp_stream_transport_set_active:
  * @trans: a #GstRTSPStreamTransport
index b73bf6ef57bf4fcf21b83a1a8e4a0a5ad564773d..fad6911cd5f699aa6a08f2dc9bbef0324f553316 100644 (file)
@@ -91,6 +91,10 @@ void                     gst_rtsp_stream_transport_set_transport (GstRTSPStreamT
                                                                   GstRTSPTransport * tr);
 const GstRTSPTransport * gst_rtsp_stream_transport_get_transport (GstRTSPStreamTransport *trans);
 
+void                     gst_rtsp_stream_transport_set_url       (GstRTSPStreamTransport *trans,
+                                                                  const GstRTSPUrl * url);
+const GstRTSPUrl *       gst_rtsp_stream_transport_get_url       (GstRTSPStreamTransport *trans);
+
 void                     gst_rtsp_stream_transport_set_callbacks (GstRTSPStreamTransport *trans,
                                                                   GstRTSPSendFunc send_rtp,
                                                                   GstRTSPSendFunc send_rtcp,