2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS WDM Streaming ActiveMovie Proxy
4 * FILE: dll/directx/ksproxy/proxy.cpp
5 * PURPOSE: IKsProxy interface
7 * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
12 const GUID IID_IPersistPropertyBag
= {0x37D84F60, 0x42CB, 0x11CE, {0x81, 0x35, 0x00, 0xAA, 0x00, 0x4B, 0xB8, 0x51}};
13 const GUID GUID_NULL
= {0x00000000L
, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
14 const GUID IID_ISpecifyPropertyPages
= {0xB196B28B, 0xBAB4, 0x101A, {0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07}};
15 const GUID IID_IPersistStream
= {0x00000109, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}};
16 const GUID KSPROPSETID_MediaSeeking
= {0xEE904F0CL
, 0xD09B, 0x11D0, {0xAB, 0xE9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};
19 const GUID IID_IBDA_DeviceControl
= {0xFD0A5AF3, 0xB41D, 0x11d2, {0x9C, 0x95, 0x00, 0xC0, 0x4F, 0x79, 0x71, 0xE0}};
20 const GUID IID_IKsAggregateControl
= {0x7F40EAC0, 0x3947, 0x11D2, {0x87, 0x4E, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};
21 const GUID IID_IKsClockPropertySet
= {0x5C5CBD84, 0xE755, 0x11D0, {0xAC, 0x18, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};
22 const GUID IID_IKsTopology
= {0x28F54683, 0x06FD, 0x11D2, {0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};
25 Needs IKsClock, IKsNotifyEvent
28 class CKsProxy
: public IBaseFilter
,
30 public IPersistPropertyBag
,
32 public IPersistStream
,
33 public IAMDeviceRemoval
,
34 public ISpecifyPropertyPages
,
35 public IReferenceClock
,
37 public IKsPropertySet
,
38 public IKsClockPropertySet
,
39 public IAMFilterMiscFlags
,
42 public IKsAggregateControl
46 typedef std::vector
<IUnknown
*>ProxyPluginVector
;
47 typedef std::vector
<IPin
*> PinVector
;
49 STDMETHODIMP
QueryInterface( REFIID InterfaceId
, PVOID
* Interface
);
51 STDMETHODIMP_(ULONG
) AddRef()
53 InterlockedIncrement(&m_Ref
);
56 STDMETHODIMP_(ULONG
) Release()
58 InterlockedDecrement(&m_Ref
);
67 // IBaseFilter methods
68 HRESULT STDMETHODCALLTYPE
GetClassID(CLSID
*pClassID
);
69 HRESULT STDMETHODCALLTYPE
Stop( void);
70 HRESULT STDMETHODCALLTYPE
Pause( void);
71 HRESULT STDMETHODCALLTYPE
Run(REFERENCE_TIME tStart
);
72 HRESULT STDMETHODCALLTYPE
GetState(DWORD dwMilliSecsTimeout
, FILTER_STATE
*State
);
73 HRESULT STDMETHODCALLTYPE
SetSyncSource(IReferenceClock
*pClock
);
74 HRESULT STDMETHODCALLTYPE
GetSyncSource(IReferenceClock
**pClock
);
75 HRESULT STDMETHODCALLTYPE
EnumPins(IEnumPins
**ppEnum
);
76 HRESULT STDMETHODCALLTYPE
FindPin(LPCWSTR Id
, IPin
**ppPin
);
77 HRESULT STDMETHODCALLTYPE
QueryFilterInfo(FILTER_INFO
*pInfo
);
78 HRESULT STDMETHODCALLTYPE
JoinFilterGraph(IFilterGraph
*pGraph
, LPCWSTR pName
);
79 HRESULT STDMETHODCALLTYPE
QueryVendorInfo(LPWSTR
*pVendorInfo
);
82 HRESULT STDMETHODCALLTYPE
GetTime(REFERENCE_TIME
*pTime
);
83 HRESULT STDMETHODCALLTYPE
AdviseTime(REFERENCE_TIME baseTime
, REFERENCE_TIME streamTime
, HEVENT hEvent
, DWORD_PTR
*pdwAdviseCookie
);
84 HRESULT STDMETHODCALLTYPE
AdvisePeriodic(REFERENCE_TIME startTime
, REFERENCE_TIME periodTime
, HSEMAPHORE hSemaphore
, DWORD_PTR
*pdwAdviseCookie
);
85 HRESULT STDMETHODCALLTYPE
Unadvise(DWORD_PTR dwAdviseCookie
);
88 HRESULT STDMETHODCALLTYPE
GetCapabilities(DWORD
*pCapabilities
);
89 HRESULT STDMETHODCALLTYPE
CheckCapabilities(DWORD
*pCapabilities
);
90 HRESULT STDMETHODCALLTYPE
IsFormatSupported(const GUID
*pFormat
);
91 HRESULT STDMETHODCALLTYPE
QueryPreferredFormat(GUID
*pFormat
);
92 HRESULT STDMETHODCALLTYPE
GetTimeFormat(GUID
*pFormat
);
93 HRESULT STDMETHODCALLTYPE
IsUsingTimeFormat(const GUID
*pFormat
);
94 HRESULT STDMETHODCALLTYPE
SetTimeFormat(const GUID
*pFormat
);
95 HRESULT STDMETHODCALLTYPE
GetDuration(LONGLONG
*pDuration
);
96 HRESULT STDMETHODCALLTYPE
GetStopPosition(LONGLONG
*pStop
);
97 HRESULT STDMETHODCALLTYPE
GetCurrentPosition(LONGLONG
*pCurrent
);
98 HRESULT STDMETHODCALLTYPE
ConvertTimeFormat(LONGLONG
*pTarget
, const GUID
*pTargetFormat
, LONGLONG Source
, const GUID
*pSourceFormat
);
99 HRESULT STDMETHODCALLTYPE
SetPositions(LONGLONG
*pCurrent
, DWORD dwCurrentFlags
, LONGLONG
*pStop
, DWORD dwStopFlags
);
100 HRESULT STDMETHODCALLTYPE
GetPositions(LONGLONG
*pCurrent
, LONGLONG
*pStop
);
101 HRESULT STDMETHODCALLTYPE
GetAvailable(LONGLONG
*pEarliest
, LONGLONG
*pLatest
);
102 HRESULT STDMETHODCALLTYPE
SetRate(double dRate
);
103 HRESULT STDMETHODCALLTYPE
GetRate(double *pdRate
);
104 HRESULT STDMETHODCALLTYPE
GetPreroll(LONGLONG
*pllPreroll
);
107 HRESULT STDMETHODCALLTYPE
Set(REFGUID guidPropSet
, DWORD dwPropID
, LPVOID pInstanceData
, DWORD cbInstanceData
, LPVOID pPropData
, DWORD cbPropData
);
108 HRESULT STDMETHODCALLTYPE
Get(REFGUID guidPropSet
, DWORD dwPropID
, LPVOID pInstanceData
, DWORD cbInstanceData
, LPVOID pPropData
, DWORD cbPropData
, DWORD
*pcbReturned
);
109 HRESULT STDMETHODCALLTYPE
QuerySupported(REFGUID guidPropSet
, DWORD dwPropID
, DWORD
*pTypeSupport
);
112 ULONG STDMETHODCALLTYPE
GetMiscFlags( void);
115 HRESULT STDMETHODCALLTYPE
KsProperty(PKSPROPERTY Property
, ULONG PropertyLength
, LPVOID PropertyData
, ULONG DataLength
, ULONG
* BytesReturned
);
116 HRESULT STDMETHODCALLTYPE
KsMethod(PKSMETHOD Method
, ULONG MethodLength
, LPVOID MethodData
, ULONG DataLength
, ULONG
* BytesReturned
);
117 HRESULT STDMETHODCALLTYPE
KsEvent(PKSEVENT Event
, ULONG EventLength
, LPVOID EventData
, ULONG DataLength
, ULONG
* BytesReturned
);
120 HRESULT STDMETHODCALLTYPE
CreateNodeInstance(ULONG NodeId
, ULONG Flags
, ACCESS_MASK DesiredAccess
, IUnknown
* UnkOuter
, REFGUID InterfaceId
, LPVOID
* Interface
);
122 //IKsAggregateControl
123 HRESULT STDMETHODCALLTYPE
KsAddAggregate(IN REFGUID AggregateClass
);
124 HRESULT STDMETHODCALLTYPE
KsRemoveAggregate(REFGUID AggregateClass
);
126 //IKsClockPropertySet
127 HRESULT STDMETHODCALLTYPE
KsGetTime(LONGLONG
* Time
);
128 HRESULT STDMETHODCALLTYPE
KsSetTime(LONGLONG Time
);
129 HRESULT STDMETHODCALLTYPE
KsGetPhysicalTime(LONGLONG
* Time
);
130 HRESULT STDMETHODCALLTYPE
KsSetPhysicalTime(LONGLONG Time
);
131 HRESULT STDMETHODCALLTYPE
KsGetCorrelatedTime(KSCORRELATED_TIME
* CorrelatedTime
);
132 HRESULT STDMETHODCALLTYPE
KsSetCorrelatedTime(KSCORRELATED_TIME
* CorrelatedTime
);
133 HRESULT STDMETHODCALLTYPE
KsGetCorrelatedPhysicalTime(KSCORRELATED_TIME
* CorrelatedTime
);
134 HRESULT STDMETHODCALLTYPE
KsSetCorrelatedPhysicalTime(KSCORRELATED_TIME
* CorrelatedTime
);
135 HRESULT STDMETHODCALLTYPE
KsGetResolution(KSRESOLUTION
* Resolution
);
136 HRESULT STDMETHODCALLTYPE
KsGetState(KSSTATE
* State
);
139 //IAMovieSetup methods
140 HRESULT STDMETHODCALLTYPE
Register( void);
141 HRESULT STDMETHODCALLTYPE
Unregister( void);
143 // IPersistPropertyBag methods
144 HRESULT STDMETHODCALLTYPE
InitNew( void);
145 HRESULT STDMETHODCALLTYPE
Load(IPropertyBag
*pPropBag
, IErrorLog
*pErrorLog
);
146 HRESULT STDMETHODCALLTYPE
Save(IPropertyBag
*pPropBag
, BOOL fClearDirty
, BOOL fSaveAllProperties
);
149 HANDLE STDMETHODCALLTYPE
KsGetObjectHandle();
152 HRESULT STDMETHODCALLTYPE
DeviceInfo(CLSID
*pclsidInterfaceClass
, LPWSTR
*pwszSymbolicLink
);
153 HRESULT STDMETHODCALLTYPE
Reassociate(void);
154 HRESULT STDMETHODCALLTYPE
Disassociate( void);
157 HRESULT STDMETHODCALLTYPE
IsDirty( void);
158 HRESULT STDMETHODCALLTYPE
Load(IStream
*pStm
);
159 HRESULT STDMETHODCALLTYPE
Save(IStream
*pStm
, BOOL fClearDirty
);
160 HRESULT STDMETHODCALLTYPE
GetSizeMax(ULARGE_INTEGER
*pcbSize
);
162 // ISpecifyPropertyPages
163 HRESULT STDMETHODCALLTYPE
GetPages(CAUUID
*pPages
);
166 CKsProxy() : m_Ref(0), m_pGraph(0), m_ReferenceClock(0), m_FilterState(State_Stopped
), m_hDevice(0), m_Plugins(), m_Pins(), m_DevicePath(0) {};
170 CloseHandle(m_hDevice
);
173 HRESULT STDMETHODCALLTYPE
GetSupportedSets(LPGUID
* pOutGuid
, PULONG NumGuids
);
174 HRESULT STDMETHODCALLTYPE
LoadProxyPlugins(LPGUID pGuids
, ULONG NumGuids
);
175 HRESULT STDMETHODCALLTYPE
GetNumberOfPins(PULONG NumPins
);
176 HRESULT STDMETHODCALLTYPE
GetPinInstanceCount(ULONG PinId
, PKSPIN_CINSTANCES Instances
);
177 HRESULT STDMETHODCALLTYPE
GetPinDataflow(ULONG PinId
, KSPIN_DATAFLOW
* DataFlow
);
178 HRESULT STDMETHODCALLTYPE
GetPinName(ULONG PinId
, KSPIN_DATAFLOW DataFlow
, ULONG PinCount
, LPWSTR
* OutPinName
);
179 HRESULT STDMETHODCALLTYPE
GetPinCommunication(ULONG PinId
, KSPIN_COMMUNICATION
* Communication
);
180 HRESULT STDMETHODCALLTYPE
CreatePins();
183 IFilterGraph
*m_pGraph
;
184 IReferenceClock
* m_ReferenceClock
;
185 FILTER_STATE m_FilterState
;
187 ProxyPluginVector m_Plugins
;
190 CLSID m_DeviceInterfaceGUID
;
195 CKsProxy::QueryInterface(
199 *Output
= (PVOID
)0xDEADDEAD;//NULL;
201 if (IsEqualGUID(refiid
, IID_IUnknown
) ||
202 IsEqualGUID(refiid
, IID_IBaseFilter
))
204 *Output
= PVOID(this);
205 reinterpret_cast<IUnknown
*>(*Output
)->AddRef();
208 else if (IsEqualGUID(refiid
, IID_IPersistPropertyBag
))
210 *Output
= (IPersistPropertyBag
*)(this);
211 reinterpret_cast<IPersistPropertyBag
*>(*Output
)->AddRef();
214 else if (IsEqualGUID(refiid
, IID_IAMDeviceRemoval
))
216 *Output
= (IAMDeviceRemoval
*)(this);
217 reinterpret_cast<IAMDeviceRemoval
*>(*Output
)->AddRef();
220 else if (IsEqualGUID(refiid
, IID_IPersistStream
))
222 *Output
= (IPersistStream
*)(this);
223 reinterpret_cast<IPersistStream
*>(*Output
)->AddRef();
226 else if (IsEqualGUID(refiid
, IID_IKsObject
))
228 *Output
= (IKsObject
*)(this);
229 reinterpret_cast<IKsObject
*>(*Output
)->AddRef();
232 else if (IsEqualGUID(refiid
, IID_IReferenceClock
))
234 *Output
= (IReferenceClock
*)(this);
235 reinterpret_cast<IReferenceClock
*>(*Output
)->AddRef();
238 else if (IsEqualGUID(refiid
, IID_IMediaSeeking
))
240 *Output
= (IMediaSeeking
*)(this);
241 reinterpret_cast<IMediaSeeking
*>(*Output
)->AddRef();
244 else if (IsEqualGUID(refiid
, IID_IAMFilterMiscFlags
))
246 *Output
= (IAMFilterMiscFlags
*)(this);
247 reinterpret_cast<IAMFilterMiscFlags
*>(*Output
)->AddRef();
250 else if (IsEqualGUID(refiid
, IID_IKsControl
))
252 *Output
= (IKsControl
*)(this);
253 reinterpret_cast<IKsControl
*>(*Output
)->AddRef();
256 else if (IsEqualGUID(refiid
, IID_IKsPropertySet
))
258 *Output
= (IKsPropertySet
*)(this);
259 reinterpret_cast<IKsPropertySet
*>(*Output
)->AddRef();
262 else if (IsEqualGUID(refiid
, IID_IKsTopology
))
264 *Output
= (IKsTopology
*)(this);
265 reinterpret_cast<IKsTopology
*>(*Output
)->AddRef();
268 else if (IsEqualGUID(refiid
, IID_IKsAggregateControl
))
270 *Output
= (IKsAggregateControl
*)(this);
271 reinterpret_cast<IKsAggregateControl
*>(*Output
)->AddRef();
274 else if (IsEqualGUID(refiid
, IID_IKsClockPropertySet
))
276 *Output
= (IKsClockPropertySet
*)(this);
277 reinterpret_cast<IKsClockPropertySet
*>(*Output
)->AddRef();
280 else if (IsEqualGUID(refiid
, IID_ISpecifyPropertyPages
))
282 *Output
= (ISpecifyPropertyPages
*)(this);
283 reinterpret_cast<ISpecifyPropertyPages
*>(*Output
)->AddRef();
287 for(ULONG Index
= 0; Index
< m_Plugins
.size(); Index
++)
291 HRESULT hr
= m_Plugins
[Index
]->QueryInterface(refiid
, Output
);
296 StringFromCLSID(refiid
, &lpstr
);
297 swprintf(Buffer
, L
"CKsProxy::QueryInterface plugin %lu supports interface %s\n", Index
, lpstr
);
298 OutputDebugStringW(Buffer
);
299 CoTaskMemFree(lpstr
);
305 WCHAR Buffer
[MAX_PATH
];
307 StringFromCLSID(refiid
, &lpstr
);
308 swprintf(Buffer
, L
"CKsProxy::QueryInterface: NoInterface for %s !!!\n", lpstr
);
309 OutputDebugStringW(Buffer
);
310 CoTaskMemFree(lpstr
);
313 return E_NOINTERFACE
;
316 //-------------------------------------------------------------------
317 // ISpecifyPropertyPages
322 CKsProxy::GetPages(CAUUID
*pPages
)
324 OutputDebugStringW(L
"CKsProxy::GetPages NotImplemented\n");
330 pPages
->pElems
= NULL
;
335 //-------------------------------------------------------------------
336 // IKsClockPropertySet interface
343 OutputDebugStringW(L
"CKsProxy::KsGetTime NotImplemented\n");
352 OutputDebugStringW(L
"CKsProxy::KsSetTime NotImplemented\n");
358 CKsProxy::KsGetPhysicalTime(
361 OutputDebugStringW(L
"CKsProxy::KsGetPhysicalTime NotImplemented\n");
367 CKsProxy::KsSetPhysicalTime(
370 OutputDebugStringW(L
"CKsProxy::KsSetPhysicalTime NotImplemented\n");
376 CKsProxy::KsGetCorrelatedTime(
377 KSCORRELATED_TIME
* CorrelatedTime
)
379 OutputDebugStringW(L
"CKsProxy::KsGetCorrelatedTime NotImplemented\n");
385 CKsProxy::KsSetCorrelatedTime(
386 KSCORRELATED_TIME
* CorrelatedTime
)
388 OutputDebugStringW(L
"CKsProxy::KsSetCorrelatedTime NotImplemented\n");
394 CKsProxy::KsGetCorrelatedPhysicalTime(
395 KSCORRELATED_TIME
* CorrelatedTime
)
397 OutputDebugStringW(L
"CKsProxy::KsGetCorrelatedPhysicalTime NotImplemented\n");
403 CKsProxy::KsSetCorrelatedPhysicalTime(
404 KSCORRELATED_TIME
* CorrelatedTime
)
406 OutputDebugStringW(L
"CKsProxy::KsSetCorrelatedPhysicalTime NotImplemented\n");
412 CKsProxy::KsGetResolution(
413 KSRESOLUTION
* Resolution
)
415 OutputDebugStringW(L
"CKsProxy::KsGetResolution NotImplemented\n");
421 CKsProxy::KsGetState(
424 OutputDebugStringW(L
"CKsProxy::KsGetState NotImplemented\n");
428 //-------------------------------------------------------------------
429 // IReferenceClock interface
434 REFERENCE_TIME
*pTime
)
436 OutputDebugStringW(L
"CKsProxy::GetTime NotImplemented\n");
442 CKsProxy::AdviseTime(
443 REFERENCE_TIME baseTime
,
444 REFERENCE_TIME streamTime
,
446 DWORD_PTR
*pdwAdviseCookie
)
448 OutputDebugStringW(L
"CKsProxy::AdviseTime NotImplemented\n");
454 CKsProxy::AdvisePeriodic(
455 REFERENCE_TIME startTime
,
456 REFERENCE_TIME periodTime
,
457 HSEMAPHORE hSemaphore
,
458 DWORD_PTR
*pdwAdviseCookie
)
460 OutputDebugStringW(L
"CKsProxy::AdvisePeriodic NotImplemented\n");
467 DWORD_PTR dwAdviseCookie
)
469 OutputDebugStringW(L
"CKsProxy::Unadvise NotImplemented\n");
473 //-------------------------------------------------------------------
474 // IMediaSeeking interface
478 CKsProxy::GetCapabilities(
479 DWORD
*pCapabilities
)
481 OutputDebugStringW(L
"CKsProxy::GetCapabilities NotImplemented\n");
487 CKsProxy::CheckCapabilities(
488 DWORD
*pCapabilities
)
490 OutputDebugStringW(L
"CKsProxy::CheckCapabilities NotImplemented\n");
496 CKsProxy::IsFormatSupported(
500 PKSMULTIPLE_ITEM FormatList
;
503 HRESULT hr
= S_FALSE
;
506 OutputDebugStringW(L
"CKsProxy::IsFormatSupported\n");
511 Property
.Set
= KSPROPSETID_MediaSeeking
;
512 Property
.Id
= KSPROPERTY_MEDIASEEKING_FORMATS
;
513 Property
.Flags
= KSPROPERTY_TYPE_GET
;
515 // query for format size list
516 hr
= KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSPROPERTY
), NULL
, 0, &BytesReturned
);
518 if (hr
== MAKE_HRESULT(SEVERITY_ERROR
, FACILITY_WIN32
, ERROR_MORE_DATA
))
520 // allocate format list
521 FormatList
= (PKSMULTIPLE_ITEM
)CoTaskMemAlloc(BytesReturned
);
525 return E_OUTOFMEMORY
;
529 hr
= KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSPROPERTY
), (PVOID
)FormatList
, BytesReturned
, &BytesReturned
);
532 // failed to query format list
533 CoTaskMemFree(FormatList
);
537 //iterate through format list
538 pGuid
= (LPGUID
)(FormatList
+ 1);
539 for(Index
= 0; Index
< FormatList
->Count
; Index
++)
541 if (IsEqualGUID(*pGuid
, *pFormat
))
543 OutputDebugStringW(L
"CKsProxy::IsFormatSupported found format\n");
544 CoTaskMemFree(FormatList
);
550 OutputDebugStringW(L
"CKsProxy::IsFormatSupported FormatNotFound\n");
552 CoTaskMemFree(FormatList
);
555 // check if all plugins support it
556 for(Index
= 0; Index
< m_Plugins
.size(); Index
++)
559 IUnknown
* Plugin
= m_Plugins
[Index
];
564 // query for IMediaSeeking interface
565 IMediaSeeking
*pSeek
= NULL
;
566 hr
= Plugin
->QueryInterface(IID_IMediaSeeking
, (void**)&pSeek
);
569 // plugin does not support interface
571 OutputDebugStringW(L
"CKsProxy::IsFormatSupported plugin does not support IMediaSeeking interface\n");
575 // query if it is supported
576 hr
= pSeek
->IsFormatSupported(pFormat
);
580 if (FAILED(hr
) || hr
== S_FALSE
)
589 CKsProxy::QueryPreferredFormat(
592 OutputDebugStringW(L
"CKsProxy::QueryPreferredFormat NotImplemented\n");
598 CKsProxy::GetTimeFormat(
601 OutputDebugStringW(L
"CKsProxy::GetTimeFormat NotImplemented\n");
607 CKsProxy::IsUsingTimeFormat(
610 OutputDebugStringW(L
"CKsProxy::IsUsingTimeFormat NotImplemented\n");
616 CKsProxy::SetTimeFormat(
619 OutputDebugStringW(L
"CKsProxy::SetTimeFormat NotImplemented\n");
625 CKsProxy::GetDuration(
628 OutputDebugStringW(L
"CKsProxy::GetDuration NotImplemented\n");
634 CKsProxy::GetStopPosition(
637 OutputDebugStringW(L
"CKsProxy::GetStopPosition NotImplemented\n");
643 CKsProxy::GetCurrentPosition(
646 OutputDebugStringW(L
"CKsProxy::GetCurrentPosition NotImplemented\n");
652 CKsProxy::ConvertTimeFormat(
654 const GUID
*pTargetFormat
,
656 const GUID
*pSourceFormat
)
658 OutputDebugStringW(L
"CKsProxy::ConvertTimeFormat NotImplemented\n");
664 CKsProxy::SetPositions(
666 DWORD dwCurrentFlags
,
670 OutputDebugStringW(L
"CKsProxy::SetPositions NotImplemented\n");
676 CKsProxy::GetPositions(
680 OutputDebugStringW(L
"CKsProxy::GetPositions NotImplemented\n");
686 CKsProxy::GetAvailable(
690 OutputDebugStringW(L
"CKsProxy::GetAvailable NotImplemented\n");
699 OutputDebugStringW(L
"CKsProxy::SetRate NotImplemented\n");
708 OutputDebugStringW(L
"CKsProxy::GetRate NotImplemented\n");
714 CKsProxy::GetPreroll(
715 LONGLONG
*pllPreroll
)
717 OutputDebugStringW(L
"CKsProxy::GetPreroll NotImplemented\n");
721 //-------------------------------------------------------------------
722 // IAMFilterMiscFlags interface
727 CKsProxy::GetMiscFlags()
732 PIN_DIRECTION PinDirection
;
733 KSPIN_COMMUNICATION Communication
;
735 for(Index
= 0; Index
< m_Pins
.size(); Index
++)
738 IPin
* pin
= m_Pins
[Index
];
740 hr
= pin
->QueryDirection(&PinDirection
);
743 if (PinDirection
== PINDIR_INPUT
)
745 if (SUCCEEDED(GetPinCommunication(Index
, //FIXME verify PinId
748 if (Communication
== KSPIN_COMMUNICATION_NONE
|| Communication
== KSPIN_COMMUNICATION_BRIDGE
)
750 Flags
|= AM_FILTER_MISC_FLAGS_IS_SOURCE
;
757 OutputDebugStringW(L
"CKsProxy::GetMiscFlags stub\n");
761 //-------------------------------------------------------------------
766 CKsProxy::KsProperty(
767 PKSPROPERTY Property
,
768 ULONG PropertyLength
,
771 ULONG
* BytesReturned
)
773 assert(m_hDevice
!= 0);
774 return KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_PROPERTY
, (PVOID
)Property
, PropertyLength
, (PVOID
)PropertyData
, DataLength
, BytesReturned
);
784 ULONG
* BytesReturned
)
786 assert(m_hDevice
!= 0);
787 return KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_METHOD
, (PVOID
)Method
, MethodLength
, (PVOID
)MethodData
, DataLength
, BytesReturned
);
797 ULONG
* BytesReturned
)
799 assert(m_hDevice
!= 0);
802 return KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_ENABLE_EVENT
, (PVOID
)Event
, EventLength
, (PVOID
)EventData
, DataLength
, BytesReturned
);
804 return KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_DISABLE_EVENT
, (PVOID
)Event
, EventLength
, NULL
, 0, BytesReturned
);
808 //-------------------------------------------------------------------
816 LPVOID pInstanceData
,
817 DWORD cbInstanceData
,
825 PKSPROPERTY Property
= (PKSPROPERTY
)CoTaskMemAlloc(sizeof(KSPROPERTY
) + cbInstanceData
);
827 return E_OUTOFMEMORY
;
829 Property
->Set
= guidPropSet
;
830 Property
->Id
= dwPropID
;
831 Property
->Flags
= KSPROPERTY_TYPE_SET
;
833 CopyMemory((Property
+1), pInstanceData
, cbInstanceData
);
835 HRESULT hr
= KsProperty(Property
, sizeof(KSPROPERTY
) + cbInstanceData
, pPropData
, cbPropData
, &BytesReturned
);
836 CoTaskMemFree(Property
);
843 Property
.Set
= guidPropSet
;
844 Property
.Id
= dwPropID
;
845 Property
.Flags
= KSPROPERTY_TYPE_SET
;
847 HRESULT hr
= KsProperty(&Property
, sizeof(KSPROPERTY
), pPropData
, cbPropData
, &BytesReturned
);
857 LPVOID pInstanceData
,
858 DWORD cbInstanceData
,
867 PKSPROPERTY Property
= (PKSPROPERTY
)CoTaskMemAlloc(sizeof(KSPROPERTY
) + cbInstanceData
);
869 return E_OUTOFMEMORY
;
871 Property
->Set
= guidPropSet
;
872 Property
->Id
= dwPropID
;
873 Property
->Flags
= KSPROPERTY_TYPE_GET
;
875 CopyMemory((Property
+1), pInstanceData
, cbInstanceData
);
877 HRESULT hr
= KsProperty(Property
, sizeof(KSPROPERTY
) + cbInstanceData
, pPropData
, cbPropData
, &BytesReturned
);
878 CoTaskMemFree(Property
);
885 Property
.Set
= guidPropSet
;
886 Property
.Id
= dwPropID
;
887 Property
.Flags
= KSPROPERTY_TYPE_GET
;
889 HRESULT hr
= KsProperty(&Property
, sizeof(KSPROPERTY
), pPropData
, cbPropData
, &BytesReturned
);
896 CKsProxy::QuerySupported(
904 Property
.Set
= guidPropSet
;
905 Property
.Id
= dwPropID
;
906 Property
.Flags
= KSPROPERTY_TYPE_SETSUPPORT
;
908 return KsProperty(&Property
, sizeof(KSPROPERTY
), pTypeSupport
, sizeof(DWORD
), &BytesReturned
);
912 //-------------------------------------------------------------------
913 // IKsTopology interface
917 CKsProxy::CreateNodeInstance(
920 ACCESS_MASK DesiredAccess
,
925 OutputDebugStringW(L
"CKsProxy::CreateNodeInstance NotImplemented\n");
929 //-------------------------------------------------------------------
930 // IKsAggregateControl interface
934 CKsProxy::KsAddAggregate(
935 IN REFGUID AggregateClass
)
937 OutputDebugStringW(L
"CKsProxy::KsAddAggregate NotImplemented\n");
943 CKsProxy::KsRemoveAggregate(
944 REFGUID AggregateClass
)
946 OutputDebugStringW(L
"CKsProxy::KsRemoveAggregate NotImplemented\n");
951 //-------------------------------------------------------------------
952 // IPersistStream interface
959 OutputDebugStringW(L
"CKsProxy::IsDirty Notimplemented\n");
971 AM_MEDIA_TYPE MediaType
;
976 LPOLESTR pMajor
, pSub
, pFormat
;
978 OutputDebugStringW(L
"CKsProxy::Load\n");
981 ULONG Version
= ReadInt(pStm
, hr
);
986 hr
= pStm
->Read(&Length
, sizeof(ULONG
), &BytesReturned
);
987 swprintf(Buffer
, L
"Length hr %x hr length %lu\n", hr
, Length
);
988 OutputDebugStringW(Buffer
);
992 hr
= pStm
->Read(&PinId
, sizeof(ULONG
), &BytesReturned
);
993 swprintf(Buffer
, L
"Read: hr %08x PinId %lx BytesReturned %lu\n", hr
, PinId
, BytesReturned
);
994 OutputDebugStringW(Buffer
);
996 if (FAILED(hr
) || !BytesReturned
)
999 Length
-= BytesReturned
;
1001 hr
= pStm
->Read(&MediaType
, sizeof(AM_MEDIA_TYPE
), &BytesReturned
);
1002 if (FAILED(hr
) || BytesReturned
!= sizeof(AM_MEDIA_TYPE
))
1004 swprintf(Buffer
, L
"Read failed with %lx\n", hr
);
1005 OutputDebugStringW(Buffer
);
1010 StringFromIID(MediaType
.majortype
, &pMajor
);
1011 StringFromIID(MediaType
.subtype
, &pSub
);
1012 StringFromIID(MediaType
.formattype
, &pFormat
);
1014 swprintf(Buffer
, L
"BytesReturned %lu majortype %s subtype %s bFixedSizeSamples %u bTemporalCompression %u lSampleSize %u formattype %s, pUnk %p cbFormat %u pbFormat %p\n", BytesReturned
, pMajor
, pSub
, MediaType
.bFixedSizeSamples
, MediaType
.bTemporalCompression
, MediaType
.lSampleSize
, pFormat
, MediaType
.pUnk
, MediaType
.cbFormat
, MediaType
.pbFormat
);
1015 OutputDebugStringW(Buffer
);
1017 Length
-= BytesReturned
;
1020 if (MediaType
.cbFormat
)
1022 MediaType
.pbFormat
= (BYTE
*)CoTaskMemAlloc(MediaType
.cbFormat
);
1023 if (!MediaType
.pbFormat
)
1024 return E_OUTOFMEMORY
;
1026 hr
= pStm
->Read(&MediaType
.pbFormat
, sizeof(MediaType
.cbFormat
), &BytesReturned
);
1029 swprintf(Buffer
, L
"ReadFormat failed with %lx\n", hr
);
1030 OutputDebugStringW(Buffer
);
1033 Length
-= BytesReturned
;
1048 OutputDebugStringW(L
"CKsProxy::Save Notimplemented\n");
1054 CKsProxy::GetSizeMax(
1055 ULARGE_INTEGER
*pcbSize
)
1057 OutputDebugStringW(L
"CKsProxy::GetSizeMax Notimplemented\n");
1062 //-------------------------------------------------------------------
1063 // IAMDeviceRemoval interface
1068 CKsProxy::DeviceInfo(CLSID
*pclsidInterfaceClass
, LPWSTR
*pwszSymbolicLink
)
1072 // object not initialized
1073 return MAKE_HRESULT(SEVERITY_ERROR
, FACILITY_WIN32
, ERROR_FILE_NOT_FOUND
);
1076 // copy device interface guid
1077 CopyMemory(pclsidInterfaceClass
, &m_DeviceInterfaceGUID
, sizeof(GUID
));
1079 if (pwszSymbolicLink
)
1081 *pwszSymbolicLink
= (LPWSTR
)CoTaskMemAlloc((wcslen(m_DevicePath
)+1) * sizeof(WCHAR
));
1082 if (!*pwszSymbolicLink
)
1083 return E_OUTOFMEMORY
;
1085 wcscpy(*pwszSymbolicLink
, m_DevicePath
);
1091 CKsProxy::Reassociate(void)
1093 if (!m_DevicePath
|| m_hDevice
)
1095 // file path not available
1096 return MAKE_HRESULT(SEVERITY_ERROR
, FACILITY_WIN32
, ERROR_FILE_NOT_FOUND
);
1099 m_hDevice
= CreateFileW(m_DevicePath
, GENERIC_READ
| GENERIC_WRITE
, 0, NULL
, OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_OVERLAPPED
, NULL
);
1102 // failed to open device
1103 return MAKE_HRESULT(SEVERITY_ERROR
, FACILITY_WIN32
, GetLastError());
1112 CKsProxy::Disassociate(void)
1117 CloseHandle(m_hDevice
);
1125 //-------------------------------------------------------------------
1126 // IKsObject interface
1131 CKsProxy::KsGetObjectHandle()
1136 //-------------------------------------------------------------------
1137 // IPersistPropertyBag interface
1141 CKsProxy::InitNew( void)
1148 CKsProxy::GetSupportedSets(
1152 KSPROPERTY Property
;
1154 ULONG NumProperty
= 0;
1155 ULONG NumMethods
= 0;
1156 ULONG NumEvents
= 0;
1158 ULONG BytesReturned
;
1161 Property
.Set
= GUID_NULL
;
1163 Property
.Flags
= KSPROPERTY_TYPE_SETSUPPORT
;
1165 KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSPROPERTY
), NULL
, 0, &NumProperty
);
1166 KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_METHOD
, (PVOID
)&Property
, sizeof(KSPROPERTY
), NULL
, 0, &NumMethods
);
1167 KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_ENABLE_EVENT
, (PVOID
)&Property
, sizeof(KSPROPERTY
), NULL
, 0, &NumEvents
);
1169 Length
= NumProperty
+ NumMethods
+ NumEvents
;
1171 // allocate guid buffer
1172 pGuid
= (LPGUID
)CoTaskMemAlloc(Length
);
1176 return E_OUTOFMEMORY
;
1179 NumProperty
/= sizeof(GUID
);
1180 NumMethods
/= sizeof(GUID
);
1181 NumEvents
/= sizeof(GUID
);
1183 // get all properties
1184 hr
= KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSPROPERTY
), (PVOID
)pGuid
, Length
, &BytesReturned
);
1187 CoTaskMemFree(pGuid
);
1190 Length
-= BytesReturned
;
1195 hr
= KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_METHOD
, (PVOID
)&Property
, sizeof(KSPROPERTY
), (PVOID
)&pGuid
[NumProperty
], Length
, &BytesReturned
);
1198 CoTaskMemFree(pGuid
);
1201 Length
-= BytesReturned
;
1207 hr
= KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_ENABLE_EVENT
, (PVOID
)&Property
, sizeof(KSPROPERTY
), (PVOID
)&pGuid
[NumProperty
+NumMethods
], Length
, &BytesReturned
);
1210 CoTaskMemFree(pGuid
);
1213 Length
-= BytesReturned
;
1216 #ifdef KSPROXY_TRACE
1218 swprintf(Buffer
, L
"NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty
, NumMethods
, NumEvents
);
1219 OutputDebugStringW(Buffer
);
1223 *NumGuids
= NumProperty
+NumEvents
+NumMethods
;
1229 CKsProxy::LoadProxyPlugins(
1237 IUnknown
* pUnknown
;
1239 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE
, L
"SYSTEM\\CurrentControlSet\\Control\\MediaInterfaces", 0, KEY_READ
, &hKey
) != ERROR_SUCCESS
)
1241 OutputDebugStringW(L
"CKsProxy::LoadProxyPlugins failed to open MediaInterfaces key\n");
1245 // enumerate all sets
1246 for(Index
= 0; Index
< NumGuids
; Index
++)
1248 // convert to string
1249 hr
= StringFromCLSID(pGuids
[Index
], &pStr
);
1253 // now try open class key
1254 if (RegOpenKeyExW(hKey
, pStr
, 0, KEY_READ
, &hSubKey
) != ERROR_SUCCESS
)
1256 // no plugin for that set exists
1257 CoTaskMemFree(pStr
);
1262 hr
= CoCreateInstance(pGuids
[Index
], (IBaseFilter
*)this, CLSCTX_INPROC_SERVER
, IID_IUnknown
, (void**)&pUnknown
);
1266 m_Plugins
.push_back(pUnknown
);
1269 RegCloseKey(hSubKey
);
1272 // close media interfaces key
1279 CKsProxy::GetNumberOfPins(
1282 KSPROPERTY Property
;
1283 ULONG BytesReturned
;
1286 Property
.Set
= KSPROPSETID_Pin
;
1287 Property
.Id
= KSPROPERTY_PIN_CTYPES
;
1288 Property
.Flags
= KSPROPERTY_TYPE_GET
;
1290 return KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSPROPERTY
), (PVOID
)NumPins
, sizeof(ULONG
), &BytesReturned
);
1295 CKsProxy::GetPinInstanceCount(
1297 PKSPIN_CINSTANCES Instances
)
1300 ULONG BytesReturned
;
1303 Property
.Property
.Set
= KSPROPSETID_Pin
;
1304 Property
.Property
.Id
= KSPROPERTY_PIN_CINSTANCES
;
1305 Property
.Property
.Flags
= KSPROPERTY_TYPE_GET
;
1306 Property
.PinId
= PinId
;
1307 Property
.Reserved
= 0;
1309 return KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSP_PIN
), (PVOID
)Instances
, sizeof(KSPIN_CINSTANCES
), &BytesReturned
);
1314 CKsProxy::GetPinCommunication(
1316 KSPIN_COMMUNICATION
* Communication
)
1319 ULONG BytesReturned
;
1322 Property
.Property
.Set
= KSPROPSETID_Pin
;
1323 Property
.Property
.Id
= KSPROPERTY_PIN_COMMUNICATION
;
1324 Property
.Property
.Flags
= KSPROPERTY_TYPE_GET
;
1325 Property
.PinId
= PinId
;
1326 Property
.Reserved
= 0;
1328 return KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSP_PIN
), (PVOID
)Communication
, sizeof(KSPIN_COMMUNICATION
), &BytesReturned
);
1333 CKsProxy::GetPinDataflow(
1335 KSPIN_DATAFLOW
* DataFlow
)
1338 ULONG BytesReturned
;
1341 Property
.Property
.Set
= KSPROPSETID_Pin
;
1342 Property
.Property
.Id
= KSPROPERTY_PIN_DATAFLOW
;
1343 Property
.Property
.Flags
= KSPROPERTY_TYPE_GET
;
1344 Property
.PinId
= PinId
;
1345 Property
.Reserved
= 0;
1347 return KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSP_PIN
), (PVOID
)DataFlow
, sizeof(KSPIN_DATAFLOW
), &BytesReturned
);
1352 CKsProxy::GetPinName(
1354 KSPIN_DATAFLOW DataFlow
,
1356 LPWSTR
* OutPinName
)
1360 ULONG BytesReturned
;
1365 Property
.Property
.Set
= KSPROPSETID_Pin
;
1366 Property
.Property
.Id
= KSPROPERTY_PIN_NAME
;
1367 Property
.Property
.Flags
= KSPROPERTY_TYPE_GET
;
1368 Property
.PinId
= PinId
;
1369 Property
.Reserved
= 0;
1371 // #1 try get it from pin directly
1372 hr
= KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSP_PIN
), NULL
, 0, &BytesReturned
);
1374 if (hr
== MAKE_HRESULT(SEVERITY_ERROR
, FACILITY_WIN32
, ERROR_MORE_DATA
))
1376 // allocate pin name
1377 PinName
= (LPWSTR
)CoTaskMemAlloc(BytesReturned
);
1379 return E_OUTOFMEMORY
;
1381 // retry with allocated buffer
1382 hr
= KsSynchronousDeviceControl(m_hDevice
, IOCTL_KS_PROPERTY
, (PVOID
)&Property
, sizeof(KSP_PIN
), PinName
, BytesReturned
, &BytesReturned
);
1385 *OutPinName
= PinName
;
1390 CoTaskMemFree(PinName
);
1394 // TODO: retrieve pin name from topology node
1397 if (DataFlow
== KSPIN_DATAFLOW_IN
)
1399 swprintf(Buffer
, L
"Input%lu", PinCount
);
1403 swprintf(Buffer
, L
"Output%lu", PinCount
);
1406 // allocate pin name
1407 PinName
= (LPWSTR
)CoTaskMemAlloc((wcslen(Buffer
)+1) * sizeof(WCHAR
));
1409 return E_OUTOFMEMORY
;
1412 wcscpy(PinName
, Buffer
);
1415 *OutPinName
= PinName
;
1422 CKsProxy::CreatePins()
1424 ULONG NumPins
, Index
;
1425 KSPIN_CINSTANCES Instances
;
1426 KSPIN_DATAFLOW DataFlow
;
1427 KSPIN_COMMUNICATION Communication
;
1433 ULONG OutputPin
= 0;
1435 // get number of pins
1436 hr
= GetNumberOfPins(&NumPins
);
1440 for(Index
= 0; Index
< NumPins
; Index
++)
1442 // query current instance count
1443 hr
= GetPinInstanceCount(Index
, &Instances
);
1447 // query pin communication;
1448 hr
= GetPinCommunication(Index
, &Communication
);
1452 if (Instances
.CurrentCount
== Instances
.PossibleCount
)
1454 // already maximum reached for this pin
1458 // get direction of pin
1459 hr
= GetPinDataflow(Index
, &DataFlow
);
1463 if (DataFlow
== KSPIN_DATAFLOW_IN
)
1464 hr
= GetPinName(Index
, DataFlow
, InputPin
, &PinName
);
1466 hr
= GetPinName(Index
, DataFlow
, OutputPin
, &PinName
);
1471 // construct the pins
1472 if (DataFlow
== KSPIN_DATAFLOW_IN
)
1474 hr
= CInputPin_Constructor((IBaseFilter
*)this, PinName
, m_hDevice
, Index
, Communication
, IID_IPin
, (void**)&pPin
);
1477 CoTaskMemFree(PinName
);
1484 hr
= COutputPin_Constructor((IBaseFilter
*)this, PinName
, Index
, IID_IPin
, (void**)&pPin
);
1487 CoTaskMemFree(PinName
);
1494 m_Pins
.push_back(pPin
);
1496 swprintf(Buffer
, L
"Index %lu DataFlow %lu Name %s\n", Index
, DataFlow
, PinName
);
1497 OutputDebugStringW(Buffer
);
1505 CKsProxy::Load(IPropertyBag
*pPropBag
, IErrorLog
*pErrorLog
)
1513 SP_DEVICE_INTERFACE_DATA DeviceInterfaceData
;
1517 varName
.vt
= VT_BSTR
;
1518 hr
= pPropBag
->Read(L
"DevicePath", &varName
, pErrorLog
);
1522 swprintf(Buffer
, L
"CKsProxy::Load Read %lx\n", hr
);
1523 OutputDebugStringW(Buffer
);
1524 return MAKE_HRESULT(SEVERITY_ERROR
, FACILITY_WIN32
, GetLastError());
1527 // create device list
1528 hList
= SetupDiCreateDeviceInfoListExW(NULL
, NULL
, NULL
, NULL
);
1529 if (hList
== INVALID_HANDLE_VALUE
)
1531 // failed to create device list
1532 return MAKE_HRESULT(SEVERITY_ERROR
, FACILITY_WIN32
, GetLastError());
1535 DeviceInterfaceData
.cbSize
= sizeof(SP_DEVICE_INTERFACE_DATA
);
1536 if (!SetupDiOpenDeviceInterfaceW(hList
, (PCWSTR
)varName
.bstrVal
, 0, &DeviceInterfaceData
))
1538 // failed to open device interface
1539 SetupDiDestroyDeviceInfoList(hList
);
1542 // FIXME handle device interface links(aliases)
1543 CopyMemory(&m_DeviceInterfaceGUID
, &DeviceInterfaceData
.InterfaceClassGuid
, sizeof(GUID
));
1545 // close device info list
1546 SetupDiDestroyDeviceInfoList(hList
);
1549 m_hDevice
= CreateFileW(varName
.bstrVal
, GENERIC_READ
| GENERIC_WRITE
, 0, NULL
, OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
| FILE_FLAG_OVERLAPPED
, NULL
);
1551 if (m_hDevice
== INVALID_HANDLE_VALUE
)
1553 // failed to open device
1554 swprintf(Buffer
, L
"CKsProxy:: failed to open device with %lx\n", GetLastError());
1555 OutputDebugStringW(Buffer
);
1557 return MAKE_HRESULT(SEVERITY_ERROR
, FACILITY_WIN32
, GetLastError());
1560 // store device path
1561 m_DevicePath
= varName
.bstrVal
;
1563 // get all supported sets
1564 hr
= GetSupportedSets(&pGuid
, &NumGuids
);
1567 CloseHandle(m_hDevice
);
1572 // load all proxy plugins
1573 hr
= LoadProxyPlugins(pGuid
, NumGuids
);
1576 CloseHandle(m_hDevice
);
1582 CoTaskMemFree(pGuid
);
1584 // now create the input / output pins
1592 CKsProxy::Save(IPropertyBag
*pPropBag
, BOOL fClearDirty
, BOOL fSaveAllProperties
)
1597 //-------------------------------------------------------------------
1598 // IBaseFilter interface
1603 CKsProxy::GetClassID(
1606 OutputDebugStringW(L
"CKsProxy::GetClassID : NotImplemented\n");
1614 OutputDebugStringW(L
"CKsProxy::Stop : NotImplemented\n");
1622 OutputDebugStringW(L
"CKsProxy::Pause : NotImplemented\n");
1629 REFERENCE_TIME tStart
)
1631 OutputDebugStringW(L
"CKsProxy::Run : NotImplemented\n");
1638 DWORD dwMilliSecsTimeout
,
1639 FILTER_STATE
*State
)
1641 *State
= m_FilterState
;
1647 CKsProxy::SetSyncSource(
1648 IReferenceClock
*pClock
)
1655 if (m_ReferenceClock
)
1657 m_ReferenceClock
->Release();
1660 m_ReferenceClock
= pClock
;
1666 CKsProxy::GetSyncSource(
1667 IReferenceClock
**pClock
)
1672 if (m_ReferenceClock
)
1673 m_ReferenceClock
->AddRef();
1675 *pClock
= m_ReferenceClock
;
1684 return CEnumPins_fnConstructor(m_Pins
, IID_IEnumPins
, (void**)ppEnum
);
1690 LPCWSTR Id
, IPin
**ppPin
)
1698 int ret
= swscanf(Id
, L
"%u", &PinId
);
1700 if (!ret
|| ret
== EOF
)
1703 return VFW_E_NOT_FOUND
;
1706 if (PinId
>= m_Pins
.size() || m_Pins
[PinId
] == NULL
)
1709 return VFW_E_NOT_FOUND
;
1713 *ppPin
= m_Pins
[PinId
];
1714 m_Pins
[PinId
]->AddRef();
1722 CKsProxy::QueryFilterInfo(
1728 pInfo
->achName
[0] = L
'\0';
1729 pInfo
->pGraph
= m_pGraph
;
1736 CKsProxy::JoinFilterGraph(
1737 IFilterGraph
*pGraph
,
1742 // joining filter graph
1757 CKsProxy::QueryVendorInfo(
1758 LPWSTR
*pVendorInfo
)
1760 OutputDebugStringW(L
"CKsProxy::QueryVendorInfo : NotImplemented\n");
1764 //-------------------------------------------------------------------
1765 // IAMovieSetup interface
1770 CKsProxy::Register()
1772 OutputDebugStringW(L
"CKsProxy::Register : NotImplemented\n");
1778 CKsProxy::Unregister()
1780 OutputDebugStringW(L
"CKsProxy::Unregister : NotImplemented\n");
1786 CKsProxy_Constructor(
1787 IUnknown
* pUnkOuter
,
1793 StringFromCLSID(riid
, &pstr
);
1794 swprintf(Buffer
, L
"CKsProxy_Constructor pUnkOuter %p riid %s\n", pUnkOuter
, pstr
);
1795 OutputDebugStringW(Buffer
);
1797 CKsProxy
* handler
= new CKsProxy();
1800 return E_OUTOFMEMORY
;
1802 if (FAILED(handler
->QueryInterface(riid
, ppv
)))
1806 return E_NOINTERFACE
;