[KSPROXY, MSDVBNP]

- Remove remaining DebugBreak
- Add debug traces

svn path=/trunk/; revision=46684
This commit is contained in:
Johannes Anderwald 2010-04-02 16:25:18 +00:00
parent 249d39c17a
commit b4a44e7a78
7 changed files with 91 additions and 38 deletions

View file

@ -71,7 +71,6 @@ CEnumPins::QueryInterface(
OutputDebugStringW(Buffer); OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr); CoTaskMemFree(lpstr);
DebugBreak();
return E_NOINTERFACE; return E_NOINTERFACE;
} }

View file

@ -700,7 +700,6 @@ CInputPin::Receive(IMediaSample *pSample)
{ {
#ifdef KSPROXY_TRACE #ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::Receive NotImplemented\n"); OutputDebugStringW(L"CInputPin::Receive NotImplemented\n");
DebugBreak();
#endif #endif
return E_NOTIMPL; return E_NOTIMPL;
@ -712,7 +711,6 @@ CInputPin::ReceiveMultiple(IMediaSample **pSamples, long nSamples, long *nSample
{ {
#ifdef KSPROXY_TRACE #ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::ReceiveMultiple NotImplemented\n"); OutputDebugStringW(L"CInputPin::ReceiveMultiple NotImplemented\n");
DebugBreak();
#endif #endif
return E_NOTIMPL; return E_NOTIMPL;
@ -724,7 +722,6 @@ CInputPin::ReceiveCanBlock( void)
{ {
#ifdef KSPROXY_TRACE #ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::ReceiveCanBlock NotImplemented\n"); OutputDebugStringW(L"CInputPin::ReceiveCanBlock NotImplemented\n");
DebugBreak();
#endif #endif
return S_FALSE; return S_FALSE;
@ -923,7 +920,6 @@ CInputPin::KsQualityNotify(
OutputDebugStringW(L"CInputPin::KsQualityNotify NotImplemented\n"); OutputDebugStringW(L"CInputPin::KsQualityNotify NotImplemented\n");
#endif #endif
DebugBreak();
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -1114,7 +1110,6 @@ CInputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
{ {
#ifdef KSPROXY_TRACE #ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::Connect NotImplemented\n"); OutputDebugStringW(L"CInputPin::Connect NotImplemented\n");
DebugBreak();
#endif #endif
return NOERROR; return NOERROR;
} }
@ -1199,7 +1194,6 @@ CInputPin::ConnectionMediaType(AM_MEDIA_TYPE *pmt)
#ifdef KSPROXY_TRACE #ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::ConnectionMediaType NotImplemented\n"); OutputDebugStringW(L"CInputPin::ConnectionMediaType NotImplemented\n");
DebugBreak();
#endif #endif
return E_NOTIMPL; return E_NOTIMPL;
@ -1496,7 +1490,6 @@ CInputPin::CreatePin(
WCHAR Buffer[100]; WCHAR Buffer[100];
swprintf(Buffer, L"CInputPin::CreatePin unexpected communication %u %s\n", m_Communication, m_PinName); swprintf(Buffer, L"CInputPin::CreatePin unexpected communication %u %s\n", m_Communication, m_PinName);
OutputDebugStringW(Buffer); OutputDebugStringW(Buffer);
DebugBreak();
#endif #endif
hr = E_FAIL; hr = E_FAIL;
} }
@ -1629,7 +1622,6 @@ CInputPin::CreatePinHandle(
{ {
#ifdef KSPROXY_TRACE #ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::CreatePinHandle GetSupportedSets failed\n"); OutputDebugStringW(L"CInputPin::CreatePinHandle GetSupportedSets failed\n");
DebugBreak();
#endif #endif
return hr; return hr;
} }
@ -1640,7 +1632,6 @@ CInputPin::CreatePinHandle(
{ {
#ifdef KSPROXY_TRACE #ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::CreatePinHandle LoadProxyPlugins failed\n"); OutputDebugStringW(L"CInputPin::CreatePinHandle LoadProxyPlugins failed\n");
DebugBreak();
#endif #endif
return hr; return hr;
} }
@ -1783,7 +1774,6 @@ CInputPin::LoadProxyPlugins(
{ {
// store plugin // store plugin
m_Plugins.push_back(pUnknown); m_Plugins.push_back(pUnknown);
DebugBreak();
} }
// close key // close key
RegCloseKey(hSubKey); RegCloseKey(hSubKey);

View file

@ -21,7 +21,6 @@ public:
STDMETHODIMP_(ULONG) Release() STDMETHODIMP_(ULONG) Release()
{ {
InterlockedDecrement(&m_Ref); InterlockedDecrement(&m_Ref);
DebugBreak();
if (!m_Ref) if (!m_Ref)
{ {
if (m_Allocator) if (m_Allocator)
@ -280,7 +279,6 @@ STDMETHODCALLTYPE
CMediaSample::SetMediaType(AM_MEDIA_TYPE *pMediaType) CMediaSample::SetMediaType(AM_MEDIA_TYPE *pMediaType)
{ {
OutputDebugStringW(L"CMediaSample::SetMediaType NotImplemented\n"); OutputDebugStringW(L"CMediaSample::SetMediaType NotImplemented\n");
DebugBreak();
return E_NOTIMPL; return E_NOTIMPL;
} }

View file

@ -1548,7 +1548,6 @@ COutputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
OutputDebugStringW(L"COutputPin::Connect no IMemInputPin interface\n"); OutputDebugStringW(L"COutputPin::Connect no IMemInputPin interface\n");
#endif #endif
DebugBreak();
return hr; return hr;
} }
@ -1946,13 +1945,26 @@ COutputPin::CreatePin(
// query for pin medium // query for pin medium
hr = KsQueryMediums(&MediumList); hr = KsQueryMediums(&MediumList);
if (FAILED(hr)) if (FAILED(hr))
{
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"COutputPin::CreatePin KsQueryMediums failed %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
return hr; return hr;
}
// query for pin interface // query for pin interface
hr = KsQueryInterfaces(&InterfaceList); hr = KsQueryInterfaces(&InterfaceList);
if (FAILED(hr)) if (FAILED(hr))
{ {
// failed // failed
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"COutputPin::CreatePin KsQueryInterfaces failed %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
CoTaskMemFree(MediumList); CoTaskMemFree(MediumList);
return hr; return hr;
} }
@ -2003,6 +2015,12 @@ COutputPin::CreatePin(
CoTaskMemFree(MediumList); CoTaskMemFree(MediumList);
CoTaskMemFree(InterfaceList); CoTaskMemFree(InterfaceList);
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"COutputPin::CreatePin failed to create interface handler %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
return hr; return hr;
} }
@ -2010,7 +2028,12 @@ COutputPin::CreatePin(
hr = InterfaceHandler->KsSetPin((IKsPin*)this); hr = InterfaceHandler->KsSetPin((IKsPin*)this);
if (FAILED(hr)) if (FAILED(hr))
{ {
// failed to load interface handler plugin // failed to initialize interface handler plugin
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"COutputPin::CreatePin failed to initialize interface handler %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
InterfaceHandler->Release(); InterfaceHandler->Release();
CoTaskMemFree(MediumList); CoTaskMemFree(MediumList);
CoTaskMemFree(InterfaceList); CoTaskMemFree(InterfaceList);
@ -2027,7 +2050,6 @@ COutputPin::CreatePin(
WCHAR Buffer[100]; WCHAR Buffer[100];
swprintf(Buffer, L"COutputPin::CreatePin unexpected communication %u %s\n", m_Communication, m_PinName); swprintf(Buffer, L"COutputPin::CreatePin unexpected communication %u %s\n", m_Communication, m_PinName);
OutputDebugStringW(Buffer); OutputDebugStringW(Buffer);
DebugBreak();
#endif #endif
hr = E_FAIL; hr = E_FAIL;
@ -2037,6 +2059,12 @@ COutputPin::CreatePin(
CoTaskMemFree(MediumList); CoTaskMemFree(MediumList);
CoTaskMemFree(InterfaceList); CoTaskMemFree(InterfaceList);
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"COutputPin::CreatePin Result %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
return hr; return hr;
} }
@ -2058,6 +2086,8 @@ COutputPin::CreatePinHandle(
//KSPROPERTY Property; //KSPROPERTY Property;
//ULONG BytesReturned; //ULONG BytesReturned;
OutputDebugStringW(L"COutputPin::CreatePinHandle\n");
if (m_hPin != INVALID_HANDLE_VALUE) if (m_hPin != INVALID_HANDLE_VALUE)
{ {
// pin already exists // pin already exists
@ -2173,7 +2203,6 @@ COutputPin::CreatePinHandle(
if (FAILED(InitializeIOThread())) if (FAILED(InitializeIOThread()))
{ {
OutputDebugStringW(L"COutputPin::CreatePinHandle failed to initialize i/o thread\n"); OutputDebugStringW(L"COutputPin::CreatePinHandle failed to initialize i/o thread\n");
DebugBreak();
} }
LPGUID pGuid; LPGUID pGuid;
@ -2184,8 +2213,7 @@ COutputPin::CreatePinHandle(
if (FAILED(hr)) if (FAILED(hr))
{ {
#ifdef KSPROXY_TRACE #ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::CreatePinHandle GetSupportedSets failed\n"); OutputDebugStringW(L"COutputPin::CreatePinHandle GetSupportedSets failed\n");
DebugBreak();
#endif #endif
return hr; return hr;
} }
@ -2195,8 +2223,7 @@ COutputPin::CreatePinHandle(
if (FAILED(hr)) if (FAILED(hr))
{ {
#ifdef KSPROXY_TRACE #ifdef KSPROXY_TRACE
OutputDebugStringW(L"CInputPin::CreatePinHandle LoadProxyPlugins failed\n"); OutputDebugStringW(L"COutputPin::CreatePinHandle LoadProxyPlugins failed\n");
DebugBreak();
#endif #endif
return hr; return hr;
} }
@ -2338,7 +2365,6 @@ COutputPin::LoadProxyPlugins(
{ {
// store plugin // store plugin
m_Plugins.push_back(pUnknown); m_Plugins.push_back(pUnknown);
DebugBreak();
} }
// close key // close key
RegCloseKey(hSubKey); RegCloseKey(hSubKey);

View file

@ -3,7 +3,7 @@
#define _FORCENAMELESSUNION #define _FORCENAMELESSUNION
#define BUILDING_KS #define BUILDING_KS
#define _KSDDK_ #define _KSDDK_
//#define KSPROXY_TRACE #define KSPROXY_TRACE
#include <dshow.h> #include <dshow.h>
//#include <streams.h> //#include <streams.h>
#include <ks.h> #include <ks.h>

View file

@ -1954,7 +1954,6 @@ CKsProxy::IsDirty()
{ {
#ifdef KSPROXY_TRACE #ifdef KSPROXY_TRACE
OutputDebugStringW(L"CKsProxy::IsDirty Notimplemented\n"); OutputDebugStringW(L"CKsProxy::IsDirty Notimplemented\n");
DebugBreak();
#endif #endif
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -2035,7 +2034,6 @@ CKsProxy::Load(
}while(Length > 0); }while(Length > 0);
DebugBreak();
return S_OK; return S_OK;
} }
@ -2059,7 +2057,6 @@ CKsProxy::GetSizeMax(
{ {
#ifdef KSPROXY_TRACE #ifdef KSPROXY_TRACE
OutputDebugStringW(L"CKsProxy::GetSizeMax Notimplemented\n"); OutputDebugStringW(L"CKsProxy::GetSizeMax Notimplemented\n");
DebugBreak();
#endif #endif
return E_NOTIMPL; return E_NOTIMPL;
@ -2480,23 +2477,50 @@ CKsProxy::CreatePins()
// query current instance count // query current instance count
hr = GetPinInstanceCount(Index, &Instances); hr = GetPinInstanceCount(Index, &Instances);
if (FAILED(hr)) if (FAILED(hr))
{
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CKsProxy::CreatePins GetPinInstanceCount failed with %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
continue; continue;
}
// query pin communication; // query pin communication;
hr = GetPinCommunication(Index, &Communication); hr = GetPinCommunication(Index, &Communication);
if (FAILED(hr)) if (FAILED(hr))
{
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CKsProxy::CreatePins GetPinCommunication failed with %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
continue; continue;
}
if (Instances.CurrentCount == Instances.PossibleCount) if (Instances.CurrentCount == Instances.PossibleCount)
{ {
// already maximum reached for this pin // already maximum reached for this pin
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CKsProxy::CreatePins Instances.CurrentCount == Instances.PossibleCount\n");
OutputDebugStringW(Buffer);
#endif
continue; continue;
} }
// get direction of pin // get direction of pin
hr = GetPinDataflow(Index, &DataFlow); hr = GetPinDataflow(Index, &DataFlow);
if (FAILED(hr)) if (FAILED(hr))
{
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CKsProxy::CreatePins GetPinDataflow failed with %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
continue; continue;
}
if (DataFlow == KSPIN_DATAFLOW_IN) if (DataFlow == KSPIN_DATAFLOW_IN)
hr = GetPinName(Index, DataFlow, InputPin, &PinName); hr = GetPinName(Index, DataFlow, InputPin, &PinName);
@ -2504,7 +2528,14 @@ CKsProxy::CreatePins()
hr = GetPinName(Index, DataFlow, OutputPin, &PinName); hr = GetPinName(Index, DataFlow, OutputPin, &PinName);
if (FAILED(hr)) if (FAILED(hr))
{
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CKsProxy::CreatePins GetPinName failed with %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
continue; continue;
}
// construct the pins // construct the pins
if (DataFlow == KSPIN_DATAFLOW_IN) if (DataFlow == KSPIN_DATAFLOW_IN)
@ -2512,6 +2543,11 @@ CKsProxy::CreatePins()
hr = CInputPin_Constructor((IBaseFilter*)this, PinName, m_hDevice, Index, Communication, IID_IPin, (void**)&pPin); hr = CInputPin_Constructor((IBaseFilter*)this, PinName, m_hDevice, Index, Communication, IID_IPin, (void**)&pPin);
if (FAILED(hr)) if (FAILED(hr))
{ {
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CKsProxy::CreatePins CInputPin_Constructor failed with %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
CoTaskMemFree(PinName); CoTaskMemFree(PinName);
continue; continue;
} }
@ -2522,6 +2558,11 @@ CKsProxy::CreatePins()
hr = COutputPin_Constructor((IBaseFilter*)this, PinName, Index, Communication, IID_IPin, (void**)&pPin); hr = COutputPin_Constructor((IBaseFilter*)this, PinName, Index, Communication, IID_IPin, (void**)&pPin);
if (FAILED(hr)) if (FAILED(hr))
{ {
#ifdef KSPROXY_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CKsProxy::CreatePins COutputPin_Constructor failed with %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
CoTaskMemFree(PinName); CoTaskMemFree(PinName);
continue; continue;
} }
@ -2627,9 +2668,12 @@ CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog)
hr = LoadProxyPlugins(pGuid, NumGuids); hr = LoadProxyPlugins(pGuid, NumGuids);
if (FAILED(hr)) if (FAILED(hr))
{ {
#if 0 //HACK
CloseHandle(m_hDevice); CloseHandle(m_hDevice);
m_hDevice = NULL; m_hDevice = NULL;
return hr; return hr;
#endif
OutputDebugStringW(L"CKsProxy::LoadProxyPlugins failed!\n");
} }
// free sets // free sets
@ -2638,6 +2682,14 @@ CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog)
// now create the input / output pins // now create the input / output pins
hr = CreatePins(); hr = CreatePins();
#ifdef KSPROXY_TRACE
swprintf(Buffer, L"CKsProxy::Load CreatePins %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
//HACK
hr = S_OK;
return hr; return hr;
} }
@ -2986,10 +3038,6 @@ STDMETHODCALLTYPE
CKsProxy::EnumPins( CKsProxy::EnumPins(
IEnumPins **ppEnum) IEnumPins **ppEnum)
{ {
#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CKsProxy::EnumPins\n");
#endif
return CEnumPins_fnConstructor(m_Pins, IID_IEnumPins, (void**)ppEnum); return CEnumPins_fnConstructor(m_Pins, IID_IEnumPins, (void**)ppEnum);
} }

View file

@ -155,14 +155,6 @@ CEnumPins_fnConstructor(
{ {
CEnumPins * handler = new CEnumPins(NumPins, pins); 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) if (!handler)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;