mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[KSPROXY]
- Implement IKsDataTypeHandler::KsIsMediaTypeInRanges, IKsDataTypeHandler::KsSetMediaType - Instantiate the IKsInterfaceHandler for the CInputPin svn path=/trunk/; revision=46208
This commit is contained in:
parent
7a57ed5819
commit
531fab28a4
7 changed files with 229 additions and 38 deletions
|
@ -42,12 +42,25 @@ public:
|
|||
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 @@ STDMETHODCALLTYPE
|
|||
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 @@ CKsDataTypeHandler::KsQueryExtendedSize(
|
|||
{
|
||||
/* no header extension required */
|
||||
*ExtendedSize = 0;
|
||||
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
|
@ -115,19 +187,38 @@ STDMETHODCALLTYPE
|
|||
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 @@ CKsDataTypeHandler_Constructor (
|
|||
LPVOID * ppv)
|
||||
{
|
||||
OutputDebugStringW(L"CKsDataTypeHandler_Constructor\n");
|
||||
|
||||
CKsDataTypeHandler * handler = new CKsDataTypeHandler();
|
||||
|
||||
if (!handler)
|
||||
|
|
|
@ -143,7 +143,7 @@ public:
|
|||
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 @@ protected:
|
|||
KSPIN_INTERFACE m_Interface;
|
||||
KSPIN_MEDIUM m_Medium;
|
||||
IPin * m_Pin;
|
||||
IKsInterfaceHandler * m_InterfaceHandler;
|
||||
BOOL m_ReadOnly;
|
||||
};
|
||||
|
||||
|
@ -666,16 +667,17 @@ CInputPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt)
|
|||
|
||||
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 @@ CInputPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt)
|
|||
return hr;
|
||||
}
|
||||
|
||||
//FIXME create pin
|
||||
m_Pin = pConnector;
|
||||
m_Pin->AddRef();
|
||||
m_Pin = pConnector;
|
||||
m_Pin->AddRef();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -925,6 +926,7 @@ CInputPin::CreatePin(
|
|||
PKSMULTIPLE_ITEM InterfaceList;
|
||||
PKSPIN_MEDIUM Medium;
|
||||
PKSPIN_INTERFACE Interface;
|
||||
IKsInterfaceHandler * InterfaceHandler;
|
||||
HRESULT hr;
|
||||
|
||||
// query for pin medium
|
||||
|
@ -963,8 +965,43 @@ CInputPin::CreatePin(
|
|||
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);
|
||||
|
|
|
@ -247,12 +247,9 @@ CKsInterfaceHandler::KsProcessMediaSamples(
|
|||
|
||||
//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 @@ CKsInterfaceHandler::KsProcessMediaSamples(
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -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}};
|
||||
const GUID CLSID_KsIBasicAudioInterfaceHandler = {0xb9f8ac3e, 0x0f71, 0x11d2, {0xb7, 0x2c, 0x00, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d}};
|
||||
|
||||
|
||||
#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 KSINTERFACESETID_Standard = {STATIC_KSINTERFACESETID_Standard};
|
||||
const GUID CLSID_Proxy = {0x17CCA71B, 0xECD7, 0x11D0, {0xB9, 0x08, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};
|
||||
|
|
|
@ -21,6 +21,7 @@ class COutputPin : public IPin,
|
|||
// public IKsPinPipe,
|
||||
public IKsControl
|
||||
/*
|
||||
public IAMBufferNegotiation,
|
||||
public IQualityControl,
|
||||
public IKsPinEx,
|
||||
public IKsAggregateControl
|
||||
|
@ -142,51 +143,55 @@ COutputPin::QueryInterface(
|
|||
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];
|
||||
LPOLESTR lpstr;
|
||||
|
@ -226,6 +231,7 @@ STDMETHODCALLTYPE
|
|||
COutputPin::KsPinFactory(
|
||||
ULONG* PinFactory)
|
||||
{
|
||||
OutputDebugStringW(L"COutputPin::KsPinFactory\n");
|
||||
*PinFactory = m_PinId;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -241,6 +247,7 @@ COutputPin::Render(
|
|||
IPin *ppinOut,
|
||||
IGraphBuilder *pGraph)
|
||||
{
|
||||
OutputDebugStringW(L"COutputPin::Render\n");
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -250,6 +257,7 @@ COutputPin::Backout(
|
|||
IPin *ppinOut,
|
||||
IGraphBuilder *pGraph)
|
||||
{
|
||||
OutputDebugStringW(L"COutputPin::Backout\n");
|
||||
return S_OK;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
|
@ -259,6 +267,7 @@ HANDLE
|
|||
STDMETHODCALLTYPE
|
||||
COutputPin::KsGetObjectHandle()
|
||||
{
|
||||
OutputDebugStringW(L"COutputPin::KsGetObjectHandle\n");
|
||||
assert(m_hPin);
|
||||
return m_hPin;
|
||||
}
|
||||
|
@ -276,6 +285,7 @@ COutputPin::KsProperty(
|
|||
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 @@ COutputPin::KsMethod(
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -303,6 +314,8 @@ COutputPin::KsEvent(
|
|||
{
|
||||
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);
|
||||
else
|
||||
|
@ -325,6 +338,8 @@ COutputPin::Set(
|
|||
{
|
||||
ULONG BytesReturned;
|
||||
|
||||
OutputDebugStringW(L"COutputPin::Set\n");
|
||||
|
||||
if (cbInstanceData)
|
||||
{
|
||||
PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData);
|
||||
|
@ -367,6 +382,8 @@ COutputPin::Get(
|
|||
{
|
||||
ULONG BytesReturned;
|
||||
|
||||
OutputDebugStringW(L"COutputPin::Get\n");
|
||||
|
||||
if (cbInstanceData)
|
||||
{
|
||||
PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData);
|
||||
|
@ -406,6 +423,8 @@ COutputPin::QuerySupported(
|
|||
KSPROPERTY Property;
|
||||
ULONG BytesReturned;
|
||||
|
||||
OutputDebugStringW(L"COutputPin::QuerySupported\n");
|
||||
|
||||
Property.Set = guidPropSet;
|
||||
Property.Id = dwPropID;
|
||||
Property.Flags = KSPROPERTY_TYPE_SETSUPPORT;
|
||||
|
@ -470,12 +489,15 @@ HRESULT
|
|||
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 @@ HRESULT
|
|||
STDMETHODCALLTYPE
|
||||
COutputPin::ConnectedTo(IPin **pPin)
|
||||
{
|
||||
OutputDebugStringW(L"COutputPin::ConnectedTo\n");
|
||||
|
||||
if (!pPin)
|
||||
return E_POINTER;
|
||||
|
||||
|
@ -520,6 +544,8 @@ HRESULT
|
|||
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 @@ HRESULT
|
|||
STDMETHODCALLTYPE
|
||||
COutputPin::QueryDirection(PIN_DIRECTION *pPinDir)
|
||||
{
|
||||
OutputDebugStringW(L"COutputPin::QueryDirection\n");
|
||||
|
||||
if (pPinDir)
|
||||
{
|
||||
*pPinDir = PINDIR_OUTPUT;
|
||||
|
@ -543,6 +571,8 @@ HRESULT
|
|||
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 @@ COutputPin::EnumMediaTypes(IEnumMediaTypes **ppEnum)
|
|||
// 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 @@ COutputPin::EnumMediaTypes(IEnumMediaTypes **ppEnum)
|
|||
{
|
||||
// failed
|
||||
CoTaskMemFree(MediaTypes);
|
||||
OutputDebugStringW(L"COutputPin::EnumMediaTypes failed2\n");
|
||||
OutputDebugStringW(L"COutputPin::EnumMediaTypes failed\n");
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <stdio.h>
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
#include <ksmedia.h>
|
||||
//#include <debug.h>
|
||||
|
||||
|
||||
|
|
|
@ -1509,6 +1509,7 @@ STDMETHODCALLTYPE
|
|||
CKsProxy::SetRate(
|
||||
double dRate)
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::SetRate\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
@ -1517,6 +1518,7 @@ STDMETHODCALLTYPE
|
|||
CKsProxy::GetRate(
|
||||
double *pdRate)
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::GetRate\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
@ -1619,6 +1621,7 @@ CKsProxy::KsProperty(
|
|||
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 @@ CKsProxy::KsMethod(
|
|||
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 @@ CKsProxy::KsEvent(
|
|||
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
|
||||
|
@ -1668,6 +1672,8 @@ CKsProxy::Set(
|
|||
{
|
||||
ULONG BytesReturned;
|
||||
|
||||
OutputDebugStringW(L"CKsProxy::Set\n");
|
||||
|
||||
if (cbInstanceData)
|
||||
{
|
||||
PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData);
|
||||
|
@ -1710,6 +1716,8 @@ CKsProxy::Get(
|
|||
{
|
||||
ULONG BytesReturned;
|
||||
|
||||
OutputDebugStringW(L"CKsProxy::Get\n");
|
||||
|
||||
if (cbInstanceData)
|
||||
{
|
||||
PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData);
|
||||
|
@ -1749,6 +1757,8 @@ CKsProxy::QuerySupported(
|
|||
KSPROPERTY Property;
|
||||
ULONG BytesReturned;
|
||||
|
||||
OutputDebugStringW(L"CKsProxy::QuerySupported\n");
|
||||
|
||||
Property.Set = guidPropSet;
|
||||
Property.Id = dwPropID;
|
||||
Property.Flags = KSPROPERTY_TYPE_SETSUPPORT;
|
||||
|
@ -1930,6 +1940,9 @@ HRESULT
|
|||
STDMETHODCALLTYPE
|
||||
CKsProxy::DeviceInfo(CLSID *pclsidInterfaceClass, LPWSTR *pwszSymbolicLink)
|
||||
{
|
||||
|
||||
OutputDebugStringW(L"CKsProxy::DeviceInfo\n");
|
||||
|
||||
if (!m_DevicePath)
|
||||
{
|
||||
// object not initialized
|
||||
|
@ -1953,6 +1966,8 @@ HRESULT
|
|||
STDMETHODCALLTYPE
|
||||
CKsProxy::Reassociate(void)
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::Reassociate\n");
|
||||
|
||||
if (!m_DevicePath || m_hDevice)
|
||||
{
|
||||
// file path not available
|
||||
|
@ -1974,6 +1989,8 @@ HRESULT
|
|||
STDMETHODCALLTYPE
|
||||
CKsProxy::Disassociate(void)
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::Disassociate\n");
|
||||
|
||||
if (!m_hDevice)
|
||||
return E_HANDLE;
|
||||
|
||||
|
@ -1990,6 +2007,7 @@ HANDLE
|
|||
STDMETHODCALLTYPE
|
||||
CKsProxy::KsGetClockHandle()
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::KsGetClockHandle\n");
|
||||
return m_hClock;
|
||||
}
|
||||
|
||||
|
@ -2002,6 +2020,7 @@ HANDLE
|
|||
STDMETHODCALLTYPE
|
||||
CKsProxy::KsGetObjectHandle()
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::KsGetObjectHandle\n");
|
||||
return m_hDevice;
|
||||
}
|
||||
|
||||
|
@ -2012,6 +2031,7 @@ HRESULT
|
|||
STDMETHODCALLTYPE
|
||||
CKsProxy::InitNew( void)
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::InitNew\n");
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -2384,6 +2404,7 @@ CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog)
|
|||
HDEVINFO hList;
|
||||
SP_DEVICE_INTERFACE_DATA DeviceInterfaceData;
|
||||
|
||||
OutputDebugStringW(L"CKsProxy::Load\n");
|
||||
|
||||
// read device path
|
||||
varName.vt = VT_BSTR;
|
||||
|
@ -2396,6 +2417,10 @@ CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog)
|
|||
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 @@ HRESULT
|
|||
STDMETHODCALLTYPE
|
||||
CKsProxy::Save(IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::Save\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
@ -2532,7 +2558,7 @@ CKsProxy::SetSyncSource(
|
|||
PIN_DIRECTION PinDir;
|
||||
|
||||
// Plug In Distributor: IKsClock
|
||||
|
||||
OutputDebugStringW(L"CKsProxy::SetSyncSource\n");
|
||||
|
||||
// FIXME
|
||||
// need locks
|
||||
|
@ -2624,6 +2650,8 @@ STDMETHODCALLTYPE
|
|||
CKsProxy::GetSyncSource(
|
||||
IReferenceClock **pClock)
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::GetSyncSource\n");
|
||||
|
||||
if (!pClock)
|
||||
return E_POINTER;
|
||||
|
||||
|
@ -2639,6 +2667,7 @@ STDMETHODCALLTYPE
|
|||
CKsProxy::EnumPins(
|
||||
IEnumPins **ppEnum)
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::EnumPins\n");
|
||||
return CEnumPins_fnConstructor(m_Pins, IID_IEnumPins, (void**)ppEnum);
|
||||
}
|
||||
|
||||
|
@ -2649,6 +2678,8 @@ CKsProxy::FindPin(
|
|||
{
|
||||
ULONG PinId;
|
||||
|
||||
OutputDebugStringW(L"CKsProxy::FindPin\n");
|
||||
|
||||
if (!ppPin)
|
||||
return E_POINTER;
|
||||
|
||||
|
@ -2683,6 +2714,8 @@ CKsProxy::QueryFilterInfo(
|
|||
if (!pInfo)
|
||||
return E_POINTER;
|
||||
|
||||
OutputDebugStringW(L"CKsProxy::QueryFilterInfo\n");
|
||||
|
||||
pInfo->achName[0] = L'\0';
|
||||
pInfo->pGraph = m_pGraph;
|
||||
|
||||
|
@ -2698,6 +2731,8 @@ CKsProxy::JoinFilterGraph(
|
|||
IFilterGraph *pGraph,
|
||||
LPCWSTR pName)
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::JoinFilterGraph\n");
|
||||
|
||||
if (pGraph)
|
||||
{
|
||||
// joining filter graph
|
||||
|
@ -2718,6 +2753,7 @@ STDMETHODCALLTYPE
|
|||
CKsProxy::QueryVendorInfo(
|
||||
LPWSTR *pVendorInfo)
|
||||
{
|
||||
OutputDebugStringW(L"CKsProxy::QueryVendorInfo\n");
|
||||
return StringFromCLSID(CLSID_Proxy, pVendorInfo);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue