Media Foundation: multi-input MFT and topology connection order
<p><strong>The problem</strong></p>

<p>I'm writing a custom MFT with two inputs and one output (it merges two video streams into one).</p>

<p>My MFT requires media types to be set on its inputs <strong>before</strong> it can provide an output type.</p>

<p>I've set up my topology by connecting two source nodes (they take different streams from an aggregate media source) to my transform node, and then an EVR to my single output.</p>

<p>When I start the media session, I see that the topology invokes <code>SetInputType</code> on the first input, and it succeeds. </p>

<p>But then it immediately tries to get an output type: first by calling <code>GetOutputCurrentType</code> on my MFT, which returns <code>MF_E_TRANSFORM_TYPE_NOT_SET</code> as it is unable to provide one, and then by calling <code>GetOutputAvailableType</code>, which I made return <code>MF_E_TRANSFORM_TYPE_NOT_SET</code> as per the documentation (says <em>You must set the input types before setting the output types</em>; I also tried to output some partial media types but it's the same).</p>

<p>And here's the problem: after that, the topology seems to give up on my MFT: <em>it never calls <code>SetInputType</code> on the second input.</em></p>

<p><strong>The question</strong></p>

<p>How can I force the topology to set all input types before dealing with the output?</p>