2

我正在努力将两个音频流混合成单个输出流。MFNode有一个 AudioMixerMFT,但是当我尝试构建这样的拓扑并执行它时,TopoEdit 崩溃:

在此处输入图像描述

注意:我尝试了 Windows SDK 7.1 附带的 TopoEdit 以及“开发 Microsoft® 媒体基础应用程序”的作者修复的很少的版本

我认为这可能是 TopoEdit 的一些问题,所以我在代码中构建了拓扑(通过修改“开发 Microsoft® 媒体基础应用程序”的 Ch#9 中的代码),但它仍然失败,在会话开始时mediaEvent->GetStatus(&hrStatus)内部出现“E_UNEXPECTED Catastrophic failure”HRESULT CPlayer::ProcessEvent(CComPtr<IMFMediaEvent>& mediaEvent)事件。

现在在这一点上,我认为 AudioMixerMFT 可能存在问题,所以我编写了一个带有 2 个输入的自定义 MFT,它的作用就像一个简单的直通(仅发送第一个输入并忽略第二个输入)。我在 TopoEdit 中构建了一个拓扑,并且它工作正常:

在此处输入图像描述

但是当我将“Audio 2.wav”连接到 MFT 时,它就崩溃了。现在我尝试在我自己的代码中使用这个自定义 MFT,它再次使用单个输入但在应用两个输入时因“E_UNEXPECTED Catastrophic failure”而失败。

不知道可能是什么问题,我开始怀疑是否支持多输入 MFT,我遇到了一个帖子http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/21596e11-c4e2-480a- b28f-9e2f5fa8820d/mutlinput-and-multioutput(是的,它很旧)表示不支持。

有没有人能够成功地从 MFNode 运行 AudioMixerMFT?Microsoft Media Foundation 的任何替代品?或任何提示将不胜感激。谢谢

4

1 回答 1

2

MFNode is my open source project.

If you read the MFNode's documentation, you will see that TopoEdit does not handle more than one inputstream in a MFT. And yes TopoEdit crashes. You can fix the bug in TopoEdit source code. It is just a null pointer that TopoEdit does not checked. But unfortunatly, it does not solve the problem. TopoEdit is not able to call ProcessInput twice on the two input streams, before calling ProcessOutput.

You have to provide a custom media session to make it work (implement IMFMediaSession).

In a next update of MFNode Project, i will provide a player to use all the MFNode, and especially the MFNode Audio Mixer.

EDIT: in tededit.cpp, TopoEdit crashes at CTedEditorVisualObjectEventHandler::NotifyObjectDeleted :

... CTedTopologyNode* pNode = m_pEditor->FindNode(pConn->GetOutputNodeID()); ...

pNode can be null pointer and TopoEdit does not check.

EDIT

I've updated my project. Check MFNodePlayer. I use a custom MediaSession to handle the wave mixer topology.

It works well but it is not perfect because of two things. If you stop the topo and then replay, it fails (because i must stop all source, and perhaps reset the time clock and bytestream). Second, there is a function wich handles IMFTransform in a recursive way. It is hard to debug.

I will fix later.

PS : Special thanks to "Developing Microsoft Media Foundation Applications" book. It helps me a lot to create a custom MediaSession.

于 2013-11-28T14:31:26.410 回答