HRESULT STDMETHODCALLTYPE KsProcessMediaSamples(IKsDataTypeHandler *KsDataTypeHandler, IMediaSample** SampleList, PLONG SampleCount, KSIOOPERATION IoOperation, PKSSTREAM_SEGMENT *StreamSegment);
HRESULT STDMETHODCALLTYPE KsCompleteIo(PKSSTREAM_SEGMENT StreamSegment);
- CKsInterfaceHandler() : m_Ref(0), m_Handle(NULL), m_Pin(0){};
+ CKsInterfaceHandler() : m_Ref(0), m_Handle(NULL), m_Pin(0) {m_PinName[0] = L'\0';};
virtual ~CKsInterfaceHandler(){};
protected:
LONG m_Ref;
HANDLE m_Handle;
IKsPinEx * m_Pin;
+ WCHAR m_PinName[129];
};
typedef struct
{
KSSTREAM_SEGMENT StreamSegment;
+ OVERLAPPED Overlapped;
IMediaSample * MediaSample[64];
ULONG SampleCount;
ULONG ExtendedSize;
PKSSTREAM_HEADER StreamHeader;
- OVERLAPPED Overlapped;
}KSSTREAM_SEGMENT_EXT, *PKSSTREAM_SEGMENT_EXT;
Pin->Release();
}
}
+#if 1
+ //DBG code
+ PIN_INFO PinInfo;
+ IPin * pPin;
+ if (SUCCEEDED(KsPin->QueryInterface(IID_IPin, (void**)&pPin)))
+ {
+ if (SUCCEEDED(pPin->QueryPinInfo(&PinInfo)))
+ {
+ if (PinInfo.pFilter)
+ PinInfo.pFilter->Release();
+
+ wcscpy(m_PinName, PinInfo.achName);
+ }
+ pPin->Release();
+ }
+#endif
// done
return hr;
ULONG ExtendedSize, Index, BytesReturned;
HRESULT hr = S_OK;
- OutputDebugString("CKsInterfaceHandler::KsProcessMediaSamples\n");
-
// sanity check
assert(*SampleCount);
// query for IMediaSample2 interface
IMediaSample2 * MediaSample;
AM_SAMPLE2_PROPERTIES Properties;
+ ZeroMemory(&Properties, sizeof(AM_SAMPLE2_PROPERTIES));
hr = SampleList[Index]->QueryInterface(IID_IMediaSample2, (void**)&MediaSample);
if (SUCCEEDED(hr))
hr = SampleList[Index]->GetPointer((BYTE**)&Properties.pbBuffer);
assert(hr == NOERROR);
hr = SampleList[Index]->GetTime(&Properties.tStart, &Properties.tStop);
- assert(hr == NOERROR);
+
+ Properties.cbBuffer = SampleList[Index]->GetSize();
+ assert(Properties.cbBuffer);
Properties.dwSampleFlags = 0;
if (SampleList[Index]->IsSyncPoint() == S_OK)
Properties.dwSampleFlags |= AM_SAMPLE_SPLICEPOINT;
}
-
- WCHAR Buffer[100];
- swprintf(Buffer, L"BufferLength %lu Property Buffer %p ExtendedSize %u lActual %u\n", Properties.cbBuffer, Properties.pbBuffer, ExtendedSize, Properties.lActual);
+#ifdef KSPROXY_TRACE
+ WCHAR Buffer[200];
+ swprintf(Buffer, L"CKsInterfaceHandler::KsProcessMediaSamples PinName %s BufferLength %lu Property Buffer %p ExtendedSize %u lActual %u dwSampleFlags %lx\n", m_PinName, Properties.cbBuffer, Properties.pbBuffer, ExtendedSize, Properties.lActual, Properties.dwSampleFlags);
OutputDebugStringW(Buffer);
+#endif
CurStreamHeader->Size = sizeof(KSSTREAM_HEADER) + ExtendedSize;
CurStreamHeader->PresentationTime.Denominator = 1;
AM_SAMPLE2_PROPERTIES Properties;
REFERENCE_TIME Start, Stop;
- OutputDebugStringW(L"CKsInterfaceHandler::KsCompleteIo\n");
-
// get private stream segment
StreamSegment = (PKSSTREAM_SEGMENT_EXT)InStreamSegment;
REFIID riid,
LPVOID * ppv)
{
+#ifdef KSPROXY_TRACE
OutputDebugStringW(L"CKsInterfaceHandler_Constructor\n");
+#endif
CKsInterfaceHandler * handler = new CKsInterfaceHandler();