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.

189 lines
7.3 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. termcaps.h
  5. Abstract:
  6. Definitions for H.323 TAPI Service Provider terminal capabilities.
  7. Environment:
  8. User Mode - Win32
  9. Revision History:
  10. --*/
  11. #ifndef _INC_TERMCAPS
  12. #define _INC_TERMCAPS
  13. ///////////////////////////////////////////////////////////////////////////////
  14. // //
  15. // Definitions //
  16. // //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #define RTP_HEADER_SIZE 12
  19. #define RTP_PACKET_SIZE_UNKNOWN 0
  20. // RTP + UDP + IP
  21. #define TOTAL_HEADER_SIZE 40
  22. #define G723_RTP_PAYLOAD_TYPE 4
  23. #define G723_BYTES_PER_FRAME 24
  24. #define G723_MILLISECONDS_PER_FRAME 30
  25. #define G723_DEFAULT_MILLISECONDS_PER_PACKET 30
  26. #define G723_SLOWLNK_MILLISECONDS_PER_PACKET 90
  27. #define G723_MAXIMUM_MILLISECONDS_PER_PACKET 360
  28. #define G723_FRAMES_PER_PACKET(_MillisecondsPerPacket_) \
  29. ((_MillisecondsPerPacket_) / G723_MILLISECONDS_PER_FRAME)
  30. #define G723_MAXIMUM_FRAME_SIZE 240
  31. #define G723_MAXIMUM_PACKET_SIZE(_FramesPerPacket_) \
  32. (((_FramesPerPacket_) * G723_MAXIMUM_FRAME_SIZE) + RTP_HEADER_SIZE)
  33. #define G723_MILLISECONDS_PER_PACKET(_FramesPerPacket_) \
  34. ((_FramesPerPacket_) * G723_MILLISECONDS_PER_FRAME)
  35. #define G711U_RTP_PAYLOAD_TYPE 0
  36. #define G711A_RTP_PAYLOAD_TYPE 8
  37. #define G711_SAMPLES_PER_FRAME 8
  38. #define G711_SAMPLES_PER_MILLISECOND 8
  39. #define G711_FRAMES_PER_MILLISECOND \
  40. (G711_SAMPLES_PER_MILLISECOND / G711_SAMPLES_PER_FRAME)
  41. #define G711_DEFAULT_MILLISECONDS_PER_PACKET 30
  42. #define G711_MAXIMUM_MILLISECONDS_PER_PACKET 240
  43. #define G711_FRAMES_PER_PACKET(_MillisecondsPerPacket_) \
  44. ((_MillisecondsPerPacket_) * G711_FRAMES_PER_MILLISECOND)
  45. #define G711_MAXIMUM_FRAME_SIZE 8
  46. #define G711_MAXIMUM_PACKET_SIZE(_FramesPerPacket_) \
  47. (((_FramesPerPacket_) * G711_MAXIMUM_FRAME_SIZE) + RTP_HEADER_SIZE)
  48. #define G711_MILLISECONDS_PER_PACKET(_FramesPerPacket_) \
  49. ((_FramesPerPacket_) / G711_FRAMES_PER_MILLISECOND)
  50. #define H263_RTP_PAYLOAD_TYPE 34
  51. #define H263_QCIF_MPI 1
  52. #define H263_MAXIMUM_PACKET_SIZE RTP_PACKET_SIZE_UNKNOWN
  53. #define H261_RTP_PAYLOAD_TYPE 31
  54. #define H261_QCIF_MPI 1
  55. #define H261_MAXIMUM_PACKET_SIZE RTP_PACKET_SIZE_UNKNOWN
  56. #define H245_SESSIONID_AUDIO 1
  57. #define H245_SESSIONID_VIDEO 2
  58. #define MAXIMUM_BITRATE_14400 144 // units of 100 bps
  59. #define MAXIMUM_BITRATE_28800 288 // units of 100 bps
  60. #define MAXIMUM_BITRATE_35000 350 // units of 100 bps
  61. #define MAXIMUM_BITRATE_42000 420 // units of 100 bps
  62. #define MAXIMUM_BITRATE_49000 490 // units of 100 bps
  63. #define MAXIMUM_BITRATE_56000 560 // units of 100 bps
  64. #define MAXIMUM_BITRATE_63000 630 // units of 100 bps
  65. #define MAXIMUM_BITRATE_ISDN 850 // units of 100 bps
  66. // #define MAXIMUM_BITRATE_LAN 6217 // units of 100 bps
  67. #define H323_UNADJ_VIDEORATE_THRESHOLD 120 // units of 100 bps
  68. #define H323_TRUE_VIDEORATE_THRESHOLD 220 // units of 100 bps
  69. #define H323_MINIMUM_AUDIO_BANDWIDTH 171 // units of 100 bps
  70. #define H323_BANDWIDTH_CUSHION_PERCENT 10
  71. #define MAXIMUM_BITRATE_H26x_QCIF 960 // units of 100 bps
  72. #define MAXIMUM_BITRATE_H26x_CIF 1280 // units of 100 bps
  73. #define H323IsSlowLink(_dwLinkSpeed_) \
  74. ((_dwLinkSpeed_) <= (MAXIMUM_BITRATE_35000 * 100))
  75. #define H245_TERMCAPINDEX_G723 0
  76. #define H245_TERMCAPINDEX_H263 1
  77. #define H245_TERMCAPINDEX_G711_ULAW64 2
  78. #define H245_TERMCAPINDEX_G711_ALAW64 3
  79. #define H245_TERMCAPINDEX_H261 4
  80. #define H245_TERMCAPINDEX_T120 5
  81. #define H245_TERMCAPID_G723 (H245_TERMCAPINDEX_G723 + 1)
  82. #define H245_TERMCAPID_H263 (H245_TERMCAPINDEX_H263 + 1)
  83. #define H245_TERMCAPID_G711_ULAW64 (H245_TERMCAPINDEX_G711_ULAW64 + 1)
  84. #define H245_TERMCAPID_G711_ALAW64 (H245_TERMCAPINDEX_G711_ALAW64 + 1)
  85. #define H245_TERMCAPID_H261 (H245_TERMCAPINDEX_H261 + 1)
  86. #define H245_TERMCAPID_T120 (H245_TERMCAPINDEX_T120 +1)
  87. #define H323IsValidDataType(_type_) \
  88. (((_type_) == H245_DATA_VIDEO) || \
  89. ((_type_) == H245_DATA_AUDIO))
  90. #define H323IsValidAudioClientType(_type_) \
  91. (((_type_) == H245_CLIENT_AUD_G711_ULAW64) || \
  92. ((_type_) == H245_CLIENT_AUD_G711_ALAW64) || \
  93. ((_type_) == H245_CLIENT_AUD_G723))
  94. #define H323IsValidVideoClientType(_type_) \
  95. (((_type_) == H245_CLIENT_VID_H261) || \
  96. ((_type_) == H245_CLIENT_VID_H263))
  97. #define H323IsValidClientType(_type_) \
  98. (H323IsValidAudioClientType(_type_) || \
  99. H323IsValidVideoClientType(_type_))
  100. #define H323IsAudioDataType(_type_) \
  101. ((_type_) == H245_DATA_AUDIO)
  102. #define H323IsVideoDataType(_type_) \
  103. ((_type_) == H245_DATA_VIDEO)
  104. #define H323IsAudioPayloadType(_type_) \
  105. (((_type_) == G711U_RTP_PAYLOAD_TYPE) || \
  106. ((_type_) == G711A_RTP_PAYLOAD_TYPE) || \
  107. ((_type_) == G723_RTP_PAYLOAD_TYPE))
  108. #define H323IsVideoPayloadType(_type_) \
  109. (((_type_) == H261_RTP_PAYLOAD_TYPE) || \
  110. ((_type_) == H263_RTP_PAYLOAD_TYPE))
  111. #define H323IsReceiveCapability(_dir_) \
  112. (((_dir_) == H245_CAPDIR_LCLRXTX) || \
  113. ((_dir_) == H245_CAPDIR_RMTRXTX) || \
  114. ((_dir_) == H245_CAPDIR_LCLRX) || \
  115. ((_dir_) == H245_CAPDIR_RMTRX))
  116. ///////////////////////////////////////////////////////////////////////////////
  117. // //
  118. // Global variables //
  119. // //
  120. ///////////////////////////////////////////////////////////////////////////////
  121. extern CC_VENDORINFO g_VendorInfo;
  122. extern DWORD g_dwIPT120;
  123. extern WORD g_wPortT120;
  124. ///////////////////////////////////////////////////////////////////////////////
  125. // //
  126. // Macros //
  127. // //
  128. ///////////////////////////////////////////////////////////////////////////////
  129. #define DEFINE_VENDORINFO(_ID_,_VERSION_) \
  130. { \
  131. H221_COUNTRY_CODE_USA, \
  132. H221_COUNTRY_EXT_USA, \
  133. H221_MFG_CODE_MICROSOFT, \
  134. &(_ID_), \
  135. &(_VERSION_) \
  136. }
  137. #define SIZEOF_TERMCAPLIST(_TermCapArray_) \
  138. (sizeof(_TermCapArray_)/sizeof(PPCC_TERMCAP))
  139. ///////////////////////////////////////////////////////////////////////////////
  140. // //
  141. // Public prototypes //
  142. // //
  143. ///////////////////////////////////////////////////////////////////////////////
  144. BOOL
  145. InitializeTermCaps(
  146. );
  147. #endif // _INC_TERMCAPS