全部博文(282)
分类:
2007-09-20 23:05:05
// Stop the graph. pControl->Stop(); // Enumerate the filters in the graph. IEnumFilters *pEnum = NULL; HRESULT hr = pGraph->EnumFilters(&pEnum); if (SUCCEEDED(hr)) { IBaseFilter *pFilter = NULL; while (S_OK == pEnum->Next(1, &pFilter, NULL)) { // Remove the filter. pGraph->RemoveFilter(pFilter); // Reset the enumerator. pEnum->Reset(); pFilter->Release(); } pEnum->Release(); } |
IGraphBuilder *pGraph = NULL; ICaptureGraphBuilder2 *pBuilder = NULL; // Create the Filter Graph Manager. HRESULT hr = CoCreateInstance(CLSID_FilterGraph, NULL,CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&pGraph); if (SUCCEEDED(hr)) { // Create the Capture Graph Builder. hr = CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL,CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2, (void **)&pBuilder); if (SUCCEEDED(hr)) { pBuilder->SetFiltergraph (pGraph); } }; |
RenderStream(NULL, NULL, A, B, C) |
RenderStream(NULL, NULL, A, NULL, C) |
RenderStream(NULL, NULL, A, B, C) RenderStream(NULL, NULL, C, D, E) |
PIN_CATEGORY_CAPTURE PIN_CATEGORY_PREVIEW |
MEDIATYPE_Audio MEDIATYPE_Video MEDIATYPE_Interleaved (DV) |
IAMStreamConfig *pConfig = NULL; HRESULT hr = pBuild->FindInterface(&PIN_CATEGORY_PREVIEW,&MEDIATYPE_Video,pVCap,IID_IAMStreamConfig, (void**)&pConfig ); if (SUCCESSFUL(hr)) { /* ... */ pConfig->Release(); } |
IPin *pPin = NULL; hr = pBuild->FindPin( pCap, // Pointer to the filter to search. PINDIR_OUTPUT, // Search for an output pin. &PIN_CATEGORY_PREVIEW, // Search for a preview pin. &MEDIATYPE_Video, // Search for a video pin. TRUE, // The pin must be unconnected. 0, // Return the first matching pin (index 0). &pPin); // This variable receives the IPin pointer. if (SUCCESSFUL(hr)) { /* ... */ pPin->Release(); } |