Author: janderwald Date: Mon Mar 15 17:22:41 2010 New Revision: 46208
URL: http://svn.reactos.org/svn/reactos?rev=46208&view=rev Log: [KSPROXY] - Implement IKsDataTypeHandler::KsIsMediaTypeInRanges, IKsDataTypeHandler::KsSetMediaType - Instantiate the IKsInterfaceHandler for the CInputPin
Modified: trunk/reactos/dll/directx/ksproxy/datatype.cpp trunk/reactos/dll/directx/ksproxy/input_pin.cpp trunk/reactos/dll/directx/ksproxy/interface.cpp trunk/reactos/dll/directx/ksproxy/ksproxy.cpp trunk/reactos/dll/directx/ksproxy/output_pin.cpp trunk/reactos/dll/directx/ksproxy/precomp.h trunk/reactos/dll/directx/ksproxy/proxy.cpp
Modified: trunk/reactos/dll/directx/ksproxy/datatype.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/datatyp... ============================================================================== --- trunk/reactos/dll/directx/ksproxy/datatype.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/datatype.cpp [iso-8859-1] Mon Mar 15 17:22:41 2010 @@ -42,12 +42,25 @@ HRESULT STDMETHODCALLTYPE KsQueryExtendedSize(OUT ULONG* ExtendedSize); HRESULT STDMETHODCALLTYPE KsSetMediaType(IN const AM_MEDIA_TYPE* AmMediaType);
- CKsDataTypeHandler() : m_Ref(0){}; - virtual ~CKsDataTypeHandler(){}; + CKsDataTypeHandler() : m_Ref(0), m_Type(0){}; + virtual ~CKsDataTypeHandler() + { + if (m_Type) + { + if (m_Type->pbFormat) + CoTaskMemFree(m_Type->pbFormat); + + if (m_Type->pUnk) + m_Type->pUnk->Release(); + + CoTaskMemFree(m_Type); + } + + };
protected: - //CMediaType * m_Type; LONG m_Ref; + AM_MEDIA_TYPE * m_Type; };
@@ -85,8 +98,68 @@ CKsDataTypeHandler::KsIsMediaTypeInRanges( IN PVOID DataRanges) { - OutputDebugString("UNIMPLEMENTED\n"); - return E_NOTIMPL; + PKSMULTIPLE_ITEM DataList; + PKSDATARANGE DataRange; + ULONG Index; + HRESULT hr = S_FALSE; + + OutputDebugStringW(L"CKsDataTypeHandler::KsIsMediaTypeInRanges\n"); + + DataList = (PKSMULTIPLE_ITEM)DataRanges; + DataRange = (PKSDATARANGE)(DataList + 1); + + for(Index = 0; Index < DataList->Count; Index++) + { + BOOL bMatch = FALSE; + + if (DataRange->FormatSize >= sizeof(KSDATARANGE)) + { + bMatch = IsEqualGUID(DataRange->MajorFormat, GUID_NULL); + } + + if (!bMatch && DataRange->FormatSize >= sizeof(KSDATARANGE_AUDIO)) + { + bMatch = IsEqualGUID(DataRange->MajorFormat, MEDIATYPE_Audio); + } + + if (bMatch) + { + if (IsEqualGUID(DataRange->SubFormat, m_Type->subtype) || + IsEqualGUID(DataRange->SubFormat, GUID_NULL)) + { + if (IsEqualGUID(DataRange->Specifier, m_Type->formattype) || + IsEqualGUID(DataRange->Specifier, GUID_NULL)) + { + if (!IsEqualGUID(m_Type->formattype, FORMAT_WaveFormatEx) && !IsEqualGUID(DataRange->Specifier, FORMAT_WaveFormatEx)) + { + //found match + hr = S_OK; + break; + } + + if (DataRange->FormatSize >= sizeof(KSDATARANGE_AUDIO) && m_Type->cbFormat >= sizeof(WAVEFORMATEX)) + { + LPWAVEFORMATEX Format = (LPWAVEFORMATEX)m_Type->pbFormat; + PKSDATARANGE_AUDIO AudioRange = (PKSDATARANGE_AUDIO)DataRange; + + if (Format->nSamplesPerSec >= AudioRange->MinimumSampleFrequency && + Format->nSamplesPerSec <= AudioRange->MaximumSampleFrequency && + Format->wBitsPerSample >= AudioRange->MinimumSampleFrequency && + Format->wBitsPerSample <= AudioRange->MaximumBitsPerSample && + Format->nChannels <= AudioRange->MaximumChannels) + { + // found match + hr = S_OK; + break; + } + } + } + } + } + + DataRange = (PKSDATARANGE)(((ULONG_PTR)DataRange + DataRange->FormatSize + 7) & ~7); + } + return S_OK; }
HRESULT @@ -106,7 +179,6 @@ { /* no header extension required */ *ExtendedSize = 0; - return NOERROR; }
@@ -115,19 +187,38 @@ CKsDataTypeHandler::KsSetMediaType( IN const AM_MEDIA_TYPE* AmMediaType) { -#if 0 + OutputDebugString("CKsDataTypeHandler::KsSetMediaType\n"); + if (m_Type) { /* media type can only be set once */ return E_FAIL; } -#endif - - /* - * TODO: allocate CMediaType and copy parameters - */ - OutputDebugString("UNIMPLEMENTED\n"); - return E_NOTIMPL; + + m_Type = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)); + if (!m_Type) + return E_OUTOFMEMORY; + + CopyMemory(m_Type, AmMediaType, sizeof(AM_MEDIA_TYPE)); + + if (m_Type->cbFormat) + { + m_Type->pbFormat = (BYTE*)CoTaskMemAlloc(m_Type->cbFormat); + + if (!m_Type->pbFormat) + { + CoTaskMemFree(m_Type); + return E_OUTOFMEMORY; + } + + CopyMemory(m_Type->pbFormat, AmMediaType->pbFormat, m_Type->cbFormat); + } + + if (m_Type->pUnk) + m_Type->pUnk->AddRef(); + + + return S_OK; }
HRESULT @@ -138,7 +229,6 @@ LPVOID * ppv) { OutputDebugStringW(L"CKsDataTypeHandler_Constructor\n"); - CKsDataTypeHandler * handler = new CKsDataTypeHandler();
if (!handler)
Modified: trunk/reactos/dll/directx/ksproxy/input_pin.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/input_p... ============================================================================== --- trunk/reactos/dll/directx/ksproxy/input_pin.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/input_pin.cpp [iso-8859-1] Mon Mar 15 17:22:41 2010 @@ -143,7 +143,7 @@ HRESULT STDMETHODCALLTYPE CheckFormat(const AM_MEDIA_TYPE *pmt); HRESULT STDMETHODCALLTYPE CreatePin(const AM_MEDIA_TYPE *pmt); HRESULT STDMETHODCALLTYPE CreatePinHandle(PKSPIN_MEDIUM Medium, PKSPIN_INTERFACE Interface, const AM_MEDIA_TYPE *pmt); - CInputPin(IBaseFilter * ParentFilter, LPCWSTR PinName, HANDLE hFilter, ULONG PinId, KSPIN_COMMUNICATION Communication) : m_Ref(0), m_ParentFilter(ParentFilter), m_PinName(PinName), m_hFilter(hFilter), m_hPin(INVALID_HANDLE_VALUE), m_PinId(PinId), m_MemAllocator(0), m_IoCount(0), m_Communication(Communication), m_Pin(0), m_ReadOnly(0){}; + CInputPin(IBaseFilter * ParentFilter, LPCWSTR PinName, HANDLE hFilter, ULONG PinId, KSPIN_COMMUNICATION Communication) : m_Ref(0), m_ParentFilter(ParentFilter), m_PinName(PinName), m_hFilter(hFilter), m_hPin(INVALID_HANDLE_VALUE), m_PinId(PinId), m_MemAllocator(0), m_IoCount(0), m_Communication(Communication), m_Pin(0), m_ReadOnly(0), m_InterfaceHandler(0){}; virtual ~CInputPin(){};
protected: @@ -159,6 +159,7 @@ KSPIN_INTERFACE m_Interface; KSPIN_MEDIUM m_Medium; IPin * m_Pin; + IKsInterfaceHandler * m_InterfaceHandler; BOOL m_ReadOnly; };
@@ -666,16 +667,17 @@
if (m_Pin) { + // already connected return VFW_E_ALREADY_CONNECTED; }
// first check format hr = CheckFormat(pmt); if (FAILED(hr)) + { + // format is not supported return hr; - - if (FAILED(CheckFormat(pmt))) - return hr; + }
hr = CreatePin(pmt); if (FAILED(hr)) @@ -683,9 +685,8 @@ return hr; }
- //FIXME create pin - m_Pin = pConnector; - m_Pin->AddRef(); + m_Pin = pConnector; + m_Pin->AddRef();
return S_OK; } @@ -925,6 +926,7 @@ PKSMULTIPLE_ITEM InterfaceList; PKSPIN_MEDIUM Medium; PKSPIN_INTERFACE Interface; + IKsInterfaceHandler * InterfaceHandler; HRESULT hr;
// query for pin medium @@ -963,8 +965,43 @@ Interface = &StandardPinInterface; }
- // now create pin - hr = CreatePinHandle(Medium, Interface, pmt); + if (m_Communication != KSPIN_COMMUNICATION_BRIDGE && m_Communication != KSPIN_COMMUNICATION_NONE) + { + // now load the IKsInterfaceHandler plugin + hr = CoCreateInstance(Interface->Set, NULL, CLSCTX_INPROC_SERVER, IID_IKsInterfaceHandler, (void**)&InterfaceHandler); + if (FAILED(hr)) + { + // failed to load interface handler plugin + OutputDebugStringW(L"CInputPin::CreatePin failed to load InterfaceHandlerPlugin\n"); + CoTaskMemFree(MediumList); + CoTaskMemFree(InterfaceList); + + return hr; + } + + // now set the pin + hr = InterfaceHandler->KsSetPin((IKsPin*)this); + if (FAILED(hr)) + { + // failed to load interface handler plugin + OutputDebugStringW(L"CInputPin::CreatePin failed to initialize InterfaceHandlerPlugin\n"); + InterfaceHandler->Release(); + CoTaskMemFree(MediumList); + CoTaskMemFree(InterfaceList); + return hr; + } + + // store interface handler + m_InterfaceHandler = InterfaceHandler; + + // now create pin + hr = CreatePinHandle(Medium, Interface, pmt); + if (FAILED(hr)) + { + m_InterfaceHandler->Release(); + m_InterfaceHandler = InterfaceHandler; + } + }
// free medium / interface / dataformat CoTaskMemFree(MediumList);
Modified: trunk/reactos/dll/directx/ksproxy/interface.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/interfa... ============================================================================== --- trunk/reactos/dll/directx/ksproxy/interface.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/interface.cpp [iso-8859-1] Mon Mar 15 17:22:41 2010 @@ -247,12 +247,9 @@
//release IMediaSample2 interface MediaSample->Release(); - if (FAILED(hr)) - OutputDebugStringW(L"CKsInterfaceHandler::KsProcessMediaSamples MediaSample::GetProperties failed\n"); } else { - OutputDebugStringW(L"CKsInterfaceHandler::KsProcessMediaSamples MediaSample:: only IMediaSample supported\n"); // get properties hr = SampleList[Index]->GetPointer((BYTE**)&Properties.pbBuffer); assert(hr == NOERROR); @@ -272,7 +269,7 @@ }
WCHAR Buffer[100]; - swprintf(Buffer, L"BufferLength %lu Property Buffer %p ExtendedSize %u lActual %u\n", Properties.cbBuffer, Properties.pbBuffer, ExtendedSize, Properties.lActual); + swprintf(Buffer, L"BufferLength %lu Property Buffer %p ExtendedSize %u lActual %u\n", Properties.cbBuffer, Properties.pbBuffer, ExtendedSize, Properties.lActual); OutputDebugStringW(Buffer);
CurStreamHeader->Size = sizeof(KSSTREAM_HEADER) + ExtendedSize;
Modified: trunk/reactos/dll/directx/ksproxy/ksproxy.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/ksproxy... ============================================================================== --- trunk/reactos/dll/directx/ksproxy/ksproxy.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/ksproxy.cpp [iso-8859-1] Mon Mar 15 17:22:41 2010 @@ -13,10 +13,10 @@
const GUID CLSID_KsClockForwarder = {0x877e4351, 0x6fea, 0x11d0, {0xb8, 0x63, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1}}; const GUID CLSID_KsQualityForwarder = {0xe05592e4, 0xc0b5, 0x11d0, {0xa4, 0x39, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96}}; + + +#ifndef _MSC_VER const GUID CLSID_KsIBasicAudioInterfaceHandler = {0xb9f8ac3e, 0x0f71, 0x11d2, {0xb7, 0x2c, 0x00, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d}}; - - -#ifndef _MSC_VER const GUID KSPROPSETID_Pin = {0x8C134960, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}}; const GUID KSINTERFACESETID_Standard = {STATIC_KSINTERFACESETID_Standard}; const GUID CLSID_Proxy = {0x17CCA71B, 0xECD7, 0x11D0, {0xB9, 0x08, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};
Modified: trunk/reactos/dll/directx/ksproxy/output_pin.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/output_... ============================================================================== --- trunk/reactos/dll/directx/ksproxy/output_pin.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/output_pin.cpp [iso-8859-1] Mon Mar 15 17:22:41 2010 @@ -21,6 +21,7 @@ // public IKsPinPipe, public IKsControl /* + public IAMBufferNegotiation, public IQualityControl, public IKsPinEx, public IKsAggregateControl @@ -142,50 +143,54 @@ if (IsEqualGUID(refiid, IID_IUnknown) || IsEqualGUID(refiid, IID_IPin)) { + OutputDebugStringW(L"COutputPin::QueryInterface IID_IPin\n"); *Output = PVOID(this); reinterpret_cast<IUnknown*>(*Output)->AddRef(); return NOERROR; } else if (IsEqualGUID(refiid, IID_IKsObject)) { + OutputDebugStringW(L"COutputPin::QueryInterface IID_IKsObject\n"); *Output = (IKsObject*)(this); reinterpret_cast<IKsObject*>(*Output)->AddRef(); return NOERROR; } else if (IsEqualGUID(refiid, IID_IKsPropertySet)) { + OutputDebugStringW(L"COutputPin::QueryInterface IID_IKsPropertySet\n"); + DebugBreak(); *Output = (IKsPropertySet*)(this); reinterpret_cast<IKsPropertySet*>(*Output)->AddRef(); return NOERROR; } else if (IsEqualGUID(refiid, IID_IKsControl)) { + OutputDebugStringW(L"COutputPin::QueryInterface IID_IKsControl\n"); *Output = (IKsControl*)(this); reinterpret_cast<IKsControl*>(*Output)->AddRef(); return NOERROR; } +#if 0 else if (IsEqualGUID(refiid, IID_IStreamBuilder)) { *Output = (IStreamBuilder*)(this); reinterpret_cast<IStreamBuilder*>(*Output)->AddRef(); return NOERROR; } +#endif else if (IsEqualGUID(refiid, IID_IKsPinFactory)) { + OutputDebugStringW(L"COutputPin::QueryInterface IID_IKsPinFactory\n"); *Output = (IKsPinFactory*)(this); reinterpret_cast<IKsPinFactory*>(*Output)->AddRef(); return NOERROR; } else if (IsEqualGUID(refiid, IID_ISpecifyPropertyPages)) { + OutputDebugStringW(L"COutputPin::QueryInterface IID_ISpecifyPropertyPages\n"); *Output = (ISpecifyPropertyPages*)(this); reinterpret_cast<ISpecifyPropertyPages*>(*Output)->AddRef(); return NOERROR; - } - else if (IsEqualGUID(refiid, IID_IBaseFilter)) - { - OutputDebugStringW(L"COutputPin::QueryInterface query IID_IBaseFilter\n"); - DebugBreak(); }
WCHAR Buffer[MAX_PATH]; @@ -226,6 +231,7 @@ COutputPin::KsPinFactory( ULONG* PinFactory) { + OutputDebugStringW(L"COutputPin::KsPinFactory\n"); *PinFactory = m_PinId; return S_OK; } @@ -241,6 +247,7 @@ IPin *ppinOut, IGraphBuilder *pGraph) { + OutputDebugStringW(L"COutputPin::Render\n"); return S_OK; }
@@ -250,6 +257,7 @@ IPin *ppinOut, IGraphBuilder *pGraph) { + OutputDebugStringW(L"COutputPin::Backout\n"); return S_OK; } //------------------------------------------------------------------- @@ -259,6 +267,7 @@ STDMETHODCALLTYPE COutputPin::KsGetObjectHandle() { + OutputDebugStringW(L"COutputPin::KsGetObjectHandle\n"); assert(m_hPin); return m_hPin; } @@ -276,6 +285,7 @@ ULONG* BytesReturned) { assert(m_hPin != 0); + OutputDebugStringW(L"COutputPin::KsProperty\n"); return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_PROPERTY, (PVOID)Property, PropertyLength, (PVOID)PropertyData, DataLength, BytesReturned); }
@@ -289,6 +299,7 @@ ULONG* BytesReturned) { assert(m_hPin != 0); + OutputDebugStringW(L"COutputPin::KsMethod\n"); return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_METHOD, (PVOID)Method, MethodLength, (PVOID)MethodData, DataLength, BytesReturned); }
@@ -302,6 +313,8 @@ ULONG* BytesReturned) { assert(m_hPin != 0); + + OutputDebugStringW(L"COutputPin::KsEvent\n");
if (EventLength) return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_ENABLE_EVENT, (PVOID)Event, EventLength, (PVOID)EventData, DataLength, BytesReturned); @@ -324,6 +337,8 @@ DWORD cbPropData) { ULONG BytesReturned; + + OutputDebugStringW(L"COutputPin::Set\n");
if (cbInstanceData) { @@ -367,6 +382,8 @@ { ULONG BytesReturned;
+ OutputDebugStringW(L"COutputPin::Get\n"); + if (cbInstanceData) { PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData); @@ -405,6 +422,8 @@ { KSPROPERTY Property; ULONG BytesReturned; + + OutputDebugStringW(L"COutputPin::QuerySupported\n");
Property.Set = guidPropSet; Property.Id = dwPropID; @@ -470,12 +489,15 @@ STDMETHODCALLTYPE COutputPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt) { + OutputDebugStringW(L"COutputPin::ReceiveConnection\n"); return E_UNEXPECTED; } HRESULT STDMETHODCALLTYPE COutputPin::Disconnect( void) { + OutputDebugStringW(L"COutputPin::Disconnect\n"); + if (!m_Pin) { // pin was not connected @@ -495,6 +517,8 @@ STDMETHODCALLTYPE COutputPin::ConnectedTo(IPin **pPin) { + OutputDebugStringW(L"COutputPin::ConnectedTo\n"); + if (!pPin) return E_POINTER;
@@ -520,6 +544,8 @@ STDMETHODCALLTYPE COutputPin::QueryPinInfo(PIN_INFO *pInfo) { + OutputDebugStringW(L"COutputPin::QueryPinInfo\n"); + wcscpy(pInfo->achName, m_PinName); pInfo->dir = PINDIR_OUTPUT; pInfo->pFilter = m_ParentFilter; @@ -531,6 +557,8 @@ STDMETHODCALLTYPE COutputPin::QueryDirection(PIN_DIRECTION *pPinDir) { + OutputDebugStringW(L"COutputPin::QueryDirection\n"); + if (pPinDir) { *pPinDir = PINDIR_OUTPUT; @@ -543,6 +571,8 @@ STDMETHODCALLTYPE COutputPin::QueryId(LPWSTR *Id) { + OutputDebugStringW(L"COutputPin::QueryId\n"); + *Id = (LPWSTR)CoTaskMemAlloc((wcslen(m_PinName)+1)*sizeof(WCHAR)); if (!*Id) return E_OUTOFMEMORY; @@ -580,10 +610,10 @@ // query media type count hr = KsGetMediaTypeCount(hFilter, m_PinId, &MediaTypeCount); if (FAILED(hr) || !MediaTypeCount) - { + { OutputDebugStringW(L"COutputPin::EnumMediaTypes failed1\n"); return hr; - } + }
// allocate media types MediaTypes = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE) * MediaTypeCount); @@ -605,7 +635,7 @@ { // failed CoTaskMemFree(MediaTypes); - OutputDebugStringW(L"COutputPin::EnumMediaTypes failed2\n"); + OutputDebugStringW(L"COutputPin::EnumMediaTypes failed\n"); return hr; } }
Modified: trunk/reactos/dll/directx/ksproxy/precomp.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/precomp... ============================================================================== --- trunk/reactos/dll/directx/ksproxy/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/precomp.h [iso-8859-1] Mon Mar 15 17:22:41 2010 @@ -19,6 +19,7 @@ #include <stdio.h> #include <vector> #include <assert.h> +#include <ksmedia.h> //#include <debug.h>
Modified: trunk/reactos/dll/directx/ksproxy/proxy.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/proxy.c... ============================================================================== --- trunk/reactos/dll/directx/ksproxy/proxy.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/proxy.cpp [iso-8859-1] Mon Mar 15 17:22:41 2010 @@ -1509,6 +1509,7 @@ CKsProxy::SetRate( double dRate) { + OutputDebugStringW(L"CKsProxy::SetRate\n"); return E_NOTIMPL; }
@@ -1517,6 +1518,7 @@ CKsProxy::GetRate( double *pdRate) { + OutputDebugStringW(L"CKsProxy::GetRate\n"); return E_NOTIMPL; }
@@ -1619,6 +1621,7 @@ ULONG* BytesReturned) { assert(m_hDevice != 0); + OutputDebugStringW(L"CKsProxy::KsProperty\n"); return KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_PROPERTY, (PVOID)Property, PropertyLength, (PVOID)PropertyData, DataLength, BytesReturned); }
@@ -1632,6 +1635,7 @@ ULONG* BytesReturned) { assert(m_hDevice != 0); + OutputDebugStringW(L"CKsProxy::KsMethod\n"); return KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_METHOD, (PVOID)Method, MethodLength, (PVOID)MethodData, DataLength, BytesReturned); }
@@ -1645,7 +1649,7 @@ ULONG* BytesReturned) { assert(m_hDevice != 0); - + OutputDebugStringW(L"CKsProxy::KsEvent\n"); if (EventLength) return KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_ENABLE_EVENT, (PVOID)Event, EventLength, (PVOID)EventData, DataLength, BytesReturned); else @@ -1667,6 +1671,8 @@ DWORD cbPropData) { ULONG BytesReturned; + + OutputDebugStringW(L"CKsProxy::Set\n");
if (cbInstanceData) { @@ -1710,6 +1716,8 @@ { ULONG BytesReturned;
+ OutputDebugStringW(L"CKsProxy::Get\n"); + if (cbInstanceData) { PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData); @@ -1748,6 +1756,8 @@ { KSPROPERTY Property; ULONG BytesReturned; + + OutputDebugStringW(L"CKsProxy::QuerySupported\n");
Property.Set = guidPropSet; Property.Id = dwPropID; @@ -1930,6 +1940,9 @@ STDMETHODCALLTYPE CKsProxy::DeviceInfo(CLSID *pclsidInterfaceClass, LPWSTR *pwszSymbolicLink) { + + OutputDebugStringW(L"CKsProxy::DeviceInfo\n"); + if (!m_DevicePath) { // object not initialized @@ -1953,6 +1966,8 @@ STDMETHODCALLTYPE CKsProxy::Reassociate(void) { + OutputDebugStringW(L"CKsProxy::Reassociate\n"); + if (!m_DevicePath || m_hDevice) { // file path not available @@ -1974,6 +1989,8 @@ STDMETHODCALLTYPE CKsProxy::Disassociate(void) { + OutputDebugStringW(L"CKsProxy::Disassociate\n"); + if (!m_hDevice) return E_HANDLE;
@@ -1990,6 +2007,7 @@ STDMETHODCALLTYPE CKsProxy::KsGetClockHandle() { + OutputDebugStringW(L"CKsProxy::KsGetClockHandle\n"); return m_hClock; }
@@ -2002,6 +2020,7 @@ STDMETHODCALLTYPE CKsProxy::KsGetObjectHandle() { + OutputDebugStringW(L"CKsProxy::KsGetObjectHandle\n"); return m_hDevice; }
@@ -2012,6 +2031,7 @@ STDMETHODCALLTYPE CKsProxy::InitNew( void) { + OutputDebugStringW(L"CKsProxy::InitNew\n"); return S_OK; }
@@ -2384,6 +2404,7 @@ HDEVINFO hList; SP_DEVICE_INTERFACE_DATA DeviceInterfaceData;
+ OutputDebugStringW(L"CKsProxy::Load\n");
// read device path varName.vt = VT_BSTR; @@ -2396,6 +2417,10 @@ return MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, GetLastError()); }
+ OutputDebugStringW(L"DevicePath: "); + OutputDebugStringW(varName.bstrVal); + OutputDebugStringW(L"\n"); + // create device list hList = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL); if (hList == INVALID_HANDLE_VALUE) @@ -2463,6 +2488,7 @@ STDMETHODCALLTYPE CKsProxy::Save(IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties) { + OutputDebugStringW(L"CKsProxy::Save\n"); return E_NOTIMPL; }
@@ -2532,7 +2558,7 @@ PIN_DIRECTION PinDir;
// Plug In Distributor: IKsClock - + OutputDebugStringW(L"CKsProxy::SetSyncSource\n");
// FIXME // need locks @@ -2624,6 +2650,8 @@ CKsProxy::GetSyncSource( IReferenceClock **pClock) { + OutputDebugStringW(L"CKsProxy::GetSyncSource\n"); + if (!pClock) return E_POINTER;
@@ -2639,6 +2667,7 @@ CKsProxy::EnumPins( IEnumPins **ppEnum) { + OutputDebugStringW(L"CKsProxy::EnumPins\n"); return CEnumPins_fnConstructor(m_Pins, IID_IEnumPins, (void**)ppEnum); }
@@ -2648,6 +2677,8 @@ LPCWSTR Id, IPin **ppPin) { ULONG PinId; + + OutputDebugStringW(L"CKsProxy::FindPin\n");
if (!ppPin) return E_POINTER; @@ -2683,6 +2714,8 @@ if (!pInfo) return E_POINTER;
+ OutputDebugStringW(L"CKsProxy::QueryFilterInfo\n"); + pInfo->achName[0] = L'\0'; pInfo->pGraph = m_pGraph;
@@ -2698,6 +2731,8 @@ IFilterGraph *pGraph, LPCWSTR pName) { + OutputDebugStringW(L"CKsProxy::JoinFilterGraph\n"); + if (pGraph) { // joining filter graph @@ -2718,6 +2753,7 @@ CKsProxy::QueryVendorInfo( LPWSTR *pVendorInfo) { + OutputDebugStringW(L"CKsProxy::QueryVendorInfo\n"); return StringFromCLSID(CLSID_Proxy, pVendorInfo); }