Reputation: 3995
I'm building a multimedia application on window8 and I need to access the system default camera device (say there multiple web cams connected to the computer and I need to select the system default one). I'm using media foundation framework and cannot find such an API that tells me which is the default camera. It seems it can only return a list of devices connected to the computer (using the MFEnumDeviceSources(pAttributes, &ppDevices, &count) function). Among all the capture device attributes listed here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd317915(v=vs.85).aspx ,
it seems there is no such an attribute specifying whether the device is a default one.
So how do I get the default device using Media Foundation ? If Media Foundation cannot achieve this, is there any other frameworks I can use ?
Upvotes: 0
Views: 316
Reputation: 2495
Media Foundation does not have a concept of a default webcam. I would suggest to provide a selector in the options, and default to the first device, and save any changed selections. In fact, to get the default mic, you will not use Media Foundation. Instead you will utilize IMMDeviceEnumerator
and IMMDevice
to get the default, and compare that to the found devices from Media Foundation.
Pertaining to other frameworks, I would stick with Media Foundation. It is easy to use, and performs quite well. Hope this helps.
Upvotes: 1