Leaked source code of windows server 2003
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.

166 lines
5.8 KiB

  1. #ifndef _MEDIACAP_H
  2. #define _MEDIACAP_H
  3. #ifdef __cplusplus
  4. #define RTP_DYNAMIC_MIN 96 // use value in the range of "dynamic" payload type
  5. #define RTP_DYNAMIC_MAX 127
  6. #define IsDynamicPayload(p) ((p >= RTP_DYNAMIC_MIN) && (p <= RTP_DYNAMIC_MAX))
  7. #define CAP_CHUNK_SIZE 8 // allocate AUDCAP_DETAILS and VIDCAP_DETAILS in chunks of this size
  8. #define MAX_CAPS_PRESORT 64
  9. typedef struct
  10. {
  11. WORD wDataRate; // (channel param) Data rate - must be one of the data rates
  12. // received in the exchanged capabilities. or within the
  13. //specified range. Note that this is redundant
  14. // in the case of exchanging a WAVEFORMATEX
  15. WORD wFrameSizeMax; // (capability)
  16. WORD wFrameSizeMin; // (capability)
  17. WORD wFrameSize; // (channel open param) Record - playback frame size
  18. WORD wFramesPerPkt; // (channel open param) Number of frames in an audio packet
  19. WORD wFramesPerPktMax; // (capability)
  20. WORD wFramesPerPktMin; // (capability)
  21. BYTE UseSilenceDet; // If silence detection is to be used/is available (both)
  22. BYTE UsePostFilter; // If post-filtering is to be used (channel open param. (both?))
  23. }NSC_CHANNEL_PARAMETERS, *PNSC_CHANNEL_PARAMETERS;
  24. typedef struct
  25. {
  26. NSC_CHANNEL_PARAMETERS ns_params;
  27. BYTE RTP_Payload;
  28. }AUDIO_CHANNEL_PARAMETERS, *PAUDIO_CHANNEL_PARAMETERS;
  29. typedef enum
  30. {
  31. NSC_ACMABBREV = 1,
  32. NSC_ACM_WAVEFORMATEX,
  33. // NSC_MS_ACTIVE_MOVIE
  34. } NSC_CAP_TYPE;
  35. typedef struct
  36. {
  37. DWORD dwFormatTag; // ACM format tag + padding
  38. DWORD dwSamplesPerSec; // samples per second
  39. DWORD dwBitsPerSample; // bits per sample plus padding
  40. }NSC_AUDIO_ACM_ABBREVIATED; //ACM_TAG_CAPS, *LP_ACM_TAG_CAPS;
  41. // DON't ever allocate an array of these because of WAVEFORMATEX Extra Bytes
  42. typedef struct {
  43. NSC_CAP_TYPE cap_type;
  44. NSC_CHANNEL_PARAMETERS cap_params;
  45. union {
  46. WAVEFORMATEX wfx;
  47. NSC_AUDIO_ACM_ABBREVIATED acm_brief;
  48. }cap_data;
  49. }NSC_AUDIO_CAPABILITY, *PNSC_AUDIO_CAPABILITY;
  50. typedef struct
  51. {
  52. UINT maxBitRate;
  53. USHORT maxBPP;
  54. USHORT MPI;
  55. }NSC_CHANNEL_VIDEO_PARAMETERS, *PNSC_CHANNEL_VIDEO_PARAMETERS;
  56. typedef struct
  57. {
  58. NSC_CHANNEL_VIDEO_PARAMETERS ns_params;
  59. BYTE RTP_Payload;
  60. BOOL TS_Tradeoff;
  61. }VIDEO_CHANNEL_PARAMETERS, *PVIDEO_CHANNEL_PARAMETERS;
  62. typedef enum
  63. {
  64. NSC_VCMABBREV = 1,
  65. NSC_VCM_VIDEOFORMATEX,
  66. // NSC_MS_ACTIVE_MOVIE
  67. } NSC_CVP_TYPE;
  68. typedef struct
  69. {
  70. DWORD dwFormatTag; // VCM format tag + padding
  71. DWORD dwSamplesPerSec; // samples per second
  72. DWORD dwBitsPerSample; // bits per sample plus padding
  73. }NSC_VIDEO_VCM_ABBREVIATED; //VCM_TAG_CAPS, *LP_VCM_TAG_CAPS;
  74. // DON't ever allocate an array of these because of VIDEOFORMATEX Extra Bytes
  75. typedef struct {
  76. NSC_CVP_TYPE cvp_type;
  77. NSC_CHANNEL_VIDEO_PARAMETERS cvp_params;
  78. union {
  79. VIDEOFORMATEX vfx;
  80. NSC_VIDEO_VCM_ABBREVIATED vcm_brief;
  81. }cvp_data;
  82. }NSC_VIDEO_CAPABILITY, *PNSC_VIDEO_CAPABILITY;
  83. // IH323MediaCap is exposed by the media-specific capability object
  84. // This interface is used primarily by the simultaneous capability object.
  85. // (i.e. the thing that combines all capabilities)
  86. class IH323MediaCap
  87. {
  88. public:
  89. STDMETHOD(QueryInterface(REFIID riid, LPVOID FAR * ppvObj))=0;
  90. STDMETHOD_(ULONG, AddRef()) =0;
  91. STDMETHOD_(ULONG, Release())=0;
  92. STDMETHOD_(BOOL, Init())=0;
  93. STDMETHOD_(BOOL, ReInit())=0;
  94. STDMETHOD_(VOID, FlushRemoteCaps())=0;
  95. STDMETHOD(AddRemoteDecodeCaps(PCC_TERMCAPLIST pTermCapList))=0;
  96. // H.245 parameter grabbing functions
  97. // Get public version of channel parameters for a specific decode capability
  98. STDMETHOD(GetPublicDecodeParams(LPVOID pBufOut, UINT uBufSize, MEDIA_FORMAT_ID id))=0;
  99. // Get local and remote channel parameters for a specific encode capability
  100. STDMETHOD( GetEncodeParams(LPVOID pBufOut, UINT uBufSize, LPVOID pLocalParams,
  101. UINT uLocalSize,MEDIA_FORMAT_ID idRemote,MEDIA_FORMAT_ID idLocal))=0;
  102. // get local version of channel parameters for a specific decode capability
  103. STDMETHOD(GetDecodeParams(PCC_RX_CHANNEL_REQUEST_CALLBACK_PARAMS pChannelParams,
  104. MEDIA_FORMAT_ID * pFormatID, LPVOID lpvBuf, UINT uBufSize))=0;
  105. STDMETHOD( CreateCapList(LPVOID *ppCapBuf))=0;
  106. STDMETHOD( DeleteCapList(LPVOID pCapBuf))=0;
  107. STDMETHOD( ResolveEncodeFormat(MEDIA_FORMAT_ID *pIDEncodeOut,MEDIA_FORMAT_ID * pIDRemoteDecode))=0;
  108. STDMETHOD_(UINT, GetNumCaps())=0;
  109. STDMETHOD_(UINT, GetNumCaps(BOOL bRXCaps))=0;
  110. STDMETHOD_(BOOL, IsHostForCapID(MEDIA_FORMAT_ID CapID))=0;
  111. STDMETHOD_(BOOL, IsCapabilityRecognized(PCC_TERMCAP pCCThisCap))=0;
  112. STDMETHOD_(MEDIA_FORMAT_ID, AddRemoteDecodeFormat(PCC_TERMCAP pCCThisCap))=0;
  113. STDMETHOD(SetCapIDBase(UINT uNewBase))=0;
  114. STDMETHOD_(UINT, GetCapIDBase())=0;
  115. STDMETHOD_(UINT, GetLocalSendParamSize(MEDIA_FORMAT_ID dwID))=0;
  116. STDMETHOD_(UINT, GetLocalRecvParamSize(PCC_TERMCAP pCapability))=0;
  117. // The following is an interim solution, definitely must revisit this for the next release.
  118. // The data pump requires access to local parameters that results from capability
  119. // negotiation. In the absence of a separate interface that the data pump can use,
  120. // the following are stuck onto this interface.
  121. STDMETHOD(GetDecodeFormatDetails(MEDIA_FORMAT_ID FormatID, VOID **ppFormat, UINT *puSize))=0;
  122. STDMETHOD(GetEncodeFormatDetails(MEDIA_FORMAT_ID FormatID, VOID **ppFormat, UINT *puSize))=0;
  123. STDMETHOD (IsFormatEnabled (MEDIA_FORMAT_ID FormatID, PBOOL bRecv, PBOOL bSend))=0;
  124. STDMETHOD_(BOOL, IsFormatPublic(MEDIA_FORMAT_ID FormatID))=0;
  125. STDMETHOD_(MEDIA_FORMAT_ID, GetPublicID(MEDIA_FORMAT_ID FormatID))=0;
  126. STDMETHOD_ (VOID, EnableTXCaps(BOOL bSetting))=0;
  127. STDMETHOD_ (VOID, EnableRemoteTSTradeoff(BOOL bSetting))=0;
  128. STDMETHOD (SetAudioPacketDuration( UINT durationInMs))=0;
  129. STDMETHOD (ResolveToLocalFormat(MEDIA_FORMAT_ID FormatIDLocal,
  130. MEDIA_FORMAT_ID * pFormatIDRemote))=0;
  131. };
  132. typedef IH323MediaCap *LPIH323MediaCap;
  133. #endif //__cplusplus
  134. #endif // _MEDIACAP_H