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.

246 lines
5.9 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. Confpart.h
  5. Abstract:
  6. Definitions for participant related classes..
  7. Author:
  8. Mu Han (muhan) 30-September-1998
  9. --*/
  10. #ifndef __CONFPART_H
  11. #define __CONFPART_H
  12. const DWORD PART_SEND = 0x0001;
  13. const DWORD PART_RECV = 0x0002;
  14. typedef struct _STREAM_INFO
  15. {
  16. DWORD dwSSRC;
  17. DWORD dwSendRecv;
  18. } STREAM_INFO;
  19. class ATL_NO_VTABLE CParticipant :
  20. public CComObjectRootEx<CComMultiThreadModelNoCS>,
  21. public IDispatchImpl<ITParticipant, &IID_ITParticipant, &LIBID_IPConfMSPLib>,
  22. public CMSPObjectSafetyImpl
  23. {
  24. public:
  25. BEGIN_COM_MAP(CParticipant)
  26. COM_INTERFACE_ENTRY(IDispatch)
  27. COM_INTERFACE_ENTRY(ITParticipant)
  28. COM_INTERFACE_ENTRY(IObjectSafety)
  29. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  30. END_COM_MAP()
  31. DECLARE_GET_CONTROLLING_UNKNOWN()
  32. #ifdef DEBUG_REFCOUNT
  33. ULONG InternalAddRef();
  34. ULONG InternalRelease();
  35. #endif
  36. CParticipant();
  37. // methods of the CComObject
  38. virtual void FinalRelease();
  39. // ITParticipant methods, called by the app.
  40. STDMETHOD (get_ParticipantTypedInfo) (
  41. IN PARTICIPANT_TYPED_INFO InfoType,
  42. OUT BSTR * ppInfo
  43. );
  44. STDMETHOD (get_MediaTypes) (
  45. // IN TERMINAL_DIRECTION Direction,
  46. OUT long * plMediaTypes
  47. );
  48. STDMETHOD (put_Status) (
  49. IN ITStream * pITStream,
  50. IN VARIANT_BOOL fEnable
  51. );
  52. STDMETHOD (get_Status) (
  53. IN ITStream * pITStream,
  54. OUT VARIANT_BOOL * pStatus
  55. );
  56. STDMETHOD (get_Streams) (
  57. OUT VARIANT * pVariant
  58. );
  59. STDMETHOD (EnumerateStreams) (
  60. OUT IEnumStream ** ppEnumStream
  61. );
  62. // methods called by the call object.
  63. HRESULT Init(
  64. IN char * szCName,
  65. IN ITStream * pITStream,
  66. IN DWORD dwSSRC,
  67. IN DWORD dwSendRecv,
  68. IN DWORD dwMediaType
  69. );
  70. BOOL UpdateInfo(
  71. IN int Type,
  72. IN DWORD dwLen,
  73. IN char * szInfo
  74. );
  75. BOOL UpdateSSRC(
  76. IN ITStream * pITStream,
  77. IN DWORD dwSSRC,
  78. IN DWORD dwSendRecv
  79. );
  80. BOOL HasSSRC(
  81. IN ITStream * pITStream,
  82. IN DWORD dwSSRC
  83. );
  84. BOOL GetSSRC(
  85. IN ITStream * pITStream,
  86. OUT DWORD * pdwSSRC
  87. );
  88. HRESULT AddStream(
  89. IN ITStream * pITStream,
  90. IN DWORD dwSSRC,
  91. IN DWORD dwSendRecv,
  92. IN DWORD dwMediaType
  93. );
  94. HRESULT RemoveStream(
  95. IN ITStream * pITStream,
  96. IN DWORD dwSSRC,
  97. OUT BOOL * pbLast
  98. );
  99. DWORD GetSendRecvStatus(
  100. IN ITStream * pITStream
  101. );
  102. int CompareCName(IN const char * szCName) const
  103. { return lstrcmpA(m_InfoItems[RTCP_SDES_CNAME - 1], szCName); }
  104. protected:
  105. // Pointer to the free threaded marshaler.
  106. IUnknown * m_pFTM;
  107. // The lock that protects the participant object.
  108. CMSPCritSection m_lock;
  109. // The list of streams that the participant is rendering on.
  110. CMSPArray <ITStream *> m_Streams;
  111. // The list of SSRC for the partcipant in each stream.
  112. CMSPArray <STREAM_INFO> m_StreamInfo;
  113. // the information items for this participant. The index is the
  114. // value of RTCP_SDES_TYPE_T - 1, see RTP.h.
  115. char * m_InfoItems[RTCP_SDES_LAST - 1];
  116. // The media types that this participant is sending.
  117. DWORD m_dwSendingMediaTypes;
  118. // The media types that this participant is receiving.
  119. DWORD m_dwReceivingMediaTypes;
  120. };
  121. class CParticipantList : public CMSPArray<ITParticipant *>
  122. {
  123. public:
  124. BOOL HasSpace() const { return m_nSize < m_nAllocSize; }
  125. BOOL FindByCName(char *szCName, int *pIndex) const;
  126. BOOL InsertAt(int index, ITParticipant *pITParticipant);
  127. };
  128. class ATL_NO_VTABLE CParticipantEvent :
  129. public CComObjectRootEx<CComMultiThreadModel>,
  130. public IDispatchImpl<ITParticipantEvent, &IID_ITParticipantEvent, &LIBID_IPConfMSPLib>,
  131. public CMSPObjectSafetyImpl
  132. {
  133. public:
  134. BEGIN_COM_MAP(CParticipantEvent)
  135. COM_INTERFACE_ENTRY(IDispatch)
  136. COM_INTERFACE_ENTRY(ITParticipantEvent)
  137. COM_INTERFACE_ENTRY(IObjectSafety)
  138. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  139. END_COM_MAP()
  140. DECLARE_GET_CONTROLLING_UNKNOWN()
  141. CParticipantEvent();
  142. // methods of the CComObject
  143. virtual void FinalRelease();
  144. STDMETHOD (get_Event) (
  145. OUT PARTICIPANT_EVENT * pParticipantEvent
  146. );
  147. STDMETHOD (get_Participant) (
  148. OUT ITParticipant ** ppITParticipant
  149. );
  150. STDMETHOD (get_SubStream) (
  151. OUT ITSubStream** ppSubStream
  152. );
  153. // methods called by the call object.
  154. HRESULT Init(
  155. IN PARTICIPANT_EVENT Event,
  156. IN ITParticipant * pITParticipant,
  157. IN ITSubStream * pITSubStream
  158. );
  159. protected:
  160. // Pointer to the free threaded marshaler.
  161. IUnknown * m_pFTM;
  162. PARTICIPANT_EVENT m_Event;
  163. ITParticipant * m_pITParticipant;
  164. ITSubStream * m_pITSubStream;
  165. };
  166. class CIPConfMSPCall;
  167. HRESULT CreateParticipantEvent(
  168. IN PARTICIPANT_EVENT Event,
  169. IN ITParticipant * pITParticipant,
  170. IN ITSubStream * pITSubStream,
  171. OUT IDispatch ** pIDispatch
  172. );
  173. HRESULT CreateParticipantEnumerator(
  174. IN ITParticipant ** begin,
  175. IN ITParticipant ** end,
  176. OUT IEnumParticipant ** ppEnumParticipant
  177. );
  178. HRESULT CreateParticipantCollection(
  179. IN ITParticipant ** begin,
  180. IN ITParticipant ** end,
  181. IN int nSize,
  182. OUT VARIANT * pVariant
  183. );
  184. #endif // __CONFPART_H