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.

325 lines
8.3 KiB

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