本文整理汇总了C++中BMediaRoster::NodeIDFor方法的典型用法代码示例。如果您正苦于以下问题:C++ BMediaRoster::NodeIDFor方法的具体用法?C++ BMediaRoster::NodeIDFor怎么用?C++ BMediaRoster::NodeIDFor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BMediaRoster
的用法示例。
在下文中一共展示了BMediaRoster::NodeIDFor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
MediaAddonServer::_DestroyInstantiatedFlavors(AddOnInfo& info)
{
printf("MediaAddonServer::_DestroyInstantiatedFlavors addon %ld\n", info.id);
NodeVector::iterator iterator = info.active_flavors.begin();
for (; iterator != info.active_flavors.end(); iterator++) {
media_node& node = *iterator;
printf("node %ld\n", node.node);
if ((node.kind & B_TIME_SOURCE) != 0
&& (fMediaRoster->StopTimeSource(node, 0, true) != B_OK)) {
printf("MediaAddonServer::_DestroyInstantiatedFlavors couldn't stop "
"timesource\n");
continue;
}
if (fMediaRoster->StopNode(node, 0, true) != B_OK) {
printf("MediaAddonServer::_DestroyInstantiatedFlavors couldn't stop "
"node\n");
continue;
}
if ((node.kind & B_BUFFER_CONSUMER) != 0) {
media_input inputs[16];
int32 count = 0;
if (fMediaRoster->GetConnectedInputsFor(node, inputs, 16, &count)
!= B_OK) {
printf("MediaAddonServer::_DestroyInstantiatedFlavors couldn't "
"get connected inputs\n");
continue;
}
for (int32 i = 0; i < count; i++) {
media_node_id sourceNode;
if ((sourceNode = fMediaRoster->NodeIDFor(
inputs[i].source.port)) < 0) {
printf("MediaAddonServer::_DestroyInstantiatedFlavors "
"couldn't get source node id\n");
continue;
}
if (fMediaRoster->Disconnect(sourceNode, inputs[i].source,
node.node, inputs[i].destination) != B_OK) {
printf("MediaAddonServer::_DestroyInstantiatedFlavors "
"couldn't disconnect input\n");
continue;
}
}
}
if ((node.kind & B_BUFFER_PRODUCER) != 0) {
media_output outputs[16];
int32 count = 0;
if (fMediaRoster->GetConnectedOutputsFor(node, outputs, 16,
&count) != B_OK) {
printf("MediaAddonServer::_DestroyInstantiatedFlavors couldn't "
"get connected outputs\n");
continue;
}
for (int32 i = 0; i < count; i++) {
media_node_id destNode;
if ((destNode = fMediaRoster->NodeIDFor(
outputs[i].destination.port)) < 0) {
printf("MediaAddonServer::_DestroyInstantiatedFlavors "
"couldn't get destination node id\n");
continue;
}
if (fMediaRoster->Disconnect(node.node, outputs[i].source,
destNode, outputs[i].destination) != B_OK) {
printf("MediaAddonServer::_DestroyInstantiatedFlavors "
"couldn't disconnect output\n");
continue;
}
}
}
MediaRosterEx(fMediaRoster)->ReleaseNodeAll(node);
}
info.active_flavors.clear();
}