How to query if we are in Pause state?

API's provided by MFSession is very limited.

I want to know whether the playback is in Pause mode (by MFSession->Pause())
or not but I can't find any API's to retrieve current status.

The only method I can figure out is to listen MESessionPasused events and to "save" state.

Is this the only way to achieve this


Answer this question

How to query if we are in Pause state?

  • Joe Lucas

    Yup, listening for MESessionPaused is the standard way to do this.

    Here's another idea, though: You can obtain the presentation clock from the Media Session via IMFMediaSession::GetClock and calling IMFClock::GetState, which will tell you the state of the presentation clock. Two caveats:

    1) While doing a state transition, the Presentation Clock's state will change a split second before the Media Session's state changes. Maybe you don't care, but depending on what you're trying to do, this might cause race conditions.

    2) Although it's possible to QueryInterface this pointer for IID_IMFPresentationClock, don't use any of the IMFPresentationClock methods to change the state of the clock; you should do transport controls only through IMFMediaSession.

    Hope that helps...



  • How to query if we are in Pause state?