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