I am writing a Directshow application which connects a file source to a MPEG4s DMO.
The graph looks like:
File Source -> DMO Wrapper Filter -> Video Renderer.
Here are my questions:
1. How can I add a file source filter in the graph ? I got this piece of code which graphedit plus generated. Is this piece of code correct ? I see that it uses "CComPtr" which needs "atlbase.h". With VS2010 Express edition I don't have the atl headers.
LPCOLESTR srcFile1 = L"C:\\Users\shyam\\Downloads\\sample.avi";
CComPtr<IBaseFilter> pBaseFilter;
hr = pBaseFilter.CoCreateInstance(CLSID_AsyncReader);
CComQIPtr<IFileSourceFilter> pFileSourceFilter = pBaseFilter;
ATLASSERT(pFileSourceFilter);
pFileSourceFilter->Load(srcFile1, NULL);
hr = pGB->AddFilter(pBaseFilter, L"File Source (Async.)");
2. I manually downloaded "atlbase.h" from net and I am encountering several build errors. What can be done in this case.
Please help me in moving in the right direction !!
Thanks,
Shyam