locked
Custom Media Sink RRS feed

  • Question

  • Hi All,
    I want to know If I create my own Media Sink then how can I register the dll. Do I have any specific API for that as we have for  MFT, MFTRegister(). can you please give me some input on creating my own media sink and registering the same?
    Thanks in advance.

     
    Tuesday, February 19, 2008 5:47 AM

Answers

  • Unfortunately, (1) is not supported. When Windows Media Player uses the Media Foundation pipeline, it will only use the build-in media sinks (EVR, SAR).

     

    re (2), what happens when you try to play a  .wav file in the BasicPlayer sample, after you register the WavSource DLL? Is there an error code?

     

    - Mike 

     

    ----------------------------------------------------------------------------
    Mike Wasson, SDK Documentation
    This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.

    (c) 2008 Microsoft Corporation. All rights reserved.

    Friday, February 22, 2008 5:26 PM

All replies

  • Short answer: No.

     

    There is no API equivalent to MFTEnum for enumerating media sinks. To use a media sink in a toplogy, the application must provide an IMFStreamSink pointer or an IMFActivate pointer. An IMFActivate pointer is required if you plan to load the media sink inside the protected process (PMP).

     

    You have several options:

     

    1. Put the code for the media sink directly in your application and simply new an instance.

    2. Build the media sink into a .lib file and export a creation function, eg CreateMyMediaSink

    3. Build the media sink into a DLL and expose it through CoCreateInstance via the standard COM mechanisms.

     

    The WavSink sample in the SDK uses option #2.

     

     

     

    Tuesday, February 19, 2008 6:22 PM
  • Hi,
    I have two queries. Could you please clarify them?,
    1. Suppose I make my own Media SInk dll and register it through standard mechanism  and If  i  want to use this dll  while running some media file through Windows Media Player then how WMP will use my dll i.e. how WMP will come to know that it has to use my dll.
    2. I have run example code of wav source and I am able to register the dll with out any error. But when I am playing BasicPlayer It is not loading wav source dll. how would I make sure that Basic Player and WMP  uses the  wav source dll.
    Thanks
     

    Thursday, February 21, 2008 10:42 AM
  • Unfortunately, (1) is not supported. When Windows Media Player uses the Media Foundation pipeline, it will only use the build-in media sinks (EVR, SAR).

     

    re (2), what happens when you try to play a  .wav file in the BasicPlayer sample, after you register the WavSource DLL? Is there an error code?

     

    - Mike 

     

    ----------------------------------------------------------------------------
    Mike Wasson, SDK Documentation
    This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.

    (c) 2008 Microsoft Corporation. All rights reserved.

    Friday, February 22, 2008 5:26 PM
  • Hello Mike,

     

    I also facing the same problem of replacing MediaSink filters.

     

    I think we discussed some times back how can I use my own MFT for WMV decoding when WMV file is played using WMP. And as far as i know this is also not possible.

     

    I am playing file in unprotected mode.

     

    Does this means we can't replace any component in Media Foundation pipeline? Is yes, then MS is preventing us to use our components?

     

    This is possible in DirectShow.

     

    Thanks,

    Vibhor

     

    Wednesday, July 9, 2008 11:24 AM