I have created a DirectShow test application which is supposed to show the webcam output in my application's window, using windowless mode but when I run the application, the output is still shown in the video renderer's default window. The code I used to render the webcam image is...
hr = m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pCap, NULL, NULL);
If I play an AVI file with the following code, it appears correctly in my application's window.
hr = m_pGraphBuilder->RenderFile(L"C:\\Temp\\Sample.avi", NULL);
Is there anything different between these rendering methods that might account for the problem? I have very little experience with DirectShow so I am not sure what I might be doing wrong, or what else I could try in order to debug it. I realise that its probably difficult to say what's wrong without seeing the code but there's a lot of code so it may not help much.
Thanks
What I have tried:
I have checked all (I think) HRESULTS and they are all SUCCEEDED. I have also tried passing the video rendering filter into RenderStream() but then no output is shown...
hr = m_pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pCap, NULL, m_pVmr);