12 #define KSDDKAPI DECLSPEC_IMPORT
15 #define STATIC_IID_IKsObject\
16 0x423c13a2L, 0x2070, 0x11d0, 0x9e, 0xf7, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1
18 #define STATIC_IID_IKsPinEx\
19 0x7bb38260L, 0xd19c, 0x11d2, 0xb3, 0x8a, 0x00, 0xa0, 0xc9, 0x5e, 0xc2, 0x2e
21 #define STATIC_IID_IKsPin\
22 0xb61178d1L, 0xa2d9, 0x11cf, 0x9e, 0x53, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1
24 #define STATIC_IID_IKsPinPipe\
25 0xe539cd90L, 0xa8b4, 0x11d1, 0x81, 0x89, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
27 #define STATIC_IID_IKsDataTypeHandler\
28 0x5ffbaa02L, 0x49a3, 0x11d0, 0x9f, 0x36, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1
30 #define STATIC_IID_IKsDataTypeCompletion\
31 0x827D1A0EL, 0x0F73, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
33 #define STATIC_IID_IKsInterfaceHandler\
34 0xD3ABC7E0L, 0x9A61, 0x11D0, 0xA4, 0x0D, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
36 #define STATIC_IID_IKsClockPropertySet\
37 0x5C5CBD84L, 0xE755, 0x11D0, 0xAC, 0x18, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
39 #define STATIC_IID_IKsAllocator\
40 0x8da64899L, 0xc0d9, 0x11d0, 0x84, 0x13, 0x00, 0x00, 0xf8, 0x22, 0xfe, 0x8a
42 #define STATIC_IID_IKsAllocatorEx\
43 0x091bb63aL, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
46 #ifndef STATIC_IID_IKsPropertySet
47 #define STATIC_IID_IKsPropertySet\
48 0x31EFAC30L, 0x515C, 0x11d0, 0xA9, 0xAA, 0x00, 0xAA, 0x00, 0x61, 0xBE, 0x93
51 #define STATIC_IID_IKsTopology\
52 0x28F54683L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
54 #ifndef STATIC_IID_IKsControl
55 #define STATIC_IID_IKsControl\
56 0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
59 #define STATIC_IID_IKsAggregateControl\
60 0x7F40EAC0L, 0x3947, 0x11D2, 0x87, 0x4E, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
62 #define STATIC_CLSID_Proxy \
63 0x17CCA71BL, 0xECD7, 0x11D0, 0xB9, 0x08, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
67 #if !defined(__cplusplus) || _MSC_VER < 1100
69 #define IID_IKsQualityForwarder KSCATEGORY_QUALITY
71 DEFINE_GUIDEX(IID_IKsObject
);
72 DEFINE_GUIDEX(IID_IKsPin
);
73 DEFINE_GUIDEX(IID_IKsPinEx
);
74 DEFINE_GUIDEX(IID_IKsPinPipe
);
75 DEFINE_GUIDEX(IID_IKsDataTypeHandler
);
76 DEFINE_GUIDEX(IID_IKsDataTypeCompletion
);
77 DEFINE_GUIDEX(IID_IKsInterfaceHandler
);
78 DEFINE_GUIDEX(IID_IKsClockPropertySet
);
79 DEFINE_GUIDEX(IID_IKsAllocator
);
80 DEFINE_GUIDEX(IID_IKsAllocatorEx
);
83 #define STATIC_IID_IKsQualityForwarder STATIC_KSCATEGORY_QUALITY
88 KsAllocatorMode_Kernel
94 FramingProp_Uninitialized
,
100 typedef FRAMING_PROP
*PFRAMING_PROP
;
105 Framing_Cache_Update
,
106 Framing_Cache_ReadLast
,
107 Framing_Cache_ReadOrig
,
114 LONGLONG MinTotalNominator
;
115 LONGLONG MaxTotalNominator
;
116 LONGLONG TotalDenominator
;
117 }OPTIMAL_WEIGHT_TOTALS
;
119 typedef struct IPin IPin
;
120 typedef struct IKsPin IKsPin
;
121 typedef struct IKsAllocator IKsAllocator
;
122 typedef struct IKsAllocatorEx IKsAllocatorEx
;
125 #define AllocatorStrategy_DontCare 0
126 #define AllocatorStrategy_MinimizeNumberOfFrames 1
127 #define AllocatorStrategy_MinimizeFrameSize 2
128 #define AllocatorStrategy_MinimizeNumberOfAllocators 4
129 #define AllocatorStrategy_MaximizeSpeed 8
131 #define PipeFactor_None 0x0
132 #define PipeFactor_UserModeUpstream 0x1
133 #define PipeFactor_UserModeDownstream 0x2
134 #define PipeFactor_MemoryTypes 0x4
135 #define PipeFactor_Flags 0x8
136 #define PipeFactor_PhysicalRanges 0x10
137 #define PipeFactor_OptimalRanges 0x20
138 #define PipeFactor_FixedCompression 0x40
139 #define PipeFactor_UnknownCompression 0x80
140 #define PipeFactor_Buffers 0x100
141 #define PipeFactor_Align 0x200
142 #define PipeFactor_PhysicalEnd 0x400
143 #define PipeFactor_LogicalEnd 0x800
148 PipeState_RangeNotFixed
,
149 PipeState_RangeFixed
,
150 PipeState_CompressionUnknown
,
155 typedef struct _PIPE_DIMENSIONS
157 KS_COMPRESSION AllocatorPin
;
158 KS_COMPRESSION MaxExpansionPin
;
159 KS_COMPRESSION EndPin
;
160 }PIPE_DIMENSIONS
, *PPIPE_DIMENSIONS
;
166 Pipe_Allocator_FirstPin
,
167 Pipe_Allocator_LastPin
,
168 Pipe_Allocator_MiddlePin
169 }PIPE_ALLOCATOR_PLACE
, *PPIPE_ALLOCATOR_PLACE
;;
173 KS_MemoryTypeDontCare
= 0,
174 KS_MemoryTypeKernelPaged
,
175 KS_MemoryTypeKernelNonPaged
,
176 KS_MemoryTypeDeviceHostMapped
,
177 KS_MemoryTypeDeviceSpecific
,
180 }KS_LogicalMemoryType
, *PKS_LogicalMemoryType
;;
182 typedef struct _PIPE_TERMINATION
{
184 ULONG OutsideFactors
;
186 KS_FRAMING_RANGE PhysicalRange
;
187 KS_FRAMING_RANGE_WEIGHTED OptimalRange
;
188 KS_COMPRESSION Compression
;
192 typedef struct _ALLOCATOR_PROPERTIES_EX
202 PIPE_TERMINATION Input
;
203 PIPE_TERMINATION Output
;
207 KS_LogicalMemoryType LogicalMemoryType
;
208 PIPE_ALLOCATOR_PLACE AllocatorPlace
;
209 PIPE_DIMENSIONS Dimensions
;
210 KS_FRAMING_RANGE PhysicalRange
;
211 IKsAllocatorEx
* PrevSegment
;
212 ULONG CountNextSegments
;
213 IKsAllocatorEx
** NextSegments
;
216 }ALLOCATOR_PROPERTIES_EX
;
218 typedef ALLOCATOR_PROPERTIES_EX
*PALLOCATOR_PROPERTIES_EX
;
223 struct DECLSPEC_UUID("5C5CBD84-E755-11D0-AC18-00A0C9223196") IKsClockPropertySet
;
225 #define INTERFACE IKsClockPropertySet
226 DECLARE_INTERFACE_(IKsClockPropertySet
, IUnknown
)
228 STDMETHOD(KsGetTime
)(
232 STDMETHOD(KsSetTime
)(
236 STDMETHOD(KsGetPhysicalTime
)(
240 STDMETHOD(KsSetPhysicalTime
)(
244 STDMETHOD(KsGetCorrelatedTime
)(
246 KSCORRELATED_TIME
* CorrelatedTime
248 STDMETHOD(KsSetCorrelatedTime
)(
250 KSCORRELATED_TIME
* CorrelatedTime
252 STDMETHOD(KsGetCorrelatedPhysicalTime
)(
254 KSCORRELATED_TIME
* CorrelatedTime
256 STDMETHOD(KsSetCorrelatedPhysicalTime
)(
258 KSCORRELATED_TIME
* CorrelatedTime
260 STDMETHOD(KsGetResolution
)(
262 KSRESOLUTION
* Resolution
264 STDMETHOD(KsGetState
)(
271 interface
DECLSPEC_UUID("8da64899-c0d9-11d0-8413-0000f822fe8a") IKsAllocator
;
273 #define INTERFACE IKsAllocator
274 DECLARE_INTERFACE_(IKsAllocator
, IUnknown
)
276 STDMETHOD_(HANDLE
, KsGetAllocatorHandle
)(
279 STDMETHOD_(KSALLOCATORMODE
, KsGetAllocatorMode
)(
282 STDMETHOD(KsGetAllocatorStatus
)(
284 PKSSTREAMALLOCATOR_STATUS AllocatorStatus
286 STDMETHOD_(VOID
, KsSetAllocatorMode
)(
292 interface
DECLSPEC_UUID("091bb63a-603f-11d1-b067-00a0c9062802") IKsAllocatorEx
;
294 #define INTERFACE IKsAllocatorEx
295 DECLARE_INTERFACE_(IKsAllocatorEx
, IKsAllocator
)
297 STDMETHOD_(PALLOCATOR_PROPERTIES_EX
, KsGetProperties
)(
300 STDMETHOD_(VOID
, KsSetProperties
)(
302 PALLOCATOR_PROPERTIES_EX
304 STDMETHOD_(VOID
, KsSetAllocatorHandle
)(
306 HANDLE AllocatorHandle
308 STDMETHOD_(HANDLE
, KsCreateAllocatorAndGetHandle
)(
315 KsPeekOperation_PeekOnly
,
316 KsPeekOperation_AddRef
319 typedef struct _KSSTREAM_SEGMENT
*PKSSTREAM_SEGMENT
;
321 interface
DECLSPEC_UUID("b61178d1-a2d9-11cf-9e53-00aa00a216a1") IKsPin
;
324 #define INTERFACE IKsPin
325 DECLARE_INTERFACE_(IKsPin
, IUnknown
)
327 STDMETHOD(KsQueryMediums
)(
329 PKSMULTIPLE_ITEM
* MediumList
331 STDMETHOD(KsQueryInterfaces
)(
333 PKSMULTIPLE_ITEM
* InterfaceList
335 STDMETHOD(KsCreateSinkPinHandle
)(
337 KSPIN_INTERFACE
& Interface
,
340 STDMETHOD(KsGetCurrentCommunication
)(
342 KSPIN_COMMUNICATION
*Communication
,
343 KSPIN_INTERFACE
*Interface
,
346 STDMETHOD(KsPropagateAcquire
)(
349 STDMETHOD(KsDeliver
)(
351 IMediaSample
* Sample
,
354 STDMETHOD(KsMediaSamplesCompleted
)(
356 PKSSTREAM_SEGMENT StreamSegment
358 STDMETHOD_(IMemAllocator
*, KsPeekAllocator
)(
360 KSPEEKOPERATION Operation
362 STDMETHOD(KsReceiveAllocator
)(
364 IMemAllocator
*MemAllocator
366 STDMETHOD(KsRenegotiateAllocator
)(
369 STDMETHOD_(LONG
, KsIncrementPendingIoCount
)(
372 STDMETHOD_(LONG
, KsDecrementPendingIoCount
)(
375 STDMETHOD(KsQualityNotify
)(
378 REFERENCE_TIME TimeDelta
382 interface
DECLSPEC_UUID("7bb38260-d19c-11d2-b38a-00a0c95ec22e") IKsPinEx
;
384 #define INTERFACE IKsPinEx
385 DECLARE_INTERFACE_(IKsPinEx
, IKsPin
)
387 STDMETHOD_(VOID
, KsNotifyError
)(
389 IMediaSample
* Sample
,
394 interface
DECLSPEC_UUID("e539cd90-a8b4-11d1-8189-00a0c9062802") IKsPinPipe
;
396 #define INTERFACE IKsPinPipe
397 DECLARE_INTERFACE_(IKsPinPipe
, IUnknown
)
399 STDMETHOD(KsGetPinFramingCache
)(
401 PKSALLOCATOR_FRAMING_EX
*FramingEx
,
402 PFRAMING_PROP FramingProp
,
403 FRAMING_CACHE_OPS Option
405 STDMETHOD(KsSetPinFramingCache
)(
407 PKSALLOCATOR_FRAMING_EX FramingEx
,
408 PFRAMING_PROP FramingProp
,
409 FRAMING_CACHE_OPS Option
411 STDMETHOD_(IPin
*, KsGetConnectedPin
)(
414 STDMETHOD_(IKsAllocatorEx
*, KsGetPipe
)(
416 KSPEEKOPERATION Operation
418 STDMETHOD(KsSetPipe
)(
420 IKsAllocatorEx
*KsAllocator
422 STDMETHOD_(ULONG
, KsGetPipeAllocatorFlag
)(
425 STDMETHOD(KsSetPipeAllocatorFlag
)(
429 STDMETHOD_(GUID
, KsGetPinBusCache
)(
432 STDMETHOD(KsSetPinBusCache
)(
437 STDMETHOD_(PWCHAR
, KsGetPinName
)(
440 STDMETHOD_(PWCHAR
, KsGetFilterName
)(
446 interface
DECLSPEC_UUID("CD5EBE6B-8B6E-11D1-8AE0-00A0C9223196") IKsPinFactory
;
448 #define INTERFACE IKsPinFactory
449 DECLARE_INTERFACE_(IKsPinFactory
, IUnknown
)
451 STDMETHOD(KsPinFactory
)(
462 interface
DECLSPEC_UUID("5ffbaa02-49a3-11d0-9f36-00aa00a216a1") IKsDataTypeHandler
;
464 #define INTERFACE IKsDataTypeHandler
465 DECLARE_INTERFACE_(IKsDataTypeHandler
, IUnknown
)
467 STDMETHOD(KsCompleteIoOperation
)(
469 IMediaSample
*Sample
,
471 KSIOOPERATION IoOperation
,
474 STDMETHOD(KsIsMediaTypeInRanges
)(
478 STDMETHOD(KsPrepareIoOperation
)(
480 IMediaSample
*Sample
,
482 KSIOOPERATION IoOperation
484 STDMETHOD(KsQueryExtendedSize
)(
488 STDMETHOD(KsSetMediaType
)(
490 const AM_MEDIA_TYPE
* AmMediaType
494 interface
DECLSPEC_UUID("827D1A0E-0F73-11D2-B27A-00A0C9223196") IKsDataTypeCompletion
;
496 #define INTERFACE IKsDataTypeCompletion
497 DECLARE_INTERFACE_(IKsDataTypeCompletion
, IUnknown
)
499 STDMETHOD(KsCompleteMediaType
)(
503 AM_MEDIA_TYPE
* AmMediaType
507 interface
DECLSPEC_UUID("D3ABC7E0-9A61-11d0-A40D-00A0C9223196") IKsInterfaceHandler
;
509 #define INTERFACE IKsInterfaceHandler
510 DECLARE_INTERFACE_(IKsInterfaceHandler
, IUnknown
)
516 STDMETHOD(KsProcessMediaSamples
)(
518 IKsDataTypeHandler
*KsDataTypeHandler
,
519 IMediaSample
** SampleList
,
521 KSIOOPERATION IoOperation
,
522 PKSSTREAM_SEGMENT
*StreamSegment
524 STDMETHOD(KsCompleteIo
)(
526 PKSSTREAM_SEGMENT StreamSegment
531 typedef struct _KSSTREAM_SEGMENT
533 IKsInterfaceHandler
*KsInterfaceHandler
;
534 IKsDataTypeHandler
*KsDataTypeHandler
;
535 KSIOOPERATION IoOperation
;
536 HANDLE CompletionEvent
;
540 interface
DECLSPEC_UUID("423c13a2-2070-11d0-9ef7-00aa00a216a1") IKsObject
;
542 #define INTERFACE IKsObject
543 DECLARE_INTERFACE_(IKsObject
, IUnknown
)
545 STDMETHOD_(HANDLE
, KsGetObjectHandle
)(
550 interface
DECLSPEC_UUID("97ebaacb-95bd-11d0-a3ea-00a0c9223196") IKsQualityForwarder
;
552 #define INTERFACE IKsQualityForwarder
553 DECLARE_INTERFACE_(IKsQualityForwarder
, IKsObject
)
555 STDMETHOD_(VOID
, KsFlushClient
)(
561 #if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1)
563 interface
DECLSPEC_UUID("412bd695-f84b-46c1-ac73-54196dbc8fa7") IKsNotifyEvent
;
565 #define INTERFACE IKsNotifyEvent
566 DECLARE_INTERFACE_(IKsNotifyEvent
, IUnknown
)
568 STDMETHOD(KsNotifyEvent
)(
581 KsResolveRequiredAttributes(
582 PKSDATARANGE DataRange
,
583 PKSMULTIPLE_ITEM Attributes OPTIONAL
);
591 PHANDLE DeviceHandle
);
596 KsSynchronousDeviceControl(
603 PULONG BytesReturned
);
608 KsGetMultiplePinFactoryItems(
620 ULONG
* MediaTypeCount
);
627 AM_MEDIA_TYPE
* AmMediaType
,
633 #ifndef _IKsPropertySet_
634 #if !defined(__cplusplus) || _MSC_VER < 1100
635 DEFINE_GUIDEX(IID_IKsPropertySet
);
640 #if !defined(__cplusplus) || _MSC_VER < 1100
641 DEFINE_GUIDEX(IID_IKsControl
);
645 #if !defined(__cplusplus) || _MSC_VER < 1100
646 DEFINE_GUIDEX(IID_IKsAggregateControl
);
649 #ifndef _IKsTopology_
650 #if !defined(__cplusplus) || _MSC_VER < 1100
651 DEFINE_GUIDEX(IID_IKsTopology
);
655 DEFINE_GUIDSTRUCT("17CCA71B-ECD7-11D0-B908-00A0C9223196", CLSID_Proxy
);
656 #define CLSID_Proxy DEFINE_GUIDNAMED(CLSID_Proxy)
660 #ifndef _IKsPropertySet_
661 #if !defined(__cplusplus) || _MSC_VER < 1100
662 DEFINE_GUID(IID_IKsPropertySet
, STATIC_IID_IKsPropertySet
);
666 #if !defined(__cplusplus) || _MSC_VER < 1100
667 DEFINE_GUID(CLSID_Proxy
, STATIC_CLSID_Proxy
);
669 DECLSPEC_UUID("17CCA71B-ECD7-11D0-B908-00A0C9223196") CLSID_Proxy
;
674 #ifndef _IKsPropertySet_
675 #define _IKsPropertySet_
677 #define KSPROPERTY_SUPPORT_GET 1
678 #define KSPROPERTY_SUPPORT_SET 2
680 interface
DECLSPEC_UUID("31EFAC30-515C-11d0-A9AA-00aa0061be93")
682 #define INTERFACE IKsPropertySet
683 DECLARE_INTERFACE_(IKsPropertySet
, IUnknown
)
689 IN LPVOID InstanceData
,
690 IN ULONG InstanceLength
,
691 IN LPVOID PropertyData
,
699 IN LPVOID InstanceData
,
700 IN ULONG InstanceLength
,
701 OUT LPVOID PropertyData
,
703 OUT ULONG
* BytesReturned
706 STDMETHOD(QuerySupported
)(
710 OUT ULONG
* TypeSupport
719 DEFINE_GUID(IID_IKsControl
, 28F54685
, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0A0
, 0xC9, 0x22, 0x31, 0x96);
722 interface
DECLSPEC_UUID("28F54685-06FD-11D2-B27A-00A0C9223196") IKsControl
;
724 #define INTERFACE IKsControl
725 DECLARE_INTERFACE_(IKsControl
, IUnknown
)
727 STDMETHOD(KsProperty
)(
729 IN PKSPROPERTY Property
,
730 IN ULONG PropertyLength
,
731 IN OUT LPVOID PropertyData
,
733 OUT ULONG
* BytesReturned
738 IN ULONG MethodLength
,
739 IN OUT LPVOID MethodData
,
741 OUT ULONG
* BytesReturned
745 IN PKSEVENT Event OPTIONAL
,
746 IN ULONG EventLength
,
747 IN OUT LPVOID EventData
,
749 OUT ULONG
* BytesReturned
756 DEFINE_GUID(IID_IKsAggregateControl
, 0x7F40EAC0, 0x3947, 0x11D2, 0x87, 0x4E, 0x00, 0A0
, 0xC9, 0x22, 0x31, 0x96);
759 #define INTERFACE IKsAggregateControl
760 DECLARE_INTERFACE_(IKsAggregateControl
, IUnknown
)
762 STDMETHOD(KsAddAggregate
)(
764 IN REFGUID AggregateClass
766 STDMETHOD(KsRemoveAggregate
)(
768 IN REFGUID AggregateClass
772 #ifndef _IKsTopology_
773 #define _IKsTopology_
775 DEFINE_GUID(IID_IKsAggregateControl
, 0x28F54683, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0A0
, 0xC9, 0x22, 0x31, 0x96);
778 #define INTERFACE IKsTopology
779 DECLARE_INTERFACE_(IKsTopology
, IUnknown
)
781 STDMETHOD(CreateNodeInstance
)(
785 IN ACCESS_MASK DesiredAccess
,
786 IN IUnknown
* UnkOuter OPTIONAL
,
787 IN REFGUID InterfaceId
,
788 OUT LPVOID
* Interface