Making Windows Media Player use my CODEC

Hi ,

If i write a Media Foundation Transform to decode some stream say h.264, will Windows Media Player pick it up automatically?

Or will have to write a player?

Thanks in advance

[205 byte] By [srikanthr] at [2008-1-10]
# 1

In order for your MFT to get picked up and used in the context of Media Foundation from Windows Media Player, the following must all be true:

  1. WMP knows to use Media Foundation to play the file format (i.e. container) in question. So for the extension (".foo") that you use, you'll need to tell WMP to use the correct runtime for playing it. See http://msdn2.microsoft.com/en-us/library/bb262867.aspx. The "runtime" value you want is 6; on Vista, this value will try Media Foundation first.
  2. Media Foundation can play the file format in question. This means that there needs to be a MF Media Source capable of handling that file type and registered with MF. Information on writing an MF Media Source is here http://msdn2.microsoft.com/en-us/library/ms700134.aspx, and there is a code sample in the SDK. Information on registering it is here: http://msdn2.microsoft.com/en-us/library/aa371872.aspx
  3. Your MFT is registered for the appropriate media types. This is a simple matter of using MFTRegister to register it as the decoder for your media types. http://msdn2.microsoft.com/en-us/library/aa965254.aspx

If these are true, then the answer is yes.

BeckyWeiss-MSFT at 2007-10-3 > top of Msdn Tech,Audio and Video Development,Media Foundation Development...