Re: custom source filter implementation
- From: "The March Hare [MVP]" <phil@xxxxxxxxx>
- Date: Thu, 5 May 2005 18:27:18 -0600
On Thu, 5 May 2005 15:15:36 -0600, Jeremy Noring wrote:
> IBaseFilter *pAS = NULL;
> IFileSourceFilter *pFS = NULL;
> HRESULT hr = CoCreateInstance(CLSID_AsyncSample, NULL, CLSCTX_INPROC_SERVER,
> IID_IBaseFilter, (void **)&pAS);
> if( FAILED( hr ) )
> return;
> hr = pGB->AddSourceFilter(wFile, L"Source", &pAS);
> if( FAILED( hr ) )
> return;
> hr = pAS->QueryInterface(IID_IFileSourceFilter, (void **)&pFS);
> if( FAILED( hr ) )
> return;
> hr = pGB->Render(pAS->GetPin(0));
> if( FAILED( hr ) )
> return;
Yuck! Better:
CComPtr<IBaseFilter> pAS;
pAS.CoCreateInstance(CLSID_AsyncSample);
if (!pAS)
return E_NOINTERFACE;
hr = pGB->AddSourceFilter(wFile, L"Source", &pAS);
CComQIPtr<IFileSourceFilter> pFS(pAS);
if(!pFS)
return E_NOINTERFACE;
hr = pGB->Render(pAS->GetPin(0));
if(FAILED(hr))
return hr;
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
.
- Follow-Ups:
- Re: custom source filter implementation
- From: Jeremy Noring
- Re: custom source filter implementation
- From: The March Hare [MVP]
- Re: custom source filter implementation
- References:
- custom source filter implementation
- From: Andreas
- Re: custom source filter implementation
- From: Jeremy Noring
- Re: custom source filter implementation
- From: Andreas
- Re: custom source filter implementation
- From: Jeremy Noring
- custom source filter implementation
- Prev by Date: DirectShow Video Realtime Ptich
- Next by Date: Re: custom source filter implementation
- Previous by thread: Re: custom source filter implementation
- Next by thread: Re: custom source filter implementation
- Index(es):
Relevant Pages
|