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.

318 lines
12 KiB

  1. //------------------------------------------------------------------------------
  2. // File: DynGraph.idl
  3. //
  4. // Desc: Dynamic graph interfaces.
  5. //
  6. // Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved.
  7. //------------------------------------------------------------------------------
  8. interface IPinConnection;
  9. interface IPinFlowControl;
  10. interface IGraphConfig;
  11. interface IGraphConfigCallback;
  12. //--------------------------------------------------------------------
  13. //
  14. // IPinConnection - supported by input pins
  15. //
  16. //--------------------------------------------------------------------
  17. [
  18. local,
  19. object,
  20. uuid(4a9a62d3-27d4-403d-91e9-89f540e55534),
  21. pointer_default(unique)
  22. ]
  23. interface IPinConnection : IUnknown {
  24. // Do you accept this type chane in your current state?
  25. HRESULT DynamicQueryAccept([in] const AM_MEDIA_TYPE *pmt);
  26. // Set event when EndOfStream receive - do NOT pass it on
  27. // This condition is cancelled by a flush or Stop
  28. HRESULT NotifyEndOfStream([in] HANDLE hNotifyEvent);
  29. // Are you an 'end pin'
  30. HRESULT IsEndPin();
  31. HRESULT DynamicDisconnect();
  32. };
  33. //--------------------------------------------------------------------
  34. //
  35. // IPinFlowControl - supported by output pins
  36. //
  37. //--------------------------------------------------------------------
  38. [
  39. local,
  40. object,
  41. uuid(c56e9858-dbf3-4f6b-8119-384af2060deb),
  42. pointer_default(unique)
  43. ]
  44. interface IPinFlowControl : IUnknown {
  45. // Block processing on this pin
  46. HRESULT Block([in] DWORD dwBlockFlags, [in] HANDLE hEvent);
  47. }
  48. // block flags
  49. enum _AM_PIN_FLOW_CONTROL_BLOCK_FLAGS {
  50. AM_PIN_FLOW_CONTROL_BLOCK = 0x00000001, // 0 means unblock
  51. };
  52. // Reconnect flags
  53. typedef enum _AM_GRAPH_CONFIG_RECONNECT_FLAGS {
  54. AM_GRAPH_CONFIG_RECONNECT_DIRECTCONNECT = 0x00000001,
  55. AM_GRAPH_CONFIG_RECONNECT_CACHE_REMOVED_FILTERS = 0x00000002,
  56. AM_GRAPH_CONFIG_RECONNECT_USE_ONLY_CACHED_FILTERS = 0x00000004
  57. } AM_GRAPH_CONFIG_RECONNECT_FLAGS;
  58. // RemoveFilterEx flags
  59. enum _REM_FILTER_FLAGS {
  60. REMFILTERF_LEAVECONNECTED = 0x00000001
  61. };
  62. typedef enum _AM_FILTER_FLAGS {
  63. AM_FILTER_FLAGS_REMOVABLE = 0x00000001
  64. } AM_FILTER_FLAGS;
  65. //--------------------------------------------------------------------
  66. //
  67. // IGraphConfig
  68. //
  69. //--------------------------------------------------------------------
  70. [
  71. local,
  72. object,
  73. uuid(03A1EB8E-32BF-4245-8502-114D08A9CB88),
  74. pointer_default(unique)
  75. ]
  76. interface IGraphConfig : IUnknown {
  77. HRESULT Reconnect([in] IPin *pOutputPin,
  78. [in] IPin *pInputPin,
  79. [in] const AM_MEDIA_TYPE *pmtFirstConnection,
  80. [in] IBaseFilter *pUsingFilter, // can be NULL
  81. [in] HANDLE hAbortEvent,
  82. [in] DWORD dwFlags);
  83. HRESULT Reconfigure([in] IGraphConfigCallback *pCallback,
  84. [in] PVOID pvContext,
  85. [in] DWORD dwFlags,
  86. [in] HANDLE hAbortEvent);
  87. HRESULT AddFilterToCache([in] IBaseFilter *pFilter);
  88. HRESULT EnumCacheFilter([out] IEnumFilters **pEnum);
  89. HRESULT RemoveFilterFromCache([in]IBaseFilter *pFilter);
  90. // Get the start time associated with the last Run() call
  91. // If the graph is not running returns VFW_E_WRONG_STATE
  92. HRESULT GetStartTime([out] REFERENCE_TIME *prtStart);
  93. HRESULT PushThroughData(
  94. [in] IPin *pOutputPin,
  95. [in] IPinConnection *pConnection,
  96. [in] HANDLE hEventAbort);
  97. HRESULT SetFilterFlags([in] IBaseFilter *pFilter, [in] DWORD dwFlags);
  98. HRESULT GetFilterFlags([in] IBaseFilter *pFilter, [out] DWORD *pdwFlags);
  99. HRESULT RemoveFilterEx( [in] IBaseFilter *pFilter, DWORD Flags );
  100. }
  101. //--------------------------------------------------------------------
  102. //
  103. // IGraphConfigCallback
  104. //
  105. //--------------------------------------------------------------------
  106. [
  107. local,
  108. object,
  109. uuid(ade0fd60-d19d-11d2-abf6-00a0c905f375),
  110. pointer_default(unique)
  111. ]
  112. interface IGraphConfigCallback : IUnknown
  113. {
  114. HRESULT Reconfigure(PVOID pvContext, DWORD dwFlags);
  115. }
  116. // Filter Chain Definition
  117. //
  118. // Filter chains have the following properties:
  119. //
  120. // - Each filter chain has one or more filters.
  121. //
  122. // - Each filter in a filter chain has at most one connected input pin and one
  123. // connected output pin. For example, filters A, C, D, F, G, H, I, J and K
  124. // (see the diagram below) can be in a filter chain because each one has at
  125. // most one connected input pin and one connected output pin.
  126. //
  127. // - Any filter in a chain is reachable by any other filter in the chain.
  128. // For example, in the filter chain F-G-H, F can reach H by following the F-
  129. // G connection to G and then following the G-H connection to H. Filters F
  130. // and J cannot be in the same filter chain because J is not reachable from
  131. // F. Anotherwords, there no sequence of connected filters between F and J.
  132. //
  133. // - The start filter is the only filter in the filter chain who's input
  134. // pin is not connected to another filter in the chain. For instance, F is
  135. // the start filter in F-G-H because F's input pin is connected to E and E
  136. // is not in the filter chain. G's input pin is connected to F and H's is
  137. // connected to G. Both F and G are in the filter chain.
  138. //
  139. // - The end filter is the only filter in the filter chain who's output pin
  140. // is not connected to another filter in the chain. For example, in the
  141. // filter chain J-K, K is the end filter because K's output pin is
  142. // connected to L. J's output pin is connected to K and K is in the J-K
  143. // filter chain.
  144. //
  145. //
  146. // --->|---| |---|--->
  147. // | C |--->| D |
  148. // |---| |---|--->|---| |---|--->|---| |---| |---| |---|
  149. // | A |--->| B | | E |--->| F |--->| G |--->| H |
  150. // |---| |---|--->|---|------------>|---| |---| |---| |---|
  151. // | I |--->
  152. // --->|---|--->
  153. //
  154. // |---| |---| |---|
  155. // | J |--->| K |--->| L |
  156. // |---| |---| |---|
  157. //
  158. // Example Filter Graph
  159. //
  160. //
  161. //
  162. // IFilterChain Methods Documentation
  163. //
  164. // HRESULT StartChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter );
  165. //
  166. // StartChain() switches all the filters in the chain into the running state
  167. // If one of the filters will not switch to the running state, then all the filters
  168. // in the chain are stopped. This method can only be called if the filter graph is
  169. // running.
  170. //
  171. // Parameters:
  172. // - pStartFilter [in]
  173. // The first filter in the filter chain. Note that this can be the same
  174. // filter as pEndFilter .
  175. //
  176. // - pEndFilter [in]
  177. // The last filter in the filter chain. Note that this can be the same
  178. // filter as pStartFilter. If pEndFilter is NULL then the filter chain extends
  179. // from pStartFilter to the last downstream filter which can be in a filter chain.
  180. // For example, IFilterChain::StartChain( A, NULL ) would start filter A.
  181. // IFilterChain::StartChain( G, NULL ) would start filters G and H.
  182. // IFilterChain::StartChain( C, NULL ) would start filters C and D. Finally,
  183. // IFilterChain::StartChain( E, NULL ) would fail because E cannot be in a
  184. // filter chain (see the Filter Chain Definition section for more information).
  185. //
  186. // Return Value:
  187. // An HRESULT. See the Direct Show SDK and COM SDK documentation for more
  188. // information on interpreting HRESULTs.
  189. //
  190. //
  191. //
  192. //
  193. // HRESULT PauseChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter );
  194. //
  195. // PauseChain() switches all the filters in a chain to the paused state. If it cannot
  196. // switch one of the filtres into the paused state, all the filters in the chain are
  197. // stopped. This method can only be called if the filter graph is paused.
  198. //
  199. // Parameters:
  200. // - pStartFilter [in]
  201. // The first filter in the filter chain. Note that this can be the same
  202. // filter as pEndFilter .
  203. //
  204. // - pEndFilter [in]
  205. // The last filter in the filter chain. Note that this can be the same
  206. // filter as pStartFilter. If pEndFilter is NULL then the filter chain extends
  207. // from pStartFilter to the last downstream filter which can be in a filter chain.
  208. // For example, IFilterChain::StopChain( A, NULL ) would stop filter A.
  209. // IFilterChain::StopChain( G, NULL ) would stop filters G and H.
  210. // IFilterChain::StopChain( C, NULL ) would stop filters C and D. Finally,
  211. // IFilterChain::StopChain( E, NULL ) would fail because E cannot be in a filter
  212. // chain (see the Filter Chain Definition section for more information).
  213. //
  214. //
  215. // Return Value:
  216. // An HRESULT. See the Direct Show SDK and COM SDK documentation for more
  217. // information on interpreting HRESULTs.
  218. //
  219. //
  220. //
  221. // HRESULT StopChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter );
  222. //
  223. // StopChain() switches all the filters in chain to the stopped state.
  224. //
  225. // Parameters:
  226. // - pStartFilter [in]
  227. // The first filter in the filter chain. Note that this can be the same
  228. // filter as pEndFilter .
  229. //
  230. // - pEndFilter [in]
  231. // The last filter in the filter chain. Note that this can be the same
  232. // filter as pStartFilter. If pEndFilter is NULL then the filter chain extends
  233. // from pStartFilter to the last downstream filter which can be in a filter chain.
  234. // For example, IFilterChain::StopChain( A, NULL ) would stop filter A.
  235. // IFilterChain::StopChain( G, NULL ) would stop filters G and H.
  236. // IFilterChain::StopChain( C, NULL ) would stop filters C and D. Finally,
  237. // IFilterChain::StopChain( E, NULL ) would fail because E cannot be in a filter
  238. // chain (see the Filter Chain Definition section for more information).
  239. //
  240. //
  241. // Return Value:
  242. // An HRESULT. See the Direct Show SDK and COM SDK documentation for more
  243. // information on interpreting HRESULTs.
  244. //
  245. //
  246. //
  247. //
  248. //
  249. // HRESULT RemoveChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter );
  250. //
  251. // RemoveChain() removes every filter in a chain from the filter graph.
  252. // The filters can be removed while the graph is running.
  253. //
  254. // Parameters:
  255. // - pStartFilter [in]
  256. // The first filter in the filter chain. Note that this can be the same
  257. // filter as pEndFilter .
  258. //
  259. // - pEndFilter [in]
  260. // The last filter in the filter chain. Note that this can be the same
  261. // filter as pStartFilter. If pEndFilter is NULL then the filter chain
  262. // extends from pStartFilter to the last downstream filter which can be in a
  263. // filter chain. For example, IFilterChain::RemoveChain( A, NULL ) would remove
  264. // filter A from the filter graph. IFilterChain::RemoveChain( G, NULL ) would
  265. // remove filters G and H. IFilterChain::RemoveChain( C, NULL ) would remove
  266. // filters C and D. Finally, IFilterChain::RemoveChain( E, NULL ) would fail
  267. // because E cannot be in a filter chain (see the Filter Chain Definition
  268. // section for more information).
  269. //
  270. //
  271. // Return Value:
  272. // An HRESULT. See the Direct Show SDK and COM SDK documentation for more
  273. // information on interpreting HRESULTs.
  274. //
  275. //
  276. [
  277. local,
  278. object,
  279. uuid(DCFBDCF6-0DC2-45f5-9AB2-7C330EA09C29),
  280. pointer_default(unique)
  281. ]
  282. interface IFilterChain : IUnknown
  283. {
  284. HRESULT StartChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter );
  285. HRESULT PauseChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter );
  286. HRESULT StopChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter );
  287. HRESULT RemoveChain( [in] IBaseFilter *pStartFilter, [in] IBaseFilter *pEndFilter );
  288. }