[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);
CoTaskMemFree(lpstr);
DebugBreak();
return E_NOINTERFACE;
}

View file

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

View file

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

View file

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

View file

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

View file

@ -155,14 +155,6 @@ CEnumPins_fnConstructor(
{
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;