1CURLOPT_RTSP_REQUEST(3)             libcurl            CURLOPT_RTSP_REQUEST(3)
2
3
4

NAME

6       CURLOPT_RTSP_REQUEST - RTSP request
7

SYNOPSIS

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

DESCRIPTION

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

DEFAULT

PROTOCOLS

96       RTSP
97

EXAMPLE

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

AVAILABILITY

109       Added in 7.20.0
110

RETURN VALUE

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

SEE ALSO

116       CURLOPT_RTSP_SESSION_ID(3), CURLOPT_RTSP_STREAM_URI(3),
117
118
119
120ibcurl 8.2.1                    April 26, 2023         CURLOPT_RTSP_REQUEST(3)
Impressum