trtp_rtcp_report_sr.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango.org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. #ifndef TINYRTP_RTCP_REPORT_SR_H
  23. #define TINYRTP_RTCP_REPORT_SR_H
  24. #include "tinyrtp_config.h"
  25. #include "tinyrtp/rtcp/trtp_rtcp_packet.h"
  26. #include "tinyrtp/rtcp/trtp_rtcp_rblock.h"
  27. TRTP_BEGIN_DECLS
  28. #define TRTP_RTCP_REPORT_SR(self) ((trtp_rtcp_report_sr_t*)(self))
  29. // RFC 3550 6.4.1 SR: Sender Report RTCP Packet
  30. typedef struct trtp_rtcp_report_sr_s {
  31. TRTP_DECLARE_RTCP_PACKET;
  32. uint32_t ssrc;
  33. struct {
  34. uint32_t ntp_msw; /**< NTP timestamp, most significant word */
  35. uint32_t ntp_lsw; /**< NTP timestamp, least significant word */
  36. uint32_t rtp_timestamp;/**< RTP timestamp */
  37. uint32_t sender_pcount; /**< sender's packet count */
  38. uint32_t sender_ocount; /**< sender's octet count */
  39. } sender_info;
  40. trtp_rtcp_rblocks_L_t* blocks;
  41. trtp_rtcp_packets_L_t* packets;
  42. }
  43. trtp_rtcp_report_sr_t;
  44. trtp_rtcp_report_sr_t* trtp_rtcp_report_sr_create_null();
  45. trtp_rtcp_report_sr_t* trtp_rtcp_report_sr_create(struct trtp_rtcp_header_s* header);
  46. trtp_rtcp_report_sr_t* trtp_rtcp_report_sr_deserialize(const void* data, tsk_size_t size);
  47. int trtp_rtcp_report_sr_serialize_to(const trtp_rtcp_report_sr_t* self, void* data, tsk_size_t size);
  48. int trtp_rtcp_report_sr_add_block(trtp_rtcp_report_sr_t* self, trtp_rtcp_rblock_t* rblock);
  49. tsk_size_t trtp_rtcp_report_sr_get_size(const trtp_rtcp_report_sr_t* self);
  50. TRTP_END_DECLS
  51. #endif /* TINYRTP_RTCP_REPORT_SR_H */