1CURLOPT_RTSP_REQUEST(3)    curl_easy_setopt options    CURLOPT_RTSP_REQUEST(3)
2
3
4

NAME

6       CURLOPT_RTSP_REQUEST - specify RTSP request
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode   curl_easy_setopt(CURL  *handle,  CURLOPT_RTSP_REQUEST,  long
12       request);
13

DESCRIPTION

15       Tell libcurl what kind of RTSP request to make. Pass one of the follow‐
16       ing  RTSP  enum  values as a long in the request argument. Unless noted
17       otherwise, commands require the Session ID to be initialized.
18
19       CURL_RTSPREQ_OPTIONS
20              Used to retrieve the available methods of the server. The appli‐
21              cation is responsible for parsing and obeying the response. (The
22              session ID is not needed for this method.)
23
24       CURL_RTSPREQ_DESCRIBE
25              Used to get the low level description of a stream. The  applica‐
26              tion  should  note  what formats it understands in the 'Accept:'
27              header. Unless set manually, libcurl will automatically fill  in
28              'Accept:  application/sdp'. Time-condition headers will be added
29              to Describe requests if the CURLOPT_TIMECONDITION(3)  option  is
30              active. (The session ID is not needed for this method)
31
32       CURL_RTSPREQ_ANNOUNCE
33              When  sent  by  a client, this method changes the description of
34              the session. For example, if a client is  using  the  server  to
35              record  a  meeting,  the  client  can use Announce to inform the
36              server of all the meta-information about the session.   ANNOUNCE
37              acts like an HTTP PUT or POST just like CURL_RTSPREQ_SET_PARAME‐
38              TER
39
40       CURL_RTSPREQ_SETUP
41              Setup is used to initialize the transport layer for the session.
42              The  application  must  set  the desired Transport options for a
43              session by using the CURLOPT_RTSP_TRANSPORT(3) option  prior  to
44              calling  setup.  If  no  session  ID  is currently set with CUR‐
45              LOPT_RTSP_SESSION_ID(3), libcurl will extract and use  the  ses‐
46              sion  ID in the response to this request. (The session ID is not
47              needed for this method).
48
49       CURL_RTSPREQ_PLAY
50              Send a Play command to  the  server.  Use  the  CURLOPT_RANGE(3)
51              option to modify the playback time (e.g. 'npt=10-15').
52
53       CURL_RTSPREQ_PAUSE
54              Send  a  Pause  command  to the server. Use the CURLOPT_RANGE(3)
55              option with a single value to indicate when the stream should be
56              halted. (e.g. npt='25')
57
58       CURL_RTSPREQ_TEARDOWN
59              This  command  terminates an RTSP session. Simply closing a con‐
60              nection does not terminate the RTSP session since it is valid to
61              control an RTSP session over different connections.
62
63       CURL_RTSPREQ_GET_PARAMETER
64              Retrieve  a  parameter from the server. By default, libcurl will
65              automatically include a Content-Type: text/parameters header  on
66              all non-empty requests unless a custom one is set. GET_PARAMETER
67              acts just like an HTTP PUT or POST (see CURL_RTSPREQ_SET_PARAME‐
68              TER).  Applications wishing to send a heartbeat message (e.g. in
69              the presence of a server-specified timeout) should send  use  an
70              empty GET_PARAMETER request.
71
72       CURL_RTSPREQ_SET_PARAMETER
73              Set a parameter on the server. By default, libcurl will automat‐
74              ically include a Content-Type: text/parameters header  unless  a
75              custom  one  is  set. The interaction with SET_PARAMETER is much
76              like an HTTP PUT or POST. An application  may  either  use  CUR‐
77              LOPT_UPLOAD(3)  with  CURLOPT_READDATA(3) like a HTTP PUT, or it
78              may use CURLOPT_POSTFIELDS(3) like  an  HTTP  POST.  No  chunked
79              transfers  are  allowed,  so  the  application must set the CUR‐
80              LOPT_INFILESIZE(3) in the former and CURLOPT_POSTFIELDSIZE(3) in
81              the  latter.  Also,  there  is no use of multi-part POSTs within
82              RTSP.
83
84       CURL_RTSPREQ_RECORD
85              Used to tell the server  to  record  a  session.  Use  the  CUR‐
86              LOPT_RANGE(3) option to modify the record time.
87
88       CURL_RTSPREQ_RECEIVE
89              This  is  a special request because it does not send any data to
90              the server. The application may call this function in  order  to
91              receive  interleaved  RTP  data. It will return after processing
92              one read buffer of data in  order  to  give  the  application  a
93              chance to run.
94

DEFAULT

PROTOCOLS

97       RTSP
98

EXAMPLE

100       CURL *curl = curl_easy_init();
101       if(curl) {
102         curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
103         /* ask for options! */
104         curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
105         ret = curl_easy_perform(curl);
106         curl_easy_cleanup(curl);
107       }
108

AVAILABILITY

110       Added in 7.20.0
111

RETURN VALUE

113       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
114       if not.
115

SEE ALSO

117       CURLOPT_RTSP_SESSION_ID(3), CURLOPT_RTSP_STREAM_URI(3),
118
119
120
121libcurl 7.64.0                  April 17, 2018         CURLOPT_RTSP_REQUEST(3)
Impressum