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;
355 uuid(ebec459c-2eca-4d42-a8af-30df557614b8),
356 pointer_default(unique)
358 interface IReferenceClockTimerControl : IUnknown {
360 HRESULT SetDefaultTimerResolution(
361 REFERENCE_TIME timerResolution);
362 HRESULT GetDefaultTimerResolution(
363 [out] REFERENCE_TIME* pTimerResolution);
370 uuid(36b73885-c2c8-11cf-8b46-00805f6cef60),
371 pointer_default(unique)
373 interface IReferenceClock2 : IReferenceClock
377 typedef IReferenceClock2 *PREFERENCECLOCK2;
384 uuid(56a8689a-0ad4-11ce-b03a-0020af0ba770),
385 pointer_default(unique)
387 interface IMediaSample : IUnknown
389 HRESULT GetPointer([out] BYTE ** ppBuffer);
394 [out] REFERENCE_TIME * pTimeStart,
395 [out] REFERENCE_TIME * pTimeEnd);
398 [in] REFERENCE_TIME * pTimeStart,
399 [in] REFERENCE_TIME * pTimeEnd);
401 HRESULT IsSyncPoint(void);
403 HRESULT SetSyncPoint(BOOL bIsSyncPoint);
405 HRESULT IsPreroll(void);
407 HRESULT SetPreroll(BOOL bIsPreroll);
409 LONG GetActualDataLength(void);
411 HRESULT SetActualDataLength(LONG length);
413 HRESULT GetMediaType(AM_MEDIA_TYPE **ppMediaType);
415 HRESULT SetMediaType(AM_MEDIA_TYPE *pMediaType);
417 HRESULT IsDiscontinuity(void);
419 HRESULT SetDiscontinuity(BOOL bDiscontinuity);
421 HRESULT GetMediaTime(
422 [out] LONGLONG * pTimeStart,
423 [out] LONGLONG * pTimeEnd);
425 HRESULT SetMediaTime(
426 [in] LONGLONG * pTimeStart,
427 [in] LONGLONG * pTimeEnd);
430 typedef IMediaSample *PMEDIASAMPLE;
432 enum tagAM_SAMPLE_PROPERTY_FLAGS
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,
444 AM_STREAM_CONTROL = 1
447 typedef struct tagAM_SAMPLE2_PROPERTIES
450 DWORD dwTypeSpecificFlags;
453 REFERENCE_TIME tStart;
454 REFERENCE_TIME tStop;
456 AM_MEDIA_TYPE *pMediaType;
459 } AM_SAMPLE2_PROPERTIES;
464 uuid(36b73884-c2c8-11cf-8b46-00805f6cef60),
465 pointer_default(unique)
467 interface IMediaSample2 : IMediaSample
469 HRESULT GetProperties(
470 [in] DWORD cbProperties,
471 [out, size_is(cbProperties)] BYTE * pbProperties
474 HRESULT SetProperties(
475 [in] DWORD cbProperties,
476 [in, size_is(cbProperties)] const BYTE * pbProperties
480 typedef IMediaSample2 *PMEDIASAMPLE2;
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")
487 cpp_quote("#define AM_GBF_NOWAIT 4")
491 uuid(56a8689c-0ad4-11ce-b03a-0020af0ba770),
492 pointer_default(unique)
494 interface IMemAllocator : IUnknown
496 HRESULT SetProperties(
497 [in] ALLOCATOR_PROPERTIES* pRequest,
498 [out] ALLOCATOR_PROPERTIES* pActual);
500 HRESULT GetProperties(
501 [out] ALLOCATOR_PROPERTIES* pProps);
503 HRESULT Commit(void);
505 HRESULT Decommit(void);
508 [out] IMediaSample **ppBuffer,
509 [in] REFERENCE_TIME * pStartTime,
510 [in] REFERENCE_TIME * pEndTime,
513 HRESULT ReleaseBuffer(
514 [in] IMediaSample *pBuffer);
517 typedef IMemAllocator *PMEMALLOCATOR;
521 uuid(379a0cf0-c1de-11d2-abf5-00a0c905f375),
522 pointer_default(unique)
524 interface IMemAllocatorCallbackTemp : IMemAllocator
527 [in] IMemAllocatorNotifyCallbackTemp *pNotify);
529 HRESULT GetFreeCount(
530 [out] LONG *plBuffersFree);
535 uuid(92980b30-c1de-11d2-abf5-00a0c905f375),
536 pointer_default(unique)
538 interface IMemAllocatorNotifyCallbackTemp : IUnknown
540 HRESULT NotifyRelease();
545 uuid(56a8689d-0ad4-11ce-b03a-0020af0ba770),
546 pointer_default(unique)
548 interface IMemInputPin : IUnknown
550 HRESULT GetAllocator(
551 [out] IMemAllocator ** ppAllocator);
553 HRESULT NotifyAllocator(
554 [in] IMemAllocator * pAllocator,
555 [in] BOOL bReadOnly);
557 HRESULT GetAllocatorRequirements( [out] ALLOCATOR_PROPERTIES*pProps );
560 [in] IMediaSample * pSample);
562 HRESULT ReceiveMultiple(
563 [in, size_is(nSamples)] IMediaSample **pSamples,
565 [out] long *nSamplesProcessed);
567 HRESULT ReceiveCanBlock();
570 typedef IMemInputPin *PMEMINPUTPIN;
574 uuid(a3d8cec0-7e5a-11cf-bbc5-00805f6cef20),
575 pointer_default(unique)
577 interface IAMovieSetup : IUnknown
580 HRESULT Unregister( );
583 typedef IAMovieSetup *PAMOVIESETUP;
585 typedef enum AM_SEEKING_SeekingFlags
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;
598 typedef enum AM_SEEKING_SeekingCapabilities
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;
613 uuid(36b73880-c2c8-11cf-8b46-00805f6cef60),
614 pointer_default(unique)
616 interface IMediaSeeking : IUnknown
618 HRESULT GetCapabilities( [out] DWORD * pCapabilities );
620 HRESULT CheckCapabilities( [in,out] DWORD * pCapabilities );
622 HRESULT IsFormatSupported([in] const GUID * pFormat);
624 HRESULT QueryPreferredFormat([out] GUID * pFormat);
626 HRESULT GetTimeFormat([out] GUID *pFormat);
628 HRESULT IsUsingTimeFormat([in] const GUID * pFormat);
630 HRESULT SetTimeFormat([in] const GUID * pFormat);
632 HRESULT GetDuration([out] LONGLONG *pDuration);
634 HRESULT GetStopPosition([out] LONGLONG *pStop);
636 HRESULT GetCurrentPosition([out] LONGLONG *pCurrent);
638 HRESULT ConvertTimeFormat([out] LONGLONG * pTarget, [in] const GUID * pTargetFormat,
639 [in] LONGLONG Source, [in] const GUID * pSourceFormat );
641 HRESULT SetPositions(
642 [in,out] LONGLONG * pCurrent,
643 [in] DWORD dwCurrentFlags,
644 [in,out] LONGLONG * pStop,
645 [in] DWORD dwStopFlags);
647 HRESULT GetPositions(
648 [out] LONGLONG * pCurrent,
649 [out] LONGLONG * pStop);
651 HRESULT GetAvailable(
652 [out] LONGLONG * pEarliest,
653 [out] LONGLONG * pLatest);
655 HRESULT SetRate([in] double dRate);
657 HRESULT GetRate([out] double * pdRate);
659 HRESULT GetPreroll([out] LONGLONG * pllPreroll);
662 typedef IMediaSeeking *PMEDIASEEKING;
664 enum tagAM_MEDIAEVENT_FLAGS
666 AM_MEDIAEVENT_NONOTIFY = 0x01