IMFTopologyNode::ConnectOutput method

Connects an output stream from this node to the input stream of another node.


HRESULT ConnectOutput(
  DWORD           dwOutputIndex,
  IMFTopologyNode *pDownstreamNode,
  DWORD           dwInputIndexOnDownstreamNode



Zero-based index of the output stream on this node.


Pointer to the IMFTopologyNode interface of the node to connect to.


Zero-based index of the input stream on the other node.

Return Value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
The method succeeded.
The method failed.
Invalid parameter.


Node connections represent data flow from one node to the next. The streams are logical, and are specified by index.

If the node is already connected at the specified output, the method breaks the existing connection. If dwOutputIndex or dwInputIndexOnDownstreamNode specify streams that do not exist yet, the method adds as many streams as needed.

This method checks for certain invalid conditions:

  • An output node cannot have any output connections. If you call this method on an output node, the method returns E_FAIL.
  • A node cannot be connected to itself. If pDownstreamNode specifies the same node as the method call, the method returns E_INVALIDARG.
However, if the method succeeds, it does not guarantee that the node connection is valid. It is possible to create a partial topology that the topology loader cannot resolve. If so, the IMFTopoLoader::Load method will fail.

To break an existing node connection, call IMFTopologyNode::DisconnectOutput.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header mfidl.h
Library Mfuuid.lib

See Also