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


C++ GetPin函数代码示例

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


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

示例1: CheckPointer

//
// FindPin
//
// If Id is In or Out then return the IPin* for that pin
// creating the pin if need be.  Otherwise return NULL with an error.
STDMETHODIMP CParserFilter::FindPin(LPCWSTR Id, IPin **ppPin) 
{
    CheckPointer(ppPin,E_POINTER);
    ValidateReadWritePtr(ppPin,sizeof(IPin *));

    if(0==lstrcmpW(Id,L"In")) {
        *ppPin = GetPin(0);
    }
    else if(0==lstrcmpW(Id,L"Out")) {
        *ppPin = GetPin(1);
    }
    else {
        *ppPin = NULL;
        return VFW_E_NOT_FOUND;
    }

    HRESULT hr = NOERROR;
    //  AddRef() returned pointer - but GetPin could fail if memory is low.
    if(*ppPin) {
        (*ppPin)->AddRef();
    }
    else {
        hr = E_OUTOFMEMORY;  // probably.  There's no pin anyway.
    }
    return hr;
}
开发者ID:guojerry,项目名称:cppxml,代码行数:31,代码来源:Parser.cpp

示例2: ConnectFilters

static HRESULT ConnectFilters(IGraphBuilder *graph,
							  IBaseFilter *lhs,
							  IBaseFilter *rhs)
{
	HRESULT hr = S_OK;
    IPin *out = 0;
	IPin *in  = 0;
	
    hr = GetPin(lhs, PINDIR_OUTPUT, &out);
	
    if (FAILED(hr))
		return hr;
	
    hr = GetPin(rhs, PINDIR_INPUT, &in);
	
    if (FAILED(hr)) 
    {
        out->Release();
        return hr;
	}
	
    hr = graph->Connect(out, in);
    in->Release();
    out->Release();
    return hr;
}
开发者ID:ChristianFrisson,项目名称:gephex,代码行数:26,代码来源:dshowutils.cpp

示例3: GetPin

//-----------------------------------------------------------------------------
// ConnectFilters
// Connects two filters by finding a pin on the upstream filter with the specified
// major format type, e.g. For connecting an audio pin to a downstream filter
HRESULT CDSUtils::ConnectFilters(IGraphBuilder* pGraph, IBaseFilter* pUpstream, IBaseFilter* pDownstream, const GUID* pFormat)
{
	HRESULT hr = S_OK;

	if (pUpstream && pDownstream && pFormat)
	{
		// find the upstream output pin with the specified format
		CComPtr<IPin> pIPinOutput = NULL;
		hr = GetPin(pUpstream, pFormat, PINDIR_OUTPUT, &pIPinOutput);
		if (SUCCEEDED(hr))
		{
			// get the downstream input pin
			CComPtr<IPin> pIPinInput = NULL;
			hr = GetPin(pDownstream, pFormat, PINDIR_INPUT, &pIPinInput);

			if (SUCCEEDED(hr))
			{
				// connect the pins
				hr = pGraph->Connect(pIPinOutput, pIPinInput);
			}
		}
	}
	else
	{
		hr = E_INVALIDARG;
	}

	return hr;
}
开发者ID:MattHung,项目名称:sage-graphics,代码行数:33,代码来源:Utils.cpp

示例4: bmp

void bmp (void) {
  uprintf("Command Excepted\r");
  switch (ExtractNum(3)) {
    case 0:itoa(GetPin('B',4),dumb,10);break;
    case 1:itoa(GetPin('B',5),dumb,10);break;
  }
  uprintf(dumb);
  uprintf("\r");
}
开发者ID:Teknoman117,项目名称:avr,代码行数:9,代码来源:main.c

示例5: lock

STDMETHODIMP CDynamicSource::JoinFilterGraph(IFilterGraph* pGraph, LPCWSTR pName)
{
    CAutoLock lock(&m_cStateLock);

    HRESULT hr;
    int nCurrentPin;
    CDynamicSourceStream* pOutputPin;

    // The filter is joining the filter graph.
    if(NULL != pGraph)
    {
        IGraphConfig* pGraphConfig = NULL;

        hr = pGraph->QueryInterface(IID_IGraphConfig, (void**)&pGraphConfig);
        if(FAILED(hr))
        {
            return hr;
        }

        hr = CBaseFilter::JoinFilterGraph(pGraph, pName);
        if(FAILED(hr))
        {
            pGraphConfig->Release();
            return hr;
        }

        for(nCurrentPin = 0; nCurrentPin < GetPinCount(); nCurrentPin++)
        {
            pOutputPin = (CDynamicSourceStream*) GetPin(nCurrentPin);
            pOutputPin->SetConfigInfo(pGraphConfig, m_evFilterStoppingEvent);
        }

        pGraphConfig->Release();
    }
    else
    {
        hr = CBaseFilter::JoinFilterGraph(pGraph, pName);
        if(FAILED(hr))
        {
            return hr;
        }

        for(nCurrentPin = 0; nCurrentPin < GetPinCount(); nCurrentPin++)
        {
            pOutputPin = (CDynamicSourceStream*)GetPin(nCurrentPin);
            pOutputPin->SetConfigInfo(NULL, NULL);
        }
    }

    return S_OK;
}
开发者ID:forssil,项目名称:thirdpartysource,代码行数:51,代码来源:dynsrc.cpp

示例6: alPinStateLock

STDMETHODIMP CDynamicSource::Stop(void)
{
    m_evFilterStoppingEvent.Set();

    HRESULT hr = CBaseFilter::Stop();

    // The following code ensures that a pins thread will be destroyed even 
    // if the pin is disconnected when CBaseFilter::Stop() is called.
    int nCurrentPin;
    CDynamicSourceStream* pOutputPin;
    {
        // This code holds the pin state lock because it
        // does not want the number of pins to change 
        // while it executes.
        CAutoLock alPinStateLock(&m_csPinStateLock);

        for(nCurrentPin = 0; nCurrentPin < GetPinCount(); nCurrentPin++)
        {
            pOutputPin = (CDynamicSourceStream*)GetPin(nCurrentPin);
            if(pOutputPin->ThreadExists())
            {
                pOutputPin->DestroySourceThread();
            }
        }
    }

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

    return NOERROR;
}
开发者ID:forssil,项目名称:thirdpartysource,代码行数:33,代码来源:dynsrc.cpp

示例7: monitor

STDMETHODIMP
BaseFilter::FindPin(LPCWSTR aId,
                    IPin** aPin)
{
  if (!aPin)
    return E_POINTER;

  *aPin = NULL;

  CriticalSectionAutoEnter monitor(mLock);
  int numPins = GetPinCount();
  for (int i = 0; i < numPins; i++) {
    BasePin* pin = GetPin(i);
    if (NULL == pin) {
      assert(pin != NULL);
      return VFW_E_NOT_FOUND;
    }

    if (!pin->Name().compare(aId)) {
      // Found a pin with a matching name, AddRef() and return it.
      *aPin = pin;
      NS_IF_ADDREF(pin);
      return S_OK;
    }
  }

  return VFW_E_NOT_FOUND;
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:28,代码来源:BaseFilter.cpp

示例8: ConnectTwoFilters

static HRESULT ConnectTwoFilters(IGraphBuilder *pGraph, IBaseFilter *pFirst, IBaseFilter *pSecond)
{
    IPin *pOut = NULL, *pIn = NULL;
    HRESULT hr = GetPin(pFirst, PINDIR_OUTPUT, &pOut);
    if (FAILED(hr)) return hr;
    hr = GetPin(pSecond, PINDIR_INPUT, &pIn);
    if (FAILED(hr)) 
    {
        pOut->Release();
        return E_FAIL;
     }
    hr = pGraph->Connect(pOut, pIn);
    pIn->Release();
    pOut->Release();
    return hr;
}
开发者ID:BlueBrain,项目名称:vrpn,代码行数:16,代码来源:directx_camera_server.cpp

示例9: XN_METHOD_CHECK_POINTER

HRESULT STDMETHODCALLTYPE XnVideoSource::SetMode( IPin *pPin, long Mode )
{
    XN_METHOD_START;

    XN_METHOD_CHECK_POINTER(pPin);

    HRESULT hr = S_OK;

    // we have only 1 pin, make sure this is it
    XnVideoStream* pVideoStream = dynamic_cast<XnVideoStream*>(GetPin(0));
    if (pPin != static_cast<IPin*>(pVideoStream))
    {
        XN_METHOD_RETURN(E_FAIL);
    }

    xnLogVerbose(XN_MASK_FILTER, "Setting flip mode to %d", Mode);

    hr = pVideoStream->SetMirror(Mode & VideoControlFlag_FlipHorizontal);
    if (FAILED(hr))
        XN_METHOD_RETURN(hr);

    hr = pVideoStream->SetVerticalFlip(Mode & VideoControlFlag_FlipVertical);
    if (FAILED(hr))
        XN_METHOD_RETURN(hr);

    XN_METHOD_RETURN(S_OK);
}
开发者ID:janjachnik,项目名称:OpenNI,代码行数:27,代码来源:XnVideoSource.cpp

示例10: ReportError

// Function name	: CVMR9Graph::RenderGraph
// Description	    : render the graph
// Return type		: BOOL 
BOOL CVMR9Graph::RenderGraph()
{
	HRESULT hr;

	if (m_pFilterGraph2 == NULL) {
		ReportError("Could not render the graph because it is not fully constructed", E_FAIL);
		return FALSE;
	}

	for (int i=0; i<10; i++) {
		IBaseFilter* pBaseFilter = m_srcFilterArray[i];
		if (pBaseFilter != NULL) {
			IPin* pPin;
      while ((pPin = GetPin(pBaseFilter, PINDIR_OUTPUT)) != NULL)
      {
        hr = m_pFilterGraph2->RenderEx(pPin, AM_RENDEREX_RENDERTOEXISTINGRENDERERS, NULL);
        if (FAILED(hr))
        {
          ReportError("Unable to render the pin", hr);
          return FALSE;
        }
      }
		}
	}
	return TRUE;
}
开发者ID:smarinel,项目名称:ags-web,代码行数:29,代码来源:acwavi3d.cpp

示例11: cObjectCreationLock

HRESULT CAnalyzerWriterFilter::GetMediaPositionInterface(REFIID riid, __deref_out void **ppv)
{
    CAutoLock cObjectCreationLock(&m_ObjectCreationLock);
    if (m_pPosition) {
        return m_pPosition->NonDelegatingQueryInterface(riid,ppv);
    }

    CBasePin *pPin = GetPin(0);
    if (NULL == pPin) {
        return E_OUTOFMEMORY;
    }

    HRESULT hr = NOERROR;

    // Create implementation of this dynamically since sometimes we may
    // never try and do a seek. The helper object implements a position
    // control interface (IMediaPosition) which in fact simply takes the
    // calls normally from the filter graph and passes them upstream

    m_pPosition = new CAnalyzerPosPassThru(NAME("Renderer CPosPassThru"),
                                           CBaseFilter::GetOwner(),
                                           (HRESULT *) &hr,
                                           pPin,
                                           m_analyzer);
    if (m_pPosition == NULL) {
        return E_OUTOFMEMORY;
    }

    if (FAILED(hr)) {
        delete m_pPosition;
        m_pPosition = NULL;
        return E_NOINTERFACE;
    }
    return GetMediaPositionInterface(riid,ppv);
}
开发者ID:perlinson,项目名称:graph-studio-next,代码行数:35,代码来源:filter_analyzer_writer.cpp

示例12: CBaseRenderer

CTextOutFilter::CTextOutFilter(LPUNKNOWN pUnk,HRESULT *phr) :
    CBaseRenderer(CLSID_TextRender, NAME("Text Display Filter\0"), pUnk, phr),
    m_TextWindow(NAME("Text properties\0"),GetOwner(),phr,&m_InterfaceLock,this)
{
    m_TextWindow.SetControlWindowPin( GetPin(0) );

} // (Constructor)
开发者ID:chinajeffery,项目名称:dx_sdk,代码行数:7,代码来源:textout.cpp

示例13: GetPin

bool ChannelPinMapper::TogglePin(int pinIdx, int chIdx) 
{
  bool on = GetPin(pinIdx, chIdx);
  on = !on;
  SetPin(pinIdx, chIdx, on); 
  return on;
}
开发者ID:Brado231,项目名称:Faderport_XT,代码行数:7,代码来源:audiobuffercontainer.cpp

示例14: LOG

void OggDemuxFilter::notifyPinConnected()
{
    LOG(logDEBUG) << __FUNCTIONW__;

    if (!m_streamMapper->allStreamsReady()) 
    {
        return;
    }

    if (m_seekTable) 
    {
        return;
    }

    m_seekTable = new CustomOggChainGranuleSeekTable();
    int outputPinCount = GetPinCount();

    for (int i = 1; i < outputPinCount; i++) 
    {
        OggDemuxOutputPin* pin = static_cast<OggDemuxOutputPin*>(GetPin(i));

        LOG(logDEBUG) << L"Adding decoder interface to seek table, serial no: " << pin->getSerialNo();
        m_seekTable->addStream(pin->getSerialNo(), pin->getDecoderInterface());
    }

#ifndef WINCE
    LOG(logDEBUG) << __FUNCTIONW__ << L" Building seek table...";

    CComPtr<IAsyncReader> reader = m_inputPin.GetReader();
    static_cast<CustomOggChainGranuleSeekTable*>(m_seekTable)->buildTable(reader);

    LOG(logDEBUG) << __FUNCTIONW__ << L" Built.";
#endif
}
开发者ID:John-He-928,项目名称:krkrz,代码行数:34,代码来源:OggDemuxFilter.cpp

示例15: CTransInPlaceFilter

CDXFilter::CDXFilter( IUnknown * pOuter, HRESULT * phr, BOOL ModifiesData )
                : CTransInPlaceFilter( TEXT("DXFilter"), (IUnknown*) pOuter, 
                                       CLSID_DXFilter, phr
#if !defined(_WIN32_WCE)
									   ,(BOOL)ModifiesData
#endif
									   )
                , m_callback( NULL )
{
    // this is used to override the input pin with our own   
    m_pInput = (CTransInPlaceInputPin*) new CDXFilterInPin( this, phr );
    if( !m_pInput )
    {
        if (phr)
            *phr = E_OUTOFMEMORY;
    }
    
    // Ensure that the output pin gets created.  This is necessary because our
    // SetDeliveryBuffer() method assumes that the input/output pins are created, but
    // the output pin isn't created until GetPin() is called.  The 
    // CTransInPlaceFilter::GetPin() method will create the output pin, since we
    // have not already created one.
    IPin *pOutput = GetPin(1);
    // The pointer is not AddRef'ed by GetPin(), so don't release it
}
开发者ID:JonathanRadesa,项目名称:mediastreamer2,代码行数:25,代码来源:dxfilter.cpp


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