解析器过滤器在 directshow 编辑服务中应如何表现?

发布于 2024-11-09 01:41:03 字数 810 浏览 4 评论 0原文

我们创建了一个自定义推送源/解析器过滤器,预计可以在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

九厘米的零° 2024-11-16 01:41:03

您可以尝试向过滤器添加自定义接口,并从客户端应用程序外部调用方法。请参阅这个问题了解更多详细信息关于这种方法。在实现此方法时,您应该小心线程安全,并且确实可能​​有一种更简洁的方法来检测应该停止捕获。

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.

往事随风而去 2024-11-16 01:41:03

我对 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?

一腔孤↑勇 2024-11-16 01:41:03

我最近有机会使用 DES 和自定义推送源过滤器。

根据我的经验;

  • DES 实际上确实向 Receive() 调用返回错误代码,当剪切到达末尾时,该错误代码又返回到源的 Deliver()。
  • 我遇到了类似的情况,源没有收到它并继续运行到流的末尾。
  • 我发现的问题(经过大量的临时试验)是源需要在每次搜索后重新启动时调用 DeliverNewSegment() 方法。 DES 似乎仅在收到通知后才采集传入样本。看起来,即使没有该通知,DES 也会将样本接收为 S_OK,但它只是将其丢弃。
  • 我也没有看到 DES 通过 IMediaSeeking::SetPositions 设置结束时间。

我希望这会有所帮助,尽管这个问题很老了,我想蒂洛不再关心这个了......

I had a chance to work with DES and custom push source filter recently.

From my experience;

  • DES actually does return error code to Receive() call, which is in turn returned to Deliver() of the source, when the cut reaches the end.
  • I hit the similar situation that source does not receive it and continues to run to the end of the stream.
  • The problem I found (after a huge amount of ad-hoc trials) is that the source needs to call DeliverNewSegment() method at each restart after seek. DES seems to take incoming samples only after that notification. It looks like DES receives the samples as S_OK even without that notification, but it just throws away.
  • I don't see DES sets end time by IMediaSeeking::SetPositions, either.

I hope this helps, although this question was very old and I suppose Tilo does not care this any more...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文