dshow在应用程序改摄像头拍照分辨率

/*********************************************************************************************************************************************/ //设置拍照分辨率 HRESULT hr=0xff,hr1=0xff; int iCount,iSize; IAMStreamConfig *pConfig = NULL; VIDEO_STREAM_CONFIG_CAPS scc; CHK(m_pCaptureGraphBuilder->FindInterface(&PIN_CATEGORY_STILL, &MEDIATYPE_Video, m_pVideoCaptureFilter, IID_IAMStreamConfig, (void **) &pConfig)); CHK(pConfig->GetNumberOfCapabilities(&iCount, &iSize)); AM_MEDIA_TYPE *pmt; //参数1: 0是320*240, 1是640*480, 2是1024*768, 3是2048*1536 CHK(pConfig ->GetStreamCaps(2, &pmt, (BYTE*)&scc)); CHK(pConfig->SetFormat(pmt)); DeleteMediaType(pmt); /********************************************************************************************************************************************/ //18,创建Still Pin,用于抓图 CHK(m_pImageSinkFilter.CoCreateInstance(CLSID_IMGSinkFilter)); CHK(m_pGraphBuilder->AddFilter(m_pImageSinkFilter, L"Still image filter" )); CHK(m_pCaptureGraphBuilder->RenderStream( &PIN_CATEGORY_STILL, &MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, m_pImageSinkFilter ));

一定要在创建Still Pin之前选好分辨率;

 

 

复制 搜索

你可能感兴趣的:(Stream,image,video,filter,null,byte)