const gchar *base;
gboolean has_slash;
- if (src->content_base)
+ if (src->control)
+ base = src->control;
+ else if (src->content_base)
base = src->content_base;
else if (src->req_location)
base = src->req_location;
g_free (src->content_base);
src->content_base = NULL;
+ g_free (src->control);
+ src->control = NULL;
+
if (src->range)
gst_rtsp_range_free (src->range);
src->range = NULL;
break;
}
}
+ /* try to find a global control attribute */
+ g_free (src->control);
+ src->control = NULL;
+ {
+ const gchar *control;
+
+ for (i = 0;; i++) {
+ control = gst_sdp_message_get_attribute_val_n (&sdp, "control", i);
+ if (control == NULL)
+ break;
+
+ if (g_str_has_prefix (control, "rtsp://")) {
+ src->control = g_strdup (control);
+ break;
+ }
+ }
+ }
/* create streams */
n_streams = gst_sdp_message_medias_len (&sdp);
GstRTSPMessage response = { 0 };
GstRTSPResult res;
gboolean ret = FALSE;
+ gchar *control;
GST_DEBUG_OBJECT (src, "TEARDOWN...");
goto close;
}
+ /* construct a control url */
+ if (src->control)
+ control = src->control;
+ else
+ control = src->req_location;
+
if (src->methods & (GST_RTSP_PLAY | GST_RTSP_TEARDOWN)) {
/* do TEARDOWN */
- res =
- gst_rtsp_message_init_request (&request, GST_RTSP_TEARDOWN,
- src->req_location);
+ res = gst_rtsp_message_init_request (&request, GST_RTSP_TEARDOWN, control);
if (res < 0)
goto create_request_failed;
gchar *hval;
gfloat fval;
gint hval_idx;
+ gchar *control;
GST_RTSP_STATE_LOCK (src);
if (!src->connection || !src->connected)
goto done;
+ /* construct a control url */
+ if (src->control)
+ control = src->control;
+ else
+ control = src->req_location;
+
/* waiting for connection idle, we were flushing so any attempt at doing data
* transfer will result in pausing the tasks. */
GST_DEBUG_OBJECT (src, "wait for connection idle");
gst_rtsp_connection_flush (src->connection, FALSE);
/* do play */
- res =
- gst_rtsp_message_init_request (&request, GST_RTSP_PLAY,
- src->req_location);
+ res = gst_rtsp_message_init_request (&request, GST_RTSP_PLAY, control);
if (res < 0)
goto create_request_failed;
{
GstRTSPMessage request = { 0 };
GstRTSPMessage response = { 0 };
+ gchar *control;
GST_RTSP_STATE_LOCK (src);
GST_DEBUG_OBJECT (src, "stop connection flush");
gst_rtsp_connection_flush (src->connection, FALSE);
+ /* construct a control url */
+ if (src->control)
+ control = src->control;
+ else
+ control = src->req_location;
+
/* do pause */
- if (gst_rtsp_message_init_request (&request, GST_RTSP_PAUSE,
- src->req_location) < 0)
+ if (gst_rtsp_message_init_request (&request, GST_RTSP_PAUSE, control) < 0)
goto create_request_failed;
if (gst_rtspsrc_send (src, &request, &response, NULL) < 0)