36 DPRINT(
"NodeId %lu NodesConnectedFromCount %lu NodesConnectedToCount %lu Visited %lu PinConnectedFromCount %lu PinConnectedToCount %lu\n", Topology->
TopologyNodes[
Index].
NodeIndex,
93 *OutTopology = Topology;
108 Topology->TopologyNodes[
Index].Visited =
FALSE;
114 Topology->TopologyPins[
Index].Visited =
FALSE;
128 ASSERT(Topology->TopologyNodesCount == NodeTypes->Count);
131 Guids = (
LPGUID)(NodeTypes + 1);
136 Topology->TopologyNodes[
Index].NodeIndex =
Index;
151 PULONG NewPinsIndex, OldPinsIndex;
158 OldNodes =
Pin->NodesConnectedTo;
163 Count =
Pin->NodesConnectedFromCount;
164 OldNodes =
Pin->NodesConnectedFrom;
191 Pin->NodesConnectedTo = NewNodes;
194 Pin->NodesConnectedToCount++;
200 OldPinsIndex =
Node->PinConnectedFrom;
205 Pin->NodesConnectedFrom = NewNodes;
208 Pin->NodesConnectedFromCount++;
214 OldPinsIndex =
Node->PinConnectedTo;
241 Node->PinConnectedFrom = NewPinsIndex;
244 Node->PinConnectedFromCount++;
249 Node->PinConnectedTo = NewPinsIndex;
252 Node->PinConnectedToCount++;
267 PULONG NewLogicalPinNodeConnectedFrom;
272 ASSERT(Topology->TopologyNodesCount > Connection->ToNode);
273 ASSERT(Topology->TopologyNodesCount > Connection->FromNode);
276 InNode = &Topology->TopologyNodes[Connection->FromNode];
277 OutNode = &Topology->TopologyNodes[Connection->ToNode];
280 LogicalPinId = Connection->ToNodePin;
296 if (!NewLogicalPinNodeConnectedFrom)
377 Count = InPin->PinConnectedToCount;
398 NewPinsIndex[
Count] = OutPin->PinId;
401 InPin->PinConnectedTo = NewPinsIndex;
404 InPin->PinConnectedToCount++;
407 Count = OutPin->PinConnectedFromCount;
428 NewPinsIndex[
Count] = InPin->PinId;
431 OutPin->PinConnectedFrom = NewPinsIndex;
434 OutPin->PinConnectedFromCount++;
456 ASSERT(Topology->TopologyPinsCount > Connection->FromNodePin);
457 ASSERT(Topology->TopologyPinsCount > Connection->ToNodePin);
461 &Topology->TopologyPins[Connection->FromNodePin],
462 &Topology->TopologyPins[Connection->ToNodePin]);
470 ASSERT(Topology->TopologyPinsCount > Connection->FromNodePin);
471 ASSERT(Topology->TopologyNodesCount > Connection->ToNode);
475 Pin = &Topology->TopologyPins[Connection->FromNodePin];
478 Node = &Topology->TopologyNodes[Connection->ToNode];
481 Pin->PinId = Connection->FromNodePin;
495 ASSERT(Topology->TopologyPinsCount > Connection->ToNodePin);
496 ASSERT(Topology->TopologyNodesCount > Connection->FromNode);
500 Pin = &Topology->TopologyPins[Connection->ToNodePin];
503 Node = &Topology->TopologyNodes[Connection->FromNode];
506 Pin->PinId = Connection->ToNodePin;
532 ASSERT(Topology->TopologyNodesCount == NodeTypes->Count);
581 if (OutPins[
Index] > PinId)
587 OutPins[
Index] = PinId;
599 OutPins[
Index] = PinId;
630 PinsCount = TopologyNode->PinConnectedFromCount;
631 Pins = TopologyNode->PinConnectedFrom;
633 TopologyNodesCount = TopologyNode->NodeConnectedFromCount;
639 PinsCount = TopologyNode->PinConnectedToCount;
640 Pins = TopologyNode->PinConnectedTo;
642 TopologyNodesCount = TopologyNode->NodeConnectedToCount;
653 Pin = &Topology->TopologyPins[Pins[
Index]];
679 TopologyNode->Visited =
TRUE;
723 ASSERT(Topology->TopologyNodesCount > NodeIndex);
726 TopologyNode = &Topology->TopologyNodes[NodeIndex];
747 TopologyNodesCount = TopologyNode->NodeConnectedFromCount;
753 TopologyNodesCount = TopologyNode->NodeConnectedToCount;
770 TopologyNode->Visited =
TRUE;
795 ASSERT(Topology->TopologyNodesCount > NodeIndex);
798 TopologyNode = &Topology->TopologyNodes[NodeIndex];
817 ULONG Index, TopologyNodesCount, TopologyPinsCount;
823 Pin = &Topology->TopologyPins[PinIndex];
829 TopologyNodesCount =
Pin->NodesConnectedFromCount;
832 TopologyPins =
Pin->PinConnectedFrom;
833 TopologyPinsCount =
Pin->PinConnectedFromCount;
840 TopologyNodesCount =
Pin->NodesConnectedToCount;
843 TopologyPins =
Pin->PinConnectedTo;
844 TopologyPinsCount =
Pin->PinConnectedToCount;
851 ASSERT(Topology->TopologyPinsCount > PinIndex);
889 Pin = &Topology->TopologyPins[PinIndex];
895 TopologyNodesCount =
Pin->NodesConnectedFromCount;
901 TopologyNodesCount =
Pin->NodesConnectedToCount;
908 ASSERT(Topology->TopologyPinsCount > PinIndex);
932 ULONG TopologyNodesCount;
936 ASSERT(PinIndex < Topology->TopologyPinsCount);
939 Pin = &Topology->TopologyPins[PinIndex];
945 TopologyNodesCount =
Pin->NodesConnectedFromCount;
951 TopologyNodesCount =
Pin->NodesConnectedToCount;
961 *OutNodesCount = TopologyNodesCount;
974 ULONG TopologyNodesCount;
978 ASSERT(NodeIndex < Topology->TopologyNodesCount);
983 TopologyNodes = Topology->TopologyNodes[NodeIndex].NodeConnectedFrom;
984 TopologyNodesCount = Topology->TopologyNodes[NodeIndex].NodeConnectedFromCount;
989 TopologyNodes = Topology->TopologyNodes[NodeIndex].NodeConnectedTo;
990 TopologyNodesCount = Topology->TopologyNodes[NodeIndex].NodeConnectedToCount;
1000 *OutNodesCount = TopologyNodesCount;
1009 *
PinCount = Topology->TopologyPinsCount;
1022 ASSERT(Topology->TopologyPinsCount != 0);
1054 ASSERT(Topology->TopologyNodesCount != 0);
1083 ASSERT(NodeIndex < Topology->TopologyNodesCount);
1086 if (Topology->TopologyNodes[NodeIndex].NodeConnectedFromCount > 1)
1089 *bTerminator =
TRUE;
1100 *bTerminator =
TRUE;
1108 *bTerminator =
FALSE;
1142 if (Pins[
Index] == PinId)
1168 ASSERT(NodeIndex < Topology->TopologyNodesCount);
1171 Node = &Topology->TopologyNodes[NodeIndex];
1180 *OutPinCount =
Node->NodeConnectedFromCount;
1189 ASSERT(NodeIndex < Topology->TopologyNodesCount);
1191 return &Topology->TopologyNodes[NodeIndex].NodeType;
1200 ASSERT(PinId < Topology->TopologyPinsCount);
1203 Topology->TopologyPins[PinId].Reserved =
TRUE;
1213 ASSERT(PinId < Topology->TopologyPinsCount);
1216 *bReserved = Topology->TopologyPins[PinId].Reserved;
1225 ASSERT(NodeIndex < Topology->TopologyNodesCount);
1228 Topology->TopologyNodes[NodeIndex].Reserved =
TRUE;
1238 ASSERT(NodeIndex < Topology->TopologyNodesCount);
1241 *bReserved = Topology->TopologyNodes[NodeIndex].Reserved;
1279 *OutTopology = Topology;
MIXER_CONTEXT MixerContext
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
static PCNODE_DESCRIPTOR TopologyNodes[]
@ MM_STATUS_INVALID_PARAMETER
struct __TOPOLOGY_NODE__ * PTOPOLOGY_NODE
struct TOPOLOGY * PTOPOLOGY
VOID MMixerPrintTopology()
VOID MMixerGetNextNodesFromPinIndex(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG PinIndex, IN ULONG bUpStream, OUT PULONG OutNodesCount, OUT PULONG OutNodes)
VOID MMixerGetTopologyPinCount(IN PTOPOLOGY Topology, OUT PULONG PinCount)
VOID MMixerIsTopologyPinReserved(IN PTOPOLOGY Topology, IN ULONG PinId, OUT PULONG bReserved)
VOID MMixerGetUpOrDownstreamNodes(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN PTOPOLOGY_NODE TopologyNode, IN ULONG bUpStream, OUT PULONG OutNodeCount, OUT PULONG OutNodes)
MIXER_STATUS MMixerAddPinConnection(IN PMIXER_CONTEXT MixerContext, IN PPIN Pin, IN PTOPOLOGY_NODE Node, IN ULONG bPinToNode)
MIXER_STATUS MMixerAllocateTopologyNodeArray(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, OUT PULONG *OutNodes)
ULONG MMixerGetNodeIndexFromGuid(IN PTOPOLOGY Topology, IN const GUID *NodeType)
VOID MMixerGetAllUpOrDownstreamNodesFromPinIndex(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG PinIndex, IN ULONG bUpStream, OUT PULONG OutNodesCount, OUT PULONG OutNodes)
VOID MMixerAddPinIndexToArray(IN PMIXER_CONTEXT MixerContext, IN ULONG PinId, IN ULONG MaxPins, OUT PULONG OutPinCount, OUT PULONG OutPins)
VOID MMixerIsTopologyNodeReserved(IN PTOPOLOGY Topology, IN ULONG NodeIndex, OUT PULONG bReserved)
VOID MMixerIsNodeTerminator(IN PTOPOLOGY Topology, IN ULONG NodeIndex, OUT ULONG *bTerminator)
MIXER_STATUS MMixerExploreTopology(IN PMIXER_CONTEXT MixerContext, IN PKSMULTIPLE_ITEM NodeConnections, IN PKSMULTIPLE_ITEM NodeTypes, IN OUT PTOPOLOGY Topology)
VOID MMixerSetTopologyPinReserved(IN PTOPOLOGY Topology, IN ULONG PinId)
MIXER_STATUS MMixerGetAllUpOrDownstreamNodesFromNodeIndex(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG bUpStream, OUT PULONG OutNodesCount, OUT PULONG OutNodes)
MIXER_STATUS MMixerHandleNodeToNodeConnection(IN PMIXER_CONTEXT MixerContext, IN PKSTOPOLOGY_CONNECTION Connection, IN OUT PTOPOLOGY Topology)
VOID MMixerResetTopologyVisitStatus(IN OUT PTOPOLOGY Topology)
VOID MMixerGetAllUpOrDownstreamPinsFromNodeIndex(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG bUpStream, OUT PULONG OutPinsCount, OUT PULONG OutPins)
VOID MMixerGetConnectedFromLogicalTopologyPins(IN PTOPOLOGY Topology, IN ULONG NodeIndex, OUT PULONG OutPinCount, OUT PULONG OutPins)
LPGUID MMixerGetNodeTypeFromTopology(IN PTOPOLOGY Topology, IN ULONG NodeIndex)
MIXER_STATUS MMixerAddPinToPinConnection(IN PMIXER_CONTEXT MixerContext, IN OUT PPIN InPin, IN OUT PPIN OutPin)
MIXER_STATUS MMixerCreateTopology(IN PMIXER_CONTEXT MixerContext, IN ULONG PinCount, IN PKSMULTIPLE_ITEM NodeConnections, IN PKSMULTIPLE_ITEM NodeTypes, OUT PTOPOLOGY *OutTopology)
VOID MMixerGetUpOrDownStreamPins(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN PTOPOLOGY_NODE TopologyNode, IN ULONG bUpStream, OUT PULONG OutPinCount, OUT PULONG OutPins)
VOID MMixerInitializeTopologyNodes(IN PMIXER_CONTEXT MixerContext, IN PKSMULTIPLE_ITEM NodeTypes, IN OUT PTOPOLOGY Topology)
VOID MMixerGetNextNodesFromNodeIndex(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG bUpStream, OUT PULONG OutNodesCount, OUT PULONG OutNodes)
MIXER_STATUS MMixerAllocateTopology(IN PMIXER_CONTEXT MixerContext, IN ULONG NodesCount, IN ULONG PinCount, OUT PTOPOLOGY *OutTopology)
MIXER_STATUS MMixerIsNodeConnectedToPin(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG PinId, IN ULONG bUpStream, OUT PULONG bConnected)
MIXER_STATUS MMixerHandleNodePinConnection(IN PMIXER_CONTEXT MixerContext, IN PKSTOPOLOGY_CONNECTION Connection, IN OUT PTOPOLOGY Topology)
MIXER_STATUS MMixerAllocateTopologyPinArray(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, OUT PULONG *OutPins)
MIXER_STATUS MMixerGetAllUpOrDownstreamPinsFromPinIndex(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG PinIndex, IN ULONG bUpStream, OUT PULONG OutPinsCount, OUT PULONG OutPins)
VOID MMixerSetTopologyNodeReserved(IN PTOPOLOGY Topology, IN ULONG NodeIndex)
_In_ const GUID _In_ ULONG PinCount
ULONG NodesConnectedToCount
PTOPOLOGY_NODE * NodesConnectedFrom
ULONG NodesConnectedFromCount
PTOPOLOGY_NODE * NodesConnectedTo
PTOPOLOGY_NODE TopologyNodes
ULONG PinConnectedFromCount
ULONG NodeConnectedFromCount
struct __TOPOLOGY_NODE__ ** NodeConnectedFrom
ULONG NodeConnectedToCount
PULONG LogicalPinNodeConnectedFrom
ULONG PinConnectedToCount
struct __TOPOLOGY_NODE__ ** NodeConnectedTo
struct KSTOPOLOGY_CONNECTION * PKSTOPOLOGY_CONNECTION
_In_ WDFCOLLECTION _In_ ULONG Index
#define IsEqualGUIDAligned(guid1, guid2)