Is this posible with Media Foundation? RRS feed

  • Question

  • Hey there guys,

    Im looking for clearification about a media playing scenario im trying to solve - so here goes:

    Say i have managed to encrypt and include a known media file (e.g. mp3) in another custom media file named "song.sd3k"

    Is it posible to tell Windows when an application is trying to play this file, to pass the file to an MFT when the file has the .sd3k extension, and is it then posible for an MFT to decrypt and pass a decrypted MP3 stream to the application which is trying to play the file.

    Im not asking how its done - im asking if it is even remotely possible in your eyes.

    I have been trying to do it with a DMO in Windows XP - but the Media Foundation sounds more capable of such actions - if any of you here have any surgestions on how it can be done with a DMO - your surgestions are more then welcome.

    //Ivan Abrahamsen

    Thursday, February 15, 2007 1:21 PM


  • Sort of.

    You would write a Media Source that is able to parse your custom container format (sd3k).  Media Foundation has this thing called a Source Resolver: At install time, you register your Media Source (this means writing some registry values) to associate the ".sd3k" extension with your Media Source.  Then, MF-based playback applications who try to open an URL with that extension and ask the Source Resolver for a Media Source will get your Media Source.

    Your Media Source would then indicate that the media type of its stream is MP3.  The MF pipeline is capable of taking care of the rest, pulling in the MP3 decoder to decode the stream, and this would produce a decoded audio stream.  (Note that because MP3 is one of the formats natively supported by MF, you didn't have to write this decoder MFT.)


    • Only Media Foundation - based applications who use the Source Resolver to find their Media Sources would see your Media Source.
    • The Windows Media Player on Vista, in particular, is limited to WMV, WMA, and MP3 files.

    So this kind of limits the scope of applications who will get your Media Source.  Of course, if you were going to be writing the application yourself, this is a moot point, since you can make sure that your Media Source gets used.

    As for the "C# please" comment... Media Foundation today is unmanaged-only.  So the above assumes you're willing to write unmanaged code.

    Hope this helps...

    Wednesday, February 21, 2007 4:05 PM