我在wince设备上有一些过滤器连接(相机-> sampleGrabber(分析图像->渲染过滤器。
渲染需要很多时间,我真的不需要看到结果(仅在“调试”模式下。
如何在 sampleGrabber 过滤器之后“转储”流?
这是主要代码:
CHK( m_pCaptureGraphBuilder.CoCreateInstance( CLSID_CaptureGraphBuilder ));
CHK( pFilterGraph.CoCreateInstance( CLSID_FilterGraph ));
CHK( m_pCaptureGraphBuilder->SetFiltergraph( pFilterGraph ));
CHK( m_pVideoCaptureFilter.CoCreateInstance( CLSID_VideoCapture ));
CHK( m_pVideoCaptureFilter.QueryInterface( &pPropertyBag ));
CHK( GetFirstCameraDriver( wzDeviceName ));
CHK( PropBag.Write( L"VCapName", &varCamName ));
CHK( pPropertyBag->Load( &PropBag, NULL ));
// Everything succeeded, now adding the video capture filter to the filtergraph
CHK( pFilterGraph->AddFilter( m_pVideoCaptureFilter, L"Video Capture Filter Source" ));
CHK( pGrabberFilter.CoCreateInstance( CLSID_CameraGrabber ));
CHK( pFilterGraph->AddFilter( pGrabberFilter, L"Sample Grabber" ));
CHK( pGrabberFilter->QueryInterface( &m_pSampleGrabber ));
// set callback method to the grabber
m_pSampleGrabber->SetCallback(&MYCALLBACK, 0);
CHK( pVideoRenderer.CoCreateInstance( CLSID_VideoRenderer ));
CHK( pFilterGraph->AddFilter( pVideoRenderer, L"VideoMixingRenderer" ));
CHK( m_pCaptureGraphBuilder->RenderStream( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, pVideoRenderer ));
有什么建议么?