Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all articles
Browse latest Browse all 1079

Is there any Audio Stream Routing feature at all in Media Foundation ?

$
0
0

Hi

I always wanted to know why the Audio Stream Routing feature, which is meantioned everywhere for Media Foundation in the MSDN, does not work at all.

It is meantioned in several places in the MSDN, but this is the most obvious one:

https://docs.microsoft.com/en-us/windows/win32/coreaudio/stream-routing

Quote:

"In Windows 7, an application can seamlessly transfer a stream from an existing default device to a new default audio endpoint. High-level audio API sets such as Media Foundation, DirectSound, and WAVE APIs implement the stream routing feature. Media applications that use these API sets to play or capture a stream from the default device use the default implementation and will not have to modify the application."

Now the problem is that it does not work at all. If you create an audio device source by calling MFCreateDeviceSource, and if you omit the endpoint ID parameter to create the source from a default device, then there is no audio stream routing. Now there are 2 questions here.

The first would be:

Is this is just another error in the documentation like the other 10 000 i discovered over the past 3-5 years ?

The second would be:

Is there a hidden attribute, that is not listed in Visual Studio and in the MSDN, that can be set to activate stream routing ?

->

The second question might be most interessting, as there was this hidden attribute for the "Video Processor MFT", which was neither in the MSDN documentation nor in any header available in Visual Studio. That attribute is a rather important one, and is only known through a Microsoft Sample Code. Does the audio device source in Media Foundation also have such a hidden attribute, or is this just an error in the documentation ?

As a side note: There seem to be several more issues with audio device sources created from the MFCreateDeviceSource function. One would be that the device removed event ( MECaptureAudioSessionDeviceRemoved ) is not send when the device was removed/lost. I found dozens of questions about it over at Stackoverflow and also here in the forum, which were never answered. And after testing the audio device source extensively myself i have to concur, that the event is never fired ( no matter what settings ).

It looks like the developement of the audio device source implementation was kinda put to a hold after Windows 7, and errors creeped in. It seems that the focus for Microsoft was UWP/WinRT from Windows 8 onwards, and that errors in existing code bases were never fixed. For example, i found around 100 hard bugs in the EVR which were never fixed, and it looks like the audio device source shared the same fate.

I hope a Microsoft dev can clear this up.

Regards,

Francis






Viewing all articles
Browse latest Browse all 1079

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>