HRESULT create (ComSmartPtr <IGraphBuilder>& graphBuilder, ComSmartPtr <IBaseFilter>& baseFilter, HWND hwnd) { ComSmartPtr <IVMRFilterConfig> filterConfig; HRESULT hr = baseFilter.CoCreateInstance (CLSID_VideoMixingRenderer); if (SUCCEEDED (hr)) hr = graphBuilder->AddFilter (baseFilter, L"VMR-7"); if (SUCCEEDED (hr)) hr = baseFilter.QueryInterface (filterConfig); if (SUCCEEDED (hr)) hr = filterConfig->SetRenderingMode (VMRMode_Windowless); if (SUCCEEDED (hr)) hr = baseFilter.QueryInterface (windowlessControl); if (SUCCEEDED (hr)) hr = windowlessControl->SetVideoClippingWindow (hwnd); if (SUCCEEDED (hr)) hr = windowlessControl->SetAspectRatioMode (VMR_ARMODE_LETTER_BOX); return hr; }
HRESULT create (ComSmartPtr <IGraphBuilder>& graphBuilder, ComSmartPtr <IBaseFilter>& baseFilter, HWND hwnd) { ComSmartPtr <IMFGetService> getService; HRESULT hr = baseFilter.CoCreateInstance (CLSID_EnhancedVideoRenderer); if (SUCCEEDED (hr)) hr = graphBuilder->AddFilter (baseFilter, L"EVR"); if (SUCCEEDED (hr)) hr = baseFilter.QueryInterface (getService); if (SUCCEEDED (hr)) hr = getService->GetService (MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl, (LPVOID*) videoDisplayControl.resetAndGetPointerAddress()); if (SUCCEEDED (hr)) hr = videoDisplayControl->SetVideoWindow (hwnd); if (SUCCEEDED (hr)) hr = videoDisplayControl->SetAspectRatioMode (MFVideoARMode_PreservePicture); return hr; }