IVMRMixerControl9为什么QueryInterface不成功呢?
IBaseFilter* pVmr = NULL;
// Create the VMR and add it to the filter graph.
HRESULT hr = CoCreateInstance(CLSID_VideoMixingRenderer, NULL,
CLSCTX_INPROC, IID_IBaseFilter, (void**)&pVmr);
if (SUCCEEDED(hr))
{
hr = m_pGB->AddFilter(pVmr, L"Video Mixing Renderer");
if (SUCCEEDED(hr))
{
// Set the rendering mode and number of streams.
IVMRFilterConfig* pConfig;
hr = pVmr->QueryInterface(IID_IVMRFilterConfig, (void**)&pConfig);
if( SUCCEEDED(hr))
{
pConfig->SetRenderingMode(VMRMode_Windowless);
pConfig->Release();
}
hr = pVmr->QueryInterface(IID_IVMRWindowlessControl, (void**)&m_pWC);
if( SUCCEEDED(hr))
{
m_pWC->SetVideoClippingWindow(hWnd);
}
hr = pVmr->QueryInterface(IID_IVMRMixerControl9, (void**)&m_pMixerC);
if (FAILED(hr))
{
AfxMessageBox("error");//就在错误!总是FAILED
}
================================================
我想用dshow来抓图,并实现图象的色度,亮度调节 ,想用IVMRMixerControl9接口的
SetProcAmpControl 来做!得QueryInterface总是不成功,是什么原因呢?
或者哪位知道可以用VC来做摄像头抓图并可以调节亮度的例子或代码,多谢了~
[解决办法]
CoInitialize(NULL)
[解决办法]