CURLOPT_RTSP_REQUEST.3 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. .\" generated by cd2nroff 0.1 from CURLOPT_RTSP_REQUEST.md
  2. .TH CURLOPT_RTSP_REQUEST 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_RTSP_REQUEST \- RTSP request
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RTSP_REQUEST, long request);
  9. .fi
  10. .SH DESCRIPTION
  11. Tell libcurl what kind of RTSP request to make. Pass one of the following RTSP
  12. enum values as a long in the \fIrequest\fP argument. Unless noted otherwise,
  13. commands require the Session ID to be initialized.
  14. .IP CURL_RTSPREQ_OPTIONS
  15. Used to retrieve the available methods of the server. The application is
  16. responsible for parsing and obeying the response. The session ID is not needed
  17. for this method.
  18. .IP CURL_RTSPREQ_DESCRIBE
  19. Used to get the low level description of a stream. The application should note
  20. what formats it understands in the \fI\(aqAccept:\(aq\fP header. Unless set manually,
  21. libcurl automatically adds in \fI\(aqAccept: application/sdp\(aq\fP. Time\-condition
  22. headers are added to Describe requests if the \fICURLOPT_TIMECONDITION(3)\fP
  23. option is used. (The session ID is not needed for this method)
  24. .IP CURL_RTSPREQ_ANNOUNCE
  25. When sent by a client, this method changes the description of the session. For
  26. example, if a client is using the server to record a meeting, the client can
  27. use Announce to inform the server of all the meta\-information about the
  28. session. ANNOUNCE acts like an HTTP PUT or POST just like
  29. \fICURL_RTSPREQ_SET_PARAMETER\fP
  30. .IP CURL_RTSPREQ_SETUP
  31. Setup is used to initialize the transport layer for the session. The
  32. application must set the desired Transport options for a session by using the
  33. \fICURLOPT_RTSP_TRANSPORT(3)\fP option prior to calling setup. If no session
  34. ID is currently set with \fICURLOPT_RTSP_SESSION_ID(3)\fP, libcurl extracts
  35. and uses the session ID in the response to this request. The session ID is not
  36. needed for this method.
  37. .IP CURL_RTSPREQ_PLAY
  38. Send a Play command to the server. Use the \fICURLOPT_RANGE(3)\fP option to
  39. modify the playback time (e.g. \fInpt=10\-15\fP).
  40. .IP CURL_RTSPREQ_PAUSE
  41. Send a Pause command to the server. Use the \fICURLOPT_RANGE(3)\fP option with
  42. a single value to indicate when the stream should be
  43. halted. (e.g. \fInpt=25\fP)
  44. .IP CURL_RTSPREQ_TEARDOWN
  45. This command terminates an RTSP session. Simply closing a connection does not
  46. terminate the RTSP session since it is valid to control an RTSP session over
  47. different connections.
  48. .IP CURL_RTSPREQ_GET_PARAMETER
  49. Retrieve a parameter from the server. By default, libcurl adds a
  50. \fIContent\-Type: text/parameters\fP header on all non\-empty requests unless a
  51. custom one is set. GET_PARAMETER acts just like an HTTP PUT or POST (see
  52. \fICURL_RTSPREQ_SET_PARAMETER\fP). Applications wishing to send a heartbeat
  53. message (e.g. in the presence of a server\-specified timeout) should send use
  54. an empty GET_PARAMETER request.
  55. .IP CURL_RTSPREQ_SET_PARAMETER
  56. Set a parameter on the server. By default, libcurl uses a *Content\-Type:
  57. text/parameters* header unless a custom one is set. The interaction with
  58. SET_PARAMETER is much like an HTTP PUT or POST. An application may either use
  59. \fICURLOPT_UPLOAD(3)\fP with \fICURLOPT_READDATA(3)\fP like an HTTP PUT, or it may use
  60. \fICURLOPT_POSTFIELDS(3)\fP like an HTTP POST. No chunked transfers are allowed, so
  61. the application must set the \fICURLOPT_INFILESIZE(3)\fP in the former and
  62. \fICURLOPT_POSTFIELDSIZE(3)\fP in the latter. Also, there is no use of multi\-part
  63. POSTs within RTSP.
  64. .IP CURL_RTSPREQ_RECORD
  65. Used to tell the server to record a session. Use the \fICURLOPT_RANGE(3)\fP
  66. option to modify the record time.
  67. .IP CURL_RTSPREQ_RECEIVE
  68. This is a special request because it does not send any data to the server. The
  69. application may call this function in order to receive interleaved RTP
  70. data. It returns after processing one read buffer of data in order to give the
  71. application a chance to run.
  72. .SH DEFAULT
  73. .SH PROTOCOLS
  74. This functionality affects rtsp only
  75. .SH EXAMPLE
  76. .nf
  77. int main(void)
  78. {
  79. CURL *curl = curl_easy_init();
  80. if(curl) {
  81. CURLcode res;
  82. curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
  83. /* ask for options! */
  84. curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
  85. res = curl_easy_perform(curl);
  86. curl_easy_cleanup(curl);
  87. }
  88. }
  89. .fi
  90. .SH AVAILABILITY
  91. Added in curl 7.20.0
  92. .SH RETURN VALUE
  93. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  94. .SH SEE ALSO
  95. .BR CURLOPT_RTSP_SESSION_ID (3),
  96. .BR CURLOPT_RTSP_STREAM_URI (3)