Why does Windows only allow one application to access the webcam? [closed]

本小妞迷上赌 提交于 2019-12-23 09:32:12

问题


I've been trying to make a sample webcam app in c#, and I discovered the app cannot run at the same time Skype or Oovoo or any other application is running? (and vice versa) Why do applications get exclusive locks over a webc


回答1:


Video capture APIs come from time when adding layers to share video hardware was unreasonable in terms of performance. Also, with 2+ apps working with a camera one would have to make them agree on capture format in some way that both are satisfied. So it was made the simplest and straightforward way: you grabbed the camera, it's yours and you can set it up for your own needs. However others would wait for you to release the hardware before anyone else can use it.

You can find third party software that shares a camera, which internally grabs it exclusively and then exposes virtual camera that is shareable. This trades off performance for flexibility.

Audio APIs were also locking hardware exclusively some time ago, but then at some point OS APIs introduced hardware abstraction layers to share hardware and do mixing from multiple applications behind the scene.




回答2:


This is probably intended to avoid an application spying on people while they are using their webcam through skype or whatever.



来源:https://stackoverflow.com/questions/9339778/why-does-windows-only-allow-one-application-to-access-the-webcam

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!