1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_RTSP_TRANSPORT 5Section: 3 6Source: libcurl 7See-also: 8 - CURLOPT_RTSP_REQUEST (3) 9 - CURLOPT_RTSP_SESSION_ID (3) 10Protocol: 11 - RTSP 12--- 13 14# NAME 15 16CURLOPT_RTSP_TRANSPORT - RTSP Transport: header 17 18# SYNOPSIS 19 20~~~c 21#include <curl/curl.h> 22 23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RTSP_TRANSPORT, 24 char *transport); 25~~~ 26 27# DESCRIPTION 28 29Pass a char pointer to tell libcurl what to pass for the Transport: header for 30this RTSP session. This is mainly a convenience method to avoid needing to set 31a custom Transport: header for every SETUP request. The application must set a 32Transport: header before issuing a SETUP request. 33 34The application does not have to keep the string around after setting this 35option. 36 37# DEFAULT 38 39NULL 40 41# EXAMPLE 42 43~~~c 44int main(void) 45{ 46 CURL *curl = curl_easy_init(); 47 if(curl) { 48 CURLcode res; 49 curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/"); 50 curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP); 51 curl_easy_setopt(curl, CURLOPT_RTSP_TRANSPORT, 52 "RTP/AVP;unicast;client_port=4588-4589"); 53 res = curl_easy_perform(curl); 54 curl_easy_cleanup(curl); 55 } 56} 57~~~ 58 59# AVAILABILITY 60 61Added in 7.20.0 62 63# RETURN VALUE 64 65Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or 66CURLE_OUT_OF_MEMORY if there was insufficient heap space. 67