Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 833
Glen Takahashi Avatar asked Feb 18 '12 08:02

Glen Takahashi


Video Answer


1 Answers

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.

like image 174
Roman R. Avatar answered Sep 28 '22 20:09

Roman R.