本文整理汇总了C++中MpResource::setStreamId方法的典型用法代码示例。如果您正苦于以下问题:C++ MpResource::setStreamId方法的具体用法?C++ MpResource::setStreamId怎么用?C++ MpResource::setStreamId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MpResource
的用法示例。
在下文中一共展示了MpResource::setStreamId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addTopologyResources
int MpTopologyGraph::addTopologyResources(MpResourceTopology& resourceTopology,
MpResourceFactory& resourceFactory,
UtlHashBag& newResources,
UtlBoolean replaceNumInName,
int resourceNum)
{
// Add the resources
int resourceIndex = 0;
MpResource* resourcePtr = NULL;
MpResource* resourceArray[MAX_CONSTRUCTED_RESOURCES];
UtlString resourceType;
UtlString resourceName;
MpConnectionID resourceConnId;
int resourceStreamId;
OsStatus result;
while(resourceTopology.getResource(resourceIndex, resourceType, resourceName,
resourceConnId, resourceStreamId) == OS_SUCCESS)
{
if(replaceNumInName)
{
MpResourceTopology::replaceNumInName(resourceName, resourceNum);
}
int numConstructorResources;
OsStatus status;
status = resourceFactory.newResource(resourceType, resourceName, MAX_CONSTRUCTED_RESOURCES,
numConstructorResources, resourceArray);
if(status == OS_SUCCESS)
{
assert(numConstructorResources > 0);
int arrayIndex;
// We now can potentially get more than one resource back from the
// constructor
for(arrayIndex = 0; arrayIndex < numConstructorResources; arrayIndex++)
{
resourcePtr = resourceArray[arrayIndex];
assert(resourcePtr);
if(resourcePtr)
{
#ifdef TEST_PRINT
printf("constructed and adding resource name: %s type: %s\n",
resourcePtr->getName().data(),
resourceType.data());
#endif
if(replaceNumInName && resourceConnId == MP_INVALID_CONNECTION_ID)
{
resourcePtr->setConnectionId(resourceNum);
}
else
{
resourcePtr->setConnectionId(resourceConnId);
}
resourcePtr->setStreamId(resourceStreamId);
newResources.insert(resourcePtr);
result = addResource(*resourcePtr, FALSE);
assert(result == OS_SUCCESS);
}
}
}
else
{
OsSysLog::add(FAC_MP, PRI_ERR,
"Failed to create resource type: %s name: %s status: %d",
resourceType.data(), resourceName.data(), status);
}
resourceIndex++;
}
return(resourceIndex);
}