Directshow 和 .NET 互操作问题
我面临一个奇怪的问题。我有一个基于 directshow 的播放器,它被包装为 COM 对象。
我以 C# 形式使用这个播放器。实际上是两个实例,以便两个剪辑可以并排播放。
现在在播放器中,当我第一次加载文件时,我让图形渲染,然后遍历图形,找到渲染器和渲染器引脚连接到的过滤器,然后在两者之间插入自定义过滤器。
它在大多数情况下都有效,但在某些情况下,当我将自定义过滤器的输出连接到渲染时,对 GraphBuilder.ConnectDirect 的调用将返回 E_NOINTERFACE。
有人见过类似的行为吗?
I am facing a strange issue. I have a directshow based player that is wrapped as a COM object.
I use this player in a C# form. Actually two instances so that two clips can be played side by side.
Now in the player, when I first load a file, I let the graph render, then traverse the graph, find the renderer and the filter that the renderer pin is connected to, and then insert a custom filter between the two.
It works most of the time, but on certain occasions, when I connect the output of my custom filter to the render, the call to GraphBuilder.ConnectDirect returns E_NOINTERFACE.
Has anyone seen similar behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要获取有关正在发生的情况的更多信息,请使用 IGraphBuilder::SetlogFile 创建日志文件。
E_NOINTERFACE 未列出由 IGraphBuilder ConnectDirect 返回的标准值,但可能是由于特定过滤器的某些内部问题,过滤器将 E_NOINTERFACE 返回到 DirectShow。错误代码本身可能不足以诊断问题。
E_NOINTERFACE 具有非常特殊的含义,但这并不能阻止组件作者错误地返回它。请参阅 Raymond Chen 博客上的“不要重载 E_NOINTERFACE 错误”:
http://blogs.msdn.com/b/oldnewthing /archive/2006/12/08/1239911.aspx
To get more information on what is going on, create a log file using IGraphBuilder::SetlogFile.
E_NOINTERFACE is not listed a standard value returned by IGraphBuilder ConnectDirect but it could be that a filter is returning E_NOINTERFACE to DirectShow due to some internal problem with that particular filter. The error code by itself is probably not enough information to diagnose the problem.
E_NOINTERFACE has a very particular meaning but that doesn't prevent component authors from returning it erroneously. See "Do not overload the E_NOINTERFACE error" on Raymond Chen's blog:
http://blogs.msdn.com/b/oldnewthing/archive/2006/12/08/1239911.aspx