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