683003e1fb2ce50e1e1957c818e05e62c294f3b4
[reactos.git] / reactos / include / dxsdk / axcore.idl
1 /*
2 * Copyright (C) 2002 Robert Shearman
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 #define CHARS_IN_GUID 39
20 cpp_quote("#define CHARS_IN_GUID 39")
21
22 /* GetTimeFormat is defined in winnls.h as
23 * either the W or A suffixed version */
24 cpp_quote("#undef GetTimeFormat")
25
26 typedef struct _AMMediaType
27 {
28 GUID majortype;
29 GUID subtype;
30 BOOL bFixedSizeSamples;
31 BOOL bTemporalCompression;
32 ULONG lSampleSize;
33 GUID formattype;
34 IUnknown * pUnk;
35 ULONG cbFormat;
36 [size_is(cbFormat)] BYTE * pbFormat;
37 } AM_MEDIA_TYPE;
38
39 typedef enum _PinDirection
40 {
41 PINDIR_INPUT,
42 PINDIR_OUTPUT
43 } PIN_DIRECTION;
44
45 #define MAX_PIN_NAME 128
46 #define MAX_FILTER_NAME 128
47 cpp_quote("#define MAX_PIN_NAME 128")
48 cpp_quote("#define MAX_FILTER_NAME 128")
49
50 typedef LONGLONG REFERENCE_TIME;
51
52 cpp_quote("#ifndef REFTIME_DEFINED")
53 cpp_quote("#define REFTIME_DEFINED")
54 typedef DOUBLE REFTIME;
55 cpp_quote("#endif")
56
57 typedef DWORD_PTR HSEMAPHORE;
58 typedef DWORD_PTR HEVENT;
59
60 typedef struct _AllocatorProperties
61 {
62 long cBuffers;
63 long cbBuffer;
64 long cbAlign;
65 long cbPrefix;
66 } ALLOCATOR_PROPERTIES;
67
68 interface IAMovieSetup;
69 interface IEnumFilters;
70 interface IEnumMediaTypes;
71 interface IEnumPins;
72 interface IBaseFilter;
73 interface IFilterGraph;
74 interface IMediaFilter;
75 interface IMediaSample;
76 interface IMemAllocator;
77 interface IMemAllocatorCallbackTemp;
78 interface IMemAllocatorNotifyCallbackTemp;
79 interface IMemInputPin;
80 interface IPin;
81 interface IReferenceClock;
82
83 [
84 object,
85 uuid(56a86891-0ad4-11ce-b03a-0020af0ba770),
86 pointer_default(unique)
87 ]
88 interface IPin : IUnknown
89 {
90 typedef struct _PinInfo
91 {
92 IBaseFilter *pFilter;
93 PIN_DIRECTION dir;
94 WCHAR achName[MAX_PIN_NAME];
95 } PIN_INFO;
96
97 HRESULT Connect(
98 [in] IPin * pReceivePin,
99 [in] const AM_MEDIA_TYPE * pmt);
100
101 HRESULT ReceiveConnection(
102 [in] IPin * pConnector,
103 [in] const AM_MEDIA_TYPE *pmt);
104
105 HRESULT Disconnect(void);
106
107 HRESULT ConnectedTo(
108 [out] IPin **pPin);
109
110 HRESULT ConnectionMediaType(
111 [out] AM_MEDIA_TYPE *pmt);
112
113 HRESULT QueryPinInfo(
114 [out] PIN_INFO * pInfo);
115
116 HRESULT QueryDirection(
117 [out] PIN_DIRECTION *pPinDir);
118
119 HRESULT QueryId(
120 [out] LPWSTR * Id);
121
122 HRESULT QueryAccept(
123 [in] const AM_MEDIA_TYPE *pmt);
124
125 HRESULT EnumMediaTypes(
126 [out] IEnumMediaTypes **ppEnum);
127
128 HRESULT QueryInternalConnections(
129 [out] IPin* *apPin,
130 [in, out] ULONG *nPin);
131
132 HRESULT EndOfStream(void);
133
134 HRESULT BeginFlush(void);
135
136 HRESULT EndFlush(void);
137 HRESULT NewSegment(
138 [in] REFERENCE_TIME tStart,
139 [in] REFERENCE_TIME tStop,
140 [in] double dRate);
141 }
142
143 typedef IPin *PPIN;
144
145 [
146 object,
147 uuid(56a86892-0ad4-11ce-b03a-0020af0ba770),
148 pointer_default(unique)
149 ]
150 interface IEnumPins : IUnknown
151 {
152
153 HRESULT Next(
154 [in] ULONG cPins,
155 [out, size_is(cPins)] IPin ** ppPins,
156 [out] ULONG * pcFetched);
157
158 HRESULT Skip(
159 [in] ULONG cPins);
160
161 HRESULT Reset(void);
162
163 HRESULT Clone(
164 [out] IEnumPins **ppEnum);
165 }
166
167 typedef IEnumPins *PENUMPINS;
168
169 [
170 object,
171 uuid(89c31040-846b-11ce-97d3-00aa0055595a),
172 pointer_default(unique)
173 ]
174 interface IEnumMediaTypes : IUnknown
175 {
176 HRESULT Next(
177 [in] ULONG cMediaTypes,
178 [out, size_is(cMediaTypes)]
179 AM_MEDIA_TYPE ** ppMediaTypes,
180 [out] ULONG * pcFetched
181 );
182
183 HRESULT Skip(
184 [in] ULONG cMediaTypes);
185
186 HRESULT Reset(void);
187
188 HRESULT Clone(
189 [out] IEnumMediaTypes **ppEnum
190 );
191 }
192
193 typedef IEnumMediaTypes *PENUMMEDIATYPES;
194
195 [
196 object,
197 uuid(56a8689f-0ad4-11ce-b03a-0020af0ba770),
198 pointer_default(unique)
199 ]
200 interface IFilterGraph : IUnknown
201 {
202 HRESULT AddFilter(
203 [in] IBaseFilter * pFilter,
204 [in, string] LPCWSTR pName);
205
206 HRESULT RemoveFilter(
207 [in] IBaseFilter * pFilter);
208
209 HRESULT EnumFilters(
210 [out] IEnumFilters **ppEnum);
211
212 HRESULT FindFilterByName(
213 [in, string] LPCWSTR pName,
214 [out] IBaseFilter ** ppFilter);
215
216 HRESULT ConnectDirect(
217 [in] IPin * ppinOut,
218 [in] IPin * ppinIn,
219 [in, unique] const AM_MEDIA_TYPE* pmt);
220
221 HRESULT Reconnect(
222 [in] IPin * ppin);
223
224 HRESULT Disconnect(
225 [in] IPin * ppin);
226
227 HRESULT SetDefaultSyncSource(void);
228 }
229
230 typedef IFilterGraph *PFILTERGRAPH;
231
232 [
233 object,
234 uuid(56a86893-0ad4-11ce-b03a-0020af0ba770),
235 pointer_default(unique)
236 ]
237 interface IEnumFilters : IUnknown
238 {
239 HRESULT Next(
240 [in] ULONG cFilters,
241 [out] IBaseFilter ** ppFilter,
242 [out] ULONG * pcFetched);
243
244
245 HRESULT Skip(
246 [in] ULONG cFilters);
247
248
249 HRESULT Reset(void);
250
251
252 HRESULT Clone(
253 [out] IEnumFilters **ppEnum);
254 }
255
256 typedef IEnumFilters *PENUMFILTERS;
257
258 [
259 object,
260 uuid(56a86899-0ad4-11ce-b03a-0020af0ba770),
261 pointer_default(unique)
262 ]
263 interface IMediaFilter : IPersist
264 {
265 typedef enum _FilterState
266 {
267 State_Stopped,
268 State_Paused,
269 State_Running
270 } FILTER_STATE;
271
272 HRESULT Stop(void);
273 HRESULT Pause(void);
274
275 HRESULT Run(REFERENCE_TIME tStart);
276
277 HRESULT GetState(
278 [in] DWORD dwMilliSecsTimeout,
279 [out] FILTER_STATE *State);
280
281 HRESULT SetSyncSource(
282 [in] IReferenceClock * pClock);
283
284 HRESULT GetSyncSource(
285 [out] IReferenceClock ** pClock);
286 }
287
288 typedef IMediaFilter *PMEDIAFILTER;
289
290 [
291 object,
292 uuid(56a86895-0ad4-11ce-b03a-0020af0ba770),
293 pointer_default(unique)
294 ]
295 interface IBaseFilter : IMediaFilter
296 {
297 typedef struct _FilterInfo
298 {
299 WCHAR achName[MAX_FILTER_NAME];
300 IFilterGraph * pGraph;
301 } FILTER_INFO;
302
303 HRESULT EnumPins(
304 [out] IEnumPins ** ppEnum);
305
306 HRESULT FindPin(
307 [in, string] LPCWSTR Id,
308 [out] IPin ** ppPin);
309
310 HRESULT QueryFilterInfo(
311 [out] FILTER_INFO * pInfo);
312
313 HRESULT JoinFilterGraph(
314 [in] IFilterGraph * pGraph,
315 [in, string] LPCWSTR pName);
316
317 HRESULT QueryVendorInfo(
318 [out, string] LPWSTR* pVendorInfo);
319 }
320
321 typedef IBaseFilter *PFILTER;
322
323 [
324 object,
325 uuid(56a86897-0ad4-11ce-b03a-0020af0ba770),
326 pointer_default(unique)
327 ]
328 interface IReferenceClock : IUnknown
329 {
330 HRESULT GetTime(
331 [out] REFERENCE_TIME *pTime);
332
333 HRESULT AdviseTime(
334 [in] REFERENCE_TIME baseTime,
335 [in] REFERENCE_TIME streamTime,
336 [in] HEVENT hEvent,
337 [out] DWORD_PTR * pdwAdviseCookie);
338
339 HRESULT AdvisePeriodic(
340 [in] REFERENCE_TIME startTime,
341 [in] REFERENCE_TIME periodTime,
342 [in] HSEMAPHORE hSemaphore,
343 [out] DWORD_PTR * pdwAdviseCookie);
344
345 HRESULT Unadvise(
346 [in] DWORD_PTR dwAdviseCookie);
347 }
348
349 typedef IReferenceClock *PREFERENCECLOCK;
350
351
352 [
353 local,
354 object,
355 uuid(ebec459c-2eca-4d42-a8af-30df557614b8),
356 pointer_default(unique)
357 ]
358 interface IReferenceClockTimerControl : IUnknown {
359
360 HRESULT SetDefaultTimerResolution(
361 REFERENCE_TIME timerResolution);
362 HRESULT GetDefaultTimerResolution(
363 [out] REFERENCE_TIME* pTimerResolution);
364 }
365
366
367 /*
368 [
369 object,
370 uuid(36b73885-c2c8-11cf-8b46-00805f6cef60),
371 pointer_default(unique)
372 ]
373 interface IReferenceClock2 : IReferenceClock
374 {
375 }
376
377 typedef IReferenceClock2 *PREFERENCECLOCK2;
378
379 */
380
381 [
382 local,
383 object,
384 uuid(56a8689a-0ad4-11ce-b03a-0020af0ba770),
385 pointer_default(unique)
386 ]
387 interface IMediaSample : IUnknown
388 {
389 HRESULT GetPointer([out] BYTE ** ppBuffer);
390
391 long GetSize(void);
392
393 HRESULT GetTime(
394 [out] REFERENCE_TIME * pTimeStart,
395 [out] REFERENCE_TIME * pTimeEnd);
396
397 HRESULT SetTime(
398 [in] REFERENCE_TIME * pTimeStart,
399 [in] REFERENCE_TIME * pTimeEnd);
400
401 HRESULT IsSyncPoint(void);
402
403 HRESULT SetSyncPoint(BOOL bIsSyncPoint);
404
405 HRESULT IsPreroll(void);
406
407 HRESULT SetPreroll(BOOL bIsPreroll);
408
409 LONG GetActualDataLength(void);
410
411 HRESULT SetActualDataLength(LONG length);
412
413 HRESULT GetMediaType(AM_MEDIA_TYPE **ppMediaType);
414
415 HRESULT SetMediaType(AM_MEDIA_TYPE *pMediaType);
416
417 HRESULT IsDiscontinuity(void);
418
419 HRESULT SetDiscontinuity(BOOL bDiscontinuity);
420
421 HRESULT GetMediaTime(
422 [out] LONGLONG * pTimeStart,
423 [out] LONGLONG * pTimeEnd);
424
425 HRESULT SetMediaTime(
426 [in] LONGLONG * pTimeStart,
427 [in] LONGLONG * pTimeEnd);
428 }
429
430 typedef IMediaSample *PMEDIASAMPLE;
431
432 enum tagAM_SAMPLE_PROPERTY_FLAGS
433 {
434 AM_SAMPLE_SPLICEPOINT = 0x01,
435 AM_SAMPLE_PREROLL = 0x02,
436 AM_SAMPLE_DATADISCONTINUITY = 0x04,
437 AM_SAMPLE_TYPECHANGED = 0x08,
438 AM_SAMPLE_TIMEVALID = 0x10,
439 AM_SAMPLE_TIMEDISCONTINUITY = 0x40,
440 AM_SAMPLE_FLUSH_ON_PAUSE = 0x80,
441 AM_SAMPLE_STOPVALID = 0x100,
442 AM_SAMPLE_ENDOFSTREAM = 0x200,
443 AM_STREAM_MEDIA = 0,
444 AM_STREAM_CONTROL = 1
445 };
446
447 typedef struct tagAM_SAMPLE2_PROPERTIES
448 {
449 DWORD cbData;
450 DWORD dwTypeSpecificFlags;
451 DWORD dwSampleFlags;
452 LONG lActual;
453 REFERENCE_TIME tStart;
454 REFERENCE_TIME tStop;
455 DWORD dwStreamId;
456 AM_MEDIA_TYPE *pMediaType;
457 BYTE *pbBuffer;
458 LONG cbBuffer;
459 } AM_SAMPLE2_PROPERTIES;
460
461 [
462 local,
463 object,
464 uuid(36b73884-c2c8-11cf-8b46-00805f6cef60),
465 pointer_default(unique)
466 ]
467 interface IMediaSample2 : IMediaSample
468 {
469 HRESULT GetProperties(
470 [in] DWORD cbProperties,
471 [out, size_is(cbProperties)] BYTE * pbProperties
472 );
473
474 HRESULT SetProperties(
475 [in] DWORD cbProperties,
476 [in, size_is(cbProperties)] const BYTE * pbProperties
477 );
478 }
479
480 typedef IMediaSample2 *PMEDIASAMPLE2;
481
482 #define AM_GBF_PREVFRAMESKIPPED 1
483 #define AM_GBF_NOTASYNCPOINT 2
484 cpp_quote("#define AM_GBF_PREVFRAMESKIPPED 1")
485 cpp_quote("#define AM_GBF_NOTASYNCPOINT 2")
486
487 cpp_quote("#define AM_GBF_NOWAIT 4")
488
489 [
490 object,
491 uuid(56a8689c-0ad4-11ce-b03a-0020af0ba770),
492 pointer_default(unique)
493 ]
494 interface IMemAllocator : IUnknown
495 {
496 HRESULT SetProperties(
497 [in] ALLOCATOR_PROPERTIES* pRequest,
498 [out] ALLOCATOR_PROPERTIES* pActual);
499
500 HRESULT GetProperties(
501 [out] ALLOCATOR_PROPERTIES* pProps);
502
503 HRESULT Commit(void);
504
505 HRESULT Decommit(void);
506
507 HRESULT GetBuffer(
508 [out] IMediaSample **ppBuffer,
509 [in] REFERENCE_TIME * pStartTime,
510 [in] REFERENCE_TIME * pEndTime,
511 [in] DWORD dwFlags);
512
513 HRESULT ReleaseBuffer(
514 [in] IMediaSample *pBuffer);
515 }
516
517 typedef IMemAllocator *PMEMALLOCATOR;
518
519 [
520 object,
521 uuid(379a0cf0-c1de-11d2-abf5-00a0c905f375),
522 pointer_default(unique)
523 ]
524 interface IMemAllocatorCallbackTemp : IMemAllocator
525 {
526 HRESULT SetNotify(
527 [in] IMemAllocatorNotifyCallbackTemp *pNotify);
528
529 HRESULT GetFreeCount(
530 [out] LONG *plBuffersFree);
531 }
532
533 [
534 object,
535 uuid(92980b30-c1de-11d2-abf5-00a0c905f375),
536 pointer_default(unique)
537 ]
538 interface IMemAllocatorNotifyCallbackTemp : IUnknown
539 {
540 HRESULT NotifyRelease();
541 }
542
543 [
544 object,
545 uuid(56a8689d-0ad4-11ce-b03a-0020af0ba770),
546 pointer_default(unique)
547 ]
548 interface IMemInputPin : IUnknown
549 {
550 HRESULT GetAllocator(
551 [out] IMemAllocator ** ppAllocator);
552
553 HRESULT NotifyAllocator(
554 [in] IMemAllocator * pAllocator,
555 [in] BOOL bReadOnly);
556
557 HRESULT GetAllocatorRequirements( [out] ALLOCATOR_PROPERTIES*pProps );
558
559 HRESULT Receive(
560 [in] IMediaSample * pSample);
561
562 HRESULT ReceiveMultiple(
563 [in, size_is(nSamples)] IMediaSample **pSamples,
564 [in] long nSamples,
565 [out] long *nSamplesProcessed);
566
567 HRESULT ReceiveCanBlock();
568 }
569
570 typedef IMemInputPin *PMEMINPUTPIN;
571
572 [
573 object,
574 uuid(a3d8cec0-7e5a-11cf-bbc5-00805f6cef20),
575 pointer_default(unique)
576 ]
577 interface IAMovieSetup : IUnknown
578 {
579 HRESULT Register( );
580 HRESULT Unregister( );
581 }
582
583 typedef IAMovieSetup *PAMOVIESETUP;
584
585 typedef enum AM_SEEKING_SeekingFlags
586 {
587 AM_SEEKING_NoPositioning = 0x00,
588 AM_SEEKING_AbsolutePositioning = 0x01,
589 AM_SEEKING_RelativePositioning = 0x02,
590 AM_SEEKING_IncrementalPositioning = 0x03,
591 AM_SEEKING_PositioningBitsMask = 0x03,
592 AM_SEEKING_SeekToKeyFrame = 0x04,
593 AM_SEEKING_ReturnTime = 0x08,
594 AM_SEEKING_Segment = 0x10,
595 AM_SEEKING_NoFlush = 0x20
596 } AM_SEEKING_SEEKING_FLAGS;
597
598 typedef enum AM_SEEKING_SeekingCapabilities
599 {
600 AM_SEEKING_CanSeekAbsolute = 0x001,
601 AM_SEEKING_CanSeekForwards = 0x002,
602 AM_SEEKING_CanSeekBackwards = 0x004,
603 AM_SEEKING_CanGetCurrentPos = 0x008,
604 AM_SEEKING_CanGetStopPos = 0x010,
605 AM_SEEKING_CanGetDuration = 0x020,
606 AM_SEEKING_CanPlayBackwards = 0x040,
607 AM_SEEKING_CanDoSegments = 0x080,
608 AM_SEEKING_Source = 0x100
609 } AM_SEEKING_SEEKING_CAPABILITIES;
610
611 [
612 object,
613 uuid(36b73880-c2c8-11cf-8b46-00805f6cef60),
614 pointer_default(unique)
615 ]
616 interface IMediaSeeking : IUnknown
617 {
618 HRESULT GetCapabilities( [out] DWORD * pCapabilities );
619
620 HRESULT CheckCapabilities( [in,out] DWORD * pCapabilities );
621
622 HRESULT IsFormatSupported([in] const GUID * pFormat);
623
624 HRESULT QueryPreferredFormat([out] GUID * pFormat);
625
626 HRESULT GetTimeFormat([out] GUID *pFormat);
627
628 HRESULT IsUsingTimeFormat([in] const GUID * pFormat);
629
630 HRESULT SetTimeFormat([in] const GUID * pFormat);
631
632 HRESULT GetDuration([out] LONGLONG *pDuration);
633
634 HRESULT GetStopPosition([out] LONGLONG *pStop);
635
636 HRESULT GetCurrentPosition([out] LONGLONG *pCurrent);
637
638 HRESULT ConvertTimeFormat([out] LONGLONG * pTarget, [in] const GUID * pTargetFormat,
639 [in] LONGLONG Source, [in] const GUID * pSourceFormat );
640
641 HRESULT SetPositions(
642 [in,out] LONGLONG * pCurrent,
643 [in] DWORD dwCurrentFlags,
644 [in,out] LONGLONG * pStop,
645 [in] DWORD dwStopFlags);
646
647 HRESULT GetPositions(
648 [out] LONGLONG * pCurrent,
649 [out] LONGLONG * pStop);
650
651 HRESULT GetAvailable(
652 [out] LONGLONG * pEarliest,
653 [out] LONGLONG * pLatest);
654
655 HRESULT SetRate([in] double dRate);
656
657 HRESULT GetRate([out] double * pdRate);
658
659 HRESULT GetPreroll([out] LONGLONG * pllPreroll);
660 }
661
662 typedef IMediaSeeking *PMEDIASEEKING;
663
664 enum tagAM_MEDIAEVENT_FLAGS
665 {
666 AM_MEDIAEVENT_NONOTIFY = 0x01
667 };