DirectShow CSourceStream 过滤器无法正确卸载
我正在使用 CSource / CSourceStream 作为基础编写 DirectShow 捕获过滤器,但是当我在 Firefox + Flash 中访问摄像头时,我在关闭 Firefox 时收到调试断言和以下调试错误。
Cam6.ax(tid 1c98) 133506 :
Cam6.ax(tid 1c98) 133506 : ID Object Description
Cam6.ax(tid 1c98) 133506 :
Cam6.ax(tid 1c98) 133506 : 19 (001AE940) Camera Stream
Cam6.ax(tid 1c98) 133507 : 18 (001AE940) Camera
Cam6.ax(tid 1c98) 133507 : 6 (001AE940) Camera Stream
Cam6.ax(tid 1c98) 133507 : 5 (001AE940) Camera
Cam6.ax(tid 1c98) 133507 :
Cam6.ax(tid 1c98) 133507 : Total object count 4
据我所知,这不是我的错。我怀疑 Flash 在关闭时不干净地丢弃了 DirectShow 图形。我已经阅读并重新阅读了 MSDN 文档,并在网上搜索了示例,但没有找到任何结果。
谁能帮助我澄清这一点或为我指出正确的方向?
I am writing a DirectShow capture filter using CSource / CSourceStream as a base but when I access the cam in Firefox + Flash, I get a debug assert and the following debug error when closing Firefox.
Cam6.ax(tid 1c98) 133506 :
Cam6.ax(tid 1c98) 133506 : ID Object Description
Cam6.ax(tid 1c98) 133506 :
Cam6.ax(tid 1c98) 133506 : 19 (001AE940) Camera Stream
Cam6.ax(tid 1c98) 133507 : 18 (001AE940) Camera
Cam6.ax(tid 1c98) 133507 : 6 (001AE940) Camera Stream
Cam6.ax(tid 1c98) 133507 : 5 (001AE940) Camera
Cam6.ax(tid 1c98) 133507 :
Cam6.ax(tid 1c98) 133507 : Total object count 4
From what I can tell this is not my fault. I suspect Flash is uncleanly discarding the DirectShow graph on shutdown. I have read and re-read the MSDN documentation and scoured the net for examples but turned up nothing.
Can anyone help clarify this for me or point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感觉这件事有点傻。花了一天时间查看引用计数之类的东西后,结果证明这是一个菜鸟错误。我使用 /MDd 标志编译了 strmbasd.lib,并使用 /MD 标志编译了我的代码。前者针对调试运行时库,后者针对发布运行时库。
链接器发出了警告,但没有引起注意,代码一直运行到释放 DLL 为止。想想吧……
我想把这归因于愚蠢。 :)
Feeling a little silly about this. After spending a day looking at reference counts and whatnot, it turned out to be a noobie mistake. I compiled strmbasd.lib with the /MDd flag and my code with the /MD flag. The former was targeting the debug runtime libraries, the later the release runtime libraries.
The linker gave a warning which went unheeded and the code ran up until time to release the DLL. Go figure..
Chalk that one up to stupidity I guess. :)