Answered by:
Using Media Foundation with C# ?

Question
-
Hi,
Microsoft will provide managed interface (wrapper?) for Media Foundation in order to use it with .NET? Because Direct Shows is almost unusable with C#...
ThanksSunday, June 18, 2006 9:04 AM
Answers
-
No. Here's what's new in MF for Windows 7:http://msdn.microsoft.com/en-us/library/bb970511(VS.85).aspx
For managed support, look for or help out with MF.NET here:
My dshow site is http://tmhare.mvps.org. Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.- Marked as answer by The March Hare Sunday, July 19, 2009 7:17 PM
Sunday, July 19, 2009 5:44 PM -
No, unfortunately we don't have plans to include a managed wrapper for Media Foundation in its v1 (Windows Vista).
Monday, June 19, 2006 1:57 PM
All replies
-
No, unfortunately we don't have plans to include a managed wrapper for Media Foundation in its v1 (Windows Vista).
Monday, June 19, 2006 1:57 PM -
Ooooo please do make plans to provide a .NET managed wrapper to Media Foundation soon thereafter!!!!! That would be most helpful and advantageous!Sunday, August 27, 2006 5:37 PM
-
Well, that's really strange because rhere has been namespace system.windows.media.core that wrapped MF functionality. Why it has been removed?Tuesday, December 19, 2006 3:14 PM
-
Becky Weiss - MSFT wrote: No, unfortunately we don't have plans to include a managed wrapper for Media Foundation in its v1 (Windows Vista).
IMHO that's very unpleasant. You have not provided managed wrapper for Windows Media Format SDK - OK, I have written one by myself. Windows Media Format SDK has been create long before .NET era. By why the heck you do not give what you already do have? .NET Framework 1.2 (yes, there has been such development version, plz see http://www.winfx247.com/247reference/System/Windows/Media/Core/System.Windows.Media.Core.aspx for example) has all I need to develop managed application that can use Media Foundation to do efficient audio streaming, bypassing DirectSound, which on Vista is merely wrapper over Media Foundation. I still do not get why you play against people developing on YOUR platform. Grrr, I *had* to write it.
- Proposed as answer by Calvin Wang Monday, January 28, 2013 8:21 AM
Thursday, January 25, 2007 7:10 PM -
OK new game, few years later, same question ;-)
Will there be direct support from Microsoft for managed wrapper for Media Foundation V2 on Windows 7?
Thanks
MikeHSunday, July 19, 2009 5:27 PM -
No. Here's what's new in MF for Windows 7:http://msdn.microsoft.com/en-us/library/bb970511(VS.85).aspx
For managed support, look for or help out with MF.NET here:
My dshow site is http://tmhare.mvps.org. Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.- Marked as answer by The March Hare Sunday, July 19, 2009 7:17 PM
Sunday, July 19, 2009 5:44 PM -
I read a decent MS dev blog article two days ago which I can't seem to find again. It was fairly sound reasoning behind any multimedia APIs never being managed. The root of the problem being the GC. I always wondered by the .Net 2.X managed API for DirectX was never released but I have a good appreciation for it. Secondly, have done a fair bit for DirectX development using .Net 1.X Managed libraries, performance was always an issue no matter how well I optimised hardware data buffering.
Moving into Media Foundation, the last thing I want to be doing is using Managed API libs for 1080p video processing, re-encoding and preview playback simultaneously. I've reluctantly put my C++ boots back on for the first time in 7 years. It's a bit more pedantic than C# but productivity isn't that much poorer.Tuesday, August 11, 2009 5:53 AM -
Don't try to put Media Foundation logic in managed code, it'll be disaster. It caused me a lot of trouble.I strongly recommend you to write your Media Foundation logic in c++ dll and call the dll from managed code. It's much easier to program low level stuff like Media Foundation in c++ directly (provided you know how to program c++ dll, lol).Tuesday, August 18, 2009 6:55 PM
-
Don't try to put Media Foundation logic in managed code, it'll be disaster. It caused me a lot of trouble.
I strongly recommend you to write your Media Foundation logic in c++ dll and call the dll from managed code. It's much easier to program low level stuff like Media Foundation in c++ directly (provided you know how to program c++ dll, lol).Except that simple Mf things would run just fine as managed stuff via a wrapper. Things like playing audio files with the use of filters (say once AC3Filter is ported from DirectShow to MF).
There are even some managed examples on the official blog page, but yet there is no official support from MS.
It seems to me that MS want you to use .NET for everything in userspace (as seen by Office moving to being developed in such a way), and yet MS fail to provide much of the good functionality under .NET.
I agree that some aspects of MF are not suitable for managed code, but there is no reason why you cannot have a System.Media.MFSimple that has the basic things from MF that are the ones mostly widely used .. after all MF handles all the work, the .net part would just be a means to make calls to MF to do things (for instance .NET app pulls the AC3 data then sends it to MF to process and then output)
Monday, August 16, 2010 2:02 PM -
...reluctantly put my C++ boots back on for the first time in 7 years... It's a bit more pedantic than C# but productivity isn't that much poorer.
LOL great outlook on C++ development vs C#. Thank you for the info.
God Bless,
Alex
Monday, July 2, 2012 9:24 PM