Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Webcam usage status

Hi,

I'm building an application for Hololenses which tracks some 3D objects in real world. I use Unity and MR Toolkit. Tracking library ofc use webcam to get frames and do magic to recognize object.
From the other side whole session with my application is streamed using mixed reality capture (live preview) to another web based application running on PC (It uses the same API as Device Portal).
I have to switch off mixed reality capture live preview each time before I run 3D Objects tracker. It is done through websocket connection. I just send message to PC application to stop live preview. PC application responds me with message as soon as it call API to stop live preview.
Unfortunately it doesn't mean that webcam resource is already free to use so when I start Tracker it fails.
Question is: Is there any possibility, API or something in Unity or MR Toolkit to get information if webcam is used or not?

I tried already without any success:
* Turn on photo or video mode to check if it is possible. (UnityEngine.XR.WSA.WebCam)
* Use MediaCapture.StartPreviewAsync() to catch System.IO.FileLoadException when camera
is in use in another process

I also can not edit Tracking library as it is 3rd party software and it doesn't throw any exception, just crash when can't get camera.

Sign In or Register to comment.