locked
MFSESSION_SETTOPOLOGY_IMMEDIATE doesn't work as stated RRS feed

  • Question

  • -Play a topology on media session
    -While it is playing, set another topology on a media session uisng the MFSESSION_SETTOPOLOGY_IMMEDIATE flag (which is suppose to stop the current one)
    -Try to play the original topology again

    Result: The video will fast forward very quickly and start playing where it left off even though the call to MediaSession::Start specified to start at 0.

    I am using the custom EVR Presenter from the sample an starting playback on the TopologySet event

    Wednesday, March 23, 2011 2:21 AM

Answers

  • Sorry for late answer but we switched to using DirectShow with GMFBridge as we had too many issues with MediaFoundation.
    Wednesday, January 25, 2012 9:39 PM

All replies

  • Are you using MF on Vista? There are a few known issues with interrupting a topology set as immediate by queueing another operation on Vista that were fixed for Windows 7. I am hoping we got them all. In any case, the workaround is to wait for the MESessionTopologyStatus event with the READY flag for the new topology before queueing any additional operations.

    The reason for the strange behavior here is that the IMMEDIATE flag does not just rip the previous topology out of the media session, it forces it to end and then the session waits for the topology to complete gracefully. If an operation comes in during this waiting period, it can reset the ended state of the previous topology and produce unexpected results.

    Wednesday, April 27, 2011 9:48 PM
  • I am using MF on windows 7. I just tried waiting to the topology status to be ready before calling start on the media session but that caused the video to become choppy after a while. Basically that's what I do when calling Play() in my application:

    if nothing is playing:

    -Set Topology

    if something is already playing:

    -Set Topology with immediate flag

     

    in the IMFAsyncCallback Invoke's when the topology is ready:

    -Start the media session

     

    After 2 or 3 iterations of that logic the video becomes choppy.

    • Proposed as answer by Guy Godin Wednesday, January 25, 2012 9:38 PM
    • Unproposed as answer by Guy Godin Wednesday, January 25, 2012 9:39 PM
    Thursday, May 12, 2011 6:24 PM
  • Do you think you could submit an MFTrace of your app running so I can take a look at it?  It sounds like there is some buggy behavior in MF here but I need more information to investigate further.
    Tuesday, June 21, 2011 11:25 PM
  • Sorry for late answer but we switched to using DirectShow with GMFBridge as we had too many issues with MediaFoundation.
    Wednesday, January 25, 2012 9:39 PM