本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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");
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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)
示例13: GetPin
bool ChannelPinMapper::TogglePin(int pinIdx, int chIdx)
{
bool on = GetPin(pinIdx, chIdx);
on = !on;
SetPin(pinIdx, chIdx, on);
return on;
}
示例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
}
示例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
}