Author: janderwald
Date: Mon Mar 1 19:59:42 2010
New Revision: 45748
URL:
http://svn.reactos.org/svn/reactos?rev=45748&view=rev
Log:
[MSDVBNP]
- Implement IEnumMediaTypes interface
- Implement IEnumPins interface
- Partly implement output pin (IPin interface) for the network provider
- Implement CNetworkProvider::GetState, CNetworkProvider::SetSyncSource,
CNetworkProvider::GetSyncSource, CNetworkProvider::EnumPins,
CNetworkProvider::QueryFilterInfo
- HACK: comment out deletion of object until reference counting has been fixed
Added:
trunk/reactos/dll/directx/msdvbnp/enum_mediatypes.cpp (with props)
trunk/reactos/dll/directx/msdvbnp/enumpins.cpp (with props)
trunk/reactos/dll/directx/msdvbnp/pin.cpp (with props)
Modified:
trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild
trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp
trunk/reactos/dll/directx/msdvbnp/precomp.h
trunk/reactos/dll/directx/msdvbnp/scanningtuner.cpp
Added: trunk/reactos/dll/directx/msdvbnp/enum_mediatypes.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/enum_m…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/enum_mediatypes.cpp (added)
+++ trunk/reactos/dll/directx/msdvbnp/enum_mediatypes.cpp [iso-8859-1] Mon Mar 1 19:59:42
2010
@@ -1,0 +1,189 @@
+/*
+ * 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(
+ IUnknown *pUnknown,
+ ULONG MediaTypeCount,
+ AM_MEDIA_TYPE * MediaTypes,
+ REFIID riid,
+ LPVOID * ppv)
+{
+ CEnumMediaTypes * handler = new CEnumMediaTypes(MediaTypeCount, MediaTypes);
+
+#ifdef MSDVBNP_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/msdvbnp/enum_mediatypes.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/directx/msdvbnp/enumpins.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/enumpi…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/enumpins.cpp (added)
+++ trunk/reactos/dll/directx/msdvbnp/enumpins.cpp [iso-8859-1] Mon Mar 1 19:59:42 2010
@@ -1,0 +1,175 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Network Provider for MPEG2 based networks
+ * FILE: dll/directx/msdvbnp/enumpins.cpp
+ * PURPOSE: IEnumPins interface
+ *
+ * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org)
+ */
+#include "precomp.h"
+
+class CEnumPins : public IEnumPins
+{
+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 cPins, IPin **ppPins, ULONG *pcFetched);
+ HRESULT STDMETHODCALLTYPE Skip(ULONG cPins);
+ HRESULT STDMETHODCALLTYPE Reset();
+ HRESULT STDMETHODCALLTYPE Clone(IEnumPins **ppEnum);
+
+ CEnumPins(ULONG NumPins, IPin ** pins) : m_Ref(0), m_NumPins(NumPins), m_Pins(pins),
m_Index(0){};
+ virtual ~CEnumPins(){};
+
+protected:
+ LONG m_Ref;
+ ULONG m_NumPins;
+ IPin ** m_Pins;
+ ULONG m_Index;
+};
+
+HRESULT
+STDMETHODCALLTYPE
+CEnumPins::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_IEnumPins))
+ {
+ *Output = (IEnumPins*)(this);
+ reinterpret_cast<IEnumPins*>(*Output)->AddRef();
+ return NOERROR;
+ }
+
+ WCHAR Buffer[MAX_PATH];
+ LPOLESTR lpstr;
+ StringFromCLSID(refiid, &lpstr);
+ swprintf(Buffer, L"CEnumPins::QueryInterface: NoInterface for %s\n",
lpstr);
+ OutputDebugStringW(Buffer);
+ CoTaskMemFree(lpstr);
+
+ return E_NOINTERFACE;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEnumPins::Next(
+ ULONG cPins,
+ IPin **ppPins,
+ ULONG *pcFetched)
+{
+ ULONG i = 0;
+
+ if (!ppPins)
+ return E_POINTER;
+
+ if (cPins > 1 && !pcFetched)
+ return E_INVALIDARG;
+
+ while(i < cPins)
+ {
+ if (m_Index + i >= m_NumPins)
+ break;
+
+ ppPins[i] = m_Pins[m_Index + i];
+ i++;
+ }
+
+ if (pcFetched)
+ {
+ *pcFetched = i;
+ }
+
+ m_Index += i;
+
+ if (i < cPins)
+ return S_FALSE;
+ else
+ return S_OK;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEnumPins::Skip(
+ ULONG cPins)
+{
+ if (cPins + m_Index >= m_NumPins)
+ {
+ return S_FALSE;
+ }
+
+ m_Index += cPins;
+ return S_OK;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEnumPins::Reset()
+{
+ m_Index = 0;
+ return S_OK;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEnumPins::Clone(
+ IEnumPins **ppEnum)
+{
+ OutputDebugStringW(L"CEnumPins::Clone : NotImplemented\n");
+ return E_NOTIMPL;
+}
+
+HRESULT
+WINAPI
+CEnumPins_fnConstructor(
+ IUnknown *pUnknown,
+ ULONG NumPins,
+ IPin ** pins,
+ REFIID riid,
+ LPVOID * ppv)
+{
+ CEnumPins * handler = new CEnumPins(NumPins, pins);
+
+#ifdef MSDVBNP_TRACE
+ WCHAR Buffer[MAX_PATH];
+ LPOLESTR lpstr;
+ StringFromCLSID(riid, &lpstr);
+ swprintf(Buffer, L"CEnumPins_fnConstructor riid %s pUnknown %p\n", lpstr,
pUnknown);
+ OutputDebugStringW(Buffer);
+#endif
+
+ if (!handler)
+ return E_OUTOFMEMORY;
+
+ if (FAILED(handler->QueryInterface(riid, ppv)))
+ {
+ /* not supported */
+ delete handler;
+ return E_NOINTERFACE;
+ }
+
+ return NOERROR;
+}
Propchange: trunk/reactos/dll/directx/msdvbnp/enumpins.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/msdvbn…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild [iso-8859-1] Mon Mar 1 19:59:42
2010
@@ -20,9 +20,12 @@
</group>
<file>classfactory.cpp</file>
+ <file>enum_mediatypes.cpp</file>
+ <file>enumpins.cpp</file>
<file>msdvbnp.cpp</file>
<file>msdvbnp.rc</file>
<file>networkprovider.cpp</file>
+ <file>pin.cpp</file>
<file>scanningtuner.cpp</file>
</module>
</group>
Modified: trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/networ…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp [iso-8859-1] Mon Mar 1 19:59:42
2010
@@ -25,7 +25,7 @@
InterlockedDecrement(&m_Ref);
if (!m_Ref)
{
- delete this;
+ //delete this;
return 0;
}
return m_Ref;
@@ -58,12 +58,15 @@
HRESULT STDMETHODCALLTYPE RegisterDeviceFilter(IUnknown *pUnkFilterControl, ULONG
*ppvRegisitrationContext);
HRESULT STDMETHODCALLTYPE UnRegisterDeviceFilter(ULONG pvRegistrationContext);
- CNetworkProvider() : m_Ref(0), m_pGraph(0){};
+ CNetworkProvider() : m_Ref(0), m_pGraph(0), m_ReferenceClock(0),
m_FilterState(State_Stopped) {m_Pins[0] = 0;};
virtual ~CNetworkProvider(){};
protected:
LONG m_Ref;
IFilterGraph *m_pGraph;
+ IReferenceClock * m_ReferenceClock;
+ FILTER_STATE m_FilterState;
+ IPin * m_Pins[1];
};
HRESULT
@@ -92,13 +95,10 @@
return CScanningTunner_fnConstructor(NULL, refiid, Output);
}
-
-
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
- swprintf(Buffer, L"CNetworkProvider::QueryInterface: NoInterface for %s",
lpstr);
- DebugBreak();
+ swprintf(Buffer, L"CNetworkProvider::QueryInterface: NoInterface for %s
!!!\n", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
@@ -150,8 +150,8 @@
DWORD dwMilliSecsTimeout,
FILTER_STATE *State)
{
- OutputDebugStringW(L"CNetworkProvider::GetState : NotImplemented\n");
- return E_NOTIMPL;
+ *State = m_FilterState;
+ return S_OK;
}
HRESULT
@@ -159,8 +159,19 @@
CNetworkProvider::SetSyncSource(
IReferenceClock *pClock)
{
- OutputDebugStringW(L"CNetworkProvider::SetSyncSource : NotImplemented\n");
- return E_NOTIMPL;
+ if (pClock)
+ {
+ pClock->AddRef();
+
+ }
+
+ if (m_ReferenceClock)
+ {
+ m_ReferenceClock->Release();
+ }
+
+ m_ReferenceClock = pClock;
+ return S_OK;
}
HRESULT
@@ -168,8 +179,14 @@
CNetworkProvider::GetSyncSource(
IReferenceClock **pClock)
{
- OutputDebugStringW(L"CNetworkProvider::GetSyncSource : NotImplemented\n");
- return E_NOTIMPL;
+ if (!pClock)
+ return E_POINTER;
+
+ if (m_ReferenceClock)
+ m_ReferenceClock->AddRef();
+
+ *pClock = m_ReferenceClock;
+ return S_OK;
}
HRESULT
@@ -177,8 +194,14 @@
CNetworkProvider::EnumPins(
IEnumPins **ppEnum)
{
- OutputDebugStringW(L"CNetworkProvider::EnumPins : NotImplemented\n");
- return E_NOTIMPL;
+ if (m_Pins[0] == 0)
+ {
+ HRESULT hr = CPin_fnConstructor(NULL, (IBaseFilter*)this, IID_IUnknown,
(void**)&m_Pins[0]);
+ if (FAILED(hr))
+ return hr;
+ }
+
+ return CEnumPins_fnConstructor(NULL, 1, m_Pins, IID_IEnumPins, (void**)ppEnum);
}
HRESULT
@@ -196,8 +219,13 @@
CNetworkProvider::QueryFilterInfo(
FILTER_INFO *pInfo)
{
- OutputDebugStringW(L"CNetworkProvider::QueryFilterInfo :
NotImplemented\n");
- return E_NOTIMPL;
+ if (!pInfo)
+ return E_POINTER;
+
+ pInfo->achName[0] = L'\0';
+ pInfo->pGraph = m_pGraph;
+
+ return S_OK;
}
HRESULT
@@ -325,7 +353,6 @@
REFIID riid,
LPVOID * ppv)
{
- // construct device control
CNetworkProvider * handler = new CNetworkProvider();
#ifdef MSDVBNP_TRACE
Added: 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 (added)
+++ trunk/reactos/dll/directx/msdvbnp/pin.cpp [iso-8859-1] Mon Mar 1 19:59:42 2010
@@ -1,0 +1,260 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Network Provider for MPEG2 based networks
+ * FILE: dll/directx/msdvbnp/pin.cpp
+ * PURPOSE: IPin interface
+ *
+ * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org)
+ */
+#include "precomp.h"
+
+const GUID KSDATAFORMAT_TYPE_BDA_ANTENNA = {0x71985f41, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x0,
0xc0, 0x4f, 0x79, 0x71, 0xe0}};
+const GUID GUID_NULL = {0x00000000L, 0x0000, 0x0000, {0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
+class CPin : public IPin
+{
+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;
+ }
+
+ //IPin methods
+ HRESULT STDMETHODCALLTYPE Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt);
+ HRESULT STDMETHODCALLTYPE ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE
*pmt);
+ HRESULT STDMETHODCALLTYPE Disconnect();
+ HRESULT STDMETHODCALLTYPE ConnectedTo(IPin **pPin);
+ HRESULT STDMETHODCALLTYPE ConnectionMediaType(AM_MEDIA_TYPE *pmt);
+ HRESULT STDMETHODCALLTYPE QueryPinInfo(PIN_INFO *pInfo);
+ HRESULT STDMETHODCALLTYPE QueryDirection(PIN_DIRECTION *pPinDir);
+ HRESULT STDMETHODCALLTYPE QueryId(LPWSTR *Id);
+ HRESULT STDMETHODCALLTYPE QueryAccept(const AM_MEDIA_TYPE *pmt);
+ HRESULT STDMETHODCALLTYPE EnumMediaTypes(IEnumMediaTypes **ppEnum);
+ HRESULT STDMETHODCALLTYPE QueryInternalConnections(IPin **apPin, ULONG *nPin);
+ HRESULT STDMETHODCALLTYPE EndOfStream();
+ HRESULT STDMETHODCALLTYPE BeginFlush();
+ HRESULT STDMETHODCALLTYPE EndFlush();
+ HRESULT STDMETHODCALLTYPE NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop,
double dRate);
+
+ CPin(IBaseFilter * ParentFilter) : m_Ref(0), m_ParentFilter(ParentFilter){};
+ virtual ~CPin(){};
+
+ static LPCWSTR PIN_ID;
+
+protected:
+ LONG m_Ref;
+ IBaseFilter * m_ParentFilter;
+};
+
+
+LPCWSTR CPin::PIN_ID = L"Antenna Out";
+
+HRESULT
+STDMETHODCALLTYPE
+CPin::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_IPin))
+ {
+ *Output = (IPin*)(this);
+ reinterpret_cast<IPin*>(*Output)->AddRef();
+ return NOERROR;
+ }
+
+ WCHAR Buffer[MAX_PATH];
+ LPOLESTR lpstr;
+ StringFromCLSID(refiid, &lpstr);
+ swprintf(Buffer, L"CPin::QueryInterface: NoInterface for %s\n", lpstr);
+ OutputDebugStringW(Buffer);
+ CoTaskMemFree(lpstr);
+
+ return E_NOINTERFACE;
+}
+
+//-------------------------------------------------------------------
+// IPin interface
+//
+HRESULT
+STDMETHODCALLTYPE
+CPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
+{
+ OutputDebugStringW(L"CPin::Connect called\n");
+ return E_NOTIMPL;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt)
+{
+ OutputDebugStringW(L"CPin::ReceiveConnection called\n");
+ return E_NOTIMPL;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::Disconnect( void)
+{
+ OutputDebugStringW(L"CPin::Disconnect called\n");
+ return E_NOTIMPL;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::ConnectedTo(IPin **pPin)
+{
+ OutputDebugStringW(L"CPin::ConnectedTo called\n");
+ return VFW_E_NOT_CONNECTED;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::ConnectionMediaType(AM_MEDIA_TYPE *pmt)
+{
+ OutputDebugStringW(L"CPin::ConnectionMediaType called\n");
+ return E_NOTIMPL;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::QueryPinInfo(PIN_INFO *pInfo)
+{
+ wcscpy(pInfo->achName, PIN_ID);
+ pInfo->dir = PINDIR_OUTPUT;
+ pInfo->pFilter = m_ParentFilter;
+
+ return S_OK;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::QueryDirection(PIN_DIRECTION *pPinDir)
+{
+ if (pPinDir)
+ {
+ *pPinDir = PINDIR_OUTPUT;
+ return S_OK;
+ }
+
+ return E_POINTER;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::QueryId(LPWSTR *Id)
+{
+ *Id = (LPWSTR)CoTaskMemAlloc(sizeof(PIN_ID));
+ if (!*Id)
+ return E_OUTOFMEMORY;
+
+ wcscpy(*Id, PIN_ID);
+ return S_OK;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::QueryAccept(const AM_MEDIA_TYPE *pmt)
+{
+ OutputDebugStringW(L"CPin::QueryAccept called\n");
+ return E_NOTIMPL;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::EnumMediaTypes(IEnumMediaTypes **ppEnum)
+{
+ AM_MEDIA_TYPE *MediaType = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
+
+ if (!MediaType)
+ {
+ return E_OUTOFMEMORY;
+ }
+
+ MediaType->majortype = KSDATAFORMAT_TYPE_BDA_ANTENNA;
+ MediaType->subtype = GUID_NULL;
+ MediaType->formattype = GUID_NULL;
+ MediaType->bFixedSizeSamples = true;
+ MediaType->bTemporalCompression = false;
+ MediaType->lSampleSize = sizeof(CHAR);
+ MediaType->pUnk = NULL;
+ MediaType->cbFormat = 0;
+ MediaType->pbFormat = NULL;
+
+ return CEnumMediaTypes_fnConstructor(NULL, 1, MediaType, IID_IEnumMediaTypes,
(void**)ppEnum);
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::QueryInternalConnections(IPin **apPin, ULONG *nPin)
+{
+ OutputDebugStringW(L"CPin::QueryInternalConnections called\n");
+ return E_NOTIMPL;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::EndOfStream( void)
+{
+ OutputDebugStringW(L"CPin::EndOfStream called\n");
+ return E_NOTIMPL;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::BeginFlush( void)
+{
+ OutputDebugStringW(L"CPin::BeginFlush called\n");
+ return E_NOTIMPL;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::EndFlush( void)
+{
+ OutputDebugStringW(L"CPin::EndFlush called\n");
+ return E_NOTIMPL;
+}
+HRESULT
+STDMETHODCALLTYPE
+CPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+ OutputDebugStringW(L"CPin::NewSegment called\n");
+ return E_NOTIMPL;
+}
+
+HRESULT
+WINAPI
+CPin_fnConstructor(
+ IUnknown *pUnknown,
+ IBaseFilter * ParentFilter,
+ REFIID riid,
+ LPVOID * ppv)
+{
+ CPin * handler = new CPin(ParentFilter);
+
+#ifdef MSDVBNP_TRACE
+ WCHAR Buffer[MAX_PATH];
+ LPOLESTR lpstr;
+ StringFromCLSID(riid, &lpstr);
+ swprintf(Buffer, L"CPin_fnConstructor riid %s pUnknown %p\n", lpstr,
pUnknown);
+ OutputDebugStringW(Buffer);
+#endif
+
+ if (!handler)
+ return E_OUTOFMEMORY;
+
+ if (FAILED(handler->QueryInterface(riid, ppv)))
+ {
+ /* not supported */
+ delete handler;
+ return E_NOINTERFACE;
+ }
+
+ return NOERROR;
+}
Propchange: trunk/reactos/dll/directx/msdvbnp/pin.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/msdvbnp/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/precom…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/msdvbnp/precomp.h [iso-8859-1] Mon Mar 1 19:59:42 2010
@@ -50,5 +50,33 @@
REFIID riid,
LPVOID * ppv);
+/* enumpins.cpp */
+HRESULT
+WINAPI
+CEnumPins_fnConstructor(
+ IUnknown *pUnknown,
+ ULONG NumPins,
+ IPin ** pins,
+ REFIID riid,
+ LPVOID * ppv);
+
+/* pin.cpp */
+HRESULT
+WINAPI
+CPin_fnConstructor(
+ IUnknown *pUnknown,
+ IBaseFilter * ParentFilter,
+ REFIID riid,
+ LPVOID * ppv);
+
+/* enum_mediatypes.cpp */
+HRESULT
+WINAPI
+CEnumMediaTypes_fnConstructor(
+ IUnknown *pUnknown,
+ ULONG MediaTypeCount,
+ AM_MEDIA_TYPE * MediaTypes,
+ REFIID riid,
+ LPVOID * ppv);
#endif
Modified: trunk/reactos/dll/directx/msdvbnp/scanningtuner.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/scanni…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/scanningtuner.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/msdvbnp/scanningtuner.cpp [iso-8859-1] Mon Mar 1 19:59:42
2010
@@ -23,7 +23,7 @@
InterlockedDecrement(&m_Ref);
if (!m_Ref)
{
- delete this;
+ //delete this;
return 0;
}
return m_Ref;
@@ -240,7 +240,6 @@
REFIID riid,
LPVOID * ppv)
{
- // construct device control
CScanningTunner * handler = new CScanningTunner();
#ifdef MSDVBNP_TRACE