SensorStreamViewer,HoloLensForCV:“未能初始化媒体捕获:访问被拒绝。”

时间:2018-07-04 03:08:10

标签: augmented-reality hololens windows-mixed-reality

我试图从HoloLens获取传感器流,所以我使用了HoloLensForCV。 (https://github.com/Microsoft/HoloLensForCV

首先,我检查了SensorStreamViewer项目是否有效,但是几天后,我更新了HoloLens,然后它不起作用了。我收到的错误是Access is Denied

HoloLens Camera view capture

HoloLens Privacy Camera capture

The Webcam capability in VS capture

而且,我猜这部分(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 ++异常:内存位置0x0180E680上的Platform :: AccessDeniedException ^。 HRESULT:0x80070005访问被拒绝。   WinRT信息:清单中尚未声明所需的设备功能。

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

在Package.appxmanifest文件中,您需要添加以下功能。

<rescap:Capability Name="perceptionSensorsExperimental" />