Setting manual focus on UWP device camera
Hi
I am currently trying to manually set the focus of the camera of a UWP device (in this case the HoloLens2) prior to capturing a photo with Unity PhotoCapture.TakePhotoAsync()
.
I am accessing the VideoDeviceController
by getting the pointer with PhotoCapture.GetUnsafePointerToVideoDeviceController()
and wrapping it with the VideoDeviceControllerWrapperUWP
found in the MRLightningTools (https://github.com/microsoft/MRLightingTools-Unity/blob/master/Assets/MixedRealityToolkit.LightingTools/CameraCapture/Util/VideoDeviceControllerWrapperUWP.cs). I could verify that the VideoDeviceController
calls work by setting the exposure and reading it back.
However, to manually set the focus, the VideoDeviceController.FocusControl
seems to expect a preview stream running (`FocusControl.LockAsync` throws an exception, SetValueAsync
changes FocusMode
to manual & FocusState
to Searching but does not compute further and blocks the device camera). Starting the preview stream is done on the MediaCapture
class, which is the parent of the VideoDeviceController
. Unfortunately, I can't seem to find a way to get a reference to the MediaCapture
in order to start the preview stream.
So, the broader question would be, how can I set a manual focus an the HoloLens2?
Or more specifically, how can I start a preview stream on a camera of a UWP device in order to manually set the focus?
Your answer
Follow this Question
Related Questions
Camera pass through with steamVR 0 Answers
No PostProcessing in Vuforia AR 0 Answers
AR camera clipping plane 0 Answers
Camera collision behaviour in AR 0 Answers
cloud anchor prefab!! 0 Answers