Media Foundation

It is the intended replacement for Microsoft DirectShow, Windows Media SDK, DirectX Media Objects (DMOs) and all other so-called "legacy" multimedia APIs such as Audio Compression Manager (ACM) and Video for Windows (VfW).

The existing DirectShow technology is intended to be replaced by Media Foundation step-by-step, starting with a few features.

The first release, present in Windows Vista, focuses on audio and video playback quality, high-definition content (i.e. HDTV), content protection and a more unified approach for digital data access control for digital rights management (DRM) and its interoperability.

The core layer uses services like file access and networking and clock synchronization to time the multimedia rendering.

These are part of the Platform layer, which provides services necessary for accessing the source and sink byte streams, presentation clocks and an object model that lets the core layer components function asynchronously, and is generally implemented as OS services.

Pausing, stopping, fast forward, reverse or time-compression can be achieved by controlling the presentation clock.

An application running in the Control layer has to choose which source types, transforms and sinks are needed for the particular video processing task at hand, and set up the "connections" between the components (a topology) to complete the data flow pipeline.

Or for a video capture application, the camcorder will act as video and audio sources, on which codec MFTs will work to compress the data and feed to a multiplexer that coalesces the streams into a container; and finally a file sink or a network sink will write it to a file or stream over a network.

The control layer components are required to propagate the data through the pipeline at a rate that the rendering synchronizes with the presentation clock.

The application specifies the required pipeline topology to the loader, which then creates the necessary connections between the components.

However this architecture can be complex to set up and there is considerable scope for lightweight, relatively easy to configure MF components designed to handle the processing of media data for simple point solutions.

In general, the media data flows from the Source Reader to the Sink Writer by the actions of the application.

The application will either take the packets of media data (called Media Samples) from the Source Reader and give them directly them to the Sink Writer or it will set up a callback function on the Source Reader which performs the same operation.

The Source Reader and Sink Writer provide ease of use and the Pipeline Architecture offers extremely sophisticated control over the flow of the media data.

However, many of the components available to a Pipeline (such as the Enhanced Video Renderer) are simply not readily usable in a Reader-Writer architecture application.

This is known as a Hybrid Architecture and it makes it possible to have an application which takes advantage of the sophisticated processing abilities of the Media Session and Pipeline while utilizing the ease of use of a Sink Writer.

In both cases a special component in the Pipeline effectively acts like a simple Reader-Writer application and feeds a Sink Writer.

Applications can use MFTs inside the Media Foundation pipeline, or use them directly as stand-alone objects.

Starting with Windows 7, MFTs also support hardware-accelerated video processing, encoding and decoding for AVStream-based media devices.

[5] In addition to Windows Media Audio and Windows Media Video encoders and decoders, and ASF file sink and file source introduced in Windows Vista,[5] Windows 7 includes an H.264 encoder with Baseline profile level 3 and Main profile support [8] and an AAC Low Complexity (AAC-LC) profile encoder [9] For playback of various media formats, Windows 7 also introduces an H.264 decoder with Baseline, Main, and High-profile support, up to level 5.1,[10] AAC-LC and HE-AAC v1 (SBR) multichannel, HE-AAC v2 (PS) stereo decoders,[11] MPEG-4 Part 2 Simple Profile and Advanced Simple Profile decoders [12] which includes decoding popular codec implementations such as DivX, Xvid and Nero Digital as well as MJPEG[5] and DV[13] MFT decoders for AVI.

Media Foundation Architecture