Multiple input MFT in Microsoft Media Foundation

前端 未结 1 883
-上瘾入骨i
-上瘾入骨i 2021-01-21 14:26

I\'m struggling with mixing two audio streams into single output stream. MFNode has an AudioMixerMFT but TopoEdit crashes when I try to build a topology like this & execute

相关标签:
1条回答
  • 2021-01-21 14:50

    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.

    0 讨论(0)
提交回复
热议问题