同时从多个应用程序访问网络摄像头 [英] Access webcam from multiple applications simultaneously

查看:406
本文介绍了同时从多个应用程序访问网络摄像头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题背景-有两个不同的Windows应用程序试图同时访问计算机上的网络摄像头。当前,只有一个应用程序能够访问它。我希望能够允许两个应用程序同时访问网络摄像头。我的问题的一个常见示例是,Skype和Yahoo Messenger试图同时访问计算机上的网络摄像头。

The problem background - there are two different windows applications that are trying to access webcam on the computer at the same time. Currently, only one application is able to access to it. I want to be able to allow both applications to simultaneously access the webcam. A common example of my problem is, skype and yahoo messenger trying to access the webcam on the computer at the same time.

我发现了一些软件(manycam.com, http://www.splitcamera.com/ )允许在Windows上执行此操作。但是我不确定他们是如何实现的。我想自己编写代码以实现此目标,因为我的代码需要与其他API集成。

I found a few softwares (manycam.com, http://www.splitcamera.com/) that allow this on windows. But I am not sure how they implemented it. I want to write the code myself to achieve this since my code needs to be integrated with other APIs.

如果有人可以阐明如何编写设备包装器,我将不胜感激。

I appreciate if anyone can shed light on how to write a device wrapper to achieve this.

推荐答案

内核照相机驱动程序注册了几个OS定义的回调。回调之一用于输出流。专用的Windows应用程序具有与此流相关的接口-您需要对此主题进行一些阅读,但SO范围无法涵盖这一点。您需要一个将在客户端应用程序和摄像头驱动程序之间分层的组件。该组件应拦截相机驱动程序的输出并将其复制给已注册的客户端。这可以在内核(过滤器驱动程序)或用户模式(首选)中实现。 http://msdn.microsoft .com / zh-CN / library / windows / hardware / ff557573%28v = vs.85%29.aspx 是一个不错的起点。

The kernel camera driver registers several OS-defined callbacks. One of the callbacks is used for the output stream. Dedicated Windows applications have an interface to this stream - you'll need to do some reading on this subject, it's not something that can be covered in scope of SO. You need a component that will be layered in between the client applications and the camera driver. This component should intercept your camera driver output and duplicate it for the registered clients. This can be achieved either in kernel (filter driver) or in user mode (preferable). http://msdn.microsoft.com/en-us/library/windows/hardware/ff557573%28v=vs.85%29.aspx is a good place to start.

注意:您的相机软件可能已经支持此功能(尽管我认为机会很小),在这种情况下,您应该阅读相应的文档。

Note: this functionality might be already supported by your camera software (though I think the chances are very slim) and in this case you should dig into the corresponding documentation.

这篇关于同时从多个应用程序访问网络摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆