Author: janderwald
Date: Wed Mar 3 04:27:25 2010
New Revision: 45776
URL:
http://svn.reactos.org/svn/reactos?rev=45776&view=rev
Log:
[KSPROXY]
- Implement IEnumMediaTypes interface
- Implement IKsObject, IKsPropertySet, IKsControl interface for CInputPin
- Verify connection format for CInputPin
- Delegate interface requests to ksproxy plugins
- Implement CKsProxy::FindPin
[MSDVBNP]
- Use FORMAT_None as format specifier
Added:
trunk/reactos/dll/directx/ksproxy/enum_mediatypes.cpp (with props)
Modified:
trunk/reactos/dll/directx/ksproxy/input_pin.cpp
trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild
trunk/reactos/dll/directx/ksproxy/precomp.h
trunk/reactos/dll/directx/ksproxy/proxy.cpp
trunk/reactos/dll/directx/msdvbnp/pin.cpp
Added: trunk/reactos/dll/directx/ksproxy/enum_mediatypes.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/enum_m…
==============================================================================
--- trunk/reactos/dll/directx/ksproxy/enum_mediatypes.cpp (added)
+++ trunk/reactos/dll/directx/ksproxy/enum_mediatypes.cpp [iso-8859-1] Wed Mar 3 04:27:25
2010
@@ -1,0 +1,188 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Network Provider for MPEG2 based networks
+ * FILE: dll/directx/msdvbnp/enum_mediatypes.cpp
+ * PURPOSE: IEnumMediaTypes interface
+ *
+ * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org)
+ */
+#include "precomp.h"
+
+class CEnumMediaTypes : public IEnumMediaTypes
+{
+public:
+ STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
+
+ STDMETHODIMP_(ULONG) AddRef()
+ {
+ InterlockedIncrement(&m_Ref);
+ return m_Ref;
+ }
+ STDMETHODIMP_(ULONG) Release()
+ {
+ InterlockedDecrement(&m_Ref);
+ if (!m_Ref)
+ {
+ delete this;
+ return 0;
+ }
+ return m_Ref;
+ }
+
+ HRESULT STDMETHODCALLTYPE Next(ULONG cMediaTypes, AM_MEDIA_TYPE **ppMediaTypes, ULONG
*pcFetched);
+ HRESULT STDMETHODCALLTYPE Skip(ULONG cMediaTypes);
+ HRESULT STDMETHODCALLTYPE Reset();
+ HRESULT STDMETHODCALLTYPE Clone(IEnumMediaTypes **ppEnum);
+
+
+ CEnumMediaTypes(ULONG MediaTypeCount, AM_MEDIA_TYPE * MediaTypes) : m_Ref(0),
m_MediaTypeCount(MediaTypeCount), m_MediaTypes(MediaTypes), m_Index(0){};
+ virtual ~CEnumMediaTypes(){};
+
+protected:
+ LONG m_Ref;
+ ULONG m_MediaTypeCount;
+ AM_MEDIA_TYPE * m_MediaTypes;
+ ULONG m_Index;
+};
+
+HRESULT
+STDMETHODCALLTYPE
+CEnumMediaTypes::QueryInterface(
+ IN REFIID refiid,
+ OUT PVOID* Output)
+{
+ if (IsEqualGUID(refiid, IID_IUnknown))
+ {
+ *Output = PVOID(this);
+ reinterpret_cast<IUnknown*>(*Output)->AddRef();
+ return NOERROR;
+ }
+ if (IsEqualGUID(refiid, IID_IEnumMediaTypes))
+ {
+ *Output = (IEnumMediaTypes*)(this);
+ reinterpret_cast<IEnumMediaTypes*>(*Output)->AddRef();
+ return NOERROR;
+ }
+
+ WCHAR Buffer[MAX_PATH];
+ LPOLESTR lpstr;
+ StringFromCLSID(refiid, &lpstr);
+ swprintf(Buffer, L"CEnumMediaTypes::QueryInterface: NoInterface for %s\n",
lpstr);
+ OutputDebugStringW(Buffer);
+ CoTaskMemFree(lpstr);
+
+ return E_NOINTERFACE;
+}
+
+//-------------------------------------------------------------------
+// IEnumMediaTypes
+//
+
+HRESULT
+STDMETHODCALLTYPE
+CEnumMediaTypes::Next(
+ ULONG cMediaTypes,
+ AM_MEDIA_TYPE **ppMediaTypes,
+ ULONG *pcFetched)
+{
+ ULONG i = 0;
+ AM_MEDIA_TYPE * MediaType;
+
+ if (!ppMediaTypes)
+ return E_POINTER;
+
+ if (cMediaTypes > 1 && !pcFetched)
+ return E_INVALIDARG;
+
+ while(i < cMediaTypes)
+ {
+ if (m_Index + i >= m_MediaTypeCount)
+ break;
+
+ MediaType = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
+ if (!MediaType)
+ break;
+
+ CopyMemory(MediaType, &m_MediaTypes[m_Index + i], sizeof(AM_MEDIA_TYPE));
+ ppMediaTypes[i] = MediaType;
+ i++;
+ }
+
+ if (pcFetched)
+ {
+ *pcFetched = i;
+ }
+
+ m_Index += i;
+
+ if (i < cMediaTypes)
+ return S_FALSE;
+ else
+ return S_OK;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEnumMediaTypes::Skip(
+ ULONG cMediaTypes)
+{
+ if (cMediaTypes + m_Index >= m_MediaTypeCount)
+ {
+ return S_FALSE;
+ }
+
+ m_Index += cMediaTypes;
+ return S_OK;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEnumMediaTypes::Reset()
+{
+ m_Index = 0;
+ return S_OK;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEnumMediaTypes::Clone(
+ IEnumMediaTypes **ppEnum)
+{
+ OutputDebugStringW(L"CEnumMediaTypes::Clone : NotImplemented\n");
+ return E_NOTIMPL;
+}
+
+HRESULT
+WINAPI
+CEnumMediaTypes_fnConstructor(
+ ULONG MediaTypeCount,
+ AM_MEDIA_TYPE * MediaTypes,
+ REFIID riid,
+ LPVOID * ppv)
+{
+ CEnumMediaTypes * handler = new CEnumMediaTypes(MediaTypeCount, MediaTypes);
+
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[MAX_PATH];
+ LPOLESTR lpstr;
+ StringFromCLSID(riid, &lpstr);
+ swprintf(Buffer, L"CEnumMediaTypes_fnConstructor riid %s pUnknown %p\n",
lpstr, pUnknown);
+ OutputDebugStringW(Buffer);
+#endif
+
+ if (!handler)
+ {
+ CoTaskMemFree(MediaTypes);
+ return E_OUTOFMEMORY;
+ }
+
+ if (FAILED(handler->QueryInterface(riid, ppv)))
+ {
+ /* not supported */
+ delete handler;
+ return E_NOINTERFACE;
+ }
+
+ return NOERROR;
+}
+
Propchange: trunk/reactos/dll/directx/ksproxy/enum_mediatypes.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/ksproxy/input_pin.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/input_…
==============================================================================
--- trunk/reactos/dll/directx/ksproxy/input_pin.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ksproxy/input_pin.cpp [iso-8859-1] Wed Mar 3 04:27:25 2010
@@ -8,17 +8,17 @@
*/
#include "precomp.h"
-class CInputPin : public IPin
+class CInputPin : public IPin,
+ public IKsPropertySet,
+ public IKsControl,
+ public IKsObject
/*
public IQualityControl,
- public IKsObject,
public IKsPinEx,
public IKsPinPipe,
public ISpecifyPropertyPages,
public IStreamBuilder,
- public IKsPropertySet,
public IKsPinFactory,
- public IKsControl,
public IKsAggregateControl
*/
{
@@ -58,13 +58,30 @@
HRESULT STDMETHODCALLTYPE EndFlush();
HRESULT STDMETHODCALLTYPE NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop,
double dRate);
- CInputPin(IBaseFilter * ParentFilter, LPCWSTR PinName) : m_Ref(0),
m_ParentFilter(ParentFilter), m_PinName(PinName){};
+ //IKsObject methods
+ HANDLE STDMETHODCALLTYPE KsGetObjectHandle();
+
+ //IKsPropertySet
+ HRESULT STDMETHODCALLTYPE Set(REFGUID guidPropSet, DWORD dwPropID, LPVOID
pInstanceData, DWORD cbInstanceData, LPVOID pPropData, DWORD cbPropData);
+ HRESULT STDMETHODCALLTYPE Get(REFGUID guidPropSet, DWORD dwPropID, LPVOID
pInstanceData, DWORD cbInstanceData, LPVOID pPropData, DWORD cbPropData, DWORD
*pcbReturned);
+ HRESULT STDMETHODCALLTYPE QuerySupported(REFGUID guidPropSet, DWORD dwPropID, DWORD
*pTypeSupport);
+
+ //IKsControl
+ HRESULT STDMETHODCALLTYPE KsProperty(PKSPROPERTY Property, ULONG PropertyLength,
LPVOID PropertyData, ULONG DataLength, ULONG* BytesReturned);
+ HRESULT STDMETHODCALLTYPE KsMethod(PKSMETHOD Method, ULONG MethodLength, LPVOID
MethodData, ULONG DataLength, ULONG* BytesReturned);
+ HRESULT STDMETHODCALLTYPE KsEvent(PKSEVENT Event, ULONG EventLength, LPVOID
EventData, ULONG DataLength, ULONG* BytesReturned);
+
+ HRESULT STDMETHODCALLTYPE CheckFormat(const AM_MEDIA_TYPE *pmt);
+ CInputPin(IBaseFilter * ParentFilter, LPCWSTR PinName, HANDLE hFilter, ULONG PinId) :
m_Ref(0), m_ParentFilter(ParentFilter), m_PinName(PinName), m_hFilter(hFilter), m_hPin(0),
m_PinId(PinId){};
virtual ~CInputPin(){};
protected:
LONG m_Ref;
IBaseFilter * m_ParentFilter;
LPCWSTR m_PinName;
+ HANDLE m_hFilter;
+ HANDLE m_hPin;
+ ULONG m_PinId;
};
HRESULT
@@ -74,11 +91,48 @@
OUT PVOID* Output)
{
*Output = NULL;
+
if (IsEqualGUID(refiid, IID_IUnknown) ||
IsEqualGUID(refiid, IID_IPin))
{
*Output = PVOID(this);
reinterpret_cast<IUnknown*>(*Output)->AddRef();
+ return NOERROR;
+ }
+ else if (IsEqualGUID(refiid, IID_IKsObject))
+ {
+ if (!m_hPin)
+ {
+ OutputDebugStringW(L"CInputPin::QueryInterface IID_IKsObject Create
PIN!!!\n");
+ DebugBreak();
+ }
+
+ *Output = (IKsObject*)(this);
+ reinterpret_cast<IKsObject*>(*Output)->AddRef();
+ return NOERROR;
+ }
+ else if (IsEqualGUID(refiid, IID_IKsPropertySet))
+ {
+ if (!m_hPin)
+ {
+ OutputDebugStringW(L"CInputPin::QueryInterface IID_IKsPropertySet Create
PIN!!!\n");
+ DebugBreak();
+ }
+
+ *Output = (IKsPropertySet*)(this);
+ reinterpret_cast<IKsPropertySet*>(*Output)->AddRef();
+ return NOERROR;
+ }
+ else if (IsEqualGUID(refiid, IID_IKsControl))
+ {
+ if (!m_hPin)
+ {
+ OutputDebugStringW(L"CInputPin::QueryInterface IID_IKsControl Create
PIN!!!\n");
+ DebugBreak();
+ }
+
+ *Output = (IKsControl*)(this);
+ reinterpret_cast<IKsControl*>(*Output)->AddRef();
return NOERROR;
}
@@ -93,13 +147,183 @@
}
//-------------------------------------------------------------------
+// IKsPropertySet
+//
+HRESULT
+STDMETHODCALLTYPE
+CInputPin::KsProperty(
+ PKSPROPERTY Property,
+ ULONG PropertyLength,
+ LPVOID PropertyData,
+ ULONG DataLength,
+ ULONG* BytesReturned)
+{
+ return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_PROPERTY, (PVOID)Property,
PropertyLength, (PVOID)PropertyData, DataLength, BytesReturned);
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CInputPin::KsMethod(
+ PKSMETHOD Method,
+ ULONG MethodLength,
+ LPVOID MethodData,
+ ULONG DataLength,
+ ULONG* BytesReturned)
+{
+ return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_METHOD, (PVOID)Method,
MethodLength, (PVOID)MethodData, DataLength, BytesReturned);
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CInputPin::KsEvent(
+ PKSEVENT Event,
+ ULONG EventLength,
+ LPVOID EventData,
+ ULONG DataLength,
+ ULONG* BytesReturned)
+{
+ if (EventLength)
+ return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_ENABLE_EVENT, (PVOID)Event,
EventLength, (PVOID)EventData, DataLength, BytesReturned);
+ else
+ return KsSynchronousDeviceControl(m_hPin, IOCTL_KS_DISABLE_EVENT, (PVOID)Event,
EventLength, NULL, 0, BytesReturned);
+}
+
+
+//-------------------------------------------------------------------
+// IKsPropertySet
+//
+HRESULT
+STDMETHODCALLTYPE
+CInputPin::Set(
+ REFGUID guidPropSet,
+ DWORD dwPropID,
+ LPVOID pInstanceData,
+ DWORD cbInstanceData,
+ LPVOID pPropData,
+ DWORD cbPropData)
+{
+ ULONG BytesReturned;
+
+ if (cbInstanceData)
+ {
+ PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) +
cbInstanceData);
+ if (!Property)
+ return E_OUTOFMEMORY;
+
+ Property->Set = guidPropSet;
+ Property->Id = dwPropID;
+ Property->Flags = KSPROPERTY_TYPE_SET;
+
+ CopyMemory((Property+1), pInstanceData, cbInstanceData);
+
+ HRESULT hr = KsProperty(Property, sizeof(KSPROPERTY) + cbInstanceData, pPropData,
cbPropData, &BytesReturned);
+ CoTaskMemFree(Property);
+ return hr;
+ }
+ else
+ {
+ KSPROPERTY Property;
+
+ Property.Set = guidPropSet;
+ Property.Id = dwPropID;
+ Property.Flags = KSPROPERTY_TYPE_SET;
+
+ HRESULT hr = KsProperty(&Property, sizeof(KSPROPERTY), pPropData, cbPropData,
&BytesReturned);
+ return hr;
+ }
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CInputPin::Get(
+ REFGUID guidPropSet,
+ DWORD dwPropID,
+ LPVOID pInstanceData,
+ DWORD cbInstanceData,
+ LPVOID pPropData,
+ DWORD cbPropData,
+ DWORD *pcbReturned)
+{
+ ULONG BytesReturned;
+
+ if (cbInstanceData)
+ {
+ PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) +
cbInstanceData);
+ if (!Property)
+ return E_OUTOFMEMORY;
+
+ Property->Set = guidPropSet;
+ Property->Id = dwPropID;
+ Property->Flags = KSPROPERTY_TYPE_GET;
+
+ CopyMemory((Property+1), pInstanceData, cbInstanceData);
+
+ HRESULT hr = KsProperty(Property, sizeof(KSPROPERTY) + cbInstanceData, pPropData,
cbPropData, &BytesReturned);
+ CoTaskMemFree(Property);
+ return hr;
+ }
+ else
+ {
+ KSPROPERTY Property;
+
+ Property.Set = guidPropSet;
+ Property.Id = dwPropID;
+ Property.Flags = KSPROPERTY_TYPE_GET;
+
+ HRESULT hr = KsProperty(&Property, sizeof(KSPROPERTY), pPropData, cbPropData,
&BytesReturned);
+ return hr;
+ }
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CInputPin::QuerySupported(
+ REFGUID guidPropSet,
+ DWORD dwPropID,
+ DWORD *pTypeSupport)
+{
+ KSPROPERTY Property;
+ ULONG BytesReturned;
+
+ Property.Set = guidPropSet;
+ Property.Id = dwPropID;
+ Property.Flags = KSPROPERTY_TYPE_SETSUPPORT;
+
+ return KsProperty(&Property, sizeof(KSPROPERTY), pTypeSupport, sizeof(DWORD),
&BytesReturned);
+}
+
+
+//-------------------------------------------------------------------
+// IKsObject
+//
+HANDLE
+STDMETHODCALLTYPE
+CInputPin::KsGetObjectHandle()
+{
+ OutputDebugStringW(L"CInputPin::KsGetObjectHandle CALLED\n");
+
+ //FIXME
+ // return pin handle
+ return m_hPin;
+}
+
+//-------------------------------------------------------------------
// IPin interface
//
HRESULT
STDMETHODCALLTYPE
CInputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
{
- OutputDebugStringW(L"CInputPin::Connect called\n");
+ //MajorFormat: KSDATAFORMAT_TYPE_BDA_ANTENNA
+ //SubType: MEDIASUBTYPE_None
+ //FormatType: FORMAT_None
+ //bFixedSizeSamples 1 bTemporalCompression 0 lSampleSize 1 pUnk 00000000 cbFormat 0
pbFormat 00000000
+
+ //KSPROPSETID_Connection KSPROPERTY_CONNECTION_PROPOSEDATAFORMAT
+ //PriorityClass = KSPRIORITY_NORMAL PrioritySubClass = KSPRIORITY_NORMAL
+
+
+ OutputDebugStringW(L"CInputPin::Connect NotImplemented\n");
return E_NOTIMPL;
}
@@ -107,28 +331,29 @@
STDMETHODCALLTYPE
CInputPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt)
{
- OutputDebugStringW(L"CInputPin::ReceiveConnection called\n");
+ OutputDebugStringW(L"CInputPin::ReceiveConnection NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CInputPin::Disconnect( void)
{
- OutputDebugStringW(L"CInputPin::Disconnect called\n");
+ OutputDebugStringW(L"CInputPin::Disconnect NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CInputPin::ConnectedTo(IPin **pPin)
{
- OutputDebugStringW(L"CInputPin::ConnectedTo called\n");
+ *pPin = NULL;
+ OutputDebugStringW(L"CInputPin::ConnectedTo NotImplemented\n");
return VFW_E_NOT_CONNECTED;
}
HRESULT
STDMETHODCALLTYPE
CInputPin::ConnectionMediaType(AM_MEDIA_TYPE *pmt)
{
- OutputDebugStringW(L"CInputPin::ConnectionMediaType called\n");
+ OutputDebugStringW(L"CInputPin::ConnectionMediaType NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
@@ -165,53 +390,112 @@
wcscpy(*Id, m_PinName);
return S_OK;
}
-HRESULT
-STDMETHODCALLTYPE
-CInputPin::QueryAccept(const AM_MEDIA_TYPE *pmt)
-{
- OutputDebugStringW(L"CInputPin::QueryAccept called\n");
- return E_NOTIMPL;
+
+HRESULT
+STDMETHODCALLTYPE
+CInputPin::CheckFormat(
+ const AM_MEDIA_TYPE *pmt)
+{
+ KSP_PIN Property;
+ PKSMULTIPLE_ITEM MultipleItem;
+ PKSDATAFORMAT DataFormat;
+ ULONG BytesReturned;
+ HRESULT hr;
+
+ // prepare request
+ Property.Property.Set = KSPROPSETID_Pin;
+ Property.Property.Id = KSPROPERTY_PIN_DATARANGES;
+ Property.Property.Flags = KSPROPERTY_TYPE_GET;
+ Property.PinId = m_PinId;
+ Property.Reserved = 0;
+
+ // query for size of dataranges
+ hr = KsSynchronousDeviceControl(m_hFilter, IOCTL_KS_PROPERTY, (PVOID)&Property,
sizeof(KSP_PIN), NULL, 0, &BytesReturned);
+
+ if (hr == MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_MORE_DATA))
+ {
+ // allocate dataranges buffer
+ MultipleItem = (PKSMULTIPLE_ITEM)CoTaskMemAlloc(BytesReturned);
+
+ if (!MultipleItem)
+ return E_OUTOFMEMORY;
+
+ // query dataranges
+ hr = KsSynchronousDeviceControl(m_hFilter, IOCTL_KS_PROPERTY,
(PVOID)&Property, sizeof(KSP_PIN), (PVOID)MultipleItem, BytesReturned,
&BytesReturned);
+
+ if (FAILED(hr))
+ {
+ // failed to query data ranges
+ CoTaskMemFree(MultipleItem);
+ return hr;
+ }
+
+ DataFormat = (PKSDATAFORMAT)(MultipleItem + 1);
+ for(ULONG Index = 0; Index < MultipleItem->Count; Index++)
+ {
+ if (IsEqualGUID(pmt->majortype, DataFormat->MajorFormat) &&
+ IsEqualGUID(pmt->subtype, DataFormat->SubFormat) &&
+ IsEqualGUID(pmt->formattype, DataFormat->Specifier))
+ {
+ // format is supported
+ CoTaskMemFree(MultipleItem);
+ OutputDebugStringW(L"CInputPin::CheckFormat format OK\n");
+ return S_OK;
+ }
+ DataFormat = (PKSDATAFORMAT)((ULONG_PTR)DataFormat +
DataFormat->FormatSize);
+ }
+ //format is not supported
+ CoTaskMemFree(MultipleItem);
+ }
+ return S_FALSE;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CInputPin::QueryAccept(
+ const AM_MEDIA_TYPE *pmt)
+{
+ return CheckFormat(pmt);
}
HRESULT
STDMETHODCALLTYPE
CInputPin::EnumMediaTypes(IEnumMediaTypes **ppEnum)
{
- OutputDebugStringW(L"CInputPin::EnumMediaTypes called\n");
- return E_NOTIMPL;
+ return CEnumMediaTypes_fnConstructor(0, NULL, IID_IEnumMediaTypes, (void**)ppEnum);
}
HRESULT
STDMETHODCALLTYPE
CInputPin::QueryInternalConnections(IPin **apPin, ULONG *nPin)
{
- OutputDebugStringW(L"CInputPin::QueryInternalConnections called\n");
+ OutputDebugStringW(L"CInputPin::QueryInternalConnections
NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CInputPin::EndOfStream( void)
{
- OutputDebugStringW(L"CInputPin::EndOfStream called\n");
+ OutputDebugStringW(L"CInputPin::EndOfStream NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CInputPin::BeginFlush( void)
{
- OutputDebugStringW(L"CInputPin::BeginFlush called\n");
+ OutputDebugStringW(L"CInputPin::BeginFlush NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CInputPin::EndFlush( void)
{
- OutputDebugStringW(L"CInputPin::EndFlush called\n");
+ OutputDebugStringW(L"CInputPin::EndFlush NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
{
- OutputDebugStringW(L"CInputPin::NewSegment called\n");
+ OutputDebugStringW(L"CInputPin::NewSegment NotImplemented\n");
return E_NOTIMPL;
}
@@ -220,10 +504,12 @@
CInputPin_Constructor(
IBaseFilter * ParentFilter,
LPCWSTR PinName,
+ HANDLE hFilter,
+ ULONG PinId,
REFIID riid,
LPVOID * ppv)
{
- CInputPin * handler = new CInputPin(ParentFilter, PinName);
+ CInputPin * handler = new CInputPin(ParentFilter, PinName, hFilter, PinId);
if (!handler)
return E_OUTOFMEMORY;
Modified: trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/ksprox…
==============================================================================
--- trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild [iso-8859-1] Wed Mar 3 04:27:25
2010
@@ -26,6 +26,7 @@
<file>cvpconfig.cpp</file>
<file>cvpvbiconfig.cpp</file>
<file>datatype.cpp</file>
+ <file>enum_mediatypes.cpp</file>
<file>enumpins.cpp</file>
<file>input_pin.cpp</file>
<file>interface.cpp</file>
Modified: trunk/reactos/dll/directx/ksproxy/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/precom…
==============================================================================
--- trunk/reactos/dll/directx/ksproxy/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ksproxy/precomp.h [iso-8859-1] Wed Mar 3 04:27:25 2010
@@ -16,6 +16,7 @@
#include <vptype.h>
#include <vpconfig.h>
#include <setupapi.h>
+#include <stdio.h>
#include <vector>
//#include <debug.h>
@@ -104,6 +105,8 @@
CInputPin_Constructor(
IBaseFilter * ParentFilter,
LPCWSTR PinName,
+ HANDLE hFilter,
+ ULONG PinId,
REFIID riid,
LPVOID * ppv);
@@ -122,5 +125,15 @@
CEnumPins_fnConstructor(
std::vector<IPin*> Pins,
REFIID riid,
- LPVOID * ppv)
-;
+ LPVOID * ppv);
+
+/* enum_mediatypes.cpp */
+HRESULT
+WINAPI
+CEnumMediaTypes_fnConstructor(
+ ULONG MediaTypeCount,
+ AM_MEDIA_TYPE * MediaTypes,
+ REFIID riid,
+ LPVOID * ppv);
+
+
Modified: trunk/reactos/dll/directx/ksproxy/proxy.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/proxy.…
==============================================================================
--- trunk/reactos/dll/directx/ksproxy/proxy.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ksproxy/proxy.cpp [iso-8859-1] Wed Mar 3 04:27:25 2010
@@ -10,7 +10,7 @@
const GUID IID_IPersistPropertyBag = {0x37D84F60, 0x42CB, 0x11CE, {0x81, 0x35, 0x00,
0xAA, 0x00, 0x4B, 0xB8, 0x51}};
const GUID GUID_NULL = {0x00000000L, 0x0000, 0x0000, {0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
-
+const GUID IID_IBDA_DeviceControl = {0xFD0A5AF3, 0xB41D, 0x11d2, {0x9C, 0x95, 0x00, 0xC0,
0x4F, 0x79, 0x71, 0xE0}};
/*
Needs IKsClock, IKsNotifyEvent
*/
@@ -134,6 +134,24 @@
return NOERROR;
}
+ for(ULONG Index = 0; Index < m_Plugins.size(); Index++)
+ {
+ if (m_Pins[Index])
+ {
+ HRESULT hr = m_Plugins[Index]->QueryInterface(refiid, Output);
+ if (SUCCEEDED(hr))
+ {
+ WCHAR Buffer[100];
+ LPOLESTR lpstr;
+ StringFromCLSID(refiid, &lpstr);
+ swprintf(Buffer, L"CKsProxy::QueryInterface plugin %lu supports
interface %s\n", Index, lpstr);
+ OutputDebugStringW(Buffer);
+ CoTaskMemFree(lpstr);
+ return hr;
+ }
+ }
+ }
+
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
@@ -469,7 +487,7 @@
// construct the pins
if (DataFlow == KSPIN_DATAFLOW_IN)
{
- hr = CInputPin_Constructor((IBaseFilter*)this, PinName, IID_IPin,
(void**)&pPin);
+ hr = CInputPin_Constructor((IBaseFilter*)this, PinName, m_hDevice, Index,
IID_IPin, (void**)&pPin);
if (FAILED(hr))
{
CoTaskMemFree(PinName);
@@ -555,11 +573,6 @@
// now create the input / output pins
hr = CreatePins();
-
- CloseHandle(m_hDevice);
- m_hDevice = NULL;
-
-
return hr;
}
@@ -657,7 +670,6 @@
CKsProxy::EnumPins(
IEnumPins **ppEnum)
{
- OutputDebugStringW(L"CKsProxy::EnumPins\n");
return CEnumPins_fnConstructor(m_Pins, IID_IEnumPins, (void**)ppEnum);
}
@@ -666,8 +678,31 @@
CKsProxy::FindPin(
LPCWSTR Id, IPin **ppPin)
{
- OutputDebugStringW(L"CKsProxy::FindPin : NotImplemented\n");
- return E_NOTIMPL;
+ ULONG PinId;
+
+ if (!ppPin)
+ return E_POINTER;
+
+ // convert to pin
+ int ret = swscanf(Id, L"%u", &PinId);
+
+ if (!ret || ret == EOF)
+ {
+ // invalid id
+ return VFW_E_NOT_FOUND;
+ }
+
+ if (PinId >= m_Pins.size() || m_Pins[PinId] == NULL)
+ {
+ // invalid id
+ return VFW_E_NOT_FOUND;
+ }
+
+ // found pin
+ *ppPin = m_Pins[PinId];
+ m_Pins[PinId]->AddRef();
+
+ return S_OK;
}
@@ -702,7 +737,6 @@
m_pGraph = 0;
}
- OutputDebugStringW(L"CKsProxy::JoinFilterGraph\n");
return S_OK;
}
Modified: trunk/reactos/dll/directx/msdvbnp/pin.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/pin.cp…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/pin.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/msdvbnp/pin.cpp [iso-8859-1] Wed Mar 3 04:27:25 2010
@@ -184,7 +184,7 @@
MediaType->majortype = KSDATAFORMAT_TYPE_BDA_ANTENNA;
MediaType->subtype = MEDIASUBTYPE_None;
- MediaType->formattype = GUID_NULL;
+ MediaType->formattype = FORMAT_None;
MediaType->bFixedSizeSamples = true;
MediaType->bTemporalCompression = false;
MediaType->lSampleSize = sizeof(CHAR);