rtsp.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef __RTSP_H_
  2. #define __RTSP_H_
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at http://curl.haxx.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * $Id$
  24. ***************************************************************************/
  25. #ifndef CURL_DISABLE_RTSP
  26. extern const struct Curl_handler Curl_handler_rtsp;
  27. /*
  28. * Parse and write out any available RTP data.
  29. *
  30. * nread: amount of data left after k->str. will be modified if RTP
  31. * data is parsed and k->str is moved up
  32. * readmore: whether or not the RTP parser needs more data right away
  33. */
  34. CURLcode Curl_rtsp_rtp_readwrite(struct SessionHandle *data,
  35. struct connectdata *conn,
  36. ssize_t *nread,
  37. bool *readmore);
  38. /* protocol-specific functions set up to be called by the main engine */
  39. CURLcode Curl_rtsp(struct connectdata *conn, bool *done);
  40. CURLcode Curl_rtsp_done(struct connectdata *conn, CURLcode, bool premature);
  41. CURLcode Curl_rtsp_connect(struct connectdata *conn, bool *done);
  42. CURLcode Curl_rtsp_disconnect(struct connectdata *conn);
  43. CURLcode Curl_rtsp_parseheader(struct connectdata *conn, char *header);
  44. #endif /* CURL_DISABLE_RTSP */
  45. /*
  46. * RTSP Connection data
  47. *
  48. * Currently, only used for tracking incomplete RTP data reads
  49. */
  50. struct rtsp_conn {
  51. char *rtp_buf;
  52. ssize_t rtp_bufsize;
  53. int rtp_channel;
  54. };
  55. /****************************************************************************
  56. * RTSP unique setup
  57. ***************************************************************************/
  58. struct RTSP {
  59. /*
  60. * http_wrapper MUST be the first element of this structure for the wrap
  61. * logic to work. In this way, we get a cheap polymorphism because
  62. * &(data->state.proto.rtsp) == &(data->state.proto.http) per the C spec
  63. *
  64. * HTTP functions can safely treat this as an HTTP struct, but RTSP aware
  65. * functions can also index into the later elements.
  66. */
  67. struct HTTP http_wrapper; /*wrap HTTP to do the heavy lifting */
  68. long CSeq_sent; /* CSeq of this request */
  69. long CSeq_recv; /* CSeq received */
  70. };
  71. #endif /* __RTSP_H_ */