You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
984B

  1. #ifndef _rtsp_header_rtp_info_h_
  2. #define _rtsp_header_rtp_info_h_
  3. #include <stdint.h>
  4. struct rtsp_header_rtp_info_t
  5. {
  6. char url[256];
  7. uint64_t seq;
  8. uint64_t rtptime;
  9. };
  10. /// parse RTSP RTP-Info header
  11. /// @return 0-ok, other-error
  12. /// usage 1:
  13. /// struct rtsp_header_rtp_info_t rtpinfo;
  14. /// const char* header = "RTP-Info: url=rtsp://foo.com/bar.avi/streamid=0;seq=45102";
  15. /// r = rtsp_header_rtp_info("url=rtsp://foo.com/bar.avi/streamid=0;seq=45102", &rtpinfo);
  16. /// check(r)
  17. ///
  18. /// usage 2:
  19. /// const char* header = "RTP-Info: url=rtsp://foo.com/bar.avi/streamid=0;seq=45102,url=rtsp://foo.com/bar.avi/streamid=1;seq=30211";
  20. /// split(header, ',');
  21. /// r1 = rtsp_header_rtp_info("url=rtsp://foo.com/bar.avi/streamid=0;seq=45102", &rtpinfo);
  22. /// r2 = rtsp_header_rtp_info("url=rtsp://foo.com/bar.avi/streamid=1;seq=30211", &rtpinfo);
  23. /// check(r1, r2)
  24. int rtsp_header_rtp_info(const char* field, struct rtsp_header_rtp_info_t* rtpinfo);
  25. #endif /* !_rtsp_header_rtp_info_h_ */