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