Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

CURLOPT_RTSP_REQUEST (3)

Name

CURLOPT_RTSP_REQUEST - RTSP request

Synopsis

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RTSP_REQUEST, long request);

Description

CURLOPT_RTSP_REQUEST(3)    curl_easy_setopt options    CURLOPT_RTSP_REQUEST(3)



NAME
       CURLOPT_RTSP_REQUEST - RTSP request

SYNOPSIS
       #include <curl/curl.h>

       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RTSP_REQUEST, long request);

DESCRIPTION
       Tell libcurl what kind of RTSP request to make. Pass one of the follow-
       ing RTSP enum values as a long in the request  argument.  Unless  noted
       otherwise, commands require the Session ID to be initialized.

       CURL_RTSPREQ_OPTIONS
              Used to retrieve the available methods of the server. The appli-
              cation is responsible for parsing and obeying the response.  The
              session ID is not needed for this method.

       CURL_RTSPREQ_DESCRIBE
              Used  to get the low level description of a stream. The applica-
              tion should note what formats it understands  in  the  'Accept:'
              header.  Unless set manually, libcurl will automatically fill in
              'Accept: application/sdp'.  Time-condition headers will be added
              to  Describe  requests if the CURLOPT_TIMECONDITION(3) option is
              active. (The session ID is not needed for this method)

       CURL_RTSPREQ_ANNOUNCE
              When sent by a client, this method changes  the  description  of
              the  session.  For  example,  if a client is using the server to
              record a meeting, the client can  use  Announce  to  inform  the
              server  of all the meta-information about the session.  ANNOUNCE
              acts like an HTTP PUT or POST just like CURL_RTSPREQ_SET_PARAME-
              TER

       CURL_RTSPREQ_SETUP
              Setup is used to initialize the transport layer for the session.
              The application must set the desired  Transport  options  for  a
              session  by  using the CURLOPT_RTSP_TRANSPORT(3) option prior to
              calling setup. If no session  ID  is  currently  set  with  CUR-
              LOPT_RTSP_SESSION_ID(3),  libcurl  will extract and use the ses-
              sion ID in the response to this request. The session ID  is  not
              needed for this method.

       CURL_RTSPREQ_PLAY
              Send  a  Play  command  to  the server. Use the CURLOPT_RANGE(3)
              option to modify the playback time (e.g. 'npt=10-15').

       CURL_RTSPREQ_PAUSE
              Send a Pause command to the  server.  Use  the  CURLOPT_RANGE(3)
              option with a single value to indicate when the stream should be
              halted. (e.g. npt='25')

       CURL_RTSPREQ_TEARDOWN
              This command terminates an RTSP session. Simply closing  a  con-
              nection does not terminate the RTSP session since it is valid to
              control an RTSP session over different connections.

       CURL_RTSPREQ_GET_PARAMETER
              Retrieve a parameter from the server. By default,  libcurl  will
              automatically  include a Content-Type: text/parameters header on
              all non-empty requests unless a custom one is set. GET_PARAMETER
              acts just like an HTTP PUT or POST (see CURL_RTSPREQ_SET_PARAME-
              TER).  Applications wishing to send a heartbeat message (e.g. in
              the  presence  of a server-specified timeout) should send use an
              empty GET_PARAMETER request.

       CURL_RTSPREQ_SET_PARAMETER
              Set a parameter on the server. By default, libcurl will automat-
              ically  include  a Content-Type: text/parameters header unless a
              custom one is set. The interaction with  SET_PARAMETER  is  much
              like  an  HTTP  PUT  or POST. An application may either use CUR-
              LOPT_UPLOAD(3) with CURLOPT_READDATA(3) like a HTTP PUT,  or  it
              may  use  CURLOPT_POSTFIELDS(3)  like  an  HTTP POST. No chunked
              transfers are allowed, so the  application  must  set  the  CUR-
              LOPT_INFILESIZE(3) in the former and CURLOPT_POSTFIELDSIZE(3) in
              the latter. Also, there is no use  of  multi-part  POSTs  within
              RTSP.

       CURL_RTSPREQ_RECORD
              Used  to  tell  the  server  to  record  a session. Use the CUR-
              LOPT_RANGE(3) option to modify the record time.

       CURL_RTSPREQ_RECEIVE
              This is a special request because it does not send any  data  to
              the  server.  The application may call this function in order to
              receive interleaved RTP data. It will  return  after  processing
              one  read  buffer  of  data  in  order to give the application a
              chance to run.

DEFAULT
PROTOCOLS
       RTSP

EXAMPLE
       CURL *curl = curl_easy_init();
       if(curl) {
         curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
         /* ask for options! */
         curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
         ret = curl_easy_perform(curl);
         curl_easy_cleanup(curl);
       }

AVAILABILITY
       Added in 7.20.0

RETURN VALUE
       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
       if not.


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+------------------+
       |ATTRIBUTE TYPE | ATTRIBUTE VALUE  |
       +---------------+------------------+
       |Availability   | web/curl         |
       +---------------+------------------+
       |Stability      | Uncommitted      |
       +---------------+------------------+

SEE ALSO
       CURLOPT_RTSP_SESSION_ID(3), CURLOPT_RTSP_STREAM_URI(3),



NOTES
       Source  code  for open source software components in Oracle Solaris can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-
       code-downloads.html.

       This     software     was    built    from    source    available    at
       https://github.com/oracle/solaris-userland.   The  original   community
       source       was       downloaded      from       https://curl.se/down-
       load/curl-7.83.1.tar.bz2.

       Further information about this software can be found on the open source
       community website at http://curl.haxx.se/.



libcurl 7.83.1                 November 26, 2021       CURLOPT_RTSP_REQUEST(3)