Source code of Windows XP (NT5)
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.

131 lines
3.7 KiB

  1. /*-------------------------------------------------------------------------
  2. * Filename: RTP.H
  3. *
  4. * RTP related data structures.
  5. *
  6. * $Workfile: rrcm_rtp.h $
  7. * $Author: CMACIOCC $
  8. * $Date: 13 Feb 1997 14:44:08 $
  9. * $Revision: 1.2 $
  10. * $Archive: R:\rtp\src\include\rtp.h_v $
  11. *
  12. * INTEL Corporation Proprietary Information
  13. * This listing is supplied under the terms of a license agreement with
  14. * Intel Corporation and may not be copied nor disclosed except in
  15. * accordance with the terms of that agreement.
  16. * Copyright (c) 1995 Intel Corporation.
  17. *
  18. * !!! This file was renamed from rtp.h to rrcm_rtp.h due
  19. * to the conflicting existence of file filters\inc\rtp.h
  20. *--------------------------------------------------------------------------*/
  21. #ifndef _RRCM_RTP_H_
  22. #define _RRCM_RTP_H_
  23. #define RTP_HDR_MIN_LEN 12
  24. #define RTP_SEQ_MOD (1<<16)
  25. #define RTP_TS_MOD (0xffffffff)
  26. #define RTP_TYPE 2 /* Current version */
  27. #define RTP_MAX_SDES 256 /* maximum text length for SDES */
  28. #define RTCP_SIZE_GAIN (1./16.)
  29. #define NTWRK_HDR_SIZE 28
  30. typedef enum {
  31. RTCP_SR = 200,
  32. RTCP_RR = 201,
  33. RTCP_SDES = 202,
  34. RTCP_BYE = 203,
  35. RTCP_APP = 204
  36. } RTCP_TYPE_T;
  37. typedef struct {
  38. // !!! WARNING !!!
  39. // The following word doesn't need to be swapped for NtoH()
  40. WORD cc:4; /* CSRC count */
  41. WORD x:1; /* header extension flag */
  42. WORD p:1; /* padding flag */
  43. WORD type:2; /* version type 1/2 */
  44. WORD pt:7; /* payload type */
  45. WORD m:1; /* marker bit */
  46. WORD seq; /* sequence number */
  47. DWORD ts; /* timestamp */
  48. DWORD ssrc; /* synchronization source */
  49. DWORD csrc[1]; /* optional CSRC list */
  50. } RTP_HDR_T;
  51. typedef struct {
  52. // !!! WARNING !!!
  53. // The following word doesn't need to be swapped for NtoH()
  54. WORD count:5; /* varies by payload type */
  55. WORD p:1; /* padding flag */
  56. WORD type:2; /* protocol version */
  57. WORD pt:8; /* payload type */
  58. WORD length; /* packet length in words, without this word */
  59. } RTCP_COMMON_T;
  60. /* reception report */
  61. typedef struct {
  62. DWORD ssrc; /* data source being reported */
  63. DWORD received; /* cumulative number of packets received */
  64. DWORD expected; /* cumulative number of packets expected */
  65. DWORD jitter; /* interarrival jitter */
  66. DWORD lsr; /* last SR packet from this source */
  67. DWORD dlsr; /* delay since last SR packet */
  68. } RTCP_RR_T;
  69. typedef struct {
  70. BYTE dwSdesType; /* type of SDES item (rtcp_sdes_type_t) */
  71. BYTE dwSdesLength; /* length of SDES item (in octets) */
  72. char sdesData[1]; /* text, not zero-terminated */
  73. } RTCP_SDES_ITEM_T;
  74. typedef struct {
  75. DWORD ssrc; /* source this RTCP packet refers to */
  76. DWORD ntp_sec; /* NTP timestamp */
  77. DWORD ntp_frac;
  78. DWORD rtp_ts; /* RTP timestamp */
  79. DWORD psent; /* packets sent */
  80. DWORD osent; /* octets sent */
  81. RTCP_RR_T rr[1]; /* variable-length list */
  82. } SENDER_RPT;
  83. typedef struct {
  84. DWORD ssrc; /* source this generating this report */
  85. RTCP_RR_T rr[1]; /* variable-length list */
  86. } RECEIVER_RPT;
  87. typedef struct {
  88. DWORD src[1]; /* list of sources */
  89. /* can't express trailing text */
  90. } BYE_PCKT;
  91. typedef struct {
  92. DWORD src; /* first SSRC/CSRC */
  93. RTCP_SDES_ITEM_T item[1]; /* list of SDES items */
  94. } RTCP_SDES_T;
  95. /* one RTCP packet */
  96. typedef struct {
  97. RTCP_COMMON_T common; /* common header */
  98. union
  99. {
  100. SENDER_RPT sr; /* sender report (SR) */
  101. RECEIVER_RPT rr; /* reception report (RR) */
  102. BYE_PCKT bye; /* BYE */
  103. RTCP_SDES_T sdes; /* source description (SDES) */
  104. } r;
  105. } RTCP_T;
  106. typedef DWORD MEMBER_T;
  107. #endif /* ifndef _RRCM_RTP_H_ */