本文整理汇总了C++中MpResource::maxOutputs方法的典型用法代码示例。如果您正苦于以下问题:C++ MpResource::maxOutputs方法的具体用法?C++ MpResource::maxOutputs怎么用?C++ MpResource::maxOutputs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MpResource
的用法示例。
在下文中一共展示了MpResource::maxOutputs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addVirtualOutputs
int MpTopologyGraph::addVirtualOutputs(MpResourceTopology& resourceTopology,
UtlHashBag& newResources,
UtlBoolean replaceNumInName,
int resourceNum)
{
int portsAdded = 0;
MpResourceTopology::VirtualPortIterator portIter;
UtlString realResourceName;
int realPortIdx;
UtlString virtualResourceName;
int virtualPortIdx;
resourceTopology.initVirtualOutputIterator(portIter);
while (resourceTopology.getNextVirtualOutput(portIter,
realResourceName, realPortIdx,
virtualResourceName, virtualPortIdx)
== OS_SUCCESS)
{
if(replaceNumInName)
{
MpResourceTopology::replaceNumInName(realResourceName, resourceNum);
MpResourceTopology::replaceNumInName(virtualResourceName, resourceNum);
}
// Lookup real resource.
MpResource *pResource = (MpResource*)newResources.find(&realResourceName);
assert(pResource);
if (!pResource)
{
continue;
}
// Check port index correctness. Note, that this check gracefully
// handles case with realPortIdx equal -1.
if (realPortIdx >= pResource->maxOutputs())
{
assert(!"Trying to map virtual port to non existing real port!");
continue;
}
// Add entry to virtual ports map.
// We need to create UtlVoidPtr wrapper for pResource, or it will be
// destroyed on pair deletion.
UtlContainablePair *pRealPort = new UtlContainablePair(new UtlVoidPtr(pResource),
new UtlInt(realPortIdx));
UtlContainablePair *pVirtPort = new UtlContainablePair(new UtlString(virtualResourceName),
new UtlInt(virtualPortIdx));
mVirtualOutputs.insertKeyAndValue(pVirtPort, pRealPort);
portsAdded++;
}
resourceTopology.freeVirtualOutputIterator(portIter);
return portsAdded;
}
示例2: removeLink
// Removes the link between the "outPortIdx" port of the "rFrom"
// resource and its downstream counterpart. If the flow graph is not
// "started", this call takes effect immediately. Otherwise, the call
// takes effect at the start of the next frame processing interval.
// Returns OS_SUCCESS if the link is removed. Returns
// OS_INVALID_ARGUMENT if the caller specified an invalid port index.
OsStatus MpFlowGraphBase::removeLink(MpResource& rFrom, int outPortIdx)
{
OsWriteLock lock(mRWMutex);
UtlBoolean handled;
MpFlowGraphMsg msg(MpFlowGraphMsg::FLOWGRAPH_REMOVE_LINK, NULL,
&rFrom, NULL, outPortIdx);
if (outPortIdx < 0 || outPortIdx >= rFrom.maxOutputs())
return OS_INVALID_ARGUMENT;
if (mCurState == STARTED)
return postMessage(msg);
handled = handleMessage(msg);
if (handled)
return OS_SUCCESS;
else
return OS_UNSPECIFIED;
}