amstream.idl 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. /*
  2. * Copyright 2004 Christian Costa
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. import "unknwn.idl";
  19. import "mmstream.idl";
  20. import "strmif.idl";
  21. cpp_quote("#include <ddraw.h>")
  22. cpp_quote("#include <mmsystem.h>")
  23. cpp_quote("#include <mmstream.h>")
  24. cpp_quote("#include <ddstream.h>")
  25. cpp_quote("#include <austream.h>")
  26. cpp_quote("#if 0")
  27. interface IDirectDraw;
  28. interface IDirectDrawSurface;
  29. cpp_quote("#endif")
  30. interface IAMMultiMediaStream;
  31. interface IAMMediaStream;
  32. interface IMediaStreamFilter;
  33. interface IAMMediaTypeStream;
  34. interface IAMMediaTypeSample;
  35. enum {
  36. AMMSF_NOGRAPHTHREAD = 0x00000001
  37. };
  38. enum {
  39. AMMSF_ADDDEFAULTRENDERER = 0x00000001,
  40. AMMSF_CREATEPEER = 0x00000002,
  41. AMMSF_STOPIFNOSAMPLES = 0x00000004,
  42. AMMSF_NOSTALL = 0x00000008
  43. };
  44. enum {
  45. AMMSF_RENDERTYPEMASK = 0x00000003,
  46. AMMSF_RENDERTOEXISTING = 0x00000000,
  47. AMMSF_RENDERALLSTREAMS = 0x00000001,
  48. AMMSF_NORENDER = 0x00000002,
  49. AMMSF_NOCLOCK = 0x00000004,
  50. AMMSF_RUN = 0x00000008
  51. };
  52. typedef [v1_enum] enum {
  53. Disabled = 0,
  54. ReadData = 1,
  55. RenderData = 2
  56. } OUTPUT_STATE;
  57. [
  58. object,
  59. uuid(7DB01C96-C0C3-11d0-8FF1-00C04FD9189D),
  60. dual,
  61. helpstring("IDirectShowStream Interface"),
  62. pointer_default(unique)
  63. ]
  64. interface IDirectShowStream : IDispatch
  65. {
  66. [propget, id(1), helpstring("property FileName")] HRESULT FileName([out, retval] BSTR *pVal);
  67. [propput, id(1), helpstring("property FileName")] HRESULT FileName([in] BSTR newVal);
  68. [propget, id(2), helpstring("property Video")] HRESULT Video([out, retval] OUTPUT_STATE *pVal);
  69. [propput, id(2), helpstring("property Video")] HRESULT Video([in] OUTPUT_STATE newVal);
  70. [propget, id(3), helpstring("property Audio")] HRESULT Audio([out, retval] OUTPUT_STATE *pVal);
  71. [propput, id(3), helpstring("property Audio")] HRESULT Audio([in] OUTPUT_STATE newVal);
  72. }
  73. [
  74. object,
  75. uuid(BEBE595C-9A6F-11d0-8FDE-00C04FD9189D),
  76. pointer_default(unique)
  77. ]
  78. interface IAMMultiMediaStream : IMultiMediaStream
  79. {
  80. HRESULT Initialize(
  81. [in] STREAM_TYPE StreamType,
  82. [in] DWORD dwFlags,
  83. [in] IGraphBuilder *pFilterGraph);
  84. HRESULT GetFilterGraph(
  85. [out] IGraphBuilder **ppGraphBuilder);
  86. HRESULT GetFilter(
  87. [out] IMediaStreamFilter **ppFilter);
  88. HRESULT AddMediaStream(
  89. [in] IUnknown *pStreamObject,
  90. [in] const MSPID *PurposeId,
  91. [in] DWORD dwFlags,
  92. [out] IMediaStream **ppNewStream);
  93. HRESULT OpenFile(
  94. [in] LPCWSTR pszFileName,
  95. [in] DWORD dwFlags);
  96. HRESULT OpenMoniker(
  97. [in] IBindCtx *pCtx,
  98. [in] IMoniker *pMoniker,
  99. [in] DWORD dwFlags);
  100. HRESULT Render(
  101. [in] DWORD dwFlags);
  102. }
  103. [
  104. object,
  105. uuid(BEBE595D-9A6F-11d0-8FDE-00C04FD9189D),
  106. pointer_default(unique)
  107. ]
  108. interface IAMMediaStream : IMediaStream
  109. {
  110. HRESULT Initialize(
  111. [in] IUnknown *pSourceObject,
  112. [in] DWORD dwFlags,
  113. [in] REFMSPID PurposeId,
  114. [in] const STREAM_TYPE StreamType);
  115. HRESULT SetState(
  116. [in] FILTER_STATE State);
  117. HRESULT JoinAMMultiMediaStream(
  118. [in] IAMMultiMediaStream *pAMMultiMediaStream);
  119. HRESULT JoinFilter(
  120. [in] IMediaStreamFilter *pMediaStreamFilter);
  121. HRESULT JoinFilterGraph(
  122. [in] IFilterGraph *pFilterGraph);
  123. }
  124. [
  125. object,
  126. local,
  127. uuid(BEBE595E-9A6F-11d0-8FDE-00C04FD9189D),
  128. pointer_default(unique)
  129. ]
  130. interface IMediaStreamFilter : IBaseFilter
  131. {
  132. HRESULT AddMediaStream(
  133. [in] IAMMediaStream *pAMMediaStream);
  134. HRESULT GetMediaStream(
  135. [in] REFMSPID idPurpose,
  136. [out] IMediaStream **ppMediaStream);
  137. HRESULT EnumMediaStreams(
  138. [in] long Index,
  139. [out] IMediaStream **ppMediaStream);
  140. HRESULT SupportSeeking(
  141. [in] BOOL bRenderer);
  142. HRESULT ReferenceTimeToStreamTime(
  143. [in] [out] REFERENCE_TIME *pTime);
  144. HRESULT GetCurrentStreamTime(
  145. [out] REFERENCE_TIME *pCurrentStreamTime);
  146. HRESULT WaitUntil(
  147. [in] REFERENCE_TIME WaitStreamTime);
  148. HRESULT Flush(
  149. [in] BOOL bCancelEOS);
  150. HRESULT EndOfStream();
  151. }
  152. [
  153. object,
  154. local,
  155. uuid(AB6B4AFC-F6E4-11d0-900D-00C04FD9189D),
  156. pointer_default(unique)
  157. ]
  158. interface IDirectDrawMediaSampleAllocator : IUnknown
  159. {
  160. HRESULT GetDirectDraw(IDirectDraw **ppDirectDraw);
  161. }
  162. [
  163. object,
  164. local,
  165. uuid(AB6B4AFE-F6E4-11d0-900D-00C04FD9189D),
  166. pointer_default(unique)
  167. ]
  168. interface IDirectDrawMediaSample : IUnknown
  169. {
  170. HRESULT GetSurfaceAndReleaseLock(
  171. [out] IDirectDrawSurface **ppDirectDrawSurface,
  172. [out] RECT * pRect);
  173. HRESULT LockMediaSamplePointer(void);
  174. }
  175. [
  176. object,
  177. local,
  178. uuid(AB6B4AFA-F6E4-11d0-900D-00C04FD9189D),
  179. pointer_default(unique)
  180. ]
  181. interface IAMMediaTypeStream : IMediaStream
  182. {
  183. HRESULT GetFormat(
  184. [out] AM_MEDIA_TYPE * pMediaType,
  185. [in] DWORD dwFlags);
  186. HRESULT SetFormat(
  187. [in] AM_MEDIA_TYPE * pMediaType,
  188. [in] DWORD dwFlags);
  189. HRESULT CreateSample(
  190. [in] long lSampleSize,
  191. [in] BYTE * pbBuffer,
  192. [in] DWORD dwFlags,
  193. [in] IUnknown *pUnkOuter,
  194. [out] IAMMediaTypeSample ** ppAMMediaTypeSample);
  195. HRESULT GetStreamAllocatorRequirements(
  196. [out] ALLOCATOR_PROPERTIES *pProps);
  197. HRESULT SetStreamAllocatorRequirements(
  198. [in] ALLOCATOR_PROPERTIES *pProps);
  199. }
  200. [
  201. object,
  202. local,
  203. uuid(AB6B4AFB-F6E4-11d0-900D-00C04FD9189D),
  204. pointer_default(unique)
  205. ]
  206. interface IAMMediaTypeSample : IStreamSample
  207. {
  208. HRESULT SetPointer(
  209. [in] BYTE *pBuffer,
  210. [in] long lSize);
  211. HRESULT GetPointer(
  212. [out] BYTE ** ppBuffer);
  213. long GetSize(void);
  214. HRESULT GetTime(
  215. [out] REFERENCE_TIME * pTimeStart,
  216. [out] REFERENCE_TIME * pTimeEnd);
  217. HRESULT SetTime(
  218. [in] REFERENCE_TIME * pTimeStart,
  219. [in] REFERENCE_TIME * pTimeEnd);
  220. HRESULT IsSyncPoint(void);
  221. HRESULT SetSyncPoint(
  222. BOOL bIsSyncPoint);
  223. HRESULT IsPreroll(void);
  224. HRESULT SetPreroll(
  225. BOOL bIsPreroll);
  226. long GetActualDataLength(void);
  227. HRESULT SetActualDataLength(long Len);
  228. HRESULT GetMediaType(
  229. AM_MEDIA_TYPE **ppMediaType);
  230. HRESULT SetMediaType(
  231. AM_MEDIA_TYPE *pMediaType);
  232. HRESULT IsDiscontinuity(void);
  233. HRESULT SetDiscontinuity(
  234. BOOL bDiscontinuity);
  235. HRESULT GetMediaTime(
  236. [out] LONGLONG * pTimeStart,
  237. [out] LONGLONG * pTimeEnd);
  238. HRESULT SetMediaTime(
  239. [in] LONGLONG * pTimeStart,
  240. [in] LONGLONG * pTimeEnd);
  241. }
  242. [
  243. uuid(49C47CE5-9BA4-11d0-8212-00C04FC32C45)
  244. ]
  245. coclass AMMultiMediaStream
  246. {
  247. [default] dispinterface IDirectShowStream;
  248. }
  249. cpp_quote("DEFINE_GUID(CLSID_AMDirectDrawStream, 0x49c47ce4, 0x9ba4, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
  250. cpp_quote("DEFINE_GUID(CLSID_AMAudioStream, 0x8496e040, 0xaf4c, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
  251. cpp_quote("DEFINE_GUID(CLSID_AMAudioData, 0xf2468580, 0xaf8a, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
  252. cpp_quote("DEFINE_GUID(CLSID_AMMediaTypeStream, 0xcf0f2f7c, 0xf7bf, 0x11d0, 0x90, 0x0d, 0x00, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);")
  253. cpp_quote("DEFINE_GUID(CLSID_MediaStreamFilter, 0x49c47ce0, 0x9ba4, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")