From 6de666a5b623aa5fe950fc10fb3db62453346ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Thu, 10 Nov 2016 17:54:55 +0100 Subject: DirectShow: Remove manual filter and pin disconnection in DsCamera In commit 3fb3231a9 we added code to disconnect all filters in the graph, that includes any filters we add our self, so there's no need to have special handling for those. Change-Id: Id601933b3ff749294cfa71a0cca99e7d25e94a39 Reviewed-by: Yoann Lopes --- src/plugins/directshow/camera/dscamerasession.cpp | 32 +---------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'src/plugins/directshow/camera') diff --git a/src/plugins/directshow/camera/dscamerasession.cpp b/src/plugins/directshow/camera/dscamerasession.cpp index 5587b479c..9955a4821 100644 --- a/src/plugins/directshow/camera/dscamerasession.cpp +++ b/src/plugins/directshow/camera/dscamerasession.cpp @@ -1078,40 +1078,10 @@ bool DSCameraSession::connectGraph() void DSCameraSession::disconnectGraph() { - IPin *pPin = 0; - HRESULT hr = getPin(m_sourceFilter, PINDIR_OUTPUT, &pPin); - if (SUCCEEDED(hr)) { - m_filterGraph->Disconnect(pPin); - pPin->Release(); - pPin = NULL; - } - - hr = getPin(m_previewFilter, PINDIR_INPUT, &pPin); - if (SUCCEEDED(hr)) { - m_filterGraph->Disconnect(pPin); - pPin->Release(); - pPin = NULL; - } - - hr = getPin(m_previewFilter, PINDIR_OUTPUT, &pPin); - if (SUCCEEDED(hr)) { - m_filterGraph->Disconnect(pPin); - pPin->Release(); - pPin = NULL; - } - - hr = getPin(m_nullRendererFilter, PINDIR_INPUT, &pPin); - if (SUCCEEDED(hr)) { - m_filterGraph->Disconnect(pPin); - pPin->Release(); - pPin = NULL; - } - // To avoid increasing the memory usage every time the graph is re-connected it's // important that all filters are released; also the ones added by the "Intelligent Connect". IEnumFilters *enumFilters = NULL; - hr = m_filterGraph->EnumFilters(&enumFilters); - if (SUCCEEDED(hr)) { + if (SUCCEEDED(m_filterGraph->EnumFilters(&enumFilters))) { IBaseFilter *filter = NULL; while (enumFilters->Next(1, &filter, NULL) == S_OK) { m_filterGraph->RemoveFilter(filter); -- cgit v1.2.3