HRESULT hr=0;
// Create the video render filter
hr = CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC,
IID_IBaseFilter, (void **)&m_pRenderer);
if (FAILED(hr))
return E_NOINTERFACE;
// Add the video render filter to the graph
hr = m_pGB->AddFilter(m_pRenderer, L"Video Render9");
if (FAILED(hr))
return hr;
//先将VMR9加入,然后在filter连接时将优先使用VMR9
hr = m_pVW->put_Owner((OAHWND)m_hOwner);
hr = m_pVW->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN );
hr = m_pVW->SetWindowPosition(m_nLeft, m_nTop, m_nWidth, m_nHeight);
// Enable the parent window to get the mouse and keyboard event in the video window
hr = m_pVW->put_Visible(OATRUE);
hr = m_pVW->SetWindowForeground(-1);
...