Basically, I want to know if a specific camera is built into the device [...] is there a way to query this?
With UWP, you can check the camera's DeviceInformation
's enclosureLocation
.panel
property, which is either:
front
/back
/etc for an integrated camera or
unknown
for an external camera
An full example is available in the CameraStarterKit sample.
However, if you can't use UWP, it should still be possible to find the underlying information. With MF, you should be able to access MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK
.
This will be something like
\\?\usb#vid_046d&pid_0843&mi_00#6&2314864d&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\global
A built-in camera is supposed to register its physical location in
HKLM\SYSTEM\CurrentControlSet\Control\InternalDeviceModification\{GUID}
Where the value of the PLD_Panel
key should be a DWORD with values very similar to the Panel
enum referenced above.
Here, 6
means unknown
. So you should be able to check for the presence of this registry key and, if present check its value. I suspect this is similar to what UWP does under the hood.
Failing that, you can also hack in support by hardcoding some values for camera vendor and product ID's or MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME
's.