DirectShow 视频捕获过滤器 - IPersistPropertyBag::Load() 返回 E_ENVALIDARG
这让我发疯。
Windows Mobile 6 示例 CameraCapture 在所有测试的 WM 6 设备上运行良好。 我已将相同的图形结构添加到一个大型复杂程序中。在某些设备上,CLSID_VideoCapture 过滤器无法通过 IPersistPropertyBag::Load() 接口调用接受摄像机名称,并返回 E_INVALIDARG (0x80070057)。
我的程序在一台 WM 6.5 设备上运行良好,因此我认为摄像机名称已正确传递到过滤器。似乎存在一些外部冲突,导致相机无法与某些设备上的滤镜关联。 WM 6.1 和 WM 6.5 设备上都会出现故障。
我已经多次检查和逐步执行此操作,但找不到简单的示例 CameraCapture (始终有效)和我的复杂程序(仅在一台设备上有效)之间有任何明显的差异。以下是更多详细信息:
- 所有工作都在主线程上完成(CameraCapture 使用辅助线程,但如果在主线程上完成图形构建,则行为相同)。
- E_INVALIDARG 未列为 IPersistPropertyBag::Load() 的可能返回值。我认为该错误来自相机初始化的某些内部方面。
- 如果我传递了一个错误的相机名称,例如“CAM”,我会得到 0x80070002,“未找到设备/文件”。由于包里没有名字,我得到 0x8007000d“数据无效”。
- 我已经为 Load( &PropBag, &ErrorLog ) 实现了一个 CErrorLog,并且在 Load() 期间从未调用它,因此没有更多可用的详细信息。
- 这两个程序的编译和链接设置大致相同。
- 两个程序都使用 CoInitializeEx( NULL, COINIT_MULTITHREADED ) 并且复杂的程序在一台设备上运行良好。
- CameraCapture 和我的程序中的相机选择几乎与此处的描述相同:http: //msdn.microsoft.com/en-us/library/aa918757.aspx
- 我发现另一个提到此问题的地方:http://www.eggheadcafe.com/software/aspnet/30318752/problem-with-propertybag.aspx
关于错误的任何想法真正意味着什么或可能导致这种情况的冲突值得赞赏。
谢谢。
This one is driving me crazy.
The Windows Mobile 6 sample CameraCapture works fine on all WM 6 devices tested.
I have added the same graph construction to a large complex program. On some devices, the CLSID_VideoCapture filter fails to accept the camera name through the IPersistPropertyBag::Load() interface call and returns E_INVALIDARG (0x80070057).
My program works fine on one WM 6.5 device, so I think the camera name is being delivered properly to the filter. There seems to be some external conflict which prevents the camera from being associated with the filter on some devices. Failures occur on both WM 6.1 and WM 6.5 devices.
I've checked and stepped through this many times, but can't find any culpable difference between the trivial sample CameraCapture (which always works) and my complex program (which only works on one device). Here are some more details:
- All work is done on the main thread (CameraCapture uses a helper thread, but behaves the same if graph construction is done on the main thread).
- E_INVALIDARG is not listed as a possible return value from IPersistPropertyBag::Load(). I think the error comes from some internal aspect of the camera initialization.
- If I pass a bad camera name like "CAM" I get 0x80070002, "device/file not found". With no name in the bag I get 0x8007000d "The data is invalid".
- I have implemented a CErrorLog for the Load( &PropBag, &ErrorLog ) and it is never called during the Load(), so there are no more details available.
- Compilation and linking settings are roughly the same between the two programs.
- Both programs use CoInitializeEx( NULL, COINIT_MULTITHREADED ) and the complex program works fine on one device.
- The camera selection in both CameraCapture and my program are nearly identical to the description here: http://msdn.microsoft.com/en-us/library/aa918757.aspx
- I've found one other mention of this problem: http://www.eggheadcafe.com/software/aspnet/30318752/problem-with-propertybag.aspx
Any thoughts about what the error really means or what conflicts could cause this are appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如怀疑的那样,我发现了外部冲突。我的所有设备都有条形码扫描仪。在某些情况下,扫描仪和相机之间存在冲突。当然,CameraCapture 示例不包含任何扫描仪控件,因此它始终有效。这些设备可能会共享一些接口硬件以节省成本,从而削弱可用性。现在我只需要做一些独家分享。
As suspected, I found an external conflict. All my devices have barcode scanners. On some, there is a conflict between the scanners and the camera. Of course, the CameraCapture sample does not contain any scanner control so it always works. The devices are probably sharing some interface hardware to save a dollar and thereby crippling the usability. Now I just need to work out some exclusive sharing.