Tuesday, November 18, 2008

Single Input mediasample and Multiple Output media Sample to be delivered from Transform Filter

Single Input mediasample and Multiple Output media Sample in Transform Filter:
===============================================================================
Solution :
---------

implement the Receive() fn:


HRESULT TransformFilter:: Receive(IMediaSample* pMediaSample)
{
HRESULT hr = S_OK;
do
{
hr = GetDeliveryBuffer(&pOutputSample);
if (FAILED(hr)) return hr;
hr = Transform(pSample,pOutputSample);
if(FAILED(hr)) return hr;

hr = m_pOutput->Deliver(pOutputSample);
pOutputSample->Release();
}while(nOutputSample != 0);

return hr;
}

No comments: