CURLOPT_RTSP_REQUEST.3 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_RTSP_REQUEST 3 "January 02, 2023" "libcurl 7.88.1" "curl_easy_setopt options"
  26. .SH NAME
  27. CURLOPT_RTSP_REQUEST \- RTSP request
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RTSP_REQUEST, long request);
  32. .fi
  33. .SH DESCRIPTION
  34. Tell libcurl what kind of RTSP request to make. Pass one of the following RTSP
  35. enum values as a long in the \fIrequest\fP argument. Unless noted otherwise,
  36. commands require the Session ID to be initialized.
  37. .IP CURL_RTSPREQ_OPTIONS
  38. Used to retrieve the available methods of the server. The application is
  39. responsible for parsing and obeying the response. The session ID is not needed
  40. for this method.
  41. .IP CURL_RTSPREQ_DESCRIBE
  42. Used to get the low level description of a stream. The application should note
  43. what formats it understands in the \fI'Accept:'\fP header. Unless set
  44. manually, libcurl will automatically fill in \fI'Accept: application/sdp'\fP.
  45. Time-condition headers will be added to Describe requests if the
  46. \fICURLOPT_TIMECONDITION(3)\fP option is active. \fB(The session ID is not
  47. needed for this method)\fP
  48. .IP CURL_RTSPREQ_ANNOUNCE
  49. When sent by a client, this method changes the description of the session. For
  50. example, if a client is using the server to record a meeting, the client can
  51. use Announce to inform the server of all the meta-information about the
  52. session. ANNOUNCE acts like an HTTP PUT or POST just like
  53. \fICURL_RTSPREQ_SET_PARAMETER\fP
  54. .IP CURL_RTSPREQ_SETUP
  55. Setup is used to initialize the transport layer for the session. The
  56. application must set the desired Transport options for a session by using the
  57. \fICURLOPT_RTSP_TRANSPORT(3)\fP option prior to calling setup. If no session
  58. ID is currently set with \fICURLOPT_RTSP_SESSION_ID(3)\fP, libcurl will
  59. extract and use the session ID in the response to this request. The session ID
  60. is not needed for this method.
  61. .IP CURL_RTSPREQ_PLAY
  62. Send a Play command to the server. Use the \fICURLOPT_RANGE(3)\fP option to
  63. modify the playback time (e.g. \fInpt=10-15\fP).
  64. .IP CURL_RTSPREQ_PAUSE
  65. Send a Pause command to the server. Use the \fICURLOPT_RANGE(3)\fP option with
  66. a single value to indicate when the stream should be
  67. halted. (e.g. \fInpt=25\fP)
  68. .IP CURL_RTSPREQ_TEARDOWN
  69. This command terminates an RTSP session. Simply closing a connection does not
  70. terminate the RTSP session since it is valid to control an RTSP session over
  71. different connections.
  72. .IP CURL_RTSPREQ_GET_PARAMETER
  73. Retrieve a parameter from the server. By default, libcurl will automatically
  74. include a \fIContent-Type: text/parameters\fP header on all non-empty requests
  75. unless a custom one is set. GET_PARAMETER acts just like an HTTP PUT or POST
  76. (see \fICURL_RTSPREQ_SET_PARAMETER\fP).
  77. Applications wishing to send a heartbeat message (e.g. in the presence of a
  78. server-specified timeout) should send use an empty GET_PARAMETER request.
  79. .IP CURL_RTSPREQ_SET_PARAMETER
  80. Set a parameter on the server. By default, libcurl will automatically include
  81. a \fIContent-Type: text/parameters\fP header unless a custom one is set. The
  82. interaction with SET_PARAMETER is much like an HTTP PUT or POST. An application
  83. may either use \fICURLOPT_UPLOAD(3)\fP with \fICURLOPT_READDATA(3)\fP like a
  84. HTTP PUT, or it may use \fICURLOPT_POSTFIELDS(3)\fP like an HTTP POST. No
  85. chunked transfers are allowed, so the application must set the
  86. \fICURLOPT_INFILESIZE(3)\fP in the former and \fICURLOPT_POSTFIELDSIZE(3)\fP
  87. in the latter. Also, there is no use of multi-part POSTs within RTSP.
  88. .IP CURL_RTSPREQ_RECORD
  89. Used to tell the server to record a session. Use the \fICURLOPT_RANGE(3)\fP
  90. option to modify the record time.
  91. .IP CURL_RTSPREQ_RECEIVE
  92. This is a special request because it does not send any data to the server. The
  93. application may call this function in order to receive interleaved RTP
  94. data. It will return after processing one read buffer of data in order to give
  95. the application a chance to run.
  96. .SH DEFAULT
  97. .SH PROTOCOLS
  98. RTSP
  99. .SH EXAMPLE
  100. .nf
  101. CURL *curl = curl_easy_init();
  102. if(curl) {
  103. curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
  104. /* ask for options! */
  105. curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
  106. ret = curl_easy_perform(curl);
  107. curl_easy_cleanup(curl);
  108. }
  109. .fi
  110. .SH AVAILABILITY
  111. Added in 7.20.0
  112. .SH RETURN VALUE
  113. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  114. .SH "SEE ALSO"
  115. .BR CURLOPT_RTSP_SESSION_ID "(3), " CURLOPT_RTSP_STREAM_URI "(3), "