2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS WDM Streaming ActiveMovie Proxy
4 * FILE: dll/directx/ksproxy/input_pin.cpp
5 * PURPOSE: InputPin of Proxy Filter
7 * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
11 const GUID IID_IKsPinPipe
= {0xe539cd90, 0xa8b4, 0x11d1, {0x81, 0x89, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02}};
12 const GUID IID_IKsPinEx
= {0x7bb38260L
, 0xd19c, 0x11d2, {0xb3, 0x8a, 0x00, 0xa0, 0xc9, 0x5e, 0xc2, 0x2e}};
17 const GUID KSPROPSETID_Connection
= {0x1D58C920L
, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
19 KSPIN_INTERFACE StandardPinInterface
=
21 {STATIC_KSINTERFACESETID_Standard
},
22 KSINTERFACE_STANDARD_STREAMING
,
26 KSPIN_MEDIUM StandardPinMedium
=
28 {STATIC_KSMEDIUMSETID_Standard
},
29 KSMEDIUM_TYPE_ANYINSTANCE
,
35 KSPIN_INTERFACE StandardPinInterface
=
37 STATIC_KSINTERFACESETID_Standard
,
38 KSINTERFACE_STANDARD_STREAMING
,
42 KSPIN_MEDIUM StandardPinMedium
=
44 STATIC_KSMEDIUMSETID_Standard
,
45 KSMEDIUM_TYPE_ANYINSTANCE
,
51 class CInputPin
: public IPin
,
52 public IKsPropertySet
,
59 public IStreamBuilder
,
60 public IKsAggregateControl
,
61 public IQualityControl
,
62 public ISpecifyPropertyPages
65 typedef std::vector
<IUnknown
*>ProxyPluginVector
;
67 STDMETHODIMP
QueryInterface( REFIID InterfaceId
, PVOID
* Interface
);
69 STDMETHODIMP_(ULONG
) AddRef()
71 InterlockedIncrement(&m_Ref
);
74 STDMETHODIMP_(ULONG
) Release()
76 InterlockedDecrement(&m_Ref
);
86 HRESULT STDMETHODCALLTYPE
KsGetPinFramingCache(PKSALLOCATOR_FRAMING_EX
*FramingEx
, PFRAMING_PROP FramingProp
, FRAMING_CACHE_OPS Option
);
87 HRESULT STDMETHODCALLTYPE
KsSetPinFramingCache(PKSALLOCATOR_FRAMING_EX FramingEx
, PFRAMING_PROP FramingProp
, FRAMING_CACHE_OPS Option
);
88 IPin
* STDMETHODCALLTYPE
KsGetConnectedPin();
89 IKsAllocatorEx
* STDMETHODCALLTYPE
KsGetPipe(KSPEEKOPERATION Operation
);
90 HRESULT STDMETHODCALLTYPE
KsSetPipe(IKsAllocatorEx
*KsAllocator
);
91 ULONG STDMETHODCALLTYPE
KsGetPipeAllocatorFlag();
92 HRESULT STDMETHODCALLTYPE
KsSetPipeAllocatorFlag(ULONG Flag
);
93 GUID STDMETHODCALLTYPE
KsGetPinBusCache();
94 HRESULT STDMETHODCALLTYPE
KsSetPinBusCache(GUID Bus
);
95 PWCHAR STDMETHODCALLTYPE
KsGetPinName();
96 PWCHAR STDMETHODCALLTYPE
KsGetFilterName();
99 HRESULT STDMETHODCALLTYPE
Connect(IPin
*pReceivePin
, const AM_MEDIA_TYPE
*pmt
);
100 HRESULT STDMETHODCALLTYPE
ReceiveConnection(IPin
*pConnector
, const AM_MEDIA_TYPE
*pmt
);
101 HRESULT STDMETHODCALLTYPE
Disconnect();
102 HRESULT STDMETHODCALLTYPE
ConnectedTo(IPin
**pPin
);
103 HRESULT STDMETHODCALLTYPE
ConnectionMediaType(AM_MEDIA_TYPE
*pmt
);
104 HRESULT STDMETHODCALLTYPE
QueryPinInfo(PIN_INFO
*pInfo
);
105 HRESULT STDMETHODCALLTYPE
QueryDirection(PIN_DIRECTION
*pPinDir
);
106 HRESULT STDMETHODCALLTYPE
QueryId(LPWSTR
*Id
);
107 HRESULT STDMETHODCALLTYPE
QueryAccept(const AM_MEDIA_TYPE
*pmt
);
108 HRESULT STDMETHODCALLTYPE
EnumMediaTypes(IEnumMediaTypes
**ppEnum
);
109 HRESULT STDMETHODCALLTYPE
QueryInternalConnections(IPin
**apPin
, ULONG
*nPin
);
110 HRESULT STDMETHODCALLTYPE
EndOfStream();
111 HRESULT STDMETHODCALLTYPE
BeginFlush();
112 HRESULT STDMETHODCALLTYPE
EndFlush();
113 HRESULT STDMETHODCALLTYPE
NewSegment(REFERENCE_TIME tStart
, REFERENCE_TIME tStop
, double dRate
);
115 // ISpecifyPropertyPages
116 HRESULT STDMETHODCALLTYPE
GetPages(CAUUID
*pPages
);
119 HANDLE STDMETHODCALLTYPE
KsGetObjectHandle();
122 HRESULT STDMETHODCALLTYPE
Set(REFGUID guidPropSet
, DWORD dwPropID
, LPVOID pInstanceData
, DWORD cbInstanceData
, LPVOID pPropData
, DWORD cbPropData
);
123 HRESULT STDMETHODCALLTYPE
Get(REFGUID guidPropSet
, DWORD dwPropID
, LPVOID pInstanceData
, DWORD cbInstanceData
, LPVOID pPropData
, DWORD cbPropData
, DWORD
*pcbReturned
);
124 HRESULT STDMETHODCALLTYPE
QuerySupported(REFGUID guidPropSet
, DWORD dwPropID
, DWORD
*pTypeSupport
);
127 HRESULT STDMETHODCALLTYPE
KsProperty(PKSPROPERTY Property
, ULONG PropertyLength
, LPVOID PropertyData
, ULONG DataLength
, ULONG
* BytesReturned
);
128 HRESULT STDMETHODCALLTYPE
KsMethod(PKSMETHOD Method
, ULONG MethodLength
, LPVOID MethodData
, ULONG DataLength
, ULONG
* BytesReturned
);
129 HRESULT STDMETHODCALLTYPE
KsEvent(PKSEVENT Event
, ULONG EventLength
, LPVOID EventData
, ULONG DataLength
, ULONG
* BytesReturned
);
132 HRESULT STDMETHODCALLTYPE
KsQueryMediums(PKSMULTIPLE_ITEM
* MediumList
);
133 HRESULT STDMETHODCALLTYPE
KsQueryInterfaces(PKSMULTIPLE_ITEM
* InterfaceList
);
134 HRESULT STDMETHODCALLTYPE
KsCreateSinkPinHandle(KSPIN_INTERFACE
& Interface
, KSPIN_MEDIUM
& Medium
);
135 HRESULT STDMETHODCALLTYPE
KsGetCurrentCommunication(KSPIN_COMMUNICATION
*Communication
, KSPIN_INTERFACE
*Interface
, KSPIN_MEDIUM
*Medium
);
136 HRESULT STDMETHODCALLTYPE
KsPropagateAcquire();
137 HRESULT STDMETHODCALLTYPE
KsDeliver(IMediaSample
* Sample
, ULONG Flags
);
138 HRESULT STDMETHODCALLTYPE
KsMediaSamplesCompleted(PKSSTREAM_SEGMENT StreamSegment
);
139 IMemAllocator
* STDMETHODCALLTYPE
KsPeekAllocator(KSPEEKOPERATION Operation
);
140 HRESULT STDMETHODCALLTYPE
KsReceiveAllocator(IMemAllocator
*MemAllocator
);
141 HRESULT STDMETHODCALLTYPE
KsRenegotiateAllocator();
142 LONG STDMETHODCALLTYPE
KsIncrementPendingIoCount();
143 LONG STDMETHODCALLTYPE
KsDecrementPendingIoCount();
144 HRESULT STDMETHODCALLTYPE
KsQualityNotify(ULONG Proportion
, REFERENCE_TIME TimeDelta
);
146 VOID STDMETHODCALLTYPE
KsNotifyError(IMediaSample
* Sample
, HRESULT hr
);
149 HRESULT STDMETHODCALLTYPE
GetAllocator(IMemAllocator
**ppAllocator
);
150 HRESULT STDMETHODCALLTYPE
NotifyAllocator(IMemAllocator
*pAllocator
, BOOL bReadOnly
);
151 HRESULT STDMETHODCALLTYPE
GetAllocatorRequirements(ALLOCATOR_PROPERTIES
*pProps
);
152 HRESULT STDMETHODCALLTYPE
Receive(IMediaSample
*pSample
);
153 HRESULT STDMETHODCALLTYPE
ReceiveMultiple(IMediaSample
**pSamples
, long nSamples
, long *nSamplesProcessed
);
154 HRESULT STDMETHODCALLTYPE
ReceiveCanBlock( void);
157 HRESULT STDMETHODCALLTYPE
KsPinFactory(ULONG
* PinFactory
);
160 HRESULT STDMETHODCALLTYPE
Render(IPin
*ppinOut
, IGraphBuilder
*pGraph
);
161 HRESULT STDMETHODCALLTYPE
Backout(IPin
*ppinOut
, IGraphBuilder
*pGraph
);
163 //IKsAggregateControl
164 HRESULT STDMETHODCALLTYPE
KsAddAggregate(IN REFGUID AggregateClass
);
165 HRESULT STDMETHODCALLTYPE
KsRemoveAggregate(REFGUID AggregateClass
);
168 HRESULT STDMETHODCALLTYPE
Notify(IBaseFilter
*pSelf
, Quality q
);
169 HRESULT STDMETHODCALLTYPE
SetSink(IQualityControl
*piqc
);
171 //---------------------------------------------------------------
172 HRESULT STDMETHODCALLTYPE
CheckFormat(const AM_MEDIA_TYPE
*pmt
);
173 HRESULT STDMETHODCALLTYPE
CreatePin(const AM_MEDIA_TYPE
*pmt
);
174 HRESULT STDMETHODCALLTYPE
CreatePinHandle(PKSPIN_MEDIUM Medium
, PKSPIN_INTERFACE Interface
, const AM_MEDIA_TYPE
*pmt
);
175 HRESULT STDMETHODCALLTYPE
GetSupportedSets(LPGUID
* pOutGuid
, PULONG NumGuids
);
176 HRESULT STDMETHODCALLTYPE
LoadProxyPlugins(LPGUID pGuids
, ULONG NumGuids
);
177 CInputPin(IBaseFilter
* ParentFilter
, LPCWSTR PinName
, ULONG PinId
, KSPIN_COMMUNICATION Communication
);
178 virtual ~CInputPin(){};
182 IBaseFilter
* m_ParentFilter
;
186 IMemAllocator
* m_MemAllocator
;
188 KSPIN_COMMUNICATION m_Communication
;
189 KSPIN_INTERFACE m_Interface
;
190 KSPIN_MEDIUM m_Medium
;
191 AM_MEDIA_TYPE m_MediaFormat
;
194 IKsInterfaceHandler
* m_InterfaceHandler
;
195 IKsAllocatorEx
* m_KsAllocatorEx
;
196 ULONG m_PipeAllocatorFlag
;
197 BOOL m_bPinBusCacheInitialized
;
200 FRAMING_PROP m_FramingProp
[4];
201 PKSALLOCATOR_FRAMING_EX m_FramingEx
[4];
202 ProxyPluginVector m_Plugins
;
205 CInputPin::CInputPin(
206 IBaseFilter
* ParentFilter
,
209 KSPIN_COMMUNICATION Communication
) : m_Ref(0),
210 m_ParentFilter(ParentFilter
),
212 m_hPin(INVALID_HANDLE_VALUE
),
216 m_Communication(Communication
),
219 m_InterfaceHandler(0),
221 m_PipeAllocatorFlag(0),
222 m_bPinBusCacheInitialized(0),
226 ZeroMemory(m_FramingProp
, sizeof(m_FramingProp
));
227 ZeroMemory(m_FramingEx
, sizeof(m_FramingEx
));
230 IKsObject
* KsObjectParent
;
233 hr
= m_ParentFilter
->QueryInterface(IID_IKsObject
, (LPVOID
*)&KsObjectParent
);
236 hFilter
= KsObjectParent
->KsGetObjectHandle();
239 KsObjectParent
->Release();
242 ZeroMemory(&m_MediaFormat
, sizeof(AM_MEDIA_TYPE
));
243 hr
= KsGetMediaType(0, &m_MediaFormat
, hFilter
, m_PinId
);
249 CInputPin::QueryInterface(
257 if (IsEqualGUID(refiid
, IID_IUnknown
) ||
258 IsEqualGUID(refiid
, IID_IPin
))
260 *Output
= PVOID(this);
261 reinterpret_cast<IUnknown
*>(*Output
)->AddRef();
264 else if (IsEqualGUID(refiid
, IID_IMemInputPin
))
266 if (m_hPin
== INVALID_HANDLE_VALUE
)
268 HRESULT hr
= CreatePin(&m_MediaFormat
);
273 *Output
= (IMemInputPin
*)(this);
274 reinterpret_cast<IMemInputPin
*>(*Output
)->AddRef();
277 else if (IsEqualGUID(refiid
, IID_IKsObject
))
279 *Output
= (IKsObject
*)(this);
280 reinterpret_cast<IKsObject
*>(*Output
)->AddRef();
283 else if (IsEqualGUID(refiid
, IID_IKsPropertySet
))
285 if (m_hPin
== INVALID_HANDLE_VALUE
)
287 HRESULT hr
= CreatePin(&m_MediaFormat
);
292 *Output
= (IKsPropertySet
*)(this);
293 reinterpret_cast<IKsPropertySet
*>(*Output
)->AddRef();
296 else if (IsEqualGUID(refiid
, IID_IKsControl
))
298 *Output
= (IKsControl
*)(this);
299 reinterpret_cast<IKsControl
*>(*Output
)->AddRef();
302 else if (IsEqualGUID(refiid
, IID_IKsPin
) ||
303 IsEqualGUID(refiid
, IID_IKsPinEx
))
305 *Output
= (IKsPinEx
*)(this);
306 reinterpret_cast<IKsPinEx
*>(*Output
)->AddRef();
309 else if (IsEqualGUID(refiid
, IID_IKsPinPipe
))
311 *Output
= (IKsPinPipe
*)(this);
312 reinterpret_cast<IKsPinPipe
*>(*Output
)->AddRef();
315 else if (IsEqualGUID(refiid
, IID_IKsPinFactory
))
317 *Output
= (IKsPinFactory
*)(this);
318 reinterpret_cast<IKsPinFactory
*>(*Output
)->AddRef();
322 else if (IsEqualGUID(refiid
, IID_IStreamBuilder
))
324 *Output
= (IStreamBuilder
*)(this);
325 reinterpret_cast<IStreamBuilder
*>(*Output
)->AddRef();
329 else if (IsEqualGUID(refiid
, IID_IKsAggregateControl
))
331 *Output
= (IKsAggregateControl
*)(this);
332 reinterpret_cast<IKsAggregateControl
*>(*Output
)->AddRef();
335 else if (IsEqualGUID(refiid
, IID_IQualityControl
))
337 *Output
= (IQualityControl
*)(this);
338 reinterpret_cast<IQualityControl
*>(*Output
)->AddRef();
341 else if (IsEqualGUID(refiid
, IID_ISpecifyPropertyPages
))
343 *Output
= (ISpecifyPropertyPages
*)(this);
344 reinterpret_cast<ISpecifyPropertyPages
*>(*Output
)->AddRef();
349 StringFromCLSID(refiid
, &lpstr
);
350 swprintf(Buffer
, L
"CInputPin::QueryInterface: NoInterface for %s\n", lpstr
);
351 OutputDebugStringW(Buffer
);
352 CoTaskMemFree(lpstr
);
354 return E_NOINTERFACE
;
356 //-------------------------------------------------------------------
357 // IQualityControl interface
366 OutputDebugStringW(L
"CInputPin::Notify NotImplemented\n");
375 IQualityControl
*piqc
)
378 OutputDebugStringW(L
"CInputPin::SetSink NotImplemented\n");
385 //-------------------------------------------------------------------
386 // IKsAggregateControl interface
390 CInputPin::KsAddAggregate(
391 IN REFGUID AggregateClass
)
394 OutputDebugStringW(L
"CInputPin::KsAddAggregate NotImplemented\n");
402 CInputPin::KsRemoveAggregate(
403 REFGUID AggregateClass
)
406 OutputDebugStringW(L
"CInputPin::KsRemoveAggregate NotImplemented\n");
412 //-------------------------------------------------------------------
420 IGraphBuilder
*pGraph
)
422 OutputDebugStringW(L
"CInputPin::Render\n");
430 IGraphBuilder
*pGraph
)
433 OutputDebugStringW(L
"CInputPin::Backout\n");
439 //-------------------------------------------------------------------
445 CInputPin::KsPinFactory(
449 OutputDebugStringW(L
"CInputPin::KsPinFactory\n");
452 *PinFactory
= m_PinId
;
456 //-------------------------------------------------------------------
462 CInputPin::KsGetPinFramingCache(
463 PKSALLOCATOR_FRAMING_EX
*FramingEx
,
464 PFRAMING_PROP FramingProp
,
465 FRAMING_CACHE_OPS Option
)
467 if (Option
> Framing_Cache_Write
|| Option
< Framing_Cache_ReadLast
)
473 // get framing properties
474 *FramingProp
= m_FramingProp
[Option
];
475 *FramingEx
= m_FramingEx
[Option
];
482 CInputPin::KsSetPinFramingCache(
483 PKSALLOCATOR_FRAMING_EX FramingEx
,
484 PFRAMING_PROP FramingProp
,
485 FRAMING_CACHE_OPS Option
)
490 if (m_FramingEx
[Option
])
492 for(Index
= 1; Index
< 4; Index
++)
494 if (m_FramingEx
[Index
] == m_FramingEx
[Option
])
500 // existing framing is only used once
501 CoTaskMemFree(m_FramingEx
[Option
]);
506 m_FramingEx
[Option
] = FramingEx
;
507 m_FramingProp
[Option
] = *FramingProp
;
514 CInputPin::KsGetConnectedPin()
521 CInputPin::KsGetPipe(
522 KSPEEKOPERATION Operation
)
524 if (Operation
== KsPeekOperation_AddRef
)
527 m_KsAllocatorEx
->AddRef();
529 return m_KsAllocatorEx
;
534 CInputPin::KsSetPipe(
535 IKsAllocatorEx
*KsAllocator
)
538 KsAllocator
->AddRef();
541 m_KsAllocatorEx
->Release();
543 m_KsAllocatorEx
= KsAllocator
;
549 CInputPin::KsGetPipeAllocatorFlag()
551 return m_PipeAllocatorFlag
;
557 CInputPin::KsSetPipeAllocatorFlag(
560 m_PipeAllocatorFlag
= Flag
;
566 CInputPin::KsGetPinBusCache()
568 if (!m_bPinBusCacheInitialized
)
570 CopyMemory(&m_PinBusCache
, &m_Medium
.Set
, sizeof(GUID
));
571 m_bPinBusCacheInitialized
= TRUE
;
574 return m_PinBusCache
;
579 CInputPin::KsSetPinBusCache(
582 CopyMemory(&m_PinBusCache
, &Bus
, sizeof(GUID
));
588 CInputPin::KsGetPinName()
590 return (PWCHAR
)m_PinName
;
596 CInputPin::KsGetFilterName()
601 //-------------------------------------------------------------------
602 // ISpecifyPropertyPages
607 CInputPin::GetPages(CAUUID
*pPages
)
613 pPages
->pElems
= NULL
;
618 //-------------------------------------------------------------------
625 CInputPin::GetAllocator(IMemAllocator
**ppAllocator
)
628 OutputDebugStringW(L
"CInputPin::GetAllocator\n");
631 return VFW_E_NO_ALLOCATOR
;
636 CInputPin::NotifyAllocator(IMemAllocator
*pAllocator
, BOOL bReadOnly
)
639 ALLOCATOR_PROPERTIES Properties
;
641 hr
= pAllocator
->GetProperties(&Properties
);
645 swprintf(Buffer
, L
"CInputPin::NotifyAllocator hr %lx bReadOnly, %u cbAlign %u cbBuffer %u cbPrefix %u cBuffers %u\n", hr
, bReadOnly
, Properties
.cbAlign
, Properties
.cbBuffer
, Properties
.cbPrefix
, Properties
.cBuffers
);
646 OutputDebugStringW(Buffer
);
651 pAllocator
->AddRef();
656 m_MemAllocator
->Release();
659 m_MemAllocator
= pAllocator
;
660 m_ReadOnly
= bReadOnly
;
666 CInputPin::GetAllocatorRequirements(ALLOCATOR_PROPERTIES
*pProps
)
668 KSALLOCATOR_FRAMING Framing
;
673 Property
.Set
= KSPROPSETID_Connection
;
674 Property
.Id
= KSPROPERTY_CONNECTION_ALLOCATORFRAMING
;
675 Property
.Flags
= KSPROPERTY_TYPE_SET
;
677 hr
= KsProperty(&Property
, sizeof(KSPROPERTY
), (PVOID
)&Framing
, sizeof(KSALLOCATOR_FRAMING
), &BytesReturned
);
680 pProps
->cBuffers
= Framing
.Frames
;
681 pProps
->cbBuffer
= Framing
.FrameSize
;
682 pProps
->cbAlign
= Framing
.FileAlignment
;
683 pProps
->cbPrefix
= 0;
690 swprintf(Buffer
, L
"CInputPin::GetAllocatorRequirements hr %lx m_hPin %p cBuffers %u cbBuffer %u cbAlign %u cbPrefix %u\n", hr
, m_hPin
, pProps
->cBuffers
, pProps
->cbBuffer
, pProps
->cbAlign
, pProps
->cbPrefix
);
691 OutputDebugStringW(Buffer
);
699 CInputPin::Receive(IMediaSample
*pSample
)
702 OutputDebugStringW(L
"CInputPin::Receive NotImplemented\n");
710 CInputPin::ReceiveMultiple(IMediaSample
**pSamples
, long nSamples
, long *nSamplesProcessed
)
713 OutputDebugStringW(L
"CInputPin::ReceiveMultiple NotImplemented\n");
721 CInputPin::ReceiveCanBlock( void)
724 OutputDebugStringW(L
"CInputPin::ReceiveCanBlock NotImplemented\n");
730 //-------------------------------------------------------------------
736 CInputPin::KsQueryMediums(
737 PKSMULTIPLE_ITEM
* MediumList
)
740 IKsObject
* KsObjectParent
;
743 hr
= m_ParentFilter
->QueryInterface(IID_IKsObject
, (LPVOID
*)&KsObjectParent
);
747 hFilter
= KsObjectParent
->KsGetObjectHandle();
749 KsObjectParent
->Release();
754 return KsGetMultiplePinFactoryItems(hFilter
, m_PinId
, KSPROPERTY_PIN_MEDIUMS
, (PVOID
*)MediumList
);
759 CInputPin::KsQueryInterfaces(
760 PKSMULTIPLE_ITEM
* InterfaceList
)
763 IKsObject
* KsObjectParent
;
766 hr
= m_ParentFilter
->QueryInterface(IID_IKsObject
, (LPVOID
*)&KsObjectParent
);
770 hFilter
= KsObjectParent
->KsGetObjectHandle();
772 KsObjectParent
->Release();
777 return KsGetMultiplePinFactoryItems(hFilter
, m_PinId
, KSPROPERTY_PIN_INTERFACES
, (PVOID
*)InterfaceList
);
782 CInputPin::KsCreateSinkPinHandle(
783 KSPIN_INTERFACE
& Interface
,
784 KSPIN_MEDIUM
& Medium
)
786 return CreatePin(&m_MediaFormat
);
791 CInputPin::KsGetCurrentCommunication(
792 KSPIN_COMMUNICATION
*Communication
,
793 KSPIN_INTERFACE
*Interface
,
794 KSPIN_MEDIUM
*Medium
)
798 *Communication
= m_Communication
;
804 return VFW_E_NOT_CONNECTED
;
806 CopyMemory(Interface
, &m_Interface
, sizeof(KSPIN_INTERFACE
));
812 return VFW_E_NOT_CONNECTED
;
814 CopyMemory(Medium
, &m_Medium
, sizeof(KSPIN_MEDIUM
));
821 CInputPin::KsPropagateAcquire()
828 assert(m_hPin
!= INVALID_HANDLE_VALUE
);
830 Property
.Set
= KSPROPSETID_Connection
;
831 Property
.Id
= KSPROPERTY_CONNECTION_STATE
;
832 Property
.Flags
= KSPROPERTY_TYPE_SET
;
834 State
= KSSTATE_ACQUIRE
;
836 hr
= KsProperty(&Property
, sizeof(KSPROPERTY
), (LPVOID
)&State
, sizeof(KSSTATE
), &BytesReturned
);
839 //propagate to connected pin on the pipe
846 CInputPin::KsDeliver(
847 IMediaSample
* Sample
,
855 CInputPin::KsMediaSamplesCompleted(PKSSTREAM_SEGMENT StreamSegment
)
862 CInputPin::KsPeekAllocator(KSPEEKOPERATION Operation
)
864 if (Operation
== KsPeekOperation_AddRef
)
866 // add reference on allocator
867 m_MemAllocator
->AddRef();
870 return m_MemAllocator
;
875 CInputPin::KsReceiveAllocator(IMemAllocator
*MemAllocator
)
880 MemAllocator
->AddRef();
885 m_MemAllocator
->Release();
888 m_MemAllocator
= MemAllocator
;
894 CInputPin::KsRenegotiateAllocator()
901 CInputPin::KsIncrementPendingIoCount()
903 return InterlockedIncrement((volatile LONG
*)&m_IoCount
);
908 CInputPin::KsDecrementPendingIoCount()
910 return InterlockedDecrement((volatile LONG
*)&m_IoCount
);
915 CInputPin::KsQualityNotify(
917 REFERENCE_TIME TimeDelta
)
920 OutputDebugStringW(L
"CInputPin::KsQualityNotify NotImplemented\n");
926 //-------------------------------------------------------------------
932 CInputPin::KsNotifyError(
933 IMediaSample
* Sample
,
937 OutputDebugStringW(L
"CInputPin::KsNotifyError NotImplemented\n");
942 //-------------------------------------------------------------------
947 CInputPin::KsProperty(
948 PKSPROPERTY Property
,
949 ULONG PropertyLength
,
952 ULONG
* BytesReturned
)
954 assert(m_hPin
!= INVALID_HANDLE_VALUE
);
955 return KsSynchronousDeviceControl(m_hPin
, IOCTL_KS_PROPERTY
, (PVOID
)Property
, PropertyLength
, (PVOID
)PropertyData
, DataLength
, BytesReturned
);
965 ULONG
* BytesReturned
)
967 assert(m_hPin
!= INVALID_HANDLE_VALUE
);
968 return KsSynchronousDeviceControl(m_hPin
, IOCTL_KS_METHOD
, (PVOID
)Method
, MethodLength
, (PVOID
)MethodData
, DataLength
, BytesReturned
);
978 ULONG
* BytesReturned
)
980 assert(m_hPin
!= INVALID_HANDLE_VALUE
);
983 return KsSynchronousDeviceControl(m_hPin
, IOCTL_KS_ENABLE_EVENT
, (PVOID
)Event
, EventLength
, (PVOID
)EventData
, DataLength
, BytesReturned
);
985 return KsSynchronousDeviceControl(m_hPin
, IOCTL_KS_DISABLE_EVENT
, (PVOID
)Event
, EventLength
, NULL
, 0, BytesReturned
);
989 //-------------------------------------------------------------------
997 LPVOID pInstanceData
,
998 DWORD cbInstanceData
,
1002 ULONG BytesReturned
;
1006 PKSPROPERTY Property
= (PKSPROPERTY
)CoTaskMemAlloc(sizeof(KSPROPERTY
) + cbInstanceData
);
1008 return E_OUTOFMEMORY
;
1010 Property
->Set
= guidPropSet
;
1011 Property
->Id
= dwPropID
;
1012 Property
->Flags
= KSPROPERTY_TYPE_SET
;
1014 CopyMemory((Property
+1), pInstanceData
, cbInstanceData
);
1016 HRESULT hr
= KsProperty(Property
, sizeof(KSPROPERTY
) + cbInstanceData
, pPropData
, cbPropData
, &BytesReturned
);
1017 CoTaskMemFree(Property
);
1022 KSPROPERTY Property
;
1024 Property
.Set
= guidPropSet
;
1025 Property
.Id
= dwPropID
;
1026 Property
.Flags
= KSPROPERTY_TYPE_SET
;
1028 HRESULT hr
= KsProperty(&Property
, sizeof(KSPROPERTY
), pPropData
, cbPropData
, &BytesReturned
);
1036 REFGUID guidPropSet
,
1038 LPVOID pInstanceData
,
1039 DWORD cbInstanceData
,
1044 ULONG BytesReturned
;
1048 PKSPROPERTY Property
= (PKSPROPERTY
)CoTaskMemAlloc(sizeof(KSPROPERTY
) + cbInstanceData
);
1050 return E_OUTOFMEMORY
;
1052 Property
->Set
= guidPropSet
;
1053 Property
->Id
= dwPropID
;
1054 Property
->Flags
= KSPROPERTY_TYPE_GET
;
1056 CopyMemory((Property
+1), pInstanceData
, cbInstanceData
);
1058 HRESULT hr
= KsProperty(Property
, sizeof(KSPROPERTY
) + cbInstanceData
, pPropData
, cbPropData
, &BytesReturned
);
1059 CoTaskMemFree(Property
);
1064 KSPROPERTY Property
;
1066 Property
.Set
= guidPropSet
;
1067 Property
.Id
= dwPropID
;
1068 Property
.Flags
= KSPROPERTY_TYPE_GET
;
1070 HRESULT hr
= KsProperty(&Property
, sizeof(KSPROPERTY
), pPropData
, cbPropData
, &BytesReturned
);
1077 CInputPin::QuerySupported(
1078 REFGUID guidPropSet
,
1080 DWORD
*pTypeSupport
)
1082 KSPROPERTY Property
;
1083 ULONG BytesReturned
;
1085 Property
.Set
= guidPropSet
;
1086 Property
.Id
= dwPropID
;
1087 Property
.Flags
= KSPROPERTY_TYPE_SETSUPPORT
;
1089 return KsProperty(&Property
, sizeof(KSPROPERTY
), pTypeSupport
, sizeof(DWORD
), &BytesReturned
);
1093 //-------------------------------------------------------------------
1098 CInputPin::KsGetObjectHandle()
1104 //-------------------------------------------------------------------
1109 CInputPin::Connect(IPin
*pReceivePin
, const AM_MEDIA_TYPE
*pmt
)
1111 #ifdef KSPROXY_TRACE
1112 OutputDebugStringW(L
"CInputPin::Connect NotImplemented\n");
1119 CInputPin::ReceiveConnection(IPin
*pConnector
, const AM_MEDIA_TYPE
*pmt
)
1125 // already connected
1126 return VFW_E_ALREADY_CONNECTED
;
1129 // first check format
1130 hr
= CheckFormat(pmt
);
1133 // format is not supported
1137 hr
= CreatePin(pmt
);
1150 CInputPin::Disconnect( void)
1154 // pin was not connected
1159 //check if filter is active
1164 #ifdef KSPROXY_TRACE
1165 OutputDebugStringW(L
"CInputPin::Disconnect\n");
1172 CInputPin::ConnectedTo(IPin
**pPin
)
1179 // increment reference count
1186 return VFW_E_NOT_CONNECTED
;
1190 CInputPin::ConnectionMediaType(AM_MEDIA_TYPE
*pmt
)
1193 return VFW_E_NOT_CONNECTED
;
1195 #ifdef KSPROXY_TRACE
1196 OutputDebugStringW(L
"CInputPin::ConnectionMediaType NotImplemented\n");
1203 CInputPin::QueryPinInfo(PIN_INFO
*pInfo
)
1205 wcscpy(pInfo
->achName
, m_PinName
);
1206 pInfo
->dir
= PINDIR_INPUT
;
1207 pInfo
->pFilter
= m_ParentFilter
;
1208 m_ParentFilter
->AddRef();
1214 CInputPin::QueryDirection(PIN_DIRECTION
*pPinDir
)
1218 *pPinDir
= PINDIR_INPUT
;
1226 CInputPin::QueryId(LPWSTR
*Id
)
1228 *Id
= (LPWSTR
)CoTaskMemAlloc((wcslen(m_PinName
)+1)*sizeof(WCHAR
));
1230 return E_OUTOFMEMORY
;
1232 wcscpy(*Id
, m_PinName
);
1238 CInputPin::QueryAccept(
1239 const AM_MEDIA_TYPE
*pmt
)
1241 return CheckFormat(pmt
);
1245 CInputPin::EnumMediaTypes(IEnumMediaTypes
**ppEnum
)
1248 ULONG MediaTypeCount
= 0, Index
;
1249 AM_MEDIA_TYPE
* MediaTypes
;
1250 IKsObject
* KsObjectParent
;
1253 hr
= m_ParentFilter
->QueryInterface(IID_IKsObject
, (LPVOID
*)&KsObjectParent
);
1257 hFilter
= KsObjectParent
->KsGetObjectHandle();
1259 KsObjectParent
->Release();
1265 // query media type count
1266 hr
= KsGetMediaTypeCount(hFilter
, m_PinId
, &MediaTypeCount
);
1267 if (FAILED(hr
) || !MediaTypeCount
)
1270 // allocate media types
1271 MediaTypes
= (AM_MEDIA_TYPE
*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE
) * MediaTypeCount
);
1274 // not enough memory
1275 return E_OUTOFMEMORY
;
1279 ZeroMemory(MediaTypes
, sizeof(AM_MEDIA_TYPE
) * MediaTypeCount
);
1281 for(Index
= 0; Index
< MediaTypeCount
; Index
++)
1284 hr
= KsGetMediaType(Index
, &MediaTypes
[Index
], hFilter
, m_PinId
);
1288 CoTaskMemFree(MediaTypes
);
1293 return CEnumMediaTypes_fnConstructor(MediaTypeCount
, MediaTypes
, IID_IEnumMediaTypes
, (void**)ppEnum
);
1298 CInputPin::QueryInternalConnections(IPin
**apPin
, ULONG
*nPin
)
1300 #ifdef KSPROXY_TRACE
1301 OutputDebugStringW(L
"CInputPin::QueryInternalConnections NotImplemented\n");
1307 CInputPin::EndOfStream( void)
1309 #ifdef KSPROXY_TRACE
1310 OutputDebugStringW(L
"CInputPin::EndOfStream NotImplemented\n");
1316 CInputPin::BeginFlush( void)
1318 #ifdef KSPROXY_TRACE
1319 OutputDebugStringW(L
"CInputPin::BeginFlush NotImplemented\n");
1325 CInputPin::EndFlush( void)
1327 #ifdef KSPROXY_TRACE
1328 OutputDebugStringW(L
"CInputPin::EndFlush NotImplemented\n");
1334 CInputPin::NewSegment(REFERENCE_TIME tStart
, REFERENCE_TIME tStop
, double dRate
)
1336 #ifdef KSPROXY_TRACE
1337 OutputDebugStringW(L
"CInputPin::NewSegment NotImplemented\n");
1343 //-------------------------------------------------------------------
1346 CInputPin::CheckFormat(
1347 const AM_MEDIA_TYPE
*pmt
)
1349 PKSMULTIPLE_ITEM MultipleItem
;
1350 PKSDATAFORMAT DataFormat
;
1352 IKsObject
* KsObjectParent
;
1358 hr
= m_ParentFilter
->QueryInterface(IID_IKsObject
, (LPVOID
*)&KsObjectParent
);
1362 hFilter
= KsObjectParent
->KsGetObjectHandle();
1364 KsObjectParent
->Release();
1370 hr
= KsGetMultiplePinFactoryItems(hFilter
, m_PinId
, KSPROPERTY_PIN_DATARANGES
, (PVOID
*)&MultipleItem
);
1374 DataFormat
= (PKSDATAFORMAT
)(MultipleItem
+ 1);
1375 for(ULONG Index
= 0; Index
< MultipleItem
->Count
; Index
++)
1377 if (IsEqualGUID(pmt
->majortype
, DataFormat
->MajorFormat
) &&
1378 IsEqualGUID(pmt
->subtype
, DataFormat
->SubFormat
) &&
1379 IsEqualGUID(pmt
->formattype
, DataFormat
->Specifier
))
1381 // format is supported
1382 CoTaskMemFree(MultipleItem
);
1383 #ifdef KSPROXY_TRACE
1384 OutputDebugStringW(L
"CInputPin::CheckFormat format OK\n");
1388 DataFormat
= (PKSDATAFORMAT
)((ULONG_PTR
)DataFormat
+ DataFormat
->FormatSize
);
1390 //format is not supported
1391 CoTaskMemFree(MultipleItem
);
1397 CInputPin::CreatePin(
1398 const AM_MEDIA_TYPE
*pmt
)
1400 PKSMULTIPLE_ITEM MediumList
;
1401 PKSMULTIPLE_ITEM InterfaceList
;
1402 PKSPIN_MEDIUM Medium
;
1403 PKSPIN_INTERFACE Interface
;
1404 IKsInterfaceHandler
* InterfaceHandler
;
1407 // query for pin medium
1408 hr
= KsQueryMediums(&MediumList
);
1412 // query for pin interface
1413 hr
= KsQueryInterfaces(&InterfaceList
);
1417 CoTaskMemFree(MediumList
);
1421 if (MediumList
->Count
)
1423 //use first available medium
1424 Medium
= (PKSPIN_MEDIUM
)(MediumList
+ 1);
1428 // default to standard medium
1429 Medium
= &StandardPinMedium
;
1432 if (InterfaceList
->Count
)
1434 //use first available interface
1435 Interface
= (PKSPIN_INTERFACE
)(InterfaceList
+ 1);
1439 // default to standard interface
1440 Interface
= &StandardPinInterface
;
1443 if (m_Communication
!= KSPIN_COMMUNICATION_BRIDGE
&& m_Communication
!= KSPIN_COMMUNICATION_NONE
)
1445 if (!m_InterfaceHandler
)
1447 // now load the IKsInterfaceHandler plugin
1448 hr
= CoCreateInstance(Interface
->Set
, NULL
, CLSCTX_INPROC_SERVER
, IID_IKsInterfaceHandler
, (void**)&InterfaceHandler
);
1451 // failed to load interface handler plugin
1452 #ifdef KSPROXY_TRACE
1453 OutputDebugStringW(L
"CInputPin::CreatePin failed to load InterfaceHandlerPlugin\n");
1455 CoTaskMemFree(MediumList
);
1456 CoTaskMemFree(InterfaceList
);
1462 hr
= InterfaceHandler
->KsSetPin((IKsPin
*)this);
1465 // failed to load interface handler plugin
1466 #ifdef KSPROXY_TRACE
1467 OutputDebugStringW(L
"CInputPin::CreatePin failed to initialize InterfaceHandlerPlugin\n");
1469 InterfaceHandler
->Release();
1470 CoTaskMemFree(MediumList
);
1471 CoTaskMemFree(InterfaceList
);
1475 // store interface handler
1476 m_InterfaceHandler
= InterfaceHandler
;
1480 hr
= CreatePinHandle(Medium
, Interface
, pmt
);
1483 m_InterfaceHandler
->Release();
1484 m_InterfaceHandler
= InterfaceHandler
;
1489 #ifdef KSPROXY_TRACE
1491 swprintf(Buffer
, L
"CInputPin::CreatePin unexpected communication %u %s\n", m_Communication
, m_PinName
);
1492 OutputDebugStringW(Buffer
);
1497 // free medium / interface / dataformat
1498 CoTaskMemFree(MediumList
);
1499 CoTaskMemFree(InterfaceList
);
1506 CInputPin::CreatePinHandle(
1507 PKSPIN_MEDIUM Medium
,
1508 PKSPIN_INTERFACE Interface
,
1509 const AM_MEDIA_TYPE
*pmt
)
1511 PKSPIN_CONNECT PinConnect
;
1512 PKSDATAFORMAT DataFormat
;
1515 IKsObject
* KsObjectParent
;
1521 hr
= m_ParentFilter
->QueryInterface(IID_IKsObject
, (LPVOID
*)&KsObjectParent
);
1525 hFilter
= KsObjectParent
->KsGetObjectHandle();
1527 KsObjectParent
->Release();
1533 if (m_hPin
!= INVALID_HANDLE_VALUE
)
1535 // pin already exists
1536 //CloseHandle(m_hPin);
1537 //m_hPin = INVALID_HANDLE_VALUE;
1543 Length
= sizeof(KSPIN_CONNECT
) + sizeof(KSDATAFORMAT
) + pmt
->cbFormat
;
1545 // allocate pin connect
1546 PinConnect
= (PKSPIN_CONNECT
)CoTaskMemAlloc(Length
);
1550 return E_OUTOFMEMORY
;
1554 CopyMemory(&PinConnect
->Interface
, Interface
, sizeof(KSPIN_INTERFACE
));
1555 CopyMemory(&PinConnect
->Medium
, Medium
, sizeof(KSPIN_MEDIUM
));
1556 PinConnect
->PinId
= m_PinId
;
1557 PinConnect
->PinToHandle
= NULL
;
1558 PinConnect
->Priority
.PriorityClass
= KSPRIORITY_NORMAL
;
1559 PinConnect
->Priority
.PrioritySubClass
= KSPRIORITY_NORMAL
;
1561 // get dataformat offset
1562 DataFormat
= (PKSDATAFORMAT
)(PinConnect
+ 1);
1565 DataFormat
->FormatSize
= sizeof(KSDATAFORMAT
) + pmt
->cbFormat
;
1566 DataFormat
->Flags
= 0;
1567 DataFormat
->SampleSize
= pmt
->lSampleSize
;
1568 DataFormat
->Reserved
= 0;
1569 CopyMemory(&DataFormat
->MajorFormat
, &pmt
->majortype
, sizeof(GUID
));
1570 CopyMemory(&DataFormat
->SubFormat
, &pmt
->subtype
, sizeof(GUID
));
1571 CopyMemory(&DataFormat
->Specifier
, &pmt
->formattype
, sizeof(GUID
));
1575 // copy extended format
1576 CopyMemory((DataFormat
+ 1), pmt
->pbFormat
, pmt
->cbFormat
);
1580 hr
= KsCreatePin(hFilter
, PinConnect
, GENERIC_WRITE
, &m_hPin
);
1584 // store current interface / medium
1585 CopyMemory(&m_Medium
, Medium
, sizeof(KSPIN_MEDIUM
));
1586 CopyMemory(&m_Interface
, Interface
, sizeof(KSPIN_INTERFACE
));
1587 CopyMemory(&m_MediaFormat
, pmt
, sizeof(AM_MEDIA_TYPE
));
1589 #ifdef KSPROXY_TRACE
1590 LPOLESTR pMajor
, pSub
, pFormat
;
1591 StringFromIID(m_MediaFormat
.majortype
, &pMajor
);
1592 StringFromIID(m_MediaFormat
.subtype
, &pSub
);
1593 StringFromIID(m_MediaFormat
.formattype
, &pFormat
);
1596 swprintf(Buffer
, L
"CInputPin::CreatePinHandle Major %s SubType %s Format %s pbFormat %p cbFormat %u\n", pMajor
, pSub
, pFormat
, pmt
->pbFormat
, pmt
->cbFormat
);
1597 CoTaskMemFree(pMajor
);
1598 CoTaskMemFree(pSub
);
1599 CoTaskMemFree(pFormat
);
1600 OutputDebugStringW(Buffer
);
1605 m_MediaFormat
.pbFormat
= (BYTE
*)CoTaskMemAlloc(pmt
->cbFormat
);
1606 if (!m_MediaFormat
.pbFormat
)
1608 CoTaskMemFree(PinConnect
);
1609 m_MediaFormat
.pbFormat
= NULL
;
1610 m_MediaFormat
.cbFormat
= 0;
1611 return E_OUTOFMEMORY
;
1613 CopyMemory(m_MediaFormat
.pbFormat
, pmt
->pbFormat
, pmt
->cbFormat
);
1619 // get all supported sets
1620 hr
= GetSupportedSets(&pGuid
, &NumGuids
);
1623 #ifdef KSPROXY_TRACE
1624 OutputDebugStringW(L
"CInputPin::CreatePinHandle GetSupportedSets failed\n");
1629 // load all proxy plugins
1630 hr
= LoadProxyPlugins(pGuid
, NumGuids
);
1633 #ifdef KSPROXY_TRACE
1634 OutputDebugStringW(L
"CInputPin::CreatePinHandle LoadProxyPlugins failed\n");
1640 CoTaskMemFree(pGuid
);
1644 // connect pin pipes
1649 CoTaskMemFree(PinConnect
);
1656 CInputPin::GetSupportedSets(
1660 KSPROPERTY Property
;
1662 ULONG NumProperty
= 0;
1663 ULONG NumMethods
= 0;
1664 ULONG NumEvents
= 0;
1666 ULONG BytesReturned
;
1669 Property
.Set
= GUID_NULL
;
1671 Property
.Flags
= KSPROPERTY_TYPE_SETSUPPORT
;
1673 KsSynchronousDeviceControl(m_hPin
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSPROPERTY
), NULL
, 0, &NumProperty
);
1674 KsSynchronousDeviceControl(m_hPin
, IOCTL_KS_METHOD
, (PVOID
)&Property
, sizeof(KSPROPERTY
), NULL
, 0, &NumMethods
);
1675 KsSynchronousDeviceControl(m_hPin
, IOCTL_KS_ENABLE_EVENT
, (PVOID
)&Property
, sizeof(KSPROPERTY
), NULL
, 0, &NumEvents
);
1677 Length
= NumProperty
+ NumMethods
+ NumEvents
;
1681 // allocate guid buffer
1682 pGuid
= (LPGUID
)CoTaskMemAlloc(Length
);
1686 return E_OUTOFMEMORY
;
1689 NumProperty
/= sizeof(GUID
);
1690 NumMethods
/= sizeof(GUID
);
1691 NumEvents
/= sizeof(GUID
);
1693 #ifdef KSPROXY_TRACE
1695 swprintf(Buffer
, L
"CInputPin::GetSupportedSets NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty
, NumMethods
, NumEvents
);
1696 OutputDebugStringW(Buffer
);
1699 // get all properties
1700 hr
= KsSynchronousDeviceControl(m_hPin
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSPROPERTY
), (PVOID
)pGuid
, Length
, &BytesReturned
);
1703 CoTaskMemFree(pGuid
);
1706 Length
-= BytesReturned
;
1709 if (Length
&& NumMethods
)
1711 hr
= KsSynchronousDeviceControl(m_hPin
, IOCTL_KS_METHOD
, (PVOID
)&Property
, sizeof(KSPROPERTY
), (PVOID
)&pGuid
[NumProperty
], Length
, &BytesReturned
);
1714 CoTaskMemFree(pGuid
);
1717 Length
-= BytesReturned
;
1721 if (Length
&& NumEvents
)
1723 hr
= KsSynchronousDeviceControl(m_hPin
, IOCTL_KS_ENABLE_EVENT
, (PVOID
)&Property
, sizeof(KSPROPERTY
), (PVOID
)&pGuid
[NumProperty
+NumMethods
], Length
, &BytesReturned
);
1726 CoTaskMemFree(pGuid
);
1729 Length
-= BytesReturned
;
1733 *NumGuids
= NumProperty
+NumEvents
+NumMethods
;
1739 CInputPin::LoadProxyPlugins(
1747 IUnknown
* pUnknown
;
1749 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE
, L
"SYSTEM\\CurrentControlSet\\Control\\MediaInterfaces", 0, KEY_READ
, &hKey
) != ERROR_SUCCESS
)
1751 OutputDebugStringW(L
"CInputPin::LoadProxyPlugins failed to open MediaInterfaces key\n");
1755 // enumerate all sets
1756 for(Index
= 0; Index
< NumGuids
; Index
++)
1758 // convert to string
1759 hr
= StringFromCLSID(pGuids
[Index
], &pStr
);
1763 // now try open class key
1764 if (RegOpenKeyExW(hKey
, pStr
, 0, KEY_READ
, &hSubKey
) != ERROR_SUCCESS
)
1766 // no plugin for that set exists
1767 CoTaskMemFree(pStr
);
1772 hr
= CoCreateInstance(pGuids
[Index
], (IBaseFilter
*)this, CLSCTX_INPROC_SERVER
, IID_IUnknown
, (void**)&pUnknown
);
1776 m_Plugins
.push_back(pUnknown
);
1779 RegCloseKey(hSubKey
);
1782 // close media interfaces key
1789 CInputPin_Constructor(
1790 IBaseFilter
* ParentFilter
,
1794 KSPIN_COMMUNICATION Communication
,
1798 CInputPin
* handler
= new CInputPin(ParentFilter
, PinName
, PinId
, Communication
);
1801 return E_OUTOFMEMORY
;
1803 if (FAILED(handler
->QueryInterface(riid
, ppv
)))
1807 return E_NOINTERFACE
;