1

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 ));

助言がありますか?

4

1 に答える 1

1

レンダリングを停止するには、sampleGrabber を nullRenderer に接続します。これにより、受信したすべてのサンプルが破棄され、プログラムの速度が低下することはありません。

ストリームを表示せずにダンプしたい場合は、FileWriterFilterを使用できます。

于 2013-06-09T06:02:57.360 に答える