怎么设置无窗口模式?
建立了2个picture对象,同时播放VMR9,设定成无窗口模式,可是只有最后设置的窗口显示视频,求教.
HRESULT InitializeWindowlessVMR(IBaseFilter **ppVmr9,HWND ghApp,IVMRWindowlessControl9 **ppWC)
{
IBaseFilter* pVmr = NULL;
IVMRWindowlessControl9* pWC=NULL;
if (!ppVmr9)
return E_POINTER;
*ppVmr9 = NULL;
// Create the VMR and add it to the filter graph.
HRESULT hr = CoCreateInstance(CLSID_VideoMixingRenderer9, NULL,
CLSCTX_INPROC, IID_IBaseFilter, (void**)&pVmr);
if (SUCCEEDED(hr))
{
hr = pGB-> AddFilter(pVmr, L "Video Mixing Renderer 9 ");
if (SUCCEEDED(hr))
{
// Set the rendering mode and number of streams
CComPtr <IVMRFilterConfig9> pConfig;
JIF(pVmr-> QueryInterface(IID_IVMRFilterConfig9, (void**)&pConfig));
JIF(pConfig-> SetRenderingMode(VMR9Mode_Windowless));
hr = pVmr-> QueryInterface(IID_IVMRWindowlessControl9, (void**)&pWC);
if( SUCCEEDED(hr))
{
JIF(pWC-> SetVideoClippingWindow(ghApp));
JIF(pWC-> SetBorderColor(RGB(0,0,0)));
}
}
// Don 't release the pVmr interface because we are copying it into
// the caller 's ppVmr9 pointer
*ppVmr9 = pVmr;
*ppWC=pWC;
}
return hr;
}
分别调用2次,设置2个picture对象
InitializeWindowlessVMR(&pVmr1,hwnd1,&pWC1);
InitializeWindowlessVMR(&pVmr,hwnd,&pWC);
[解决办法]
你的程序肯定是在最后一个窗口上播放视频,你要实现什么不太清楚
[解决办法]
后面的覆盖了前面的,想2个窗口同时播放就建立2个graph