• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetPin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetPin

void PinView::Update () {
    PinGraphic* pin = GetPin();
    Graphic* pingr = pin;
    
    IncurDamage(pin);
    *pingr = *GetPinComp()->GetGraphic();
    IncurDamage(pin);
    EraseHandles();
}
开发者ID:PNCG,项目名称:neuron,代码行数:9,代码来源:pin.cpp


示例17: EncoderHandler

// Handler to respond to pin interrupts
static void EncoderHandler(void *data) {
    tEncoder *enc = data;
    
    // Determine actual value of pins
    // and normalize inputs for lookup in a table
    int input = (GetPin(enc->pinA) ? 0x1 : 0x0) |
                (GetPin(enc->pinB) ? 0x2 : 0x0);
    
    // Add the value in the FSM to the current tick count
    // (or substract if invert is set)
    if (enc->invert) {
        enc->ticks -= enc->decoder->value[input];
    } else {
        enc->ticks += enc->decoder->value[input];
    }

    // Setup the next state of the mealy machine
    enc->decoder = &DecoderFSM[input];
}
开发者ID:ALoupe,项目名称:Rasware2013,代码行数:20,代码来源:encoder.c


示例18: GetPin

void CCaptureDevice::SetCaptureBufferSize(void)
{
	IPin * pCapturePin = GetPin();
	if (pCapturePin)
	{
		DWORD  dwBytesPerSec = 0;
		AM_MEDIA_TYPE * pmt = {0};
		IAMStreamConfig * pCfg = NULL;
		HRESULT hr = pCapturePin->QueryInterface(IID_IAMStreamConfig, (void **)&pCfg);
		if ( hr==S_OK )
		{
            hr = pCfg->GetFormat(&pmt);
			if ( hr==S_OK )
			{
				WAVEFORMATEX *pWF = (WAVEFORMATEX *) pmt->pbFormat;
				dwBytesPerSec = pWF->nAvgBytesPerSec;
				pWF->nChannels = 1;
				pWF->wBitsPerSample = 8;
				pWF->nSamplesPerSec = 11025;
				pWF->nAvgBytesPerSec = pWF->nSamplesPerSec * pWF->nChannels * pWF->wBitsPerSample / 8;
				pWF->nBlockAlign = 1;
/*
	info.cbSize = sizeof(WAVEFORMATEX);
	info.wFormatTag = 1;
	info.nChannels = 2;
	info.nSamplesPerSec = 44100;
	//info.nSamplesPerSec = 22050;
	11025
	info.wBitsPerSample = 16;
	info.nAvgBytesPerSec = info.nSamplesPerSec * info.nChannels * info.wBitsPerSample / 8;
	info.nBlockAlign = 4;
	*/
				pCfg->SetFormat( pmt );
				DeleteMediaType(pmt);
			}
			pCfg->Release();
		}
/*		if (dwBytesPerSec)
		{
			IAMBufferNegotiation * pNeg = NULL;
			hr = pCapturePin->QueryInterface(IID_IAMBufferNegotiation, 
				(void **)&pNeg);
			if (SUCCEEDED(hr))
			{
				ALLOCATOR_PROPERTIES AllocProp;
				AllocProp.cbAlign  = -1;  // -1 means no preference.
				AllocProp.cbBuffer = dwBytesPerSec *  dwLatencyInMilliseconds / 1000;
				AllocProp.cbPrefix = -1;
				AllocProp.cBuffers = -1;
				hr = pNeg->SuggestAllocatorProperties(&AllocProp);
				pNeg->Release();
			}
		}*/
	}
}
开发者ID:duzhi5368,项目名称:FKChessCards,代码行数:55,代码来源:CaptureDevice.cpp


示例19: CoInitialize

VideoCapture::VideoCapture(HWND hWnd)
{
    CoInitialize(NULL);
    //	HRESULT hr;

    InitVideoFilters();

    IPin *pPin = GetPin(m_pBaseFilter, PINDIR_OUTPUT);
    ShowFilterProperty(pPin);
    StartRender(hWnd);
}
开发者ID:alienwow,项目名称:CSharpProjects,代码行数:11,代码来源:DirectXDemo.cpp


示例20: cObjectCreationLock

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

    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 CRendererPosPassThru(NAME("Renderer CPosPassThru"),
                                           CBaseFilter::GetOwner(),
                                           (HRESULT *) &hr,
                                           GetPin(0));*/
	m_pPosition = new CMPEGSeeking(NAME("Renderer CPosPassThru"),
                                           CBaseFilter::GetOwner(),
                                           (HRESULT *) &hr,
                                           GetPin(0),
										   GetPin(1),
										   m_pMPEGObj);
    if (m_pPosition == NULL) {
        return E_OUTOFMEMORY;
    }

    if (FAILED(hr)) {
        delete m_pPosition;
        m_pPosition = NULL;
        return E_NOINTERFACE;
    }

	m_pPosition->AddRef();
	*ppv = m_pPosition;

    return S_OK;
}
开发者ID:BlackMael,项目名称:DirectEncode,代码行数:41,代码来源:MPEGFilter.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetPitch函数代码示例发布时间:2022-05-30
下一篇:
C++ GetPictureScreen函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap