我试图制作一个视频播放器,按顺序无缝播放视频并循环播放。 "序列"和"无缝"部分通过使用Sequencer Source解决。但是"循环"部分让我头疼!
我想要做的是捕获 MEEndOfPresentation 事件,当它被捕获时我会执行以下步骤:
这很有效。如果我将输出节点上的 MF_TOPONODE_NOSHUTDOWN_ON_REMOVE 设置为 TRUE ,则可以正常工作。但是,这会在几分钟内产生大量内存泄漏!
如果我将 MF_TOPONODE_NOSHUTDOWN_ON_REMOVE 设置为 FALSE ,则显示的步骤无法正常工作。我使用的策略是否正确?
我记录了这些事件,看看我在比赛后接到了什么。在这里他们分别是:
MF_TOPONODE_NOSHUTDOWN_ON_REMOVE = FALSE
MENewPresentation, Event Status: S_OK
# then I queue the next segment
MESessionTopologyStatus, Event Status: S_OK, Topology Status: StartedSource
MESessionTopologyStatus, Event Status: S_OK, Topology Status: Ended
MESessionTopologyStatus, Event Status: S_OK, Topology Status: SinkSwitched
MESessionTopologyStatus, Event Status: S_OK, Topology Status: Ready
MESessionTopologyStatus, Event Status: S_OK, Topology Status: StartedSource
MEEndOfPresentation, Event Status: S_OK, Canceled: 0
# then I do the steps mentioned
MENewPresentation, Event Status: S_OK
# then I queue the next segment
MESessionTopologyStatus, Event Status: S_OK, Topology Status: Ended
MF_TOPONODE_NOSHUTDOWN_ON_REMOVE = TRUE
MENewPresentation, Event Status: S_OK
# then I queue the next segment
MESessionTopologyStatus, Event Status: S_OK, Topology Status: StartedSource
MESessionTopologyStatus, Event Status: S_OK, Topology Status: Ended
MESessionTopologyStatus, Event Status: S_OK, Topology Status: SinkSwitched
MESessionTopologyStatus, Event Status: S_OK, Topology Status: Ready
MESessionTopologyStatus, Event Status: S_OK, Topology Status: StartedSource
MEEndOfPresentation, Event Status: S_OK, Canceled: 0
# then I do the steps mentioned
MENewPresentation, Event Status: S_OK
# then I queue the next segment
MESessionTopologyStatus, Event Status: S_OK, Topology Status: Ended
MESessionTopologyStatus, Event Status: S_OK, Topology Status: SinkSwitched
MESessionTopologyStatus, Event Status: S_OK, Topology Status: Ready
MESessionTopologyStatus, Event Status: S_OK, Topology Status: StartedSource
MESessionTopologyStatus, Event Status: S_OK, Topology Status: Ended
MESessionTopologyStatus, Event Status: S_OK, Topology Status: SinkSwitched
...
P.S。我没有添加代码,因为它非常大。但如果你需要,我可以编辑我的问题。