解析器过滤器在 directshow 编辑服务中应如何表现?
我们创建了一个自定义推送源/解析器过滤器,预计可以在 directshow
编辑服务时间线中工作。
时过滤器不会停止传送样本
现在一切都很好,除了当当前切割到达终点 。渲染停止,但下游过滤器继续消耗
样本。过滤器传送样本直至达到 EOF。这会导致 CPU 负载过高,因此应用程序
根本无法使用。
经过大量调查后,我无法找到合适的机制来通知我的过滤器
剪切已结束,因此需要停止过滤器:
- 连接的解码器引脚上的 Deliver 函数始终返回 S_OK,这意味着连接的解码器
是也不知道 IMediaSamples 被下游丢弃
过滤器图中没有刷新
使用了 IMediaSeeking::SetPositions 接口,但只显示起始位置设置 –
我们总是被指示播放到文件末尾。
我期望在应用程序中使用 IAMTimelineSrc::SetMediaTimes(Start, Stop)
这也会设置停止时间,但这不会发生。
我还尝试操纵 XTL 时间线,向所有剪辑中添加“mstop”属性
希望这意味着设置了一个停止位置,但没有效果。
从过滤器的角度来看,输出缓冲区始终可用(因为 IMediaSamples 被下游丢弃),
因此过滤器会尽可能快地填充样本,直到源文件是 完成的。
有什么方法可以让过滤器检测何时停止,或者我们可以从应用程序端做任何事情吗?
非常感
谢蒂洛
we´ve created a custom push source / parser filter that is expected to work in a directshow
editing services timeline.
Now everything is great except that the filter does not stop to deliver samples when the current
cut has reached it´s end. The rendering stops, but the downstream filter continues to consume
samples. The filter delivers samples until it reaches EOF. This causes high cpu load, so the application
is simply unusable.
After a lot of investigation I’m not able to find a suitable mechanism that can inform my filter
that the cut is over so the filter needs to be stopped :
- The Deliver function on the connected decoder pins always returns S_OK, meaning the attached decoder
is also not aware the IMediaSamples are being discarded downstream
there’s no flushing in the filter graph
the IMediaSeeking::SetPositions interface is used but only the start positions are set –
our is always instructed to play up to the end of the file.
I would expect when using IAMTimelineSrc::SetMediaTimes(Start, Stop) from the application
that this would set a stop time too, but this does not happen.
I’ve also tried to manipulate the XTL timeline adding ‘mstop’ attributes to all the clip in the
hope that this would imply a stop position being set, but to no avail
In the filters point of view, the output buffers are always available (as the IMediaSamples are being discarded downstream),
so the filter is filling samples as fast as it can until the source file is finished.
Is there any way the filter can detect when to stop or can we do anything from the application side ?
Many thanks
Tilo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以尝试向过滤器添加自定义接口,并从客户端应用程序外部调用方法。请参阅这个问题了解更多详细信息关于这种方法。在实现此方法时,您应该小心线程安全,并且确实可能有一种更简洁的方法来检测应该停止捕获。
You can try adding a custom interface to your filter and call a method externally from your client application. See this SO question for a bit more of details on this approach. You should be careful with thread safety while implementing this method, and it is indeed possible that there is a neater way of detecting that the capturing should be stopped.
我对 DES 不太熟悉,但我已经在 DES 中尝试过我的解复用器过滤器,并且当剪辑有“stop=”标签时,停止时间设置正确。
也许您的 demux 没有正确实现 IMediaSeeking。您是否通过引脚公开 IMediaSeeking?
I'm not that familiar with DES, but I have tried my demux filters in DES and the stop time was set correctly when there was a "stop=" tag for the clip.
Perhaps your demux does not implement IMediaSeeking correctly. Do you expose IMediaSeeking through the pins?
我最近有机会使用 DES 和自定义推送源过滤器。
根据我的经验;
我希望这会有所帮助,尽管这个问题很老了,我想蒂洛不再关心这个了......
I had a chance to work with DES and custom push source filter recently.
From my experience;
I hope this helps, although this question was very old and I suppose Tilo does not care this any more...