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


C++ IEnumPins类代码示例

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


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

示例1: qWarning

IBaseFilter *DirectShowPlayerService::getConnected(
        IBaseFilter *filter, PIN_DIRECTION direction) const
{
    IBaseFilter *connected = 0;

    IEnumPins *pins = 0;

    if (SUCCEEDED(filter->EnumPins(&pins))) {
        for (IPin *pin = 0; pins->Next(1, &pin, 0) == S_OK; pin->Release()) {
            PIN_DIRECTION dir;
            if (SUCCEEDED(pin->QueryDirection(&dir)) && dir == direction) {
                IPin *peer = 0;
                if (SUCCEEDED(pin->ConnectedTo(&peer))) {
                    PIN_INFO info;

                    if (SUCCEEDED(peer->QueryPinInfo(&info))) {
                        if (connected) {
                            qWarning("DirectShowPlayerService::getConnected: "
                                "Multiple connected filters");
                            connected->Release();
                        }
                        connected = info.pFilter;
                    }
                    peer->Release();
                }
            }
        }
        pins->Release();
    }
    return connected;
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:31,代码来源:directshowplayerservice.cpp

示例2: GetPinCountForOneType

	HRESULT GetPinCountForOneType(IUnknown* pUnk, PIN_DIRECTION direction, LPDWORD pPinCount)
	{
		(*pPinCount) = 0;
		IBaseFilter* pBaseFilter = NULL;
		HRESULT hr = pUnk->QueryInterface(IID_IBaseFilter, (VOID**)&pBaseFilter);
		if (SUCCEEDED(hr))
		{
			IEnumPins* pEnumPins = NULL;
			hr = pBaseFilter->EnumPins(&pEnumPins);
			if (SUCCEEDED(hr))
			{
				pEnumPins->Reset();
				if (SUCCEEDED(hr))
				{
					IPin* pPin = NULL;
					BOOL bFound = FALSE;
					DWORD dwFetched = 0;
					while (((pEnumPins->Next(1, &pPin, &dwFetched)) == S_OK) && !bFound)
					{
						PIN_DIRECTION fetchedDir;
						hr = pPin->QueryDirection(&fetchedDir);
						if (SUCCEEDED(hr) && (fetchedDir == direction))
						{
							(*pPinCount)++;
						}
						pPin->Release();
					}
				}
				pEnumPins->Release();
			}
			pBaseFilter->Release();
		}
		return hr;
	}
开发者ID:wyrover,项目名称:HiVideo2,代码行数:34,代码来源:DShowUtils.cpp

示例3: NukeDownstream

void videoInputCamera::NukeDownstream(IBaseFilter *pBF){
	IPin *pP, *pTo;
	ULONG u;
	IEnumPins *pins = NULL;
	PIN_INFO pininfo;
	HRESULT hr = pBF->EnumPins(&pins);
	pins->Reset();
	while (hr == NOERROR)
	{
		hr = pins->Next(1, &pP, &u);
		if (hr == S_OK && pP)
		{
			pP->ConnectedTo(&pTo);
			if (pTo)
			{
				hr = pTo->QueryPinInfo(&pininfo);
				if (hr == NOERROR)
				{
					if (pininfo.dir == PINDIR_INPUT)
					{
						NukeDownstream(pininfo.pFilter);
						pGraphBuilder->Disconnect(pTo);
						pGraphBuilder->Disconnect(pP);
						pGraphBuilder->RemoveFilter(pininfo.pFilter);
					}
					pininfo.pFilter->Release();
					pininfo.pFilter = NULL;
				}
				pTo->Release();
			}
			pP->Release();
		}
	}
	if (pins) pins->Release();
}
开发者ID:cmayer0087,项目名称:reacTIVision,代码行数:35,代码来源:videoInputCamera.cpp

示例4: GetUnconnectedPin

// helper functions
HRESULT GetUnconnectedPin(IBaseFilter *pFilter,PIN_DIRECTION PinDir, IPin **ppPin)
{
	*ppPin = 0;
	IEnumPins *pEnum = 0;
	IPin *pPin = 0;
	HRESULT hr = pFilter->EnumPins(&pEnum);
	if (FAILED(hr))
	{
		return hr;
	}
	while (pEnum->Next(1, &pPin, NULL) == S_OK)
	{
		PIN_DIRECTION ThisPinDir;
		pPin->QueryDirection(&ThisPinDir);
		if (ThisPinDir == PinDir)
		{
			IPin *pTmp = 0;
			hr = pPin->ConnectedTo(&pTmp);
			if (SUCCEEDED(hr))  // Already connected, not the pin we want.
			{
				pTmp->Release();
			}
			else  // Unconnected, this is the pin we want.
			{
				pEnum->Release();
				*ppPin = pPin;
				return S_OK;
			}
		}
		pPin->Release();
	}
	pEnum->Release();
	// Did not find a matching pin.
	return E_FAIL;
}
开发者ID:my12doom,项目名称:personalProjects,代码行数:36,代码来源:my12doom's+3dv+demuxerDlg.cpp

示例5: GetFirstPin

IPin* GetFirstPin (IBaseFilter *inFilter)
{
	
	BOOL found=FALSE;
	IEnumPins * pEnum = NULL;
	IPin * pPin = NULL;

	if (SUCCEEDED(inFilter->EnumPins(&pEnum)))
	{
		//ASSERT(pEnum);
		printf("while(pSnowFilter)\n");
		while (pEnum->Next(1, &pPin, 0) == S_OK)
		{
			//_LOG_VAL(pinInfo.achName);
			printf("Next(pSnowFilter)\n");
			found=TRUE;
			pPin->Release();
		}
		pEnum->Release();
	}
	if(found){
		return pPin;
	}else{
		return NULL;
	}
	
}
开发者ID:philipgreat,项目名称:cplusplus-windows-test-apps,代码行数:27,代码来源:WPLAYER.cpp

示例6: GetOutPin

IPin * GetOutPin( IBaseFilter * pFilter, int PinNum )
{
    IEnumPins * pEnum = 0;
    HRESULT hr = pFilter->EnumPins( &pEnum );
    pEnum->Reset( );
    ULONG Fetched;
    do
    {
        Fetched = 0;
        IPin * pPin = 0;
        pEnum->Next( 1, &pPin, &Fetched );
        if( Fetched )
        {
            PIN_DIRECTION pd;
            pPin->QueryDirection( &pd);
            pPin->Release( );
            if( pd == PINDIR_OUTPUT )
            {
                if( PinNum == 0 )
                {
                    pEnum->Release( );
                    return pPin;
                }
                PinNum--;
            }
        }
    }
    while( Fetched );
    pEnum->Release( );
    return NULL;
}
开发者ID:RaymondLiao,项目名称:elektronika,代码行数:31,代码来源:dxsend.cpp

示例7: findPin

HRESULT MiniPlayer::findPin(IBaseFilter *pFilter, int dir, IPin **pOutPin)
{
	IEnumPins *pEnumPins = NULL;
	IPin *pPin = NULL;
	PIN_INFO pinInfo;
	//FILTER_INFO filterInfo;

	//HRESULT hr = pFilter->QueryFilterInfo(&filterInfo);
	//if(hr == S_OK)
	//{
	//	ctrace(L"%s Pins:\n", filterInfo.achName);
	//}

	HRESULT hr = pFilter->EnumPins(&pEnumPins);
	if(FAILED(hr)) return hr;

	
	while(pEnumPins->Next(1, &pPin, NULL) == S_OK)
	{
		hr = pPin->QueryPinInfo(&pinInfo);
		if(FAILED(hr)) continue;

		if(pinInfo.dir == dir)
		{
			*pOutPin = pPin;
			//ctrace(L"[%s] %s\n", (dir == PINDIR_INPUT)? L"INPUT": L"OUTPUT", pinInfo.achName);
			return S_OK;
		}
	}
	pEnumPins->Release();

	return -1;
}
开发者ID:jslhs,项目名称:_dump,代码行数:33,代码来源:MiniPlayer.cpp

示例8: DbgLog

//
// CFilePlayer::IsOvMConnected(): Private method to detect if the video stream
// is passing through the Overlay Mixer (i.e, is it connected?).
//
BOOL CFilePlayer::IsOvMConnected(IBaseFilter *pOvM)
{
    DbgLog((LOG_TRACE, 5, TEXT("CFilePlayer::IsOvMConnected() entered"))) ;

    IEnumPins   *pEnumPins ;
    IPin        *pPin ;
    IPin        *pPin2 ;
    ULONG        ul ;
    HRESULT      hr ;
    BOOL         bConnected = FALSE ;

    pOvM->EnumPins(&pEnumPins) ;
    while (S_OK == pEnumPins->Next(1, &pPin, &ul) && 1 == ul)
    {
        hr = pPin->ConnectedTo(&pPin2) ;
        if (SUCCEEDED(hr) && pPin2)
        {
            DbgLog((LOG_TRACE, 3, TEXT("Found pin %s connected to pin %s"),
                    (LPCTSTR)CDisp(pPin), (LPCTSTR)CDisp(pPin2))) ;
            bConnected = TRUE ;
            pPin2->Release() ;
        }
        pPin->Release() ;
    }
    pEnumPins->Release() ;

    return bConnected ;
}
开发者ID:jleclanche,项目名称:darkdust-ctp2,代码行数:32,代码来源:vidplay.cpp

示例9: gst_dshow_get_pin_from_filter

gboolean
gst_dshow_get_pin_from_filter (IBaseFilter * filter, PIN_DIRECTION pindir,
    IPin ** pin)
{
  gboolean ret = FALSE;
  IEnumPins *enumpins = NULL;
  IPin *pintmp = NULL;
  HRESULT hres;
  *pin = NULL;

  hres = filter->EnumPins (&enumpins);
  if (FAILED (hres)) {
    return ret;
  }

  while (enumpins->Next (1, &pintmp, NULL) == S_OK) {
    PIN_DIRECTION pindirtmp;
    hres = pintmp->QueryDirection (&pindirtmp);
    if (hres == S_OK && pindir == pindirtmp) {
      *pin = pintmp;
      ret = TRUE;
      break;
    }
    pintmp->Release ();
  }
  enumpins->Release ();

  return ret;
}
开发者ID:0p1pp1,项目名称:gst-plugins-bad,代码行数:29,代码来源:gstdshow.cpp

示例10: FindPinInterface

//查找Pin上某一个接口,只要找到Filter上某一个Pin又该接口即返回
BOOL FindPinInterface(IBaseFilter* pFilter, REFGUID iid, void** ppUnk)
{
	if(!pFilter || !ppUnk)
		return FALSE;

	HRESULT hr = E_FAIL;
	IEnumPins* pEnumPin = NULL;
	if(FAILED(pFilter->EnumPins(&pEnumPin)))
	{
		return FALSE;
	}

	IPin* pPin = NULL;
	while(pEnumPin->Next(1,&pPin,NULL) == S_OK)
	{
		hr = pPin->QueryInterface(iid,ppUnk);
		pPin->Release();
		if(SUCCEEDED(hr))
		{
			pEnumPin->Release();
			return TRUE;
		}
	}

	pEnumPin->Release();

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

示例11: while

// Function name	: CVMR9Graph::GetPin
// Description	    : return the desired pin
// Return type		: IPin* 
// Argument         : IBaseFilter *pFilter
// Argument         : PIN_DIRECTION PinDir
IPin* CVMR9Graph::GetPin(IBaseFilter *pFilter, PIN_DIRECTION PinDir)
{
    BOOL       bFound = FALSE;
    IEnumPins  *pEnum;
    IPin       *pPin;

    pFilter->EnumPins(&pEnum);
    while(pEnum->Next(1, &pPin, 0) == S_OK) {
        PIN_DIRECTION PinDirThis;
        pPin->QueryDirection(&PinDirThis);
        if (PinDir == PinDirThis)
        {
            IPin *pTmp = 0;
            if (SUCCEEDED(pPin->ConnectedTo(&pTmp)))  // Already connected, not the pin we want.
            {
                pTmp->Release();
            }
            else  // Unconnected, this is the pin we want.
            {
              bFound = true;
              break;
            }
        }
        pPin->Release();
    }
    pEnum->Release();

    return (bFound ? pPin : 0);
}
开发者ID:smarinel,项目名称:ags-web,代码行数:34,代码来源:acwavi3d.cpp

示例12: GetPin

IPin* EMTestVideoOut::GetPin(IBaseFilter *pFilter, PIN_DIRECTION PinDir)
{
    BOOL       bFound = FALSE;
    IEnumPins  *pEnum;
    IPin       *pPin;
	bool		FoundIt = false;
    pFilter->EnumPins(&pEnum);
    while(pEnum->Next(1, &pPin, 0) == S_OK)
    {
        PIN_DIRECTION PinDirThis;
        pPin->QueryDirection(&PinDirThis);
        if (bFound = (PinDir == PinDirThis))
		{
//			MessageBox(NULL, "Found Matching PIN_DIRECTION", "Looking for a PIN", MB_OK);
			FoundIt = true;
            break;
		}
        pPin->Release();
//			MessageBox(NULL, "Found A Non Matching PIN_DIRECTION", "Looking for a PIN", MB_OK);
    }
//	if(!FoundIt)
//			MessageBox(NULL, "DIDN'T FIND A MATCHING PIN", "WARNING WARNING!!!", MB_OK);
    pEnum->Release();
    return (bFound ? pPin : 0);  
}
开发者ID:Barrett17,项目名称:libvodoo,代码行数:25,代码来源:EMTestVideoOut.cpp

示例13: FindPinInterface

HRESULT FindPinInterface(
	IBaseFilter *pFilter,  // Pointer to the filter to search.
	REFGUID iid,           // IID of the interface.
	void **ppUnk)          // Receives the interface pointer.
{
	if (!pFilter || !ppUnk) return E_POINTER;

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

示例14: FindPin

void FindPin(IBaseFilter* baseFilter, PIN_DIRECTION direction, int pinNumber, IPin** destPin) 
{
    IEnumPins *enumPins = 0;

    *destPin = NULL;

    if (SUCCEEDED(baseFilter->EnumPins(&enumPins))) {
        ULONG numFound;
        IPin* tmpPin;

        while (SUCCEEDED(enumPins->Next(1, &tmpPin, &numFound))) {
            PIN_DIRECTION pinDirection;

            tmpPin->QueryDirection(&pinDirection);
            if (pinDirection == direction) {
                if (pinNumber == 0) {
                    // Return the pin's interface
                    *destPin = tmpPin;
                    break;
                }
                pinNumber--;
            }
            tmpPin->Release();
        }
    }

	if (enumPins)
	{
		enumPins->Release();
	}
}
开发者ID:gaoyakun,项目名称:atom3d,代码行数:31,代码来源:dshow_movieplayer.cpp

示例15: GetAMConfigForSinglePin

	HRESULT GetAMConfigForSinglePin(IUnknown* pUnk, PIN_DIRECTION direction, IAMStreamConfig** ppConfig)
	{
		IBaseFilter* pBaseFilter = NULL;
		HRESULT hr = pUnk->QueryInterface(IID_IBaseFilter, (void**)&pBaseFilter);
		if (SUCCEEDED(hr))
		{
			IEnumPins* pEnumPins = NULL;
			hr = pBaseFilter->EnumPins(&pEnumPins);
			if (SUCCEEDED(hr))
			{
				pEnumPins->Reset();
				if (SUCCEEDED(hr))
				{
					IPin* pPin = NULL;
					BOOL bFound = FALSE;
					while (((pEnumPins->Next(1, &pPin, NULL)) == S_OK) && !bFound)
					{
						PIN_DIRECTION fetchedDir;
						hr = pPin->QueryDirection(&fetchedDir);
						if (SUCCEEDED(hr) && (fetchedDir == direction))
						{
							hr = pPin->QueryInterface(IID_IAMStreamConfig, (void**)ppConfig);
							bFound = SUCCEEDED(hr);
						}
						pPin->Release();
					}
				}
				pEnumPins->Release();
			}
			pBaseFilter->Release();
		}
		return hr;
	}
开发者ID:wyrover,项目名称:HiVideo2,代码行数:33,代码来源:DShowUtils.cpp


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