本文整理汇总了C++中NodeRef::name方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeRef::name方法的具体用法?C++ NodeRef::name怎么用?C++ NodeRef::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeRef
的用法示例。
在下文中一共展示了NodeRef::name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: instantiate
status_t ConnectionIO::instantiate(
NodeManager* manager,
const NodeSetIOContext* context,
Connection* outCon) {
// sanity checks
ASSERT(manager);
if(!m_inputNodeIO || !m_outputNodeIO)
return B_NOT_ALLOWED;
status_t err;
media_node_id node;
// find output node
NodeRef* outputRef;
err = m_outputNodeIO->getNode(manager, context, &node);
if(err < B_OK)
return err;
err = manager->getNodeRef(
node,
&outputRef);
if(err < B_OK)
return err;
// find output +++++ currently matches by name only
const int32 outputBufferSize = 16;
media_output outputs[outputBufferSize];
int32 count = outputBufferSize;
//vector<media_output> outputs;
// err = outputRef->getFreeOutputs(
// outputs/*,
// m_outputFormat.type*/);
err = outputRef->getFreeOutputs(
outputs,
outputBufferSize,
&count);
if(err < B_OK)
return err;
media_output output;
bool found = false;
for(int n = 0; n < count; ++n) {
if(m_outputName == outputs[n].name) {
output = outputs[n];
found = true;
break;
}
}
if(!found) {
PRINT(("!!! output '%s' of node '%s' not found\n",
m_outputName.String(),
outputRef->name()));
return B_NAME_NOT_FOUND;
}
// find input node
NodeRef* inputRef;
err = m_inputNodeIO->getNode(manager, context, &node);
if(err < B_OK)
return err;
err = manager->getNodeRef(
node,
&inputRef);
if(err < B_OK)
return err;
// find input +++++ currently matches by name only
vector<media_input> inputs;
err = inputRef->getFreeInputs(
inputs /*,
m_inputFormat.type*/);
if(err < B_OK)
return err;
media_input input;
found = false;
for(unsigned int n = 0; n < inputs.size(); ++n) {
if(m_inputName == inputs[n].name) {
input = inputs[n];
found = true;
break;
}
}
if(!found) {
PRINT(("!!! input '%s' of node '%s' not found\n",
m_inputName.String(),
inputRef->name()));
return B_NAME_NOT_FOUND;
}
// connect
Connection con;
if(m_requestedFormat.type != B_MEDIA_NO_TYPE)
err = manager->connect(
output,
input,
m_requestedFormat,
&con);
//.........这里部分代码省略.........