概述
-
Call CoCreateInstance to create the VMR-9:
IBaseFilter *pVmr = NULL; hr = CoCreateInstance(CLSID_VideoMixingRenderer9, 0, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&pVmr);
-
Call IFilterGraph::AddFilter on the Filter Graph Manager to add the VMR-9 to the filter graph:
hr = pGraph->AddFilter(pVmr, L"VMR9");
-
Call IGraphBuilder::AddSourceFilter to add a source filter for the video file:
IBaseFilter *pSource; hr = pGraph->AddSourceFilter(L"C:\Example.avi", L"Source1", &pSource);
-
Call the ICaptureGraphBuilder2::RenderStream method to render the video stream to the VMR:
hr = pBuild->RenderStream(0, 0, pSource, 0, pVmr);
-
Optionally, call RenderStream again to render the audio stream:
hr = pBuild->RenderStream(0, &MEDIATYPE_Audio, pSource, 0, NULL);
最后
以上就是耍酷早晨为你收集整理的DirectShow中VM9的创建与使用的全部内容,希望文章能够帮你解决DirectShow中VM9的创建与使用所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复