<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Mike Wasson's Blog</title><subtitle type="html">About Media Foundation, DirectShow, and related topics</subtitle><id>http://blogs.msdn.com/mikewasson/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mikewasson/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/mikewasson/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-01-11T01:02:00Z</updated><entry><title>Media Foundation SDK Samples on Code Gallery</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mikewasson/archive/2009/09/09/media-foundation-sdk-samples-on-code-gallery.aspx" /><id>http://blogs.msdn.com/mikewasson/archive/2009/09/09/media-foundation-sdk-samples-on-code-gallery.aspx</id><published>2009-09-09T20:26:00Z</published><updated>2009-09-09T20:26:00Z</updated><content type="html">&lt;P&gt;We have published all of the Media Foundation samples from the Windows 7 SDK on MSDN Code Gallery. You can find them here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://code.msdn.microsoft.com/mediafoundation"&gt;http://code.msdn.microsoft.com/mediafoundation&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You will still need to download the&amp;nbsp;Windows SDK in order to build the samples.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: 'Times New Roman','serif'; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9893192" width="1" height="1"&gt;</content><author><name>MikeWasson</name><uri>http://blogs.msdn.com/members/MikeWasson.aspx</uri></author><category term="Media Foundation" scheme="http://blogs.msdn.com/mikewasson/archive/tags/Media+Foundation/default.aspx" /></entry><entry><title>Media Foundation: RC Documentation is Live</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mikewasson/archive/2009/05/06/media-foundation-rc-documentation-is-live.aspx" /><id>http://blogs.msdn.com/mikewasson/archive/2009/05/06/media-foundation-rc-documentation-is-live.aspx</id><published>2009-05-06T20:39:00Z</published><updated>2009-05-06T20:39:00Z</updated><content type="html">&lt;P&gt;The Media Foundation SDK documentation has been updated for the Windows 7 Release Candidate (RC) &lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms694197(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms694197(VS.85).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Highlights:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Updated MFPlay documentation: &lt;A href="http://msdn.microsoft.com/en-us/library/dd389294(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd389294(VS.85).aspx&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Source Reader tutorial: &lt;A href="http://msdn.microsoft.com/en-us/library/dd757929(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd757929(VS.85).aspx&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;New codec and file-format support: &lt;A href="http://msdn.microsoft.com/en-us/library/dd757780(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd757780(VS.85).aspx&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;Please remember that everything new in the SDK is still pre-release and subject to change&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;- Mike&lt;/P&gt;
&lt;P&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9591692" width="1" height="1"&gt;</content><author><name>MikeWasson</name><uri>http://blogs.msdn.com/members/MikeWasson.aspx</uri></author><category term="Media Foundation" scheme="http://blogs.msdn.com/mikewasson/archive/tags/Media+Foundation/default.aspx" /></entry><entry><title>Windows 7 and new Media Foundation features</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mikewasson/archive/2009/03/08/windows-7-and-new-media-foundation-features.aspx" /><id>http://blogs.msdn.com/mikewasson/archive/2009/03/08/windows-7-and-new-media-foundation-features.aspx</id><published>2009-03-09T05:42:00Z</published><updated>2009-03-09T05:42:00Z</updated><content type="html">&lt;P&gt;Based on a couple of threads in the &lt;A href="http://social.msdn.microsoft.com/forums/en-US/mediafoundationdevelopment/threads/" mce_href="http://social.msdn.microsoft.com/forums/en-US/mediafoundationdevelopment/threads/"&gt;Media Foundation Development&lt;/A&gt; forum, there is some confusion about the status of new Media Foundation features.&lt;/P&gt;
&lt;P&gt;All of the new features for Media Foundation mentioned &lt;A href="http://msdn.microsoft.com/en-us/library/bb970511(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb970511(VS.85).aspx"&gt;here&lt;/A&gt; require Windows 7 to run. You can install the Windows 7 SDK on a Windows Vista or XP machine and use it to build the new samples, etc, but any application that uses the new features will run only on Windows 7.&lt;/P&gt;
&lt;P&gt;- Mike&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9467112" width="1" height="1"&gt;</content><author><name>MikeWasson</name><uri>http://blogs.msdn.com/members/MikeWasson.aspx</uri></author><category term="Media Foundation" scheme="http://blogs.msdn.com/mikewasson/archive/tags/Media+Foundation/default.aspx" /></entry><entry><title>Introducing the Source Reader</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mikewasson/archive/2009/02/23/introducing-the-source-reader.aspx" /><id>http://blogs.msdn.com/mikewasson/archive/2009/02/23/introducing-the-source-reader.aspx</id><published>2009-02-23T20:35:00Z</published><updated>2009-02-23T20:35:00Z</updated><content type="html">&lt;P&gt;One of the new features in Media Foundation is the Source Reader.&lt;/P&gt;
&lt;P&gt;Media Foundation, like DirectShow before it, has focused on the end-to-end pipeline. The application passes in a URL and streaming happens on another thread. The application gives commands (play, pause) and gets events (end of stream). &lt;/P&gt;
&lt;P&gt;While this approach is convenient for playback, it makes it relatively hard for the application to get access to the bits as they travel from the source to the renderer. &lt;/P&gt;
&lt;P&gt;The Source Reader uses a different model. The application passes in a URL and then requests samples by calling IMFSourceReader::ReadSample in a loop. You can use the Source Reader to get compressed or uncompressed data from the source. For uncompressed data, the Source Reader hosts any decoders that are needed.&lt;/P&gt;
&lt;P&gt;I see two very broad categories of application for the Source Reader:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Applications that implement their own playback pipeline -- say, by using Direct3D to draw the video frames directly.&lt;/LI&gt;
&lt;LI&gt;Applications that need to perform non-real-time processing on media data, such as encoding, signal processing, video thumbnails, etc. For this type of application, all you want are the uncompressed samples; you don't need the API to manage streaming threads or a presentation clock.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Format SDK&amp;nbsp;programmers will find&amp;nbsp;the Source Reader looks similar to the FSDK reader object. (The Source Reader can operate in either synchronous or asynchronous mode).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For DirectShow programmers, the Source Reader fills approximately the same&amp;nbsp;niche as the Sample Grabber filter, except it is (IMO) easier to use.&lt;/P&gt;
&lt;P&gt;More information here:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;IMFSourceReader: &lt;A href="http://msdn.microsoft.com/en-us/library/dd374655(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd374655(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd374655(VS.85).aspx&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Overview: &lt;A href="http://msdn.microsoft.com/en-us/library/dd389281(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd389281(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd389281(VS.85).aspx&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;Please remember that everything new in the SDK is beta&lt;/EM&gt;. There have been minor changes to the&amp;nbsp;Source Reader API&amp;nbsp;for the upcoming RC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;- Mike&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9441558" width="1" height="1"&gt;</content><author><name>MikeWasson</name><uri>http://blogs.msdn.com/members/MikeWasson.aspx</uri></author><category term="Media Foundation" scheme="http://blogs.msdn.com/mikewasson/archive/tags/Media+Foundation/default.aspx" /></entry><entry><title>MSDN TOC issues</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mikewasson/archive/2009/01/28/msdn-toc-issues.aspx" /><id>http://blogs.msdn.com/mikewasson/archive/2009/01/28/msdn-toc-issues.aspx</id><published>2009-01-28T19:36:00Z</published><updated>2009-01-28T19:36:00Z</updated><content type="html">&lt;P&gt;It's been brought to my attention that the MSDN table of contents (TOC) is having some problems, at least in the "Audio and Video" node of the MSDN Library.&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;&amp;nbsp;1.&amp;nbsp; The TOC for the Media Foundation documentation is out of sync. Anything that is new for Windows 7 is not in the TOC. So if you navigate through the topics in Media Foundation, you wil find lots of "orphaned" pages.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt; This issue has been fixed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;2. The latest version of the DirectShow documentation has a new URL, and the old link points to an older version of the documentation. The latest DirectShow documentation is here:&amp;nbsp; &lt;A href="http://msdn.microsoft.com/en-us/library/dd375454(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd375454(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/dd375454(VS.85).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt; No ETA for&amp;nbsp;fixing this&amp;nbsp;issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I do not have an ETA for when these issues will be fixed. Apologies for the inconvenience. My only advice is to install the Windows SDK and use that documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;- Mike&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9381320" width="1" height="1"&gt;</content><author><name>MikeWasson</name><uri>http://blogs.msdn.com/members/MikeWasson.aspx</uri></author><category term="Windows SDK" scheme="http://blogs.msdn.com/mikewasson/archive/tags/Windows+SDK/default.aspx" /><category term="MSDN" scheme="http://blogs.msdn.com/mikewasson/archive/tags/MSDN/default.aspx" /></entry><entry><title>Introducing MFPlay</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mikewasson/archive/2009/01/18/mfplay.aspx" /><id>http://blogs.msdn.com/mikewasson/archive/2009/01/18/mfplay.aspx</id><published>2009-01-18T22:22:00Z</published><updated>2009-01-18T22:22:00Z</updated><content type="html">&lt;P&gt;MFPlay is a new high-level playback API for Media Foundation.&lt;/P&gt;
&lt;P&gt;Previously, to play a file in Media Foundation, the application had to:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Use the source resolver to create a media source.&lt;/LI&gt;
&lt;LI&gt;Enumerate the streams and find the media types (audio or video).&lt;/LI&gt;
&lt;LI&gt;Construct a partial topology, connecting the streams to the right renderers.&lt;/LI&gt;
&lt;LI&gt;Set the topology on the media session.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;With MFPlay, the equivalent steps&amp;nbsp;are just&amp;nbsp;one line of code:&lt;/P&gt;&lt;PRE&gt;const WCHAR *sURL = L"C:\\Users\\Public\\Videos\\example.wmv";

hr = MFPCreateMediaPlayer(
    sURL,
    TRUE,   // Start playback automatically?
    0,      // Flags.
    NULL,   // Callback pointer.
    hwnd,
    &amp;amp;g_pPlayer
    );
&lt;/PRE&gt;
&lt;P&gt;MFPlay also uses a much simpler event mechanism than the media session. The media session requires asynchronous calls to &lt;STRONG&gt;BeginGetEvent&lt;/STRONG&gt;/&lt;STRONG&gt;EndGetEvent&lt;/STRONG&gt;, and the event callback is invoked from a separate workqueue thread.&amp;nbsp;MFPlay uses a single callback method that passes an event structure:&lt;/P&gt;&lt;PRE&gt;STDMETHODIMP MediaPlayerCallback::OnMediaPlayerEvent(
    MFP_EVENT_HEADER *pEventHeader
    )
{
    switch (pEventHeader-&amp;gt;eEventType)
    {
    case MFP_EVENT_TYPE_PLAY:
        OnPlay(MFP_GET_PLAY_EVENT(pEventHeader));
        break;

    // Other event types (not shown).

    }
}
&lt;/PRE&gt;
&lt;P&gt;By default, the event callback is invoked on your application's WndProc thread, so you can treat&amp;nbsp;MFPlay events much like window messages.&lt;/P&gt;
&lt;P&gt;You can read more about MFPlay here:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd389294(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd389294(VS.85).aspx"&gt;Using MFPlay for Audio/Video Playback&lt;/A&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd374329(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd374329(VS.85).aspx"&gt;IMFPMediaPlayer&lt;/A&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;There is also an MFPlay sample in the Windows 7 BETA SDK, located under Samples\Multimedia\MediaFoundation\SimplePlay.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;EM&gt;Please remember that everything&amp;nbsp;new in the SDK is beta and subject to change.&lt;/EM&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;- Mike&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9338595" width="1" height="1"&gt;</content><author><name>MikeWasson</name><uri>http://blogs.msdn.com/members/MikeWasson.aspx</uri></author><category term="Media Foundation" scheme="http://blogs.msdn.com/mikewasson/archive/tags/Media+Foundation/default.aspx" /><category term="Windows 7" scheme="http://blogs.msdn.com/mikewasson/archive/tags/Windows+7/default.aspx" /></entry><entry><title>Windows 7 SDK </title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mikewasson/archive/2009/01/11/windows-7-sdk.aspx" /><id>http://blogs.msdn.com/mikewasson/archive/2009/01/11/windows-7-sdk.aspx</id><published>2009-01-11T09:02:00Z</published><updated>2009-01-11T09:02:00Z</updated><content type="html">&lt;P&gt;&lt;SPAN&gt;&lt;FONT face=Arial size=2&gt;The Windows SDK for Windows 7 is available for download!&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P align=left&gt;&lt;A title=http://www.microsoft.com/downloads/details.aspx?FamilyID=a91dc12a-fc94-4027-b67e-46bab7c5226c&amp;amp;DisplayLang=en href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a91dc12a-fc94-4027-b67e-46bab7c5226c&amp;amp;DisplayLang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=a91dc12a-fc94-4027-b67e-46bab7c5226c&amp;amp;DisplayLang=en&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P align=left&gt;Updated documentation for Media Foundation is also live on MSDN:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P align=left&gt;&lt;A title=http://msdn.microsoft.com/en-us/library/ms694197(VS.85).aspx href="http://msdn.microsoft.com/en-us/library/ms694197(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms694197(VS.85).aspx&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P align=left&gt;You can read about what's new for Media Foundation here:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P align=left&gt;&lt;A title=http://msdn.microsoft.com/en-us/library/bb970511(VS.85).aspx href="http://msdn.microsoft.com/en-us/library/bb970511(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb970511(VS.85).aspx&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P align=left&gt;Please remember that everything&amp;nbsp;new in the SDK is beta and subject to change. Over the next few weeks, I will be posting more about the new features.&lt;/P&gt;
&lt;P align=left&gt;&amp;nbsp;- Mike&lt;/P&gt;&lt;/SPAN&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9305393" width="1" height="1"&gt;</content><author><name>MikeWasson</name><uri>http://blogs.msdn.com/members/MikeWasson.aspx</uri></author><category term="Windows SDK" scheme="http://blogs.msdn.com/mikewasson/archive/tags/Windows+SDK/default.aspx" /><category term="Media Foundation" scheme="http://blogs.msdn.com/mikewasson/archive/tags/Media+Foundation/default.aspx" /><category term="Windows 7" scheme="http://blogs.msdn.com/mikewasson/archive/tags/Windows+7/default.aspx" /></entry></feed>