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