当前位置: 首页>>代码示例>>C++>>正文


C++ IEnumFilters类代码示例

本文整理汇总了C++中IEnumFilters的典型用法代码示例。如果您正苦于以下问题:C++ IEnumFilters类的具体用法?C++ IEnumFilters怎么用?C++ IEnumFilters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了IEnumFilters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RemoveAllFilters

//
//  Removes any filters in the audio graph - called before rebuilding the audio graph.
//
void CMediaPlayer::RemoveAllFilters()
{
    IEnumFilters *enumFilters;
    HRESULT hr = _GraphBuilder->EnumFilters(&enumFilters);

    if (SUCCEEDED(hr))
    {
        IBaseFilter *filter = NULL;
        hr = enumFilters->Next(1, &filter, NULL);
        while (hr == S_OK)
        {
            //
            //  Remove the filter from the graph.
            //
            _GraphBuilder->RemoveFilter(filter);
            filter->Release();

            //
            //  Reset the enumeration since we removed the filter (which invalidates the enumeration).
            //
            enumFilters->Reset();

            hr = enumFilters->Next(1, &filter, NULL);
        }
        enumFilters->Release();
    }
}
开发者ID:quartorz,项目名称:Hockey,代码行数:30,代码来源:MediaPlayer.cpp

示例2: FindFilterInterface

HRESULT FindFilterInterface(
	IGraphBuilder *pGraph, // Pointer to the Filter Graph Manager.
	REFGUID iid,           // IID of the interface to retrieve.
	void **ppUnk)          // Receives the interface pointer.
{
	if (!pGraph || !ppUnk) return E_POINTER;

	HRESULT hr = E_FAIL;
	IEnumFilters *pEnum = NULL;
	IBaseFilter *pF = NULL;
	if (FAILED(pGraph->EnumFilters(&pEnum)))
	{
		return E_FAIL;
	}
	// Query every filter for the interface.
	while (S_OK == pEnum->Next(1, &pF, 0))
	{
		hr = pF->QueryInterface(iid, ppUnk);
		pF->Release();
		if (SUCCEEDED(hr))
		{
			break;
		}
	}
	pEnum->Release();
	return hr;
}
开发者ID:lincolnfz,项目名称:suvlo,代码行数:27,代码来源:filterUtil.cpp

示例3: PrintAllFilters

void PrintAllFilters(IFilterGraph* filterGraph)
{
	IEnumFilters *enumFilters;
	HRESULT hr;

	hr = filterGraph->EnumFilters(&enumFilters);
	if(FAILED(hr))
	{
		ErrorPrint("Enum filters error", hr);
		return ;
	}
	ComReleaser enumFiltersReleaser(enumFilters);

	std::cout<<"Start print filter graphs:"<<endl;
	IBaseFilter* filter;
	while (S_OK == enumFilters->Next(1, &filter, NULL))
	{
		ComReleaser filterReleaser(filter);
		FILTER_INFO filterInfo;
		filter->QueryFilterInfo(&filterInfo);
		char* name = WideCharToChar(filterInfo.achName);
		std::cout<<name<<endl;
		delete[] name;
	}
	std::cout<<"Print end"<<endl;
}
开发者ID:dalinhuang,项目名称:networkprogram,代码行数:26,代码来源:FilterCommon.cpp

示例4: FindSubtitleFilter

//
// FindSubtitleFilter
//
// be careful with this method, can cause deadlock with CSync::Stop, so should only be called in Run()
HRESULT CTsReaderFilter::FindSubtitleFilter()
{
  if( m_pDVBSubtitle )
  {
    return S_OK;
  }
  //LogDebug( "FindSubtitleFilter - start");

  IEnumFilters * piEnumFilters = NULL;
  if (GetFilterGraph() && SUCCEEDED(GetFilterGraph()->EnumFilters(&piEnumFilters)))
  {
    IBaseFilter * pFilter;
    while (piEnumFilters->Next(1, &pFilter, 0) == NOERROR )
    {
      FILTER_INFO filterInfo;
      if (pFilter->QueryFilterInfo(&filterInfo) == S_OK)
      {
        if (!wcsicmp(L"MediaPortal DVBSub2", filterInfo.achName))
        {
          HRESULT fhr = pFilter->QueryInterface( IID_IDVBSubtitle2, ( void**)&m_pDVBSubtitle );
          assert( fhr == S_OK);
          //LogDebug("Testing that DVBSub2 works");
          m_pDVBSubtitle->Test(1);
        }
        filterInfo.pGraph->Release();
      }
      pFilter->Release();
      pFilter = NULL;
    }
    piEnumFilters->Release();
  }
  //LogDebug( "FindSubtitleFilter - End");
  return S_OK;
}
开发者ID:SilentException,项目名称:MediaPortal-1,代码行数:38,代码来源:TsReader.cpp

示例5: FindInterfaceAnywhere

HRESULT FindInterfaceAnywhere(
	IGraphBuilder *pGraph, 
	REFGUID iid, 
	void **ppUnk)
{
	if (!pGraph || !ppUnk) return E_POINTER;
	HRESULT hr = E_FAIL;
	IEnumFilters *pEnum = 0;
	if (FAILED(pGraph->EnumFilters(&pEnum)))
	{
		return E_FAIL;
	}
	// Loop through every filter in the graph.
	IBaseFilter *pF = 0;
	while (S_OK == pEnum->Next(1, &pF, 0))
	{
		hr = pF->QueryInterface(iid, ppUnk);
		if (FAILED(hr))
		{
			// The filter does not expose the interface, but maybe
			// one of its pins does.
			hr = FindPinInterface(pF, iid, ppUnk);
		}
		pF->Release();
		if (SUCCEEDED(hr))
		{
			break;
		}
	}
	pEnum->Release();
	return hr;
}
开发者ID:lincolnfz,项目名称:suvlo,代码行数:32,代码来源:filterUtil.cpp

示例6: FindFilterInterface

HRESULT CDShowUtility::FindFilterInterface(IGraphBuilder *pGraph, REFGUID iid, void **ppUnk)
{
    if (!pGraph || !ppUnk) 
    {
        return E_POINTER;
    }

    HRESULT hr = E_FAIL;
    IEnumFilters *pEnum = NULL;
    IBaseFilter *pF = NULL;

    if (FAILED(pGraph->EnumFilters(&pEnum)))
    {
        return E_FAIL;
    }

    //分别调用 Queryinterface, 枚举filter Graph 中的所有Filter 
    while (S_OK == pEnum->Next(1, &pF, 0))
    {
        hr = pF->QueryInterface(iid, ppUnk);
        pF->Release();

        if (SUCCEEDED(hr))
        {
            break;
        }
    }

    pEnum->Release();
    return hr;    
}
开发者ID:moon-sky,项目名称:fishjam-template-library,代码行数:31,代码来源:DShowUtility.cpp

示例7: FindFilterInterface

//查找Filter上某一个接口,只要找到FilterGraph上某一个Filter有该接口即返回
BOOL FindFilterInterface(IGraphBuilder* pGraphBuilder, REFGUID iid, void** ppUnk)
{
	if(!pGraphBuilder || !ppUnk)
		return FALSE;

	IEnumFilters* pEnumFilter = NULL;
	IBaseFilter* pFilter = NULL;

	if(FAILED(pGraphBuilder->EnumFilters(&pEnumFilter)))
	{
		return FALSE;
	}

	HRESULT hr = E_FAIL;
	while(S_OK == pEnumFilter->Next(1,&pFilter,NULL))
	{
		hr = pFilter->QueryInterface(iid,ppUnk);
		pFilter->Release();
		if(SUCCEEDED(hr))
		{
			pEnumFilter->Release();
			return TRUE;
		}
	}

	pEnumFilter->Release();
	return FALSE;
}
开发者ID:wumuzi520,项目名称:ForestProject,代码行数:29,代码来源:BaseFunc.cpp

示例8: FindSubtitleFilter

HRESULT CBDReaderFilter::FindSubtitleFilter()
{
  if (m_pDVBSubtitle)
    return S_OK;

  HRESULT hr = S_FALSE;
  ULONG fetched = 0;

  IEnumFilters * piEnumFilters = NULL;
  if (GetFilterGraph() && SUCCEEDED(GetFilterGraph()->EnumFilters(&piEnumFilters)))
  {
    IBaseFilter * pFilter;
    while (piEnumFilters->Next(1, &pFilter, &fetched) == NOERROR)
    {
      FILTER_INFO filterInfo;
      if (pFilter->QueryFilterInfo(&filterInfo) == S_OK)
      {
        if (!wcsicmp(L"MediaPortal DVBSub3", filterInfo.achName))
          hr = pFilter->QueryInterface(IID_IDVBSubtitle3, (void**)&m_pDVBSubtitle);

        filterInfo.pGraph->Release();
      }
      pFilter->Release();
      pFilter = NULL;
    }
    piEnumFilters->Release();
  }

  return hr;
}
开发者ID:BMOTech,项目名称:MediaPortal-1,代码行数:30,代码来源:BDReader.cpp

示例9: while

/*****************************Public*Routine******************************\
* FindInterfaceFromFilterGraph
*
\**************************************************************************/
HRESULT
CMovie::FindInterfaceFromFilterGraph(
    REFIID iid, // interface to look for
    LPVOID *lp  // place to return interface pointer in
    )
{
    IEnumFilters* pEF;
    IBaseFilter*  pFilter;

    // Grab an enumerator for the filter graph.
    HRESULT hr = m_Fg->EnumFilters(&pEF);

    if(FAILED(hr))
    {
        return hr;
    }

    // Check out each filter.
    while(pEF->Next(1, &pFilter, NULL) == S_OK)
    {
        hr = pFilter->QueryInterface(iid, lp);
        pFilter->Release();

        if(SUCCEEDED(hr))
        {
            break;
        }
    }

    pEF->Release();

    return hr;
}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:37,代码来源:vcdplyer.cpp

示例10: RemoveAllFilter

HRESULT RemoveAllFilter(IFilterGraph* filterGraph, const std::vector<IBaseFilter*> &exceptList)
{
	HRESULT hr;
	IEnumFilters *enumFilters;
	hr = filterGraph->EnumFilters(&enumFilters);
	if (FAILED(hr))
	{
		ErrorPrint("Get enum filters error",hr);
		return hr;
	}
	ComReleaser enumFilterReleaser(enumFilters);

	IBaseFilter* filter;
	while (S_OK == enumFilters->Next(1, &filter, NULL))
	{
		ComReleaser filterReleaser(filter);
		if(std::find(exceptList.begin(), exceptList.end() , filter) == exceptList.end())
		{
			filterGraph->RemoveFilter(filter);
			enumFilters->Reset();
		}
	}

	return S_OK;
}
开发者ID:dalinhuang,项目名称:networkprogram,代码行数:25,代码来源:FilterCommon.cpp

示例11: FindSourceFilter

HRESULT FindSourceFilter(IFilterGraph* filterGraph,IBaseFilter*& result)
{
	HRESULT hr;
	IEnumFilters *enumFilters;
	hr = filterGraph->EnumFilters(&enumFilters);
	if (FAILED(hr))
	{
		ErrorPrint("Get enum filters error",hr);
		return hr;
	}
	ComReleaser enumFilterReleaser(enumFilters);

	IBaseFilter* filter;
	while (S_OK == enumFilters->Next(1, &filter, NULL))
	{
		ComReleaser filterReleaser(filter);
		IEnumPins *enumPins;
		
		hr = filter->EnumPins(&enumPins);
		if (FAILED(hr))
		{
			ErrorPrint("Get enum pins error",hr);
			return hr;
		}
		ComReleaser enumPinsReleaser(enumPins);

		IPin* pin;
		bool isSourceFilter = true;
		while (S_OK == enumPins->Next(1, &pin, NULL))
		{
			ComReleaser pinReleaser(pin);
			PIN_INFO pinInfo;
			hr = pin->QueryPinInfo(&pinInfo);
			if (FAILED(hr))
			{
				ErrorPrint("Get pin info error",hr);
				continue;
			}
			if (pinInfo.dir == PINDIR_INPUT) //认为没有输入pin的就是source filter,这其实是有些问题的,特别是当捕获(如声卡的音频)的filter有时候有很多输入PIN
			{
				isSourceFilter = false;
				break;
			}
		}

		if (isSourceFilter)
		{
			filter->AddRef(); //存在一个资源管理的释放类,必须增加一个引用,否则会被释放掉
			result = filter;
			return S_OK;
		}
	}

	return E_FAIL;
}
开发者ID:dalinhuang,项目名称:networkprogram,代码行数:55,代码来源:FilterCommon.cpp

示例12: EnumFilters

HRESULT CFilterProp::EnumFilters()
{
	if ( !pGB ) return E_FAIL;

    HRESULT hr;
    IEnumFilters *pEnum = NULL;
    IBaseFilter *pFilter = NULL;
    ULONG cFetched;

    // Clear filters list box
    m_ListFilters.ResetContent();
    
    // Get filter enumerator
    hr = pGB->EnumFilters(&pEnum);
    if (FAILED(hr))
    {
        m_ListFilters.AddString(TEXT("<ERROR>"));
        return hr;
    }

    // Enumerate all filters in the graph
    while(pEnum->Next(1, &pFilter, &cFetched) == S_OK)
    {
        FILTER_INFO FilterInfo;
        TCHAR szName[256];
        
        hr = pFilter->QueryFilterInfo(&FilterInfo);
        if (FAILED(hr))
        {
            m_ListFilters.AddString(TEXT("<ERROR>"));
        }
        else
        {
				ISpecifyPropertyPages *pSpecify;
				hr = pFilter->QueryInterface(IID_ISpecifyPropertyPages, (void **)&pSpecify);
				if (SUCCEEDED(hr)) 
				{
	            pSpecify->Release();

					// Add the filter name to the filters listbox
					USES_CONVERSION;

					lstrcpy(szName, W2T(FilterInfo.achName));
					m_ListFilters.AddString(szName);

				}
				FilterInfo.pGraph->Release();
        }       
        pFilter->Release();
    }
    pEnum->Release();

    return hr;
}
开发者ID:adamjoniec,项目名称:theimp,代码行数:54,代码来源:FilterProp.cpp

示例13: while

//
// The GraphBuilder interface provides a FindFilterByName() method,
// which provides similar functionality to the method below.
// This local method is provided for educational purposes.
//
IBaseFilter *FindFilterFromName(IGraphBuilder *pGB, LPTSTR szNameToFind)
{
    USES_CONVERSION;

    HRESULT hr;
    IEnumFilters *pEnum = NULL;
    IBaseFilter *pFilter = NULL;
    ULONG cFetched;
    BOOL bFound = FALSE;

    // Verify graph builder interface
    if (!pGB)
        return NULL;

    // Get filter enumerator
    hr = pGB->EnumFilters(&pEnum);
    if (FAILED(hr))
        return NULL;

    // Enumerate all filters in the graph
    while((pEnum->Next(1, &pFilter, &cFetched) == S_OK) && (!bFound))
    {
        FILTER_INFO FilterInfo;
        TCHAR szName[256];
        
        hr = pFilter->QueryFilterInfo(&FilterInfo);
        if (FAILED(hr))
        {
            pFilter->Release();
            pEnum->Release();
            return NULL;
        }

        // Compare this filter's name with the one we want
        lstrcpy(szName, W2T(FilterInfo.achName));
        if (! lstrcmp(szName, szNameToFind))
        {
            bFound = TRUE;
        }

        FilterInfo.pGraph->Release();

        // If we found the right filter, don't release its interface.
        // The caller will use it and release it later.
        if (!bFound)
            pFilter->Release();
        else
            break;
    }
    pEnum->Release();

    return (bFound ? pFilter : NULL);
}
开发者ID:grakidov,项目名称:Render3D,代码行数:58,代码来源:mfcutil.cpp

示例14: UpdateFGFiltersArray

//Обновляет массив m_pFGBaseFilter[], хранящий список фильтров DirectShow в текущем Filter Graph
//Функция Open() вызывает эту функцию автоматически
//Однако, крайне желательно вызывать её повторно перед вызовом функций,
//работающих с m_pFGBaseFilter[] массивом
void CDirectShow::UpdateFGFiltersArray()
{
	IEnumFilters *pEnumFilters = NULL;
	if (FAILED(m_pGraphBuilder->EnumFilters(&pEnumFilters))) return;
	for (m_lCounter = 0; m_lCounter < E_MAX_ARR_SIZE; m_lCounter++)
	{
		SR(m_pFGBaseFilter[m_lCounter]);
		m_pFGBaseFilter[m_lCounter] = NULL;
	}
	pEnumFilters->Reset();
	pEnumFilters->Next(E_MAX_ARR_SIZE, &m_pFGBaseFilter[0], &m_lFGFilCount);
	pEnumFilters->Release();
}
开发者ID:BorisVorontsov,项目名称:easybar,代码行数:17,代码来源:DirectShow.cpp

示例15: __CONTEXT

recChannel_t::~recChannel_t(void)
{
     __CONTEXT("recChannel_t::~recChannel_t");

	IBaseFilter * pFilter = NULL;
	if (camInfo->getKind() == TEST) 
	{
		looper->EndThread();
	}
	
	unmap();
	camList->lookUp(sourceId)->setFree(true);
	 
	pControl->Stop();
	
    looper->EndThread();
 
    delete looper;
    delete pSender;

    remap();
	
	int hr = 0;

	// Enumerate the filters in the graph.
	IEnumFilters *pEnum = NULL;
	hr = pGraph->EnumFilters(&pEnum);
	if (SUCCEEDED(hr))
	{
		IBaseFilter *pFilter = NULL;
		while (S_OK == pEnum->Next(1, &pFilter, NULL))
		{
				pGraph->RemoveFilter(pFilter);
				pFilter->Release();
				pEnum->Reset();
		}
		pEnum->Release();
	}
	pControl->Release();
	pEvent->Release();
	pGraph->Release();
	
	channelList->remove(getId());
	rtpSession->deleteSender (getId(), "Channel deleted");
#ifdef _WINDOWS
    EndThread();
    TerminateThread(hThread,0); 
#endif
    

}
开发者ID:cchatterj,项目名称:isabel,代码行数:51,代码来源:recchanel.cpp


注:本文中的IEnumFilters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。