include: Fix the C_ASSERT macro to not generate an unused variable warning when compi...
[wine] / include / amstream.idl
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
19 import "unknwn.idl";
20 import "mmstream.idl";
21 import "strmif.idl";
22
23 cpp_quote("#include <ddraw.h>")
24 cpp_quote("#include <mmsystem.h>")
25 cpp_quote("#include <mmstream.h>")
26 cpp_quote("#include <ddstream.h>")
27 cpp_quote("#include <austream.h>")
28
29 cpp_quote("#if 0")
30 interface IDirectDraw;
31 interface IDirectDrawSurface;
32 cpp_quote("#endif")
33
34 interface IAMMultiMediaStream;
35 interface IAMMediaStream;
36 interface IMediaStreamFilter;
37 interface IAMMediaTypeStream;
38 interface IAMMediaTypeSample;
39
40 enum {
41         AMMSF_NOGRAPHTHREAD      = 0x00000001
42 };
43
44 enum {
45         AMMSF_ADDDEFAULTRENDERER = 0x00000001,
46         AMMSF_CREATEPEER         = 0x00000002,
47         AMMSF_STOPIFNOSAMPLES    = 0x00000004,
48         AMMSF_NOSTALL            = 0x00000008
49 };
50
51 enum {
52         AMMSF_RENDERTYPEMASK     = 0x00000003,
53         AMMSF_RENDERTOEXISTING   = 0x00000000,
54         AMMSF_RENDERALLSTREAMS   = 0x00000001,
55         AMMSF_NORENDER           = 0x00000002,
56         AMMSF_NOCLOCK            = 0x00000004,
57         AMMSF_RUN                = 0x00000008
58 };
59
60
61 typedef [v1_enum] enum {
62         Disabled = 0,
63         ReadData = 1,
64         RenderData = 2
65 } OUTPUT_STATE;
66
67 /*
68 [
69 object,
70 uuid(7DB01C96-C0C3-11d0-8FF1-00C04FD9189D),
71 dual,
72 helpstring("IDirectShowStream Interface"),
73 pointer_default(unique)
74 ]
75 interface IDirectShowStream : IDispatch
76 {
77         [propget, id(1), helpstring("property FileName")] HRESULT FileName([out, retval] BSTR *pVal);
78         [propput, id(1), helpstring("property FileName")] HRESULT FileName([in] BSTR newVal);
79         [propget, id(2), helpstring("property Video")] HRESULT Video([out, retval] OUTPUT_STATE *pVal);
80         [propput, id(2), helpstring("propetry Video")] HRESULT Video([in] OUTPUT_STATE newVal);
81         [propget, id(3), helpstring("property Audio")] HRESULT Audio([out, retval] OUTPUT_STATE *pVal);
82         [propput, id(3), helpstring("propetry Audio")] HRESULT Audio([in] OUTPUT_STATE newVal);
83 };
84 */
85
86 [
87 object,
88 uuid(BEBE595C-9A6F-11d0-8FDE-00C04FD9189D),
89 pointer_default(unique)
90 ]
91 interface IAMMultiMediaStream : IMultiMediaStream
92 {
93         HRESULT Initialize(
94                 [in] STREAM_TYPE StreamType,
95                 [in] DWORD dwFlags,
96                 [in, optional] IGraphBuilder *pFilterGraph);
97
98         HRESULT GetFilterGraph(
99                 [out] IGraphBuilder **ppGraphBuilder);
100
101         HRESULT GetFilter(
102                 [out] IMediaStreamFilter **ppFilter);
103
104         HRESULT AddMediaStream(
105                 [in, optional] IUnknown *pStreamObject,
106                 [in, optional] const MSPID *PurposeId,
107                 [in] DWORD dwFlags,
108                 [out, optional] IMediaStream **ppNewStream);
109
110         HRESULT OpenFile(
111                 [in] LPCWSTR pszFileName,
112                 [in] DWORD dwFlags);
113
114         HRESULT OpenMoniker(
115                 [in] IBindCtx *pCtx,
116                 [in] IMoniker *pMoniker,
117                 [in] DWORD dwFlags);
118
119         HRESULT Render(
120                 [in] DWORD dwFlags);
121 }
122
123
124 [
125 object,
126 uuid(BEBE595D-9A6F-11d0-8FDE-00C04FD9189D),
127 pointer_default(unique)
128 ]
129 interface IAMMediaStream : IMediaStream
130 {
131         HRESULT Initialize(
132                 [in, optional] IUnknown *pSourceObject,
133                 [in] DWORD dwFlags,
134                 [in] REFMSPID PurposeId,
135                 [in] const STREAM_TYPE StreamType);
136
137         HRESULT SetState(
138                 [in] FILTER_STATE State);
139
140         HRESULT JoinAMMultiMediaStream(
141                 [in] IAMMultiMediaStream *pAMMultiMediaStream);
142
143         HRESULT JoinFilter(
144                 [in] IMediaStreamFilter *pMediaStreamFilter);
145
146         HRESULT JoinFilterGraph(
147                 [in] IFilterGraph *pFilterGraph);
148 }
149
150
151 [
152 object,
153 local,
154 uuid(BEBE595E-9A6F-11d0-8FDE-00C04FD9189D),
155 pointer_default(unique)
156 ]
157 interface IMediaStreamFilter : IBaseFilter
158 {
159         HRESULT AddMediaStream(
160                 [in] IAMMediaStream *pAMMediaStream);
161
162         HRESULT GetMediaStream(
163                 [in] REFMSPID idPurpose,
164                 [out] IMediaStream **ppMediaStream);
165
166         HRESULT EnumMediaStreams(
167                 [in] long Index,
168                 [out] IMediaStream **ppMediaStream);
169
170         HRESULT SupportSeeking(
171                 [in] BOOL bRenderer);
172
173         HRESULT ReferenceTimeToStreamTime(
174                 [in] [out] REFERENCE_TIME *pTime);
175
176         HRESULT GetCurrentStreamTime(
177                 [out] REFERENCE_TIME *pCurrentStreamTime);
178
179         HRESULT WaitUntil(
180                 [in]  REFERENCE_TIME WaitStreamTime);
181
182         HRESULT Flush(
183                 [in] BOOL bCancelEOS);
184
185         HRESULT EndOfStream();
186 }
187
188
189 [
190 object,
191 local,
192 uuid(AB6B4AFC-F6E4-11d0-900D-00C04FD9189D),
193 pointer_default(unique)
194 ]
195 interface IDirectDrawMediaSampleAllocator : IUnknown
196 {
197         HRESULT GetDirectDraw(IDirectDraw **ppDirectDraw);
198 }
199
200
201 [
202 object,
203 local,
204 uuid(AB6B4AFE-F6E4-11d0-900D-00C04FD9189D),
205 pointer_default(unique)
206 ]
207 interface IDirectDrawMediaSample : IUnknown
208 {
209         HRESULT GetSurfaceAndReleaseLock(
210                 [out] IDirectDrawSurface **ppDirectDrawSurface,
211                 [out] RECT * pRect);
212
213         HRESULT LockMediaSamplePointer(void);
214 }
215
216
217 [
218 object,
219 local,
220 uuid(AB6B4AFA-F6E4-11d0-900D-00C04FD9189D),
221 pointer_default(unique)
222 ]
223
224 interface IAMMediaTypeStream : IMediaStream
225 {
226         HRESULT GetFormat(
227                 [out] AM_MEDIA_TYPE * pMediaType,
228                 [in] DWORD dwFlags);
229
230         HRESULT SetFormat(
231                 [in] AM_MEDIA_TYPE * pMediaType,
232                 [in] DWORD dwFlags);
233
234         HRESULT CreateSample(
235                 [in] long lSampleSize,
236                 [in, optional] BYTE * pbBuffer,
237                 [in] DWORD dwFlags,
238                 [in, optional] IUnknown *pUnkOuter,
239                 [out] IAMMediaTypeSample ** ppAMMediaTypeSample);
240
241         HRESULT GetStreamAllocatorRequirements(
242                 [out] ALLOCATOR_PROPERTIES *pProps);
243
244         HRESULT SetStreamAllocatorRequirements(
245                 [in] ALLOCATOR_PROPERTIES *pProps);
246 }
247
248
249 [
250 object,
251 local,
252 uuid(AB6B4AFB-F6E4-11d0-900D-00C04FD9189D),
253 pointer_default(unique)
254 ]
255 interface IAMMediaTypeSample : IStreamSample
256 {
257         HRESULT SetPointer(
258                 [in] BYTE *pBuffer,
259                 [in] long lSize);
260
261         HRESULT GetPointer(
262                 [out] BYTE ** ppBuffer);
263
264         long GetSize(void);
265
266         HRESULT GetTime(
267                 [out] REFERENCE_TIME * pTimeStart,
268                 [out] REFERENCE_TIME * pTimeEnd);
269
270         HRESULT SetTime(
271                 [in] REFERENCE_TIME * pTimeStart,
272                 [in] REFERENCE_TIME * pTimeEnd);
273
274         HRESULT IsSyncPoint(void);
275
276         HRESULT SetSyncPoint(
277                 BOOL bIsSyncPoint);
278
279         HRESULT IsPreroll(void);
280
281         HRESULT SetPreroll(
282                 BOOL bIsPreroll);
283
284         long GetActualDataLength(void);
285
286         HRESULT SetActualDataLength(long Len);
287
288         HRESULT GetMediaType(
289                 AM_MEDIA_TYPE **ppMediaType);
290
291         HRESULT SetMediaType(
292                 AM_MEDIA_TYPE *pMediaType);
293
294         HRESULT IsDiscontinuity(void);
295
296         HRESULT SetDiscontinuity(
297                 BOOL bDiscontinuity);
298
299         HRESULT GetMediaTime(
300                 [out] LONGLONG * pTimeStart,
301                 [out] LONGLONG * pTimeEnd);
302
303         HRESULT SetMediaTime(
304                 [in] LONGLONG * pTimeStart,
305                 [in] LONGLONG * pTimeEnd);
306 }
307
308 [
309     uuid(49C47CE5-9BA4-11d0-8212-00C04FC32C45)
310 ]
311 coclass AMMultiMediaStream
312 {
313     [default] dispinterface IDirectShowStream;
314 }
315
316 cpp_quote("DEFINE_GUID(CLSID_AMDirectDrawStream,  0x49c47ce4, 0x9ba4, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
317 cpp_quote("DEFINE_GUID(CLSID_AMAudioStream,       0x8496e040, 0xaf4c, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
318 cpp_quote("DEFINE_GUID(CLSID_AMAudioData,         0xf2468580, 0xaf8a, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
319 cpp_quote("DEFINE_GUID(CLSID_AMMediaTypeStream,   0xcf0f2f7c, 0xf7bf, 0x11d0, 0x90, 0x0d, 0x00, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);")