On Fri Sep 5 10:55:55 2025 +0000, Conor McCarthy wrote:
By wrapping the transform, sink and sink media type handler I found the type switch occurs after the transform has processed some samples. It always occurs before the first sample is sent to the sink. The session engine calls `GetOutputAvailableType()` on the transform, and then with the new type it calls `SetOutputType()` on the transform and `SetCurrentMediaType()` on the sink type handler. This happens for H.264 even for aligned sizes, but it is not done for WMV. It may be possible to define the sequence of events more completely by wrapping the `IMFMediaSession`, but I think that's unnecessary and would be complicated. Applications must depend for their sequencing on the same events used in this test, so it's unlikely any will break on a subtle difference. It should suffice to update the type before the sink receives the first sample and also before `MESessionStarted`. I also tested `MESessionTopologyStatus/MF_TOPOSTATUS_STARTED_SOURCE` which showed the change occurs after that. That's the last event before `MESessionStarted`. I will be adding that test to the MR. I'm not planning to include the wrapped transform, since we need only check for sample delivery to the grabber. I'll add a test for that. Do you have suggestions for other tests?
If decoder is doing this type adjustment, could we test decoder transform directly, without any wrappers?