1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_RTSP_STREAM_URI
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_RTSP_REQUEST (3)
9  - CURLOPT_RTSP_TRANSPORT (3)
10---
11
12# NAME
13
14CURLOPT_RTSP_STREAM_URI - RTSP stream URI
15
16# SYNOPSIS
17
18~~~c
19#include <curl/curl.h>
20
21CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RTSP_STREAM_URI, char *URI);
22~~~
23
24# DESCRIPTION
25
26Set the stream *URI* to operate on by passing a char * . For example, a single
27session may be controlling *rtsp://foo/twister/audio* and
28*rtsp://foo/twister/video* and the application can switch to the appropriate
29stream using this option. If unset, libcurl defaults to operating on generic
30server options by passing '*' in the place of the RTSP Stream URI. This option
31is distinct from CURLOPT_URL(3). When working with RTSP, the
32CURLOPT_RTSP_STREAM_URI(3) indicates what URL to send to the server in the
33request header while the CURLOPT_URL(3) indicates where to make the connection
34to. (e.g. the CURLOPT_URL(3) for the above examples might be set to
35*rtsp://foo/twister*
36
37The application does not have to keep the string around after setting this
38option.
39
40# DEFAULT
41
42"*"
43
44# PROTOCOLS
45
46RTSP
47
48# EXAMPLE
49
50~~~c
51int main(void)
52{
53  CURL *curl = curl_easy_init();
54  if(curl) {
55    CURLcode res;
56    curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
57    curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI,
58                     "rtsp://foo.example.com/twister/video");
59    res = curl_easy_perform(curl);
60    curl_easy_cleanup(curl);
61  }
62}
63~~~
64
65# AVAILABILITY
66
67Added in 7.20.0
68
69# RETURN VALUE
70
71Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
72CURLE_OUT_OF_MEMORY if there was insufficient heap space.
73