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.

337 lines
8.9 KiB

  1. //------------------------------------------------------------------------------
  2. // File: AMStream.idl
  3. //
  4. // Desc:
  5. //
  6. // Copyright (c) 1998 - 2000, Microsoft Corporation. All rights reserved.
  7. //------------------------------------------------------------------------------
  8. import "unknwn.idl";
  9. import "mmstream.idl";
  10. import "strmif.idl";
  11. cpp_quote("#include <ddraw.h>")
  12. cpp_quote("#include <mmsystem.h>")
  13. cpp_quote("#include <mmstream.h>")
  14. cpp_quote("#include <ddstream.h>")
  15. cpp_quote("#include <austream.h>")
  16. interface IAMMultiMediaStream;
  17. interface IAMMediaStream;
  18. interface IMediaStreamFilter;
  19. interface IDirectDraw;
  20. interface IDirectDrawSurface;
  21. interface IAMMediaTypeStream;
  22. interface IAMMediaTypeSample;
  23. // Flags definitions for IAMMultiMediaStream::Initialize
  24. enum {
  25. AMMSF_NOGRAPHTHREAD = 0x00000001
  26. };
  27. // Flags definitions for AddMediaStream and IAMMediaStream::Initialize
  28. enum {
  29. // Don't add a stream - create a default renderer instead
  30. // for the supplied purpose id
  31. AMMSF_ADDDEFAULTRENDERER = 0x00000001,
  32. AMMSF_CREATEPEER = 0x00000002,
  33. // If no samples are created when we run or the last sample
  34. // is deleted then terminate this stream
  35. AMMSF_STOPIFNOSAMPLES = 0x00000004,
  36. // If Update is not called keep going
  37. AMMSF_NOSTALL = 0x00000008
  38. };
  39. // Flag definitions for OpenFile and OpenMoniker
  40. enum {
  41. AMMSF_RENDERTYPEMASK = 0x00000003,
  42. AMMSF_RENDERTOEXISTING = 0x00000000,
  43. AMMSF_RENDERALLSTREAMS = 0x00000001,
  44. AMMSF_NORENDER = 0x00000002,
  45. AMMSF_NOCLOCK = 0x00000004,
  46. AMMSF_RUN = 0x00000008
  47. };
  48. typedef [v1_enum] enum {
  49. Disabled = 0,
  50. ReadData = 1,
  51. RenderData = 2
  52. } OUTPUT_STATE;
  53. [
  54. object,
  55. uuid(7DB01C96-C0C3-11d0-8FF1-00C04FD9189D),
  56. dual,
  57. helpstring("IDirectShowStream Interface"),
  58. pointer_default(unique)
  59. ]
  60. interface IDirectShowStream : IDispatch
  61. {
  62. [propget, id(1), helpstring("property FileName")] HRESULT FileName([out, retval] BSTR *pVal);
  63. [propput, id(1), helpstring("property FileName")] HRESULT FileName([in] BSTR newVal);
  64. [propget, id(2), helpstring("property Video")] HRESULT Video([out, retval] OUTPUT_STATE *pVal);
  65. [propput, id(2), helpstring("propetry Video")] HRESULT Video([in] OUTPUT_STATE newVal);
  66. [propget, id(3), helpstring("property Audio")] HRESULT Audio([out, retval] OUTPUT_STATE *pVal);
  67. [propput, id(3), helpstring("propetry Audio")] HRESULT Audio([in] OUTPUT_STATE newVal);
  68. };
  69. // IAMMultiMediaStream interface
  70. [
  71. object,
  72. uuid(BEBE595C-9A6F-11d0-8FDE-00C04FD9189D),
  73. pointer_default(unique)
  74. ]
  75. interface IAMMultiMediaStream : IMultiMediaStream
  76. {
  77. HRESULT Initialize(
  78. [in] STREAM_TYPE StreamType,
  79. [in] DWORD dwFlags,
  80. [in] IGraphBuilder *pFilterGraph);
  81. HRESULT GetFilterGraph(
  82. [out] IGraphBuilder **ppGraphBuilder);
  83. HRESULT GetFilter(
  84. [out] IMediaStreamFilter **ppFilter);
  85. HRESULT AddMediaStream(
  86. [in] IUnknown *pStreamObject,
  87. [in] const MSPID *PurposeId,
  88. [in] DWORD dwFlags,
  89. [out] IMediaStream **ppNewStream);
  90. HRESULT OpenFile(
  91. [in] LPCWSTR pszFileName,
  92. [in] DWORD dwFlags);
  93. HRESULT OpenMoniker(
  94. [in] IBindCtx *pCtx,
  95. [in] IMoniker *pMoniker,
  96. [in] DWORD dwFlags);
  97. HRESULT Render(
  98. [in] DWORD dwFlags);
  99. }
  100. // IAMMediaStream interface
  101. [
  102. object,
  103. uuid(BEBE595D-9A6F-11d0-8FDE-00C04FD9189D),
  104. pointer_default(unique)
  105. ]
  106. interface IAMMediaStream : IMediaStream
  107. {
  108. HRESULT Initialize(
  109. [in] IUnknown *pSourceObject,
  110. [in] DWORD dwFlags,
  111. [in] REFMSPID PurposeId,
  112. [in] const STREAM_TYPE StreamType);
  113. HRESULT SetState(
  114. [in] FILTER_STATE State);
  115. HRESULT JoinAMMultiMediaStream(
  116. [in] IAMMultiMediaStream *pAMMultiMediaStream);
  117. HRESULT JoinFilter(
  118. [in] IMediaStreamFilter *pMediaStreamFilter);
  119. HRESULT JoinFilterGraph(
  120. [in] IFilterGraph *pFilterGraph);
  121. };
  122. // IMediaStreamFilter interface
  123. [
  124. object,
  125. local,
  126. uuid(BEBE595E-9A6F-11d0-8FDE-00C04FD9189D),
  127. pointer_default(unique)
  128. ]
  129. interface IMediaStreamFilter : IBaseFilter
  130. {
  131. HRESULT AddMediaStream(
  132. [in] IAMMediaStream *pAMMediaStream);
  133. HRESULT GetMediaStream(
  134. [in] REFMSPID idPurpose,
  135. [out] IMediaStream **ppMediaStream);
  136. HRESULT EnumMediaStreams(
  137. [in] long Index,
  138. [out] IMediaStream **ppMediaStream);
  139. HRESULT SupportSeeking(
  140. [in] BOOL bRenderer);
  141. HRESULT ReferenceTimeToStreamTime(
  142. [in] [out] REFERENCE_TIME *pTime);
  143. HRESULT GetCurrentStreamTime(
  144. [out] REFERENCE_TIME *pCurrentStreamTime);
  145. HRESULT WaitUntil(
  146. [in] REFERENCE_TIME WaitStreamTime);
  147. HRESULT Flush(
  148. [in] BOOL bCancelEOS);
  149. HRESULT EndOfStream();
  150. };
  151. [
  152. object,
  153. local,
  154. uuid(AB6B4AFC-F6E4-11d0-900D-00C04FD9189D),
  155. pointer_default(unique)
  156. ]
  157. interface IDirectDrawMediaSampleAllocator : IUnknown
  158. {
  159. HRESULT GetDirectDraw(IDirectDraw **ppDirectDraw);
  160. };
  161. [
  162. object,
  163. local,
  164. uuid(AB6B4AFE-F6E4-11d0-900D-00C04FD9189D),
  165. pointer_default(unique)
  166. ]
  167. interface IDirectDrawMediaSample : IUnknown
  168. {
  169. HRESULT GetSurfaceAndReleaseLock(
  170. [out] IDirectDrawSurface **ppDirectDrawSurface,
  171. [out] RECT * pRect);
  172. HRESULT LockMediaSamplePointer(void);
  173. };
  174. [
  175. object,
  176. local,
  177. uuid(AB6B4AFA-F6E4-11d0-900D-00C04FD9189D),
  178. pointer_default(unique)
  179. ]
  180. interface IAMMediaTypeStream : IMediaStream
  181. {
  182. HRESULT GetFormat(
  183. [out] AM_MEDIA_TYPE * pMediaType,
  184. [in] DWORD dwFlags);
  185. HRESULT SetFormat(
  186. [in] AM_MEDIA_TYPE * pMediaType,
  187. [in] DWORD dwFlags);
  188. HRESULT CreateSample(
  189. [in] long lSampleSize,
  190. [in] BYTE * pbBuffer,
  191. [in] DWORD dwFlags,
  192. [in] IUnknown *pUnkOuter,
  193. [out] IAMMediaTypeSample ** ppAMMediaTypeSample);
  194. HRESULT GetStreamAllocatorRequirements(
  195. [out] ALLOCATOR_PROPERTIES *pProps);
  196. HRESULT SetStreamAllocatorRequirements(
  197. [in] ALLOCATOR_PROPERTIES *pProps);
  198. };
  199. [
  200. object,
  201. local,
  202. uuid(AB6B4AFB-F6E4-11d0-900D-00C04FD9189D),
  203. pointer_default(unique)
  204. ]
  205. interface IAMMediaTypeSample : IStreamSample
  206. {
  207. //
  208. // Unique methods for IAMMediaTypeSample
  209. //
  210. HRESULT SetPointer([in] BYTE *pBuffer, [in] long lSize);
  211. //
  212. // Mirror of IMediaSample
  213. //
  214. HRESULT GetPointer([out] BYTE ** ppBuffer);
  215. long GetSize(void);
  216. HRESULT GetTime([out] REFERENCE_TIME * pTimeStart, [out] REFERENCE_TIME * pTimeEnd);
  217. HRESULT SetTime([in] REFERENCE_TIME * pTimeStart, [in] REFERENCE_TIME * pTimeEnd);
  218. HRESULT IsSyncPoint(void);
  219. HRESULT SetSyncPoint(BOOL bIsSyncPoint);
  220. HRESULT IsPreroll(void);
  221. HRESULT SetPreroll(BOOL bIsPreroll);
  222. long GetActualDataLength(void);
  223. HRESULT SetActualDataLength(long);
  224. HRESULT GetMediaType(AM_MEDIA_TYPE **ppMediaType);
  225. HRESULT SetMediaType(AM_MEDIA_TYPE *pMediaType);
  226. HRESULT IsDiscontinuity(void);
  227. HRESULT SetDiscontinuity(BOOL bDiscontinuity);
  228. HRESULT GetMediaTime([out] LONGLONG * pTimeStart, [out] LONGLONG * pTimeEnd);
  229. HRESULT SetMediaTime([in] LONGLONG * pTimeStart, [in] LONGLONG * pTimeEnd);
  230. };
  231. [
  232. uuid(4E6CDE29-C0C4-11d0-8FF1-00C04FD9189D),
  233. version(1.0),
  234. helpstring("DirectShowStream 1.0 Type Library")
  235. ]
  236. library DirectShowStreamLib
  237. {
  238. importlib("stdole2.tlb");
  239. [
  240. uuid(49c47ce5-9ba4-11d0-8212-00c04fc32c45),
  241. helpstring("DirectShow Multi Media Stream")
  242. ]
  243. coclass AMMultiMediaStream
  244. {
  245. [default] dispinterface IDirectShowStream;
  246. };
  247. };
  248. //
  249. // The MIDL compiler wants to produce a CLSID for everything defined in
  250. // our type library, but it also wants to generate huge, fat proxy code
  251. // so we use DEFINE_GUID for all other classes. It has another interesting
  252. // bug in that it defines CLSID_AMMultiMediaStream within a #ifdef __cplusplus
  253. // block, so we need to define it outside of that scope.
  254. //
  255. cpp_quote("#ifndef __cplusplus")
  256. cpp_quote("EXTERN_C const CLSID CLSID_AMMultiMediaStream;")
  257. cpp_quote("#endif")
  258. cpp_quote("DEFINE_GUID(CLSID_AMDirectDrawStream, /* 49c47ce4-9ba4-11d0-8212-00c04fc32c45 */")
  259. cpp_quote("0x49c47ce4, 0x9ba4, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
  260. cpp_quote("DEFINE_GUID(CLSID_AMAudioStream, /* 8496e040-af4c-11d0-8212-00c04fc32c45 */")
  261. cpp_quote("0x8496e040, 0xaf4c, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
  262. cpp_quote("DEFINE_GUID(CLSID_AMAudioData, /* f2468580-af8a-11d0-8212-00c04fc32c45 */")
  263. cpp_quote("0xf2468580, 0xaf8a, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
  264. cpp_quote("DEFINE_GUID(CLSID_AMMediaTypeStream, /* CF0F2F7C-F7BF-11d0-900D-00C04FD9189D */")
  265. cpp_quote("0xcf0f2f7c, 0xf7bf, 0x11d0, 0x90, 0xd, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);")