[KSPROXY]

- Implement IKsDataTypeHandler::KsIsMediaTypeInRanges, IKsDataTypeHandler::KsSetMediaType
- Instantiate the IKsInterfaceHandler for the CInputPin 


svn path=/trunk/; revision=46208
This commit is contained in:
Johannes Anderwald 2010-03-15 16:22:41 +00:00
parent 7a57ed5819
commit 531fab28a4
7 changed files with 229 additions and 38 deletions

View file

@ -42,12 +42,25 @@ public:
HRESULT STDMETHODCALLTYPE KsQueryExtendedSize(OUT ULONG* ExtendedSize); HRESULT STDMETHODCALLTYPE KsQueryExtendedSize(OUT ULONG* ExtendedSize);
HRESULT STDMETHODCALLTYPE KsSetMediaType(IN const AM_MEDIA_TYPE* AmMediaType); HRESULT STDMETHODCALLTYPE KsSetMediaType(IN const AM_MEDIA_TYPE* AmMediaType);
CKsDataTypeHandler() : m_Ref(0){}; CKsDataTypeHandler() : m_Ref(0), m_Type(0){};
virtual ~CKsDataTypeHandler(){}; 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: protected:
//CMediaType * m_Type;
LONG m_Ref; LONG m_Ref;
AM_MEDIA_TYPE * m_Type;
}; };
@ -85,8 +98,68 @@ STDMETHODCALLTYPE
CKsDataTypeHandler::KsIsMediaTypeInRanges( CKsDataTypeHandler::KsIsMediaTypeInRanges(
IN PVOID DataRanges) IN PVOID DataRanges)
{ {
OutputDebugString("UNIMPLEMENTED\n"); PKSMULTIPLE_ITEM DataList;
return E_NOTIMPL; 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 HRESULT
@ -106,7 +179,6 @@ CKsDataTypeHandler::KsQueryExtendedSize(
{ {
/* no header extension required */ /* no header extension required */
*ExtendedSize = 0; *ExtendedSize = 0;
return NOERROR; return NOERROR;
} }
@ -115,19 +187,38 @@ STDMETHODCALLTYPE
CKsDataTypeHandler::KsSetMediaType( CKsDataTypeHandler::KsSetMediaType(
IN const AM_MEDIA_TYPE* AmMediaType) IN const AM_MEDIA_TYPE* AmMediaType)
{ {
#if 0 OutputDebugString("CKsDataTypeHandler::KsSetMediaType\n");
if (m_Type) if (m_Type)
{ {
/* media type can only be set once */ /* media type can only be set once */
return E_FAIL; return E_FAIL;
} }
#endif
/* m_Type = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
* TODO: allocate CMediaType and copy parameters if (!m_Type)
*/ return E_OUTOFMEMORY;
OutputDebugString("UNIMPLEMENTED\n");
return E_NOTIMPL; 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 HRESULT
@ -138,7 +229,6 @@ CKsDataTypeHandler_Constructor (
LPVOID * ppv) LPVOID * ppv)
{ {
OutputDebugStringW(L"CKsDataTypeHandler_Constructor\n"); OutputDebugStringW(L"CKsDataTypeHandler_Constructor\n");
CKsDataTypeHandler * handler = new CKsDataTypeHandler(); CKsDataTypeHandler * handler = new CKsDataTypeHandler();
if (!handler) if (!handler)

View file

@ -143,7 +143,7 @@ public:
HRESULT STDMETHODCALLTYPE CheckFormat(const AM_MEDIA_TYPE *pmt); HRESULT STDMETHODCALLTYPE CheckFormat(const AM_MEDIA_TYPE *pmt);
HRESULT STDMETHODCALLTYPE CreatePin(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); 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(){}; virtual ~CInputPin(){};
protected: protected:
@ -159,6 +159,7 @@ protected:
KSPIN_INTERFACE m_Interface; KSPIN_INTERFACE m_Interface;
KSPIN_MEDIUM m_Medium; KSPIN_MEDIUM m_Medium;
IPin * m_Pin; IPin * m_Pin;
IKsInterfaceHandler * m_InterfaceHandler;
BOOL m_ReadOnly; BOOL m_ReadOnly;
}; };
@ -666,16 +667,17 @@ CInputPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt)
if (m_Pin) if (m_Pin)
{ {
// already connected
return VFW_E_ALREADY_CONNECTED; return VFW_E_ALREADY_CONNECTED;
} }
// first check format // first check format
hr = CheckFormat(pmt); hr = CheckFormat(pmt);
if (FAILED(hr)) if (FAILED(hr))
{
// format is not supported
return hr; return hr;
}
if (FAILED(CheckFormat(pmt)))
return hr;
hr = CreatePin(pmt); hr = CreatePin(pmt);
if (FAILED(hr)) if (FAILED(hr))
@ -683,7 +685,6 @@ CInputPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt)
return hr; return hr;
} }
//FIXME create pin
m_Pin = pConnector; m_Pin = pConnector;
m_Pin->AddRef(); m_Pin->AddRef();
@ -925,6 +926,7 @@ CInputPin::CreatePin(
PKSMULTIPLE_ITEM InterfaceList; PKSMULTIPLE_ITEM InterfaceList;
PKSPIN_MEDIUM Medium; PKSPIN_MEDIUM Medium;
PKSPIN_INTERFACE Interface; PKSPIN_INTERFACE Interface;
IKsInterfaceHandler * InterfaceHandler;
HRESULT hr; HRESULT hr;
// query for pin medium // query for pin medium
@ -963,8 +965,43 @@ CInputPin::CreatePin(
Interface = &StandardPinInterface; Interface = &StandardPinInterface;
} }
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 // now create pin
hr = CreatePinHandle(Medium, Interface, pmt); hr = CreatePinHandle(Medium, Interface, pmt);
if (FAILED(hr))
{
m_InterfaceHandler->Release();
m_InterfaceHandler = InterfaceHandler;
}
}
// free medium / interface / dataformat // free medium / interface / dataformat
CoTaskMemFree(MediumList); CoTaskMemFree(MediumList);

View file

@ -247,12 +247,9 @@ CKsInterfaceHandler::KsProcessMediaSamples(
//release IMediaSample2 interface //release IMediaSample2 interface
MediaSample->Release(); MediaSample->Release();
if (FAILED(hr))
OutputDebugStringW(L"CKsInterfaceHandler::KsProcessMediaSamples MediaSample::GetProperties failed\n");
} }
else else
{ {
OutputDebugStringW(L"CKsInterfaceHandler::KsProcessMediaSamples MediaSample:: only IMediaSample supported\n");
// get properties // get properties
hr = SampleList[Index]->GetPointer((BYTE**)&Properties.pbBuffer); hr = SampleList[Index]->GetPointer((BYTE**)&Properties.pbBuffer);
assert(hr == NOERROR); assert(hr == NOERROR);

View file

@ -13,10 +13,10 @@
const GUID CLSID_KsClockForwarder = {0x877e4351, 0x6fea, 0x11d0, {0xb8, 0x63, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1}}; 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}}; const GUID CLSID_KsQualityForwarder = {0xe05592e4, 0xc0b5, 0x11d0, {0xa4, 0x39, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96}};
const GUID CLSID_KsIBasicAudioInterfaceHandler = {0xb9f8ac3e, 0x0f71, 0x11d2, {0xb7, 0x2c, 0x00, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d}};
#ifndef _MSC_VER #ifndef _MSC_VER
const GUID CLSID_KsIBasicAudioInterfaceHandler = {0xb9f8ac3e, 0x0f71, 0x11d2, {0xb7, 0x2c, 0x00, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d}};
const GUID KSPROPSETID_Pin = {0x8C134960, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}}; const GUID KSPROPSETID_Pin = {0x8C134960, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}};
const GUID KSINTERFACESETID_Standard = {STATIC_KSINTERFACESETID_Standard}; const GUID KSINTERFACESETID_Standard = {STATIC_KSINTERFACESETID_Standard};
const GUID CLSID_Proxy = {0x17CCA71B, 0xECD7, 0x11D0, {0xB9, 0x08, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}}; const GUID CLSID_Proxy = {0x17CCA71B, 0xECD7, 0x11D0, {0xB9, 0x08, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};

View file

@ -21,6 +21,7 @@ class COutputPin : public IPin,
// public IKsPinPipe, // public IKsPinPipe,
public IKsControl public IKsControl
/* /*
public IAMBufferNegotiation,
public IQualityControl, public IQualityControl,
public IKsPinEx, public IKsPinEx,
public IKsAggregateControl public IKsAggregateControl
@ -142,51 +143,55 @@ COutputPin::QueryInterface(
if (IsEqualGUID(refiid, IID_IUnknown) || if (IsEqualGUID(refiid, IID_IUnknown) ||
IsEqualGUID(refiid, IID_IPin)) IsEqualGUID(refiid, IID_IPin))
{ {
OutputDebugStringW(L"COutputPin::QueryInterface IID_IPin\n");
*Output = PVOID(this); *Output = PVOID(this);
reinterpret_cast<IUnknown*>(*Output)->AddRef(); reinterpret_cast<IUnknown*>(*Output)->AddRef();
return NOERROR; return NOERROR;
} }
else if (IsEqualGUID(refiid, IID_IKsObject)) else if (IsEqualGUID(refiid, IID_IKsObject))
{ {
OutputDebugStringW(L"COutputPin::QueryInterface IID_IKsObject\n");
*Output = (IKsObject*)(this); *Output = (IKsObject*)(this);
reinterpret_cast<IKsObject*>(*Output)->AddRef(); reinterpret_cast<IKsObject*>(*Output)->AddRef();
return NOERROR; return NOERROR;
} }
else if (IsEqualGUID(refiid, IID_IKsPropertySet)) else if (IsEqualGUID(refiid, IID_IKsPropertySet))
{ {
OutputDebugStringW(L"COutputPin::QueryInterface IID_IKsPropertySet\n");
DebugBreak();
*Output = (IKsPropertySet*)(this); *Output = (IKsPropertySet*)(this);
reinterpret_cast<IKsPropertySet*>(*Output)->AddRef(); reinterpret_cast<IKsPropertySet*>(*Output)->AddRef();
return NOERROR; return NOERROR;
} }
else if (IsEqualGUID(refiid, IID_IKsControl)) else if (IsEqualGUID(refiid, IID_IKsControl))
{ {
OutputDebugStringW(L"COutputPin::QueryInterface IID_IKsControl\n");
*Output = (IKsControl*)(this); *Output = (IKsControl*)(this);
reinterpret_cast<IKsControl*>(*Output)->AddRef(); reinterpret_cast<IKsControl*>(*Output)->AddRef();
return NOERROR; return NOERROR;
} }
#if 0
else if (IsEqualGUID(refiid, IID_IStreamBuilder)) else if (IsEqualGUID(refiid, IID_IStreamBuilder))
{ {
*Output = (IStreamBuilder*)(this); *Output = (IStreamBuilder*)(this);
reinterpret_cast<IStreamBuilder*>(*Output)->AddRef(); reinterpret_cast<IStreamBuilder*>(*Output)->AddRef();
return NOERROR; return NOERROR;
} }
#endif
else if (IsEqualGUID(refiid, IID_IKsPinFactory)) else if (IsEqualGUID(refiid, IID_IKsPinFactory))
{ {
OutputDebugStringW(L"COutputPin::QueryInterface IID_IKsPinFactory\n");
*Output = (IKsPinFactory*)(this); *Output = (IKsPinFactory*)(this);
reinterpret_cast<IKsPinFactory*>(*Output)->AddRef(); reinterpret_cast<IKsPinFactory*>(*Output)->AddRef();
return NOERROR; return NOERROR;
} }
else if (IsEqualGUID(refiid, IID_ISpecifyPropertyPages)) else if (IsEqualGUID(refiid, IID_ISpecifyPropertyPages))
{ {
OutputDebugStringW(L"COutputPin::QueryInterface IID_ISpecifyPropertyPages\n");
*Output = (ISpecifyPropertyPages*)(this); *Output = (ISpecifyPropertyPages*)(this);
reinterpret_cast<ISpecifyPropertyPages*>(*Output)->AddRef(); reinterpret_cast<ISpecifyPropertyPages*>(*Output)->AddRef();
return NOERROR; return NOERROR;
} }
else if (IsEqualGUID(refiid, IID_IBaseFilter))
{
OutputDebugStringW(L"COutputPin::QueryInterface query IID_IBaseFilter\n");
DebugBreak();
}
WCHAR Buffer[MAX_PATH]; WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr; LPOLESTR lpstr;
@ -226,6 +231,7 @@ STDMETHODCALLTYPE
COutputPin::KsPinFactory( COutputPin::KsPinFactory(
ULONG* PinFactory) ULONG* PinFactory)
{ {
OutputDebugStringW(L"COutputPin::KsPinFactory\n");
*PinFactory = m_PinId; *PinFactory = m_PinId;
return S_OK; return S_OK;
} }
@ -241,6 +247,7 @@ COutputPin::Render(
IPin *ppinOut, IPin *ppinOut,
IGraphBuilder *pGraph) IGraphBuilder *pGraph)
{ {
OutputDebugStringW(L"COutputPin::Render\n");
return S_OK; return S_OK;
} }
@ -250,6 +257,7 @@ COutputPin::Backout(
IPin *ppinOut, IPin *ppinOut,
IGraphBuilder *pGraph) IGraphBuilder *pGraph)
{ {
OutputDebugStringW(L"COutputPin::Backout\n");
return S_OK; return S_OK;
} }
//------------------------------------------------------------------- //-------------------------------------------------------------------
@ -259,6 +267,7 @@ HANDLE
STDMETHODCALLTYPE STDMETHODCALLTYPE
COutputPin::KsGetObjectHandle() COutputPin::KsGetObjectHandle()
{ {
OutputDebugStringW(L"COutputPin::KsGetObjectHandle\n");
assert(m_hPin); assert(m_hPin);
return m_hPin; return m_hPin;
} }
@ -276,6 +285,7 @@ COutputPin::KsProperty(
ULONG* BytesReturned) ULONG* BytesReturned)
{ {
assert(m_hPin != 0); assert(m_hPin != 0);
OutputDebugStringW(L"COutputPin::KsProperty\n");
return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_PROPERTY, (PVOID)Property, PropertyLength, (PVOID)PropertyData, DataLength, BytesReturned); return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_PROPERTY, (PVOID)Property, PropertyLength, (PVOID)PropertyData, DataLength, BytesReturned);
} }
@ -289,6 +299,7 @@ COutputPin::KsMethod(
ULONG* BytesReturned) ULONG* BytesReturned)
{ {
assert(m_hPin != 0); assert(m_hPin != 0);
OutputDebugStringW(L"COutputPin::KsMethod\n");
return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_METHOD, (PVOID)Method, MethodLength, (PVOID)MethodData, DataLength, BytesReturned); return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_METHOD, (PVOID)Method, MethodLength, (PVOID)MethodData, DataLength, BytesReturned);
} }
@ -303,6 +314,8 @@ COutputPin::KsEvent(
{ {
assert(m_hPin != 0); assert(m_hPin != 0);
OutputDebugStringW(L"COutputPin::KsEvent\n");
if (EventLength) if (EventLength)
return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_ENABLE_EVENT, (PVOID)Event, EventLength, (PVOID)EventData, DataLength, BytesReturned); return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_ENABLE_EVENT, (PVOID)Event, EventLength, (PVOID)EventData, DataLength, BytesReturned);
else else
@ -325,6 +338,8 @@ COutputPin::Set(
{ {
ULONG BytesReturned; ULONG BytesReturned;
OutputDebugStringW(L"COutputPin::Set\n");
if (cbInstanceData) if (cbInstanceData)
{ {
PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData); PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData);
@ -367,6 +382,8 @@ COutputPin::Get(
{ {
ULONG BytesReturned; ULONG BytesReturned;
OutputDebugStringW(L"COutputPin::Get\n");
if (cbInstanceData) if (cbInstanceData)
{ {
PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData); PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData);
@ -406,6 +423,8 @@ COutputPin::QuerySupported(
KSPROPERTY Property; KSPROPERTY Property;
ULONG BytesReturned; ULONG BytesReturned;
OutputDebugStringW(L"COutputPin::QuerySupported\n");
Property.Set = guidPropSet; Property.Set = guidPropSet;
Property.Id = dwPropID; Property.Id = dwPropID;
Property.Flags = KSPROPERTY_TYPE_SETSUPPORT; Property.Flags = KSPROPERTY_TYPE_SETSUPPORT;
@ -470,12 +489,15 @@ HRESULT
STDMETHODCALLTYPE STDMETHODCALLTYPE
COutputPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt) COutputPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt)
{ {
OutputDebugStringW(L"COutputPin::ReceiveConnection\n");
return E_UNEXPECTED; return E_UNEXPECTED;
} }
HRESULT HRESULT
STDMETHODCALLTYPE STDMETHODCALLTYPE
COutputPin::Disconnect( void) COutputPin::Disconnect( void)
{ {
OutputDebugStringW(L"COutputPin::Disconnect\n");
if (!m_Pin) if (!m_Pin)
{ {
// pin was not connected // pin was not connected
@ -495,6 +517,8 @@ HRESULT
STDMETHODCALLTYPE STDMETHODCALLTYPE
COutputPin::ConnectedTo(IPin **pPin) COutputPin::ConnectedTo(IPin **pPin)
{ {
OutputDebugStringW(L"COutputPin::ConnectedTo\n");
if (!pPin) if (!pPin)
return E_POINTER; return E_POINTER;
@ -520,6 +544,8 @@ HRESULT
STDMETHODCALLTYPE STDMETHODCALLTYPE
COutputPin::QueryPinInfo(PIN_INFO *pInfo) COutputPin::QueryPinInfo(PIN_INFO *pInfo)
{ {
OutputDebugStringW(L"COutputPin::QueryPinInfo\n");
wcscpy(pInfo->achName, m_PinName); wcscpy(pInfo->achName, m_PinName);
pInfo->dir = PINDIR_OUTPUT; pInfo->dir = PINDIR_OUTPUT;
pInfo->pFilter = m_ParentFilter; pInfo->pFilter = m_ParentFilter;
@ -531,6 +557,8 @@ HRESULT
STDMETHODCALLTYPE STDMETHODCALLTYPE
COutputPin::QueryDirection(PIN_DIRECTION *pPinDir) COutputPin::QueryDirection(PIN_DIRECTION *pPinDir)
{ {
OutputDebugStringW(L"COutputPin::QueryDirection\n");
if (pPinDir) if (pPinDir)
{ {
*pPinDir = PINDIR_OUTPUT; *pPinDir = PINDIR_OUTPUT;
@ -543,6 +571,8 @@ HRESULT
STDMETHODCALLTYPE STDMETHODCALLTYPE
COutputPin::QueryId(LPWSTR *Id) COutputPin::QueryId(LPWSTR *Id)
{ {
OutputDebugStringW(L"COutputPin::QueryId\n");
*Id = (LPWSTR)CoTaskMemAlloc((wcslen(m_PinName)+1)*sizeof(WCHAR)); *Id = (LPWSTR)CoTaskMemAlloc((wcslen(m_PinName)+1)*sizeof(WCHAR));
if (!*Id) if (!*Id)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
@ -605,7 +635,7 @@ COutputPin::EnumMediaTypes(IEnumMediaTypes **ppEnum)
{ {
// failed // failed
CoTaskMemFree(MediaTypes); CoTaskMemFree(MediaTypes);
OutputDebugStringW(L"COutputPin::EnumMediaTypes failed2\n"); OutputDebugStringW(L"COutputPin::EnumMediaTypes failed\n");
return hr; return hr;
} }
} }

View file

@ -19,6 +19,7 @@
#include <stdio.h> #include <stdio.h>
#include <vector> #include <vector>
#include <assert.h> #include <assert.h>
#include <ksmedia.h>
//#include <debug.h> //#include <debug.h>

View file

@ -1509,6 +1509,7 @@ STDMETHODCALLTYPE
CKsProxy::SetRate( CKsProxy::SetRate(
double dRate) double dRate)
{ {
OutputDebugStringW(L"CKsProxy::SetRate\n");
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -1517,6 +1518,7 @@ STDMETHODCALLTYPE
CKsProxy::GetRate( CKsProxy::GetRate(
double *pdRate) double *pdRate)
{ {
OutputDebugStringW(L"CKsProxy::GetRate\n");
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -1619,6 +1621,7 @@ CKsProxy::KsProperty(
ULONG* BytesReturned) ULONG* BytesReturned)
{ {
assert(m_hDevice != 0); assert(m_hDevice != 0);
OutputDebugStringW(L"CKsProxy::KsProperty\n");
return KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_PROPERTY, (PVOID)Property, PropertyLength, (PVOID)PropertyData, DataLength, BytesReturned); return KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_PROPERTY, (PVOID)Property, PropertyLength, (PVOID)PropertyData, DataLength, BytesReturned);
} }
@ -1632,6 +1635,7 @@ CKsProxy::KsMethod(
ULONG* BytesReturned) ULONG* BytesReturned)
{ {
assert(m_hDevice != 0); assert(m_hDevice != 0);
OutputDebugStringW(L"CKsProxy::KsMethod\n");
return KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_METHOD, (PVOID)Method, MethodLength, (PVOID)MethodData, DataLength, BytesReturned); return KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_METHOD, (PVOID)Method, MethodLength, (PVOID)MethodData, DataLength, BytesReturned);
} }
@ -1645,7 +1649,7 @@ CKsProxy::KsEvent(
ULONG* BytesReturned) ULONG* BytesReturned)
{ {
assert(m_hDevice != 0); assert(m_hDevice != 0);
OutputDebugStringW(L"CKsProxy::KsEvent\n");
if (EventLength) if (EventLength)
return KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_ENABLE_EVENT, (PVOID)Event, EventLength, (PVOID)EventData, DataLength, BytesReturned); return KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_ENABLE_EVENT, (PVOID)Event, EventLength, (PVOID)EventData, DataLength, BytesReturned);
else else
@ -1668,6 +1672,8 @@ CKsProxy::Set(
{ {
ULONG BytesReturned; ULONG BytesReturned;
OutputDebugStringW(L"CKsProxy::Set\n");
if (cbInstanceData) if (cbInstanceData)
{ {
PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData); PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData);
@ -1710,6 +1716,8 @@ CKsProxy::Get(
{ {
ULONG BytesReturned; ULONG BytesReturned;
OutputDebugStringW(L"CKsProxy::Get\n");
if (cbInstanceData) if (cbInstanceData)
{ {
PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData); PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData);
@ -1749,6 +1757,8 @@ CKsProxy::QuerySupported(
KSPROPERTY Property; KSPROPERTY Property;
ULONG BytesReturned; ULONG BytesReturned;
OutputDebugStringW(L"CKsProxy::QuerySupported\n");
Property.Set = guidPropSet; Property.Set = guidPropSet;
Property.Id = dwPropID; Property.Id = dwPropID;
Property.Flags = KSPROPERTY_TYPE_SETSUPPORT; Property.Flags = KSPROPERTY_TYPE_SETSUPPORT;
@ -1930,6 +1940,9 @@ HRESULT
STDMETHODCALLTYPE STDMETHODCALLTYPE
CKsProxy::DeviceInfo(CLSID *pclsidInterfaceClass, LPWSTR *pwszSymbolicLink) CKsProxy::DeviceInfo(CLSID *pclsidInterfaceClass, LPWSTR *pwszSymbolicLink)
{ {
OutputDebugStringW(L"CKsProxy::DeviceInfo\n");
if (!m_DevicePath) if (!m_DevicePath)
{ {
// object not initialized // object not initialized
@ -1953,6 +1966,8 @@ HRESULT
STDMETHODCALLTYPE STDMETHODCALLTYPE
CKsProxy::Reassociate(void) CKsProxy::Reassociate(void)
{ {
OutputDebugStringW(L"CKsProxy::Reassociate\n");
if (!m_DevicePath || m_hDevice) if (!m_DevicePath || m_hDevice)
{ {
// file path not available // file path not available
@ -1974,6 +1989,8 @@ HRESULT
STDMETHODCALLTYPE STDMETHODCALLTYPE
CKsProxy::Disassociate(void) CKsProxy::Disassociate(void)
{ {
OutputDebugStringW(L"CKsProxy::Disassociate\n");
if (!m_hDevice) if (!m_hDevice)
return E_HANDLE; return E_HANDLE;
@ -1990,6 +2007,7 @@ HANDLE
STDMETHODCALLTYPE STDMETHODCALLTYPE
CKsProxy::KsGetClockHandle() CKsProxy::KsGetClockHandle()
{ {
OutputDebugStringW(L"CKsProxy::KsGetClockHandle\n");
return m_hClock; return m_hClock;
} }
@ -2002,6 +2020,7 @@ HANDLE
STDMETHODCALLTYPE STDMETHODCALLTYPE
CKsProxy::KsGetObjectHandle() CKsProxy::KsGetObjectHandle()
{ {
OutputDebugStringW(L"CKsProxy::KsGetObjectHandle\n");
return m_hDevice; return m_hDevice;
} }
@ -2012,6 +2031,7 @@ HRESULT
STDMETHODCALLTYPE STDMETHODCALLTYPE
CKsProxy::InitNew( void) CKsProxy::InitNew( void)
{ {
OutputDebugStringW(L"CKsProxy::InitNew\n");
return S_OK; return S_OK;
} }
@ -2384,6 +2404,7 @@ CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog)
HDEVINFO hList; HDEVINFO hList;
SP_DEVICE_INTERFACE_DATA DeviceInterfaceData; SP_DEVICE_INTERFACE_DATA DeviceInterfaceData;
OutputDebugStringW(L"CKsProxy::Load\n");
// read device path // read device path
varName.vt = VT_BSTR; varName.vt = VT_BSTR;
@ -2396,6 +2417,10 @@ CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog)
return MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, GetLastError()); return MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, GetLastError());
} }
OutputDebugStringW(L"DevicePath: ");
OutputDebugStringW(varName.bstrVal);
OutputDebugStringW(L"\n");
// create device list // create device list
hList = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL); hList = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL);
if (hList == INVALID_HANDLE_VALUE) if (hList == INVALID_HANDLE_VALUE)
@ -2463,6 +2488,7 @@ HRESULT
STDMETHODCALLTYPE STDMETHODCALLTYPE
CKsProxy::Save(IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties) CKsProxy::Save(IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
{ {
OutputDebugStringW(L"CKsProxy::Save\n");
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -2532,7 +2558,7 @@ CKsProxy::SetSyncSource(
PIN_DIRECTION PinDir; PIN_DIRECTION PinDir;
// Plug In Distributor: IKsClock // Plug In Distributor: IKsClock
OutputDebugStringW(L"CKsProxy::SetSyncSource\n");
// FIXME // FIXME
// need locks // need locks
@ -2624,6 +2650,8 @@ STDMETHODCALLTYPE
CKsProxy::GetSyncSource( CKsProxy::GetSyncSource(
IReferenceClock **pClock) IReferenceClock **pClock)
{ {
OutputDebugStringW(L"CKsProxy::GetSyncSource\n");
if (!pClock) if (!pClock)
return E_POINTER; return E_POINTER;
@ -2639,6 +2667,7 @@ STDMETHODCALLTYPE
CKsProxy::EnumPins( CKsProxy::EnumPins(
IEnumPins **ppEnum) IEnumPins **ppEnum)
{ {
OutputDebugStringW(L"CKsProxy::EnumPins\n");
return CEnumPins_fnConstructor(m_Pins, IID_IEnumPins, (void**)ppEnum); return CEnumPins_fnConstructor(m_Pins, IID_IEnumPins, (void**)ppEnum);
} }
@ -2649,6 +2678,8 @@ CKsProxy::FindPin(
{ {
ULONG PinId; ULONG PinId;
OutputDebugStringW(L"CKsProxy::FindPin\n");
if (!ppPin) if (!ppPin)
return E_POINTER; return E_POINTER;
@ -2683,6 +2714,8 @@ CKsProxy::QueryFilterInfo(
if (!pInfo) if (!pInfo)
return E_POINTER; return E_POINTER;
OutputDebugStringW(L"CKsProxy::QueryFilterInfo\n");
pInfo->achName[0] = L'\0'; pInfo->achName[0] = L'\0';
pInfo->pGraph = m_pGraph; pInfo->pGraph = m_pGraph;
@ -2698,6 +2731,8 @@ CKsProxy::JoinFilterGraph(
IFilterGraph *pGraph, IFilterGraph *pGraph,
LPCWSTR pName) LPCWSTR pName)
{ {
OutputDebugStringW(L"CKsProxy::JoinFilterGraph\n");
if (pGraph) if (pGraph)
{ {
// joining filter graph // joining filter graph
@ -2718,6 +2753,7 @@ STDMETHODCALLTYPE
CKsProxy::QueryVendorInfo( CKsProxy::QueryVendorInfo(
LPWSTR *pVendorInfo) LPWSTR *pVendorInfo)
{ {
OutputDebugStringW(L"CKsProxy::QueryVendorInfo\n");
return StringFromCLSID(CLSID_Proxy, pVendorInfo); return StringFromCLSID(CLSID_Proxy, pVendorInfo);
} }