我试图从 获取传感器流HoloLens
,所以我使用了HoloLensForCV
. (https://github.com/Microsoft/HoloLensForCV)
首先,我检查了该SensorStreamViewer
项目是否有效,但几天后,我更新HoloLens
了它然后它不起作用。我收到的错误是Access is Denied
而且,我猜错误发生在这部分(SensorStreamViewer.xaml.cpp)。
// Initialize MediaCapture with the specified group.
// This must occur on the UI thread because some device families
// (such as Xbox) will prompt the user to grant consent for the
// app to access cameras.
// This can raise an exception if the source no longer exists,
// or if the source could not be initialized.
return create_task(m_mediaCapture->InitializeAsync(settings))
.then([this](task<void> initializeMediaCaptureTask)
{
try
{
// Get the result of the initialization. This call will throw if initialization failed
// This pattern is docuemnted at https://msdn.microsoft.com/en-us/library/dd997692.aspx
initializeMediaCaptureTask.get();
m_logger->Log("MediaCapture is successfully initialized in shared mode.");
return true;
}
catch (Exception^ exception)
{
m_logger->Log("Failed to initialize media capture: " + exception->Message);
return false;
}
});
当我启动“ComputeOnDevice”等其他项目时,我可以看到一个警告消息窗口,询问我是否允许访问相机。但是,当我启动“SensorStreamViewer”时,我没有看到任何询问相机访问权限的警报消息。
我开始调试,并遇到此错误消息。
在 SensorStreamViewer.exe 中的 0x772C3332 处引发异常:Microsoft C++ 异常:Platform::AccessDeniedException ^ 在内存位置 0x0180E680。HRESULT:0x80070005 访问被拒绝。WinRT 信息:所需的设备功能尚未在清单中声明。
我怎么解决这个问题?