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.

185 lines
4.1 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Module: cni.h
  4. //
  5. // Description: Connect Node Instance Class
  6. //
  7. //
  8. //@@BEGIN_MSINTERNAL
  9. // Development Team:
  10. // Mike McLaughlin
  11. //
  12. // History: Date Author Comment
  13. //
  14. //@@END_MSINTERNAL
  15. //---------------------------------------------------------------------------
  16. //
  17. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  18. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  19. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  20. // PURPOSE.
  21. //
  22. // Copyright (c) 1996-1999 Microsoft Corporation. All Rights Reserved.
  23. //
  24. //---------------------------------------------------------------------------
  25. //---------------------------------------------------------------------------
  26. // Constants and Macros
  27. //---------------------------------------------------------------------------
  28. //---------------------------------------------------------------------------
  29. // Classes
  30. //---------------------------------------------------------------------------
  31. typedef class CConnectNodeInstance : public CListMultiItem
  32. {
  33. friend class CStartNodeInstance;
  34. private:
  35. CConnectNodeInstance(
  36. IN PCONNECT_NODE pConnectNode
  37. );
  38. ~CConnectNodeInstance(
  39. );
  40. public:
  41. static NTSTATUS
  42. Create(
  43. PSTART_NODE_INSTANCE pStartNodeInstance,
  44. PDEVICE_NODE pDeviceNode
  45. );
  46. VOID
  47. AddRef(
  48. )
  49. {
  50. Assert(this);
  51. ++cReference;
  52. };
  53. NTSTATUS
  54. AddListEnd(
  55. PCLIST_MULTI plm
  56. );
  57. ENUMFUNC
  58. Destroy(
  59. );
  60. BOOL
  61. IsTopDown(
  62. )
  63. {
  64. Assert(this);
  65. return(pConnectNode->IsTopDown());
  66. };
  67. NTSTATUS
  68. Connect(
  69. IN PWAVEFORMATEX pWaveFormatEx,
  70. IN PKSPIN_CONNECT pPinConnectDirect
  71. );
  72. NTSTATUS
  73. SetStateTopDown(
  74. KSSTATE NewState,
  75. KSSTATE PreviousState,
  76. ULONG ulFlags
  77. );
  78. NTSTATUS
  79. SetStateBottomUp(
  80. KSSTATE NewState,
  81. KSSTATE PreviousState,
  82. ULONG ulFlags
  83. );
  84. #ifdef DEBUG
  85. ENUMFUNC Dump();
  86. PKSPIN_CONNECT pPinConnect;
  87. #endif
  88. private:
  89. NTSTATUS
  90. AddList( // don't use these list functions
  91. PCLIST_MULTI plm
  92. )
  93. {
  94. return(STATUS_NOT_IMPLEMENTED);
  95. };
  96. NTSTATUS
  97. AddListOrdered(
  98. PCLIST_MULTI plm,
  99. LONG lFieldOffset
  100. )
  101. {
  102. return(STATUS_NOT_IMPLEMENTED);
  103. };
  104. VOID
  105. RemoveList(
  106. PCLIST_MULTI plm
  107. )
  108. {
  109. };
  110. BOOL fRender;
  111. LONG cReference;
  112. PCONNECT_NODE pConnectNode;
  113. PFILTER_NODE_INSTANCE pFilterNodeInstanceSource;
  114. PFILTER_NODE_INSTANCE pFilterNodeInstanceSink;
  115. PPIN_NODE_INSTANCE pPinNodeInstanceSource;
  116. PPIN_NODE_INSTANCE pPinNodeInstanceSink;
  117. public:
  118. DefineSignature(0x20494E43); // CNI
  119. } CONNECT_NODE_INSTANCE, *PCONNECT_NODE_INSTANCE;
  120. //---------------------------------------------------------------------------
  121. typedef ListMultiDestroy<CONNECT_NODE_INSTANCE> LIST_CONNECT_NODE_INSTANCE;
  122. typedef LIST_CONNECT_NODE_INSTANCE *PLIST_CONNECT_NODE_INSTANCE;
  123. //---------------------------------------------------------------------------
  124. // Local prototypes
  125. //---------------------------------------------------------------------------
  126. NTSTATUS
  127. CreatePinConnect(
  128. PKSPIN_CONNECT *ppPinConnect,
  129. PCONNECT_NODE pConnectNode,
  130. PFILTER_NODE_INSTANCE pFilterNodeInstanceSink,
  131. PFILTER_NODE_INSTANCE pFilterNodeInstanceSource,
  132. PWAVEFORMATEX pWaveFormatExLimit
  133. );
  134. NTSTATUS
  135. CreatePinIntersection(
  136. PKSPIN_CONNECT *ppPinConnect,
  137. PPIN_NODE pPinNode1,
  138. PPIN_NODE pPinNode2,
  139. PFILTER_NODE_INSTANCE pFilterNodeInstance1,
  140. PFILTER_NODE_INSTANCE pFilterNodeInstance2
  141. );
  142. NTSTATUS
  143. CreateWaveFormatEx(
  144. PKSPIN_CONNECT *ppPinConnect,
  145. PCONNECT_NODE pConnectNode,
  146. PWAVEFORMATEX pWaveFormatExLimit
  147. );
  148. VOID
  149. WaveFormatFromAudioRange(
  150. PKSDATARANGE_AUDIO pDataRangeAudio,
  151. WAVEFORMATEX *pWavFormatEx
  152. );
  153. BOOL
  154. LimitAudioRangeToWave(
  155. PWAVEFORMATEX pWaveFormatEx,
  156. PKSDATARANGE_AUDIO pDataRangeAudio
  157. );
  158. //---------------------------------------------------------------------------