locked
About the method of loading Original Sink. RRS feed

  • Question

  • Hi all!

    Please give me some pieces of advice on  how  to serialize Original Sink to MIG Process.

     

    Because the method of making general IMFActivate doesn't exist,

    IMFActivate for original Sink cannot be made.

    I would like you to teach the way of serializing original Sink to MIG Process.

     

    My Best Regards.

    Wednesday, November 1, 2006 8:10 AM

Answers

  • The way to get your sink instantiated in the PMP process is to write your own implementation of IMFActivate.

    This object should also implement IPersistStream.  In particular, its IPersistStream::GetClassID should return a CLSID for this object by which it can be CoCreated in the PMP process.  The IPersistStream::Save() and Load() implementations are options, to be used if you have other data for your IMFActivate that you'd like to serialize and send across to the PMP process.

    In the application process, you should set an instance of your IMFActivate implementation on the appropriate output topology node (IMFTopologyNode::SetObject).  When MF sends the topology to the PMP process, it will CoCreate a second (remote) instance of your IMFActivate implementation in the PMP process, and IMFActivate::Activate() will be called on that instance, so it will be able to create your sink in the PMP process.

    Of course, getting your code loaded into the PMP process depends either on the PMP process being run as a regular (i.e. not protected) process, or on you being a PMP licensee and having your code signed with the appropriate certs.

    Friday, November 3, 2006 4:05 PM

All replies

  • The way to get your sink instantiated in the PMP process is to write your own implementation of IMFActivate.

    This object should also implement IPersistStream.  In particular, its IPersistStream::GetClassID should return a CLSID for this object by which it can be CoCreated in the PMP process.  The IPersistStream::Save() and Load() implementations are options, to be used if you have other data for your IMFActivate that you'd like to serialize and send across to the PMP process.

    In the application process, you should set an instance of your IMFActivate implementation on the appropriate output topology node (IMFTopologyNode::SetObject).  When MF sends the topology to the PMP process, it will CoCreate a second (remote) instance of your IMFActivate implementation in the PMP process, and IMFActivate::Activate() will be called on that instance, so it will be able to create your sink in the PMP process.

    Of course, getting your code loaded into the PMP process depends either on the PMP process being run as a regular (i.e. not protected) process, or on you being a PMP licensee and having your code signed with the appropriate certs.

    Friday, November 3, 2006 4:05 PM
  • Thank you for your answer.

    And I have more questions.

    1. Please tell me how to implement the IMFActivate::Activate().

        Only return "S_OK"?

    2. Should  I  implement all of the IMFAttributes's methods?

         Is it useless only they return S_OK(or E_NOTIMPL )?

    Regards.Thank you.

    Wednesday, November 8, 2006 4:29 AM
  • 1. IMFActivate::Activate() is actually where the important stuff happens.  You'll want to instantiate your Media Sink from this method and return it.  This will be called in the mfpmp process.

    2. Yes, you should implement IMFAttributes.  This is easy enough, though -- just use the IMFAttributes implementation that MF provides (MFCreateAttributes()) and forward all IMFAttributes calls to it.

    Wednesday, November 8, 2006 6:36 PM
  • Thank you for your answer.

    1.----> May I return My MediaSink object  when IMFActivate::Activate() is called?

               And, though I don't have any  more data for IMFActivate, Should I implement  IPersistStream::Load() and Save()?

                In the last answer, you advised me that the two methods were options,

                so I thought  that I only had to return "E_NOTIMPL".

    2.----> I implemented IMFAttributes but GetUnknown() returned "MF_E_ATTRIBUTENOTFOUND".

               Isn't  there problem about this?

     

    Please point it out when I have the misunderstanding.

    Thank you.

    Tuesday, November 14, 2006 7:07 AM