2 * Copyright (C) 2002 Robert Shearman
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.
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.
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
19 #define CHARS_IN_GUID 39
20 cpp_quote("#define CHARS_IN_GUID 39")
22 /* GetTimeFormat is defined in winnls.h as
23 * either the W or A suffixed version */
24 cpp_quote("#undef GetTimeFormat")
26 typedef struct _AMMediaType
30 BOOL bFixedSizeSamples;
31 BOOL bTemporalCompression;
36 [size_is(cbFormat)] BYTE * pbFormat;
39 typedef enum _PinDirection
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")
50 typedef LONGLONG REFERENCE_TIME;
52 cpp_quote("#ifndef REFTIME_DEFINED")
53 cpp_quote("#define REFTIME_DEFINED")
54 typedef DOUBLE REFTIME;
57 typedef DWORD_PTR HSEMAPHORE;
58 typedef DWORD_PTR HEVENT;
60 typedef struct _AllocatorProperties
66 } ALLOCATOR_PROPERTIES;
68 interface IAMovieSetup;
69 interface IEnumFilters;
70 interface IEnumMediaTypes;
72 interface IBaseFilter;
73 interface IFilterGraph;
74 interface IMediaFilter;
75 interface IMediaSample;
76 interface IMemAllocator;
77 interface IMemAllocatorCallbackTemp;
78 interface IMemAllocatorNotifyCallbackTemp;
79 interface IMemInputPin;
81 interface IReferenceClock;
85 uuid(56a86891-0ad4-11ce-b03a-0020af0ba770),
86 pointer_default(unique)
88 interface IPin : IUnknown
90 typedef struct _PinInfo
94 WCHAR achName[MAX_PIN_NAME];
98 [in] IPin * pReceivePin,
99 [in] const AM_MEDIA_TYPE * pmt);
101 HRESULT ReceiveConnection(
102 [in] IPin * pConnector,
103 [in] const AM_MEDIA_TYPE *pmt);
105 HRESULT Disconnect(void);
110 HRESULT ConnectionMediaType(
111 [out] AM_MEDIA_TYPE *pmt);
113 HRESULT QueryPinInfo(
114 [out] PIN_INFO * pInfo);
116 HRESULT QueryDirection(
117 [out] PIN_DIRECTION *pPinDir);
123 [in] const AM_MEDIA_TYPE *pmt);
125 HRESULT EnumMediaTypes(
126 [out] IEnumMediaTypes **ppEnum);
128 HRESULT QueryInternalConnections(
130 [in, out] ULONG *nPin);
132 HRESULT EndOfStream(void);
134 HRESULT BeginFlush(void);
136 HRESULT EndFlush(void);
138 [in] REFERENCE_TIME tStart,
139 [in] REFERENCE_TIME tStop,
147 uuid(56a86892-0ad4-11ce-b03a-0020af0ba770),
148 pointer_default(unique)
150 interface IEnumPins : IUnknown
155 [out, size_is(cPins)] IPin ** ppPins,
156 [out] ULONG * pcFetched);
164 [out] IEnumPins **ppEnum);
167 typedef IEnumPins *PENUMPINS;
171 uuid(89c31040-846b-11ce-97d3-00aa0055595a),
172 pointer_default(unique)
174 interface IEnumMediaTypes : IUnknown
177 [in] ULONG cMediaTypes,
178 [out, size_is(cMediaTypes)]
179 AM_MEDIA_TYPE ** ppMediaTypes,
180 [out] ULONG * pcFetched
184 [in] ULONG cMediaTypes);
189 [out] IEnumMediaTypes **ppEnum
193 typedef IEnumMediaTypes *PENUMMEDIATYPES;
197 uuid(56a8689f-0ad4-11ce-b03a-0020af0ba770),
198 pointer_default(unique)
200 interface IFilterGraph : IUnknown
203 [in] IBaseFilter * pFilter,
204 [in, string] LPCWSTR pName);
206 HRESULT RemoveFilter(
207 [in] IBaseFilter * pFilter);
210 [out] IEnumFilters **ppEnum);
212 HRESULT FindFilterByName(
213 [in, string] LPCWSTR pName,
214 [out] IBaseFilter ** ppFilter);
216 HRESULT ConnectDirect(
219 [in, unique] const AM_MEDIA_TYPE* pmt);
227 HRESULT SetDefaultSyncSource(void);
230 typedef IFilterGraph *PFILTERGRAPH;
234 uuid(56a86893-0ad4-11ce-b03a-0020af0ba770),
235 pointer_default(unique)
237 interface IEnumFilters : IUnknown
241 [out] IBaseFilter ** ppFilter,
242 [out] ULONG * pcFetched);
246 [in] ULONG cFilters);
253 [out] IEnumFilters **ppEnum);
256 typedef IEnumFilters *PENUMFILTERS;
260 uuid(56a86899-0ad4-11ce-b03a-0020af0ba770),
261 pointer_default(unique)
263 interface IMediaFilter : IPersist
265 typedef enum _FilterState
275 HRESULT Run(REFERENCE_TIME tStart);
278 [in] DWORD dwMilliSecsTimeout,
279 [out] FILTER_STATE *State);
281 HRESULT SetSyncSource(
282 [in] IReferenceClock * pClock);
284 HRESULT GetSyncSource(
285 [out] IReferenceClock ** pClock);
288 typedef IMediaFilter *PMEDIAFILTER;
292 uuid(56a86895-0ad4-11ce-b03a-0020af0ba770),
293 pointer_default(unique)
295 interface IBaseFilter : IMediaFilter
297 typedef struct _FilterInfo
299 WCHAR achName[MAX_FILTER_NAME];
300 IFilterGraph * pGraph;
304 [out] IEnumPins ** ppEnum);
307 [in, string] LPCWSTR Id,
308 [out] IPin ** ppPin);
310 HRESULT QueryFilterInfo(
311 [out] FILTER_INFO * pInfo);
313 HRESULT JoinFilterGraph(
314 [in] IFilterGraph * pGraph,
315 [in, string] LPCWSTR pName);
317 HRESULT QueryVendorInfo(
318 [out, string] LPWSTR* pVendorInfo);
321 typedef IBaseFilter *PFILTER;
325 uuid(56a86897-0ad4-11ce-b03a-0020af0ba770),
326 pointer_default(unique)
328 interface IReferenceClock : IUnknown
331 [out] REFERENCE_TIME *pTime);
334 [in] REFERENCE_TIME baseTime,
335 [in] REFERENCE_TIME streamTime,
337 [out] DWORD_PTR * pdwAdviseCookie);
339 HRESULT AdvisePeriodic(
340 [in] REFERENCE_TIME startTime,
341 [in] REFERENCE_TIME periodTime,
342 [in] HSEMAPHORE hSemaphore,
343 [out] DWORD_PTR * pdwAdviseCookie);
346 [in] DWORD_PTR dwAdviseCookie);
349 typedef IReferenceClock *PREFERENCECLOCK;
354 uuid(36b73885-c2c8-11cf-8b46-00805f6cef60),
355 pointer_default(unique)
357 interface IReferenceClock2 : IReferenceClock
361 typedef IReferenceClock2 *PREFERENCECLOCK2;
368 uuid(56a8689a-0ad4-11ce-b03a-0020af0ba770),
369 pointer_default(unique)
371 interface IMediaSample : IUnknown
373 HRESULT GetPointer([out] BYTE ** ppBuffer);
378 [out] REFERENCE_TIME * pTimeStart,
379 [out] REFERENCE_TIME * pTimeEnd);
382 [in] REFERENCE_TIME * pTimeStart,
383 [in] REFERENCE_TIME * pTimeEnd);
385 HRESULT IsSyncPoint(void);
387 HRESULT SetSyncPoint(BOOL bIsSyncPoint);
389 HRESULT IsPreroll(void);
391 HRESULT SetPreroll(BOOL bIsPreroll);
393 LONG GetActualDataLength(void);
395 HRESULT SetActualDataLength(LONG length);
397 HRESULT GetMediaType(AM_MEDIA_TYPE **ppMediaType);
399 HRESULT SetMediaType(AM_MEDIA_TYPE *pMediaType);
401 HRESULT IsDiscontinuity(void);
403 HRESULT SetDiscontinuity(BOOL bDiscontinuity);
405 HRESULT GetMediaTime(
406 [out] LONGLONG * pTimeStart,
407 [out] LONGLONG * pTimeEnd);
409 HRESULT SetMediaTime(
410 [in] LONGLONG * pTimeStart,
411 [in] LONGLONG * pTimeEnd);
414 typedef IMediaSample *PMEDIASAMPLE;
416 enum tagAM_SAMPLE_PROPERTY_FLAGS
418 AM_SAMPLE_SPLICEPOINT = 0x01,
419 AM_SAMPLE_PREROLL = 0x02,
420 AM_SAMPLE_DATADISCONTINUITY = 0x04,
421 AM_SAMPLE_TYPECHANGED = 0x08,
422 AM_SAMPLE_TIMEVALID = 0x10,
423 AM_SAMPLE_TIMEDISCONTINUITY = 0x40,
424 AM_SAMPLE_FLUSH_ON_PAUSE = 0x80,
425 AM_SAMPLE_STOPVALID = 0x100,
426 AM_SAMPLE_ENDOFSTREAM = 0x200,
428 AM_STREAM_CONTROL = 1
431 typedef struct tagAM_SAMPLE2_PROPERTIES
434 DWORD dwTypeSpecificFlags;
437 REFERENCE_TIME tStart;
438 REFERENCE_TIME tStop;
440 AM_MEDIA_TYPE *pMediaType;
443 } AM_SAMPLE2_PROPERTIES;
448 uuid(36b73884-c2c8-11cf-8b46-00805f6cef60),
449 pointer_default(unique)
451 interface IMediaSample2 : IMediaSample
453 HRESULT GetProperties(
454 [in] DWORD cbProperties,
455 [out, size_is(cbProperties)] BYTE * pbProperties
458 HRESULT SetProperties(
459 [in] DWORD cbProperties,
460 [in, size_is(cbProperties)] const BYTE * pbProperties
464 typedef IMediaSample2 *PMEDIASAMPLE2;
466 #define AM_GBF_PREVFRAMESKIPPED 1
467 #define AM_GBF_NOTASYNCPOINT 2
468 cpp_quote("#define AM_GBF_PREVFRAMESKIPPED 1")
469 cpp_quote("#define AM_GBF_NOTASYNCPOINT 2")
471 cpp_quote("#define AM_GBF_NOWAIT 4")
475 uuid(56a8689c-0ad4-11ce-b03a-0020af0ba770),
476 pointer_default(unique)
478 interface IMemAllocator : IUnknown
480 HRESULT SetProperties(
481 [in] ALLOCATOR_PROPERTIES* pRequest,
482 [out] ALLOCATOR_PROPERTIES* pActual);
484 HRESULT GetProperties(
485 [out] ALLOCATOR_PROPERTIES* pProps);
487 HRESULT Commit(void);
489 HRESULT Decommit(void);
492 [out] IMediaSample **ppBuffer,
493 [in] REFERENCE_TIME * pStartTime,
494 [in] REFERENCE_TIME * pEndTime,
497 HRESULT ReleaseBuffer(
498 [in] IMediaSample *pBuffer);
501 typedef IMemAllocator *PMEMALLOCATOR;
505 uuid(379a0cf0-c1de-11d2-abf5-00a0c905f375),
506 pointer_default(unique)
508 interface IMemAllocatorCallbackTemp : IMemAllocator
511 [in] IMemAllocatorNotifyCallbackTemp *pNotify);
513 HRESULT GetFreeCount(
514 [out] LONG *plBuffersFree);
519 uuid(92980b30-c1de-11d2-abf5-00a0c905f375),
520 pointer_default(unique)
522 interface IMemAllocatorNotifyCallbackTemp : IUnknown
524 HRESULT NotifyRelease();
529 uuid(56a8689d-0ad4-11ce-b03a-0020af0ba770),
530 pointer_default(unique)
532 interface IMemInputPin : IUnknown
534 HRESULT GetAllocator(
535 [out] IMemAllocator ** ppAllocator);
537 HRESULT NotifyAllocator(
538 [in] IMemAllocator * pAllocator,
539 [in] BOOL bReadOnly);
541 HRESULT GetAllocatorRequirements( [out] ALLOCATOR_PROPERTIES*pProps );
544 [in] IMediaSample * pSample);
546 HRESULT ReceiveMultiple(
547 [in, size_is(nSamples)] IMediaSample **pSamples,
549 [out] long *nSamplesProcessed);
551 HRESULT ReceiveCanBlock();
554 typedef IMemInputPin *PMEMINPUTPIN;
558 uuid(a3d8cec0-7e5a-11cf-bbc5-00805f6cef20),
559 pointer_default(unique)
561 interface IAMovieSetup : IUnknown
564 HRESULT Unregister( );
567 typedef IAMovieSetup *PAMOVIESETUP;
569 typedef enum AM_SEEKING_SeekingFlags
571 AM_SEEKING_NoPositioning = 0x00,
572 AM_SEEKING_AbsolutePositioning = 0x01,
573 AM_SEEKING_RelativePositioning = 0x02,
574 AM_SEEKING_IncrementalPositioning = 0x03,
575 AM_SEEKING_PositioningBitsMask = 0x03,
576 AM_SEEKING_SeekToKeyFrame = 0x04,
577 AM_SEEKING_ReturnTime = 0x08,
578 AM_SEEKING_Segment = 0x10,
579 AM_SEEKING_NoFlush = 0x20
580 } AM_SEEKING_SEEKING_FLAGS;
582 typedef enum AM_SEEKING_SeekingCapabilities
584 AM_SEEKING_CanSeekAbsolute = 0x001,
585 AM_SEEKING_CanSeekForwards = 0x002,
586 AM_SEEKING_CanSeekBackwards = 0x004,
587 AM_SEEKING_CanGetCurrentPos = 0x008,
588 AM_SEEKING_CanGetStopPos = 0x010,
589 AM_SEEKING_CanGetDuration = 0x020,
590 AM_SEEKING_CanPlayBackwards = 0x040,
591 AM_SEEKING_CanDoSegments = 0x080,
592 AM_SEEKING_Source = 0x100
593 } AM_SEEKING_SEEKING_CAPABILITIES;
597 uuid(36b73880-c2c8-11cf-8b46-00805f6cef60),
598 pointer_default(unique)
600 interface IMediaSeeking : IUnknown
602 HRESULT GetCapabilities( [out] DWORD * pCapabilities );
604 HRESULT CheckCapabilities( [in,out] DWORD * pCapabilities );
606 HRESULT IsFormatSupported([in] const GUID * pFormat);
608 HRESULT QueryPreferredFormat([out] GUID * pFormat);
610 HRESULT GetTimeFormat([out] GUID *pFormat);
612 HRESULT IsUsingTimeFormat([in] const GUID * pFormat);
614 HRESULT SetTimeFormat([in] const GUID * pFormat);
616 HRESULT GetDuration([out] LONGLONG *pDuration);
618 HRESULT GetStopPosition([out] LONGLONG *pStop);
620 HRESULT GetCurrentPosition([out] LONGLONG *pCurrent);
622 HRESULT ConvertTimeFormat([out] LONGLONG * pTarget, [in] const GUID * pTargetFormat,
623 [in] LONGLONG Source, [in] const GUID * pSourceFormat );
625 HRESULT SetPositions(
626 [in,out] LONGLONG * pCurrent,
627 [in] DWORD dwCurrentFlags,
628 [in,out] LONGLONG * pStop,
629 [in] DWORD dwStopFlags);
631 HRESULT GetPositions(
632 [out] LONGLONG * pCurrent,
633 [out] LONGLONG * pStop);
635 HRESULT GetAvailable(
636 [out] LONGLONG * pEarliest,
637 [out] LONGLONG * pLatest);
639 HRESULT SetRate([in] double dRate);
641 HRESULT GetRate([out] double * pdRate);
643 HRESULT GetPreroll([out] LONGLONG * pllPreroll);
646 typedef IMediaSeeking *PMEDIASEEKING;
648 enum tagAM_MEDIAEVENT_FLAGS
650 AM_MEDIAEVENT_NONOTIFY = 0x01