PhotoCapture.CreateAsync() never executed

大城市里の小女人 提交于 2019-12-08 08:09:42

问题


I'm using the HoloLens and Unity and I try to take a photo.

I have the same problem as in this discussion https://forums.hololens.com/discussion/897/locatable-camera-known-issue-photocapture-createasync-doesnt-start

This code in a MonoBehaviour in Unity :

void Start() {
  Debug.LogError("CreateAsync start");
  Debug.LogError(WebCam.Mode);
  Debug.LogError(PhotoCapture.SupportedResolutions);
  foreach (Resolution resolution in PhotoCapture.SupportedResolutions) {
    Debug.LogError(resolution);
  }
  Debug.LogError("END");
  PhotoCapture.CreateAsync(false, delegate (PhotoCapture captureObject) {
    Debug.LogError("CreateAsync done");
  }
}

Print this output :

CreateAsync start
None
UnityEngine.Resolution[]
END

Here is my "Capabilities" part of the Package.appxmanifest :

<Capabilities>
    <Capability Name="internetClient" />
    <uap2:Capability Name="spatialPerception" />
    <DeviceCapability Name="webcam" />
    <DeviceCapability Name="microphone" />
</Capabilities>

Here is the "Module information" part of the log :

Module information:
Built with Compiler Ver '190023918'
Built from '5.5/release' branch
Version is '5.5.3f1 (4d2f809fd6f3)'
Release build
Application type 'D3D11'
Used 'UWP'

OS 'Windows 10 (10.0.14393)'

Do you see my problem ? Can some other script block the execution ?


回答1:


On the hololens :

Settings/Privacy/Camera/"Let apps use my camera" => ON

It's works... I wish there was an explict error message in this case.



来源:https://stackoverflow.com/questions/43519326/photocapture-createasync-never-executed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!