locked
Is there any API in Media Foundation similar to JoinFilterGraph in DirectShow RRS feed

  • Question

  • Hi,

    I am writing a custom MFT.

    I want my custom MFT gets notified whenever it gets loaded/used by Media Session.

    In directshow, filter's JoinFilterGraph api gets called when filter is loaded into graph.

    Is there any similar api or an event which i can use whenever Media session loads my custom MFT.

     

    Thanks and Regards,

    Vishu

    Friday, December 9, 2011 11:18 AM

All replies

  • Why do you need to use a special API? Can't you write your code in the constructor, which is being called upon creation in the session? Or later during media type negotiation its also clear that the MFT has been used by MF...

    Monday, December 12, 2011 4:06 PM
  • Hi Stefan,

    Thank you for the reply.

    Filter's JoinFilterGraph function gets called whenever Graph Manager loads or unloads the filter from Graph. I don't want to use in the constructor, what if it is already created/loaded, but not being used. And also if I use during media type negotiation, it is not guaranteed that my custom MFT is used until Media Session or  Application sets output media set by calling SetOutType function. How do I decide when to call my de-initialization operation (except in destructor)

    JoinFilterGraph function helps in to do custom initialization and de-initialization operations.

    I hope I made my question clear. I thank you very much for any help.

    Thanks and Regards,

    Vishwanath Biradar

    Tuesday, December 13, 2011 4:48 AM
  • The MFT message MFT_MESSAGE_NOTIFY_BEGIN_STREAMING and MFT_MESSAGE_NOTIFY_END_STREAMING are appropriate places to allocate and release resources respectively.  It is not a requirement that an MFT receive these messages, so your MFT should still be able to allocate resources on the first ProcessInput and release them in the destructor.
    Friday, January 6, 2012 8:17 PM