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.

254 lines
8.2 KiB

  1. /*-------------------------------------------------------------------------
  2. // File : RRCM.H
  3. //
  4. // RRCM's include files .
  5. //
  6. // $Workfile: rrcm.h $
  7. // $Author: CMACIOCC $
  8. // $Date: 18 Feb 1997 13:23:28 $
  9. // $Revision: 1.10 $
  10. // $Archive: R:\rtp\src\rrcm\rrcminc\rrcm.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. #ifndef __RRCM_H_
  19. #define __RRCM_H_
  20. #if !defined(USE_RRCM)
  21. #ifdef INCL_WINSOCK_API_TYPEDEFS
  22. #undef INCL_WINSOCK_API_TYPEDEFS
  23. #endif
  24. #define INCL_WINSOCK_API_TYPEDEFS 1
  25. #include <winsock2.h>
  26. #include <qossp.h>
  27. #include <stdio.h>
  28. #include <io.h>
  29. #include <string.h>
  30. #include <stdlib.h>
  31. #include <time.h>
  32. #include <math.h>
  33. #include <process.h>
  34. #include <mmsystem.h>
  35. #include <assert.h>
  36. #endif
  37. #if (defined(_DEBUG) || defined(PCS_COMPLIANCE))
  38. //INTEROP
  39. #include "interop.h"
  40. #include "rtpplog.h"
  41. #endif
  42. typedef CHAR *PCHAR;
  43. #ifdef ENABLE_ISDM2
  44. #include "isdmapi2.h"
  45. #endif
  46. #include <rrcm_dll.h>
  47. #include <rrcmdata.h>
  48. #include "rrcmprot.h"
  49. #include "rrcm_rtp.h"
  50. // #include "isrg.h"
  51. //----------------------------------------------------------------------------
  52. // RTP/RTCP: Registry information under:
  53. // HKEY_LOCAL_MACHINE\SOFTWARE\INTEL\RRCM
  54. //----------------------------------------------------------------------------
  55. #define szRegRRCMSubKey TEXT("RRCM")
  56. #define szRegRRCMSubKeyIntel TEXT("iRRCM")
  57. #define szRegRRCMKey TEXT("SOFTWARE\\Intel\\")
  58. #define szRegRRCMWsLib TEXT("WsLib")
  59. #define szRegRRCMNumSessions TEXT("NumSessions")
  60. #define szRegRRCMNumFreeSSRC TEXT("NumFreeSSRC")
  61. #define szRegRRCMNumRTCPPostedBfr TEXT("NumRTCPPostedBfr")
  62. #define szRegRRCMRTCPrcvBfrSize TEXT("RTCPrcvBfrSize")
  63. //----------------------------------------------------------------------------
  64. // RTP/RTCP: Dynamically loaded DLL
  65. //----------------------------------------------------------------------------
  66. #ifdef ENABLE_ISDM2
  67. #define szISDMdll TEXT("ISDM2")
  68. #endif
  69. #define szRRCMdefaultLib TEXT("ws2_32")
  70. #ifdef ENABLE_ISDM2
  71. //----------------------------------------------------------------------------
  72. // RTP/RTCP: ISDM module
  73. //----------------------------------------------------------------------------
  74. #define szSSRCtoken TEXT("SSRC")
  75. #define szPcktSentToken TEXT("Number of packets send")
  76. #define szByteSentToken TEXT("Number of bytes send")
  77. #define szPcktRcvdToken TEXT("Number of packets received")
  78. #define szByteRcvdToken TEXT("Number of bytes received")
  79. #define szFractionLostToken TEXT("Fraction lost")
  80. #define szCumNumPcktLostToken TEXT("Cumulative number of packets lost")
  81. #define szXntHighSeqNumToken TEXT("Extended highest sequence number")
  82. #define szInterarrivalJitterToken TEXT("Interarrival jitter")
  83. #define szLastSRtoken TEXT("Last sender report")
  84. #define szDSLRtoken TEXT("Delay since last sender report")
  85. #define szNTPfracToken TEXT("NTP fraction")
  86. #define szNTPsecToken TEXT("NTP seconds")
  87. #define szWhoAmItoken TEXT("Who Am I")
  88. #define szFdbkFractionLostToken TEXT("Fraction lost feedback")
  89. #define szFdbkCumNumPcktLostToken \
  90. TEXT("Cumulative number of packets lost feedback")
  91. #define szFdbkLastSRtoken TEXT("Last sender report feedback")
  92. #define szFdbkDSLRtoken \
  93. TEXT("Delay since last sender report feedback")
  94. #define szFdbkInterarrivalJitterToken TEXT("Interarrival jitter feedback")
  95. #endif
  96. //----------------------------------------------------------------------------
  97. // RTP: Bitmaps used to isolate errors detected for incoming received packets
  98. //----------------------------------------------------------------------------
  99. #define SSRC_LOOP_DETECTED (1)
  100. #define SSRC_COLLISION_DETECTED (2)
  101. #define INVALID_RTP_HEADER (3)
  102. #define MCAST_LOOPBACK_NOT_OFF (4)
  103. //----------------------------------------------------------------------------
  104. // RTP: Default number of RTP sessions
  105. //----------------------------------------------------------------------------
  106. #define NUM_RRCM_SESS 50
  107. #define MIN_NUM_RRCM_SESS 5
  108. #define MAX_NUM_RRCM_SESS 100
  109. //----------------------------------------------------------------------------
  110. // RTP: Number of entries in the hash table
  111. //----------------------------------------------------------------------------
  112. #define NUM_RTP_HASH_SESS 65
  113. //----------------------------------------------------------------------------
  114. // RTP: DEFINES TO DETERMINE SEQUENCE NUMBER WRAP or STALENESS (per RFC)
  115. //----------------------------------------------------------------------------
  116. #define MAX_DROPOUT 3000
  117. #define MAX_MISORDER 100
  118. #define MIN_SEQUENTIAL 2
  119. //----------------------------------------------------------------------------
  120. // RTCP: Defined
  121. //----------------------------------------------------------------------------
  122. #define MAX_RR_ENTRIES 31 // Max # of Receiver Reports
  123. #define TIMEOUT_CHK_FREQ (8*1000) // Timeout check freq. - 8s
  124. #define RTCP_TIME_OUT (30*60*1000) // 30 minutes timeout
  125. #define RTCP_XMT_MINTIME 2500
  126. #define RTCP_TIMEOUT_WITHIN_RANGE 100
  127. #define ONE_K 1024
  128. #define NUM_FREE_SSRC 100
  129. #define MIN_NUM_FREE_SSRC 5
  130. #define MAX_NUM_FREE_SSRC 500
  131. #define NUM_FREE_CONTEXT_CELLS 10
  132. #define MAXNUM_CONTEXT_CELLS_REALLOC 10
  133. #define NUM_FREE_RCV_BFR 8
  134. #define NUM_FREE_XMT_BFR 2
  135. #define NUM_RCV_BFR_POSTED 4
  136. #define MIN_NUM_RCV_BFR_POSTED 1
  137. #define MAX_NUM_RCV_BFR_POSTED 8
  138. #define RRCM_RCV_BFR_SIZE (8*ONE_K)
  139. #define MIN_RRCM_RCV_BFR_SIZE (1*ONE_K)
  140. #define MAX_RRCM_RCV_BFR_SIZE (8*ONE_K)
  141. #define RRCM_XMT_BFR_SIZE (8*ONE_K)
  142. #define RCV_BFR_LIST_HEAP_SIZE (4*ONE_K) // Rcv bfr list heap size
  143. #define XMT_BFR_LIST_HEAP_SIZE (4*ONE_K) // Xmt bfr list heap size
  144. #define INITIAL_RTCP_BANDWIDTH 50 // BW in bytes/sec (~ G.723)
  145. // 5% of 6.3Kb/s = 35 bytes
  146. #define MAX_STREAMS_PER_SESSION 64 // Max number of active
  147. // streams per RTP session
  148. #define MAX_NUM_SDES 9 // Number of SDES support
  149. //----------------------------------------------------------------------------
  150. // RTP/RTCP Misc defined
  151. //----------------------------------------------------------------------------
  152. #define UNKNOWN_PAYLOAD_TYPE 0xFFFFFFFF
  153. #define szDfltCname TEXT("No Cname")
  154. //----------------------------------------------------------------------------
  155. // RTP/RTCP: Debug Defined
  156. //----------------------------------------------------------------------------
  157. #define DBG_STRING_LEN 200
  158. #define IO_CHECK 0
  159. #define FLUSH_RTP_PAYLOAD_TYPE 90
  160. enum ISRBDG_CODE{
  161. DBG_NOTIFY = 1,
  162. DBG_CRITICAL,
  163. DBG_ERROR,
  164. DBG_WARNING,
  165. DBG_TRACE,
  166. DBG_TEMP
  167. };
  168. #if !defined(DXMRTP) && !defined(USE_RRCM)
  169. // DXMRTP is defined while building dxmrtp.dll
  170. // that contains all the filtersi, or amrtpnet.ax that
  171. // includes the rrcm stuff
  172. #ifdef _DEBUG
  173. #define ASSERT(x) assert(x)
  174. //#define ASSERT(x)
  175. #define RRCM_DEV_MSG(x,e,f,l,t) RRCMdebugMsg(x,e,f,l,t)
  176. #if defined(DEBUG_RRCM)
  177. #define RRCM_DBG_MSG(x,e,f,l,t) RRCMdebugMsg(x,e,f,l,t)
  178. #else
  179. #define RRCM_DBG_MSG(x,e,f,l,t) {} // DO NOT DELETE BRACKETS ...
  180. #endif
  181. enum { LOG_TIMING = 0x01, // Timing and performance measurements
  182. LOG_TRACE = 0x02, // General step point call tracing
  183. LOG_MEMORY = 0x04, // Memory and object allocation/destruction
  184. LOG_LOCKING = 0x08, // Locking/unlocking of critical sections
  185. LOG_ERROR = 0x10 }; // Debug error notification
  186. #define LOG_DEVELOP 1
  187. #define LOG_DEVELOP1 1
  188. #define LOG_DEVELOP2 2
  189. #define LOG_DEVELOP3 3
  190. #define LOG_DEVELOP4 4
  191. #define LOG_ALWAYS 0x8
  192. #define LOG_CRITICAL 0XF
  193. #define LOG_EVERYTHING 0xFFFFFFFF
  194. void RRCMDebugLogInfo(DWORD Type, DWORD Level, const char *pFormat,...);
  195. #define RRCMDbgLog(_x_) RRCMDebugLogInfo _x_
  196. #else // #ifde _DEBUG
  197. #define ASSERT(x)
  198. #define RRCM_DBG_MSG(x,e,f,l,t) {} // DO NOT DELETE BRACKETS ...
  199. #define RRCM_DEV_MSG(x,e,f,l,t) {} // DO NOT DELETE BRACKETS ...
  200. #define RRCMDbgLog(_x_)
  201. #endif // #ifdef _DEBUG
  202. #ifdef IN_OUT_CHK
  203. #define IN_OUT_STR(x) OutputDebugString (x);
  204. #else
  205. #define IN_OUT_STR(x)
  206. #endif
  207. #endif // #if !defined(USE_RRCM)
  208. #endif // #ifndef __RRCM_H_