Readme for the Media Foundation SDK

January 2007

This documentation provides late-breaking or other information that supplements the documentation for the Media Foundation SDK.


Known Issues

  • ASF Support
  • EVR Media Sink
  • Media Foundation Transforms
  • Media Session
  • Presentation Descriptors
  • Protected Media Path

For More Information

Legal Notice

Known Issues

ASF Support

The constant MFASF_MIN_HEADER_BYTES is defined incorrectly in the header file wmcontiner.h. Using this constant could result in an incorrect header size. Instead, applications should use the following value: sizeof(GUID)+sizeof(QWORD).

If the IMFASFSplitter::ParseData method receives invalid data, the method does not generate any samples but no error is returned. Applications using the ASF splitter must ensure that the data offset is set accurately.

By default, the ASF profile returned by the IMFASFContentInfo::GetProfile method does not contain any of the MF_PD_ASF_xxx attributes. To get these attributes from the ASFContentInfo object, do one of the following:

  • Call IMFASFContentInfo::GeneratePresentationDescriptor and query the returned presentation descriptor for the attributes.
  • Convert the ASF profile to a presentation descriptor by calling MFCreatePresentationDescriptorFromASFProfile.

EVR Media Sink

If a topology contains the enhanced video renderer (EVR) media sink, the EVR must be placed directly downstream from a Media Foundation transform (MFT), and that MFT must not provide its own output samples. The following types of object cannot be placed directly upstream from the EVR:

  • Media sources
  • Tee nodes
  • MFTs that allocate their own output samples

You can work around this limitation by inserting an MFT that copies the data from the samples of the upstream object to the EVR samples.

To test whether an MFT provides its own output samples, call the IMFTransform::GetOutputStreamInfo method. If the MFT sets the MFT_OUTPUT_STREAM_PROVIDES_SAMPLES flag, it means the MFT provides its own output samples and cannot be placed directly upstream from the EVR.

Media Foundation Transforms

If an MFT dynamically changes its output format during streaming, the IMFTransform::GetOutputCurrentType method must return a new instance of the media type object. Do not simply change the attributes on an existing media type object; if you do, the format change will not take effect.

Media Session

The IMFMediaSession::SetTopology method called with the MFSESSION_SETTOPOLOGY_IMMEDIATE flag does not work correctly in the following situations:

  • More than one topology is queued on the media session. The MFSESSION_SETTOPOLOGY_IMMEDIATE flag works only when the media session is playing the topology from the most recent SetTopology call, or when no topology is playing. It does not work when the application queues two or more topologies.
  • The media session is running inside the protected media path (PMP).

There are no workarounds for these two issues.

Presentation Descriptors

Presentation descriptors implement the IMFAttributes interface. However, if you call a presentation descriptor's QueryInterface method with IID_IMFAttributes, the method returns E_NOINTERFACE. The workaround is to query for IMFPresentationDescriptor, which inherits IMFAttributes.

The same issue occurs with stream descriptors. If you call a stream descriptor's QueryInterface method with IID_IMFAttributes, the method returns E_NOINTERFACE. The workaround is to query for IMFStreamDescriptor, which inherits IMFAttributes.

For some implementations of IMFMediaTypeHandler, if the stream contains protected content, the IMFMediaTypeHandler::GetMediaTypeByIndex method returns a protected media type, with a major type equal to MFMediaType_Protected. However, the IMFMediaTypeHandler::GetCurrentMediaType and IMFMediaTypeHandler::GetMajorType methods return the unprotected media type, such as audio or video.

Protected Media Path

Side-by-side (SxS) modules cannot be loaded in a protected process. If you are building a trusted component that will be loaded inside the protected media path, change the following default project settings in Visual Studio:

  • Remove the link option /MANIFEST. This option creates a side-by-side manifest file, which will prevent the component from being loaded in the protected process.
  • Change the /MD compiler option to /MT. The /MT option statically links the C runtime library. The latest C runtime DLL (msvcr80.dll) is an SxS DLL, so it will not load in a protected process.

For More Information

Information in this document, including URL and other Internet Web site references, is subject to change without notice.  Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, place or event is intended or should be inferred.  Complying with all applicable copyright laws is the responsibility of the user.  Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document.  Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

© 2007 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows NT, Windows Server, Windows Vista, Active Directory, ActiveSync, ActiveX, Direct3D, DirectDraw, DirectInput, DirectMusic, DirectPlay, DirectShow, DirectSound, DirectX, Expression, FrontPage, Internet Explorer, HighMAT, JScript, Microsoft Press, MSN, Outlook, PlaysForSure logo, PowerPoint, SideShow, Visual Basic, Visual C++, Visual InterDev, Visual J++, Visual Studio, WebTV, Windows Media, Win32, and Win32s are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries.

All other trademarks are property of their respective owners.