CONTEXT: I would like to know when any other app grabs hold of the RGB camera stream, so I can stop streaming the IR stream of an RGB-IR device (IR LEDs cause an undesirable effect on the RGB stream).
The best way I could think was to monitor ExclusiveControl being grabbed on the RGB stream. This works with newer apps (e.g. Camera app), which presumably use the Windows.Media.Capture API. However, for legacy apps (e.g. AmCap, YouCam), this event only gets triggered when the app lets go of the stream (i.e. NOT when starting up). I assume these apps are using the UVC API to access it, hence the difference.
Can you confirm whether this is a bug or not, and when it might be resolved? If you have an alternative suggestion on how to monitor the RGB stream, please let me know!
In order to work past the fact that CaptureDeviceExclusiveControlStatusChanged() does not trigger on camera startup for legacy apps, I tried hooking into FormatChanged. This appears to work, but will only trigger if I have a MediaFrameReader instance streaming. Is this necessary? I feel I should be able to hook in and receive notifications without having to turn the camera on.
FYI: I have also filed this on the Feedback Hub, here: https://aka.ms/AA7iqpf
However, I did not get feedback previously when I have filed there.