本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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 ;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
}
示例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;
}