Merge pull request #38 from vimusc/master
HolographicRemoting version 2.6.1
This commit is contained in:
Коммит
daa5f2bd5a
|
@ -16,7 +16,7 @@ products:
|
|||
|
||||
| Holographic Remoting version |
|
||||
:-----------------: |
|
||||
|2.6.0 |
|
||||
|2.6.1 |
|
||||
|
||||
The [Holographic Remoting Samples](https://github.com/microsoft/MixedReality-HolographicRemoting-Samples) repository hosts sample applications for [Holographic Remoting](https://docs.microsoft.com/en-us/windows/mixed-reality/holographic-remoting-player). The two remote samples show how to write an application for streaming content to a Microsoft HoloLens 2 or a PC running Windows Mixed Reality.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" IgnorableNamespaces="uap mp uap2 uap5">
|
||||
<Identity Name="SampleHolographicRemotingPlayer" Publisher="CN=SampleHolographicRemotingPlayer" Version="2.6.0.0" />
|
||||
<Identity Name="SampleHolographicRemotingPlayer" Publisher="CN=SampleHolographicRemotingPlayer" Version="2.6.1.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="b65c9a46-d0b3-4954-829a-6a60bed54d0a" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>Sample Holographic AppRemoting Player</DisplayName>
|
||||
|
|
|
@ -342,6 +342,6 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
<Import Project="packages\Microsoft.Holographic.Remoting.2.6.0\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.6.0\build\native\Microsoft.Holographic.Remoting.targets')" />
|
||||
<Import Project="packages\Microsoft.Holographic.Remoting.2.6.1\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.6.1\build\native\Microsoft.Holographic.Remoting.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -424,14 +424,27 @@ void SamplePlayerMain::SetWindow(const CoreWindow& window)
|
|||
#ifdef ENABLE_CUSTOM_DATA_CHANNEL_SAMPLE
|
||||
try
|
||||
{
|
||||
m_playerContext.OnDataChannelCreated([this](const IDataChannel& dataChannel, uint8_t channelId) {
|
||||
std::lock_guard lock(m_customDataChannelLock);
|
||||
m_customDataChannel = dataChannel.as<IDataChannel2>();
|
||||
m_playerContext.OnDataChannelCreated([weakThis = get_weak()](const IDataChannel& dataChannel, uint8_t channelId) {
|
||||
if (auto strongThis = weakThis.get())
|
||||
{
|
||||
std::lock_guard lock(strongThis->m_customDataChannelLock);
|
||||
strongThis->m_customDataChannel = dataChannel.as<IDataChannel2>();
|
||||
|
||||
m_customChannelDataReceivedEventRevoker = m_customDataChannel.OnDataReceived(
|
||||
winrt::auto_revoke, [this](winrt::array_view<const uint8_t> dataView) { OnCustomDataChannelDataReceived(); });
|
||||
strongThis->m_customChannelDataReceivedEventRevoker = strongThis->m_customDataChannel.OnDataReceived(
|
||||
winrt::auto_revoke, [weakThis](winrt::array_view<const uint8_t> dataView) {
|
||||
if (auto strongThis = weakThis.get())
|
||||
{
|
||||
strongThis->OnCustomDataChannelDataReceived();
|
||||
}
|
||||
});
|
||||
|
||||
m_customChannelClosedEventRevoker = m_customDataChannel.OnClosed(winrt::auto_revoke, [this]() { OnCustomDataChannelClosed(); });
|
||||
strongThis->m_customChannelClosedEventRevoker = strongThis->m_customDataChannel.OnClosed(winrt::auto_revoke, [weakThis]() {
|
||||
if (auto strongThis = weakThis.get())
|
||||
{
|
||||
strongThis->OnCustomDataChannelClosed();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (winrt::hresult_error err)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.200729.8" targetFramework="native" />
|
||||
<package id="Microsoft.Holographic.Remoting" version="2.6.0" targetFramework="native" />
|
||||
</packages>
|
||||
<package id="Microsoft.Holographic.Remoting" version="2.6.1" targetFramework="native" />
|
||||
</packages>
|
||||
|
|
|
@ -29,12 +29,6 @@ QRCodeRenderer::QRCodeRenderer(const std::shared_ptr<DXHelper::DeviceResources>&
|
|||
{
|
||||
}
|
||||
|
||||
void QRCodeRenderer::OnAddedQRCode(const winrt::Microsoft::MixedReality::QR::QRCode& code)
|
||||
{
|
||||
std::scoped_lock lock(m_mutex);
|
||||
m_qrCodes.insert({code, nullptr});
|
||||
}
|
||||
|
||||
void QRCodeRenderer::OnUpdatedQRCode(const winrt::Microsoft::MixedReality::QR::QRCode& code)
|
||||
{
|
||||
std::scoped_lock lock(m_mutex);
|
||||
|
|
|
@ -32,8 +32,6 @@ public:
|
|||
|
||||
void Update(winrt::Windows::Perception::Spatial::SpatialCoordinateSystem renderingCoordinateSystem);
|
||||
|
||||
void OnAddedQRCode(const winrt::Microsoft::MixedReality::QR::QRCode& code);
|
||||
|
||||
void OnUpdatedQRCode(const winrt::Microsoft::MixedReality::QR::QRCode& code);
|
||||
|
||||
void Reset();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" IgnorableNamespaces="uap mp uap2">
|
||||
<Identity Name="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="2.6.0.0" />
|
||||
<Identity Name="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="2.6.1.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>SampleRemote</DisplayName>
|
||||
|
|
|
@ -332,6 +332,6 @@
|
|||
<Import Project="packages\Microsoft.MixedReality.SceneUnderstanding.0.5.2069\build\native\Microsoft.MixedReality.SceneUnderstanding.targets" Condition="Exists('packages\Microsoft.MixedReality.SceneUnderstanding.0.5.2069\build\native\Microsoft.MixedReality.SceneUnderstanding.targets') And ('$(Configuration)'=='Debug' Or '$(Configuration)'=='Release' Or '$(Configuration)'=='RelWithDebInfo')" />
|
||||
<Import Project="packages\Microsoft.MixedReality.QR.0.5.3011\build\native\Microsoft.MixedReality.QR.targets" Condition="Exists('packages\Microsoft.MixedReality.QR.0.5.3011\build\native\Microsoft.MixedReality.QR.targets') And ('$(Configuration)'=='Debug' Or '$(Configuration)'=='Release' Or '$(Configuration)'=='RelWithDebInfo')" />
|
||||
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
<Import Project="packages\Microsoft.Holographic.Remoting.2.6.0\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.6.0\build\native\Microsoft.Holographic.Remoting.targets')" />
|
||||
<Import Project="packages\Microsoft.Holographic.Remoting.2.6.1\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.6.1\build\native\Microsoft.Holographic.Remoting.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -159,7 +159,15 @@ void SampleRemoteApp::OnResize(int width, int height)
|
|||
|
||||
if (m_swapChain)
|
||||
{
|
||||
winrt::check_hresult(m_swapChain->ResizeBuffers(2, m_width, m_height, DXGI_FORMAT_B8G8R8A8_UNORM, 0));
|
||||
winrt::hresult hr = m_swapChain->ResizeBuffers(2, m_width, m_height, DXGI_FORMAT_B8G8R8A8_UNORM, 0);
|
||||
if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
|
||||
{
|
||||
m_swapChain = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
winrt::check_hresult(hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -573,16 +581,15 @@ void SampleRemoteApp::Render(HolographicFrame holographicFrame)
|
|||
// * Holographic streamer
|
||||
// * Renderer
|
||||
// * Holographic space
|
||||
// The InitializeRemoteContext() function will call the functions necessary to recreate these resources.
|
||||
// Call the InitializeRemoteContextAndConnectOrListen() function will call the functions necessary to recreate these resources.
|
||||
ShutdownRemoteContext();
|
||||
InitializeRemoteContextAndConnectOrListen();
|
||||
}
|
||||
|
||||
// Determine whether or not to copy to the preview buffer.
|
||||
bool copyPreview;
|
||||
{
|
||||
std::lock_guard remoteContextLock(m_remoteContextAccess);
|
||||
copyPreview = m_remoteContext == nullptr || m_remoteContext.ConnectionState() != ConnectionState::Connected;
|
||||
copyPreview = m_swapChain && (m_remoteContext == nullptr || m_remoteContext.ConnectionState() != ConnectionState::Connected);
|
||||
}
|
||||
if (copyPreview && m_isInitialized)
|
||||
{
|
||||
|
@ -710,16 +717,29 @@ void SampleRemoteApp::InitializeRemoteContextAndConnectOrListen()
|
|||
});
|
||||
|
||||
#ifdef ENABLE_CUSTOM_DATA_CHANNEL_SAMPLE
|
||||
m_onDataChannelCreatedEventRevoker =
|
||||
m_remoteContext.OnDataChannelCreated(winrt::auto_revoke, [this](const IDataChannel& dataChannel, uint8_t channelId) {
|
||||
std::lock_guard lock(m_customDataChannelLock);
|
||||
m_customDataChannel = dataChannel.as<IDataChannel2>();
|
||||
m_onDataChannelCreatedEventRevoker = m_remoteContext.OnDataChannelCreated(
|
||||
winrt::auto_revoke, [weakThis = weak_from_this()](const IDataChannel& dataChannel, uint8_t channelId) {
|
||||
if (auto strongThis = weakThis.lock())
|
||||
{
|
||||
std::lock_guard lock(strongThis->m_customDataChannelLock);
|
||||
strongThis->m_customDataChannel = dataChannel.as<IDataChannel2>();
|
||||
|
||||
m_customChannelDataReceivedEventRevoker = m_customDataChannel.OnDataReceived(
|
||||
winrt::auto_revoke, [this](winrt::array_view<const uint8_t> dataView) { OnCustomDataChannelDataReceived(dataView); });
|
||||
strongThis->m_customChannelDataReceivedEventRevoker = strongThis->m_customDataChannel.OnDataReceived(
|
||||
winrt::auto_revoke, [weakThis](winrt::array_view<const uint8_t> dataView) {
|
||||
if (auto strongThis = weakThis.lock())
|
||||
{
|
||||
strongThis->OnCustomDataChannelDataReceived(dataView);
|
||||
}
|
||||
});
|
||||
|
||||
m_customChannelClosedEventRevoker =
|
||||
m_customDataChannel.OnClosed(winrt::auto_revoke, [this]() { OnCustomDataChannelClosed(); });
|
||||
strongThis->m_customChannelClosedEventRevoker =
|
||||
strongThis->m_customDataChannel.OnClosed(winrt::auto_revoke, [weakThis]() {
|
||||
if (auto strongThis = weakThis.lock())
|
||||
{
|
||||
strongThis->OnCustomDataChannelClosed();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
#endif
|
||||
|
||||
|
@ -866,23 +886,26 @@ void SampleRemoteApp::SavePosition()
|
|||
|
||||
auto position = SpatialAnchor::TryCreateRelativeTo(m_referenceFrame.CoordinateSystem(), m_spinningCubeRenderer->GetPosition());
|
||||
|
||||
auto storeRequest = SpatialAnchorManager::RequestStoreAsync();
|
||||
storeRequest.Completed([position](winrt::Windows::Foundation::IAsyncOperation<SpatialAnchorStore> result, auto asyncStatus) {
|
||||
if (result.Status() != winrt::Windows::Foundation::AsyncStatus::Completed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const SpatialAnchorStore& store = result.GetResults();
|
||||
if (store)
|
||||
{
|
||||
store.Clear();
|
||||
if (store.TrySave(L"position", position))
|
||||
if (position)
|
||||
{
|
||||
auto storeRequest = SpatialAnchorManager::RequestStoreAsync();
|
||||
storeRequest.Completed([position](winrt::Windows::Foundation::IAsyncOperation<SpatialAnchorStore> result, auto asyncStatus) {
|
||||
if (result.Status() != winrt::Windows::Foundation::AsyncStatus::Completed)
|
||||
{
|
||||
OutputDebugStringW(L"Saved cube position to SpatialAnchorStore.\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const SpatialAnchorStore& store = result.GetResults();
|
||||
if (store)
|
||||
{
|
||||
store.Clear();
|
||||
if (store.TrySave(L"position", position))
|
||||
{
|
||||
OutputDebugStringW(L"Saved cube position to SpatialAnchorStore.\n");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
winrt::fire_and_forget SampleRemoteApp::ExportPosition()
|
||||
|
@ -1087,17 +1110,6 @@ winrt::fire_and_forget SampleRemoteApp::RequestQRCodeWatcherUpdates()
|
|||
|
||||
m_qrWatcher = QRCodeWatcher();
|
||||
|
||||
m_qrAddedRevoker = m_qrWatcher.Added(
|
||||
winrt::auto_revoke,
|
||||
[&, weakThis = weak_from_this()](
|
||||
const winrt::Microsoft::MixedReality::QR::QRCodeWatcher&,
|
||||
const winrt::Microsoft::MixedReality::QR::QRCodeAddedEventArgs& args) {
|
||||
if (auto strongThis = weakThis.lock())
|
||||
{
|
||||
m_qrCodeRenderer->OnAddedQRCode(args.Code());
|
||||
}
|
||||
});
|
||||
|
||||
m_qrUpdatedRevoker = m_qrWatcher.Updated(
|
||||
winrt::auto_revoke,
|
||||
[&, weakThis = weak_from_this()](
|
||||
|
@ -1290,8 +1302,15 @@ void SampleRemoteApp::OnDisconnected(winrt::Microsoft::Holographic::AppRemoting:
|
|||
|
||||
m_hasSceneObserverAccess = false;
|
||||
|
||||
m_sceneUnderstandingRenderer->Reset();
|
||||
m_qrCodeRenderer->Reset();
|
||||
if (m_sceneUnderstandingRenderer)
|
||||
{
|
||||
m_sceneUnderstandingRenderer->Reset();
|
||||
}
|
||||
|
||||
if (m_qrCodeRenderer)
|
||||
{
|
||||
m_qrCodeRenderer->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void SampleRemoteApp::OnSendFrame(const winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface& texture)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.200729.8" targetFramework="native" />
|
||||
<package id="Microsoft.Holographic.Remoting" version="2.6.0" targetFramework="native" />
|
||||
<package id="Microsoft.Holographic.Remoting" version="2.6.1" targetFramework="native" />
|
||||
<package id="Microsoft.MixedReality.QR" version="0.5.3011" targetFramework="native" />
|
||||
<package id="Microsoft.MixedReality.SceneUnderstanding" version="0.5.2069" targetFramework="native" />
|
||||
<package id="Microsoft.VCRTForwarders.140" version="1.0.7" targetFramework="native" />
|
||||
</packages>
|
||||
</packages>
|
||||
|
|
|
@ -29,12 +29,6 @@ QRCodeRenderer::QRCodeRenderer(const std::shared_ptr<DXHelper::DeviceResources>&
|
|||
{
|
||||
}
|
||||
|
||||
void QRCodeRenderer::OnAddedQRCode(const winrt::Microsoft::MixedReality::QR::QRCode& code)
|
||||
{
|
||||
std::scoped_lock lock(m_mutex);
|
||||
m_qrCodes.insert({code, nullptr});
|
||||
}
|
||||
|
||||
void QRCodeRenderer::OnUpdatedQRCode(const winrt::Microsoft::MixedReality::QR::QRCode& code)
|
||||
{
|
||||
std::scoped_lock lock(m_mutex);
|
||||
|
|
|
@ -32,8 +32,6 @@ public:
|
|||
|
||||
void Update(winrt::Windows::Perception::Spatial::SpatialCoordinateSystem renderingCoordinateSystem);
|
||||
|
||||
void OnAddedQRCode(const winrt::Microsoft::MixedReality::QR::QRCode& code);
|
||||
|
||||
void OnUpdatedQRCode(const winrt::Microsoft::MixedReality::QR::QRCode& code);
|
||||
|
||||
void Reset();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" IgnorableNamespaces="uap mp uap2">
|
||||
<Identity Name="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="2.6.0.0" />
|
||||
<Identity Name="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="2.6.1.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>SampleRemote</DisplayName>
|
||||
|
|
|
@ -389,6 +389,6 @@
|
|||
<Import Project="packages\Microsoft.MixedReality.SceneUnderstanding.0.5.2069\build\native\Microsoft.MixedReality.SceneUnderstanding.targets" Condition="Exists('packages\Microsoft.MixedReality.SceneUnderstanding.0.5.2069\build\native\Microsoft.MixedReality.SceneUnderstanding.targets') And ('$(Configuration)'=='Debug' Or '$(Configuration)'=='Release' Or '$(Configuration)'=='RelWithDebInfo')" />
|
||||
<Import Project="packages\Microsoft.MixedReality.QR.0.5.3011\build\native\Microsoft.MixedReality.QR.targets" Condition="Exists('packages\Microsoft.MixedReality.QR.0.5.3011\build\native\Microsoft.MixedReality.QR.targets') And ('$(Configuration)'=='Debug' Or '$(Configuration)'=='Release' Or '$(Configuration)'=='RelWithDebInfo')" />
|
||||
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
<Import Project="packages\Microsoft.Holographic.Remoting.2.6.0\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.6.0\build\native\Microsoft.Holographic.Remoting.targets')" />
|
||||
<Import Project="packages\Microsoft.Holographic.Remoting.2.6.1\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.6.1\build\native\Microsoft.Holographic.Remoting.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -159,7 +159,15 @@ void SampleRemoteApp::OnResize(int width, int height)
|
|||
|
||||
if (m_swapChain)
|
||||
{
|
||||
winrt::check_hresult(m_swapChain->ResizeBuffers(2, m_width, m_height, DXGI_FORMAT_B8G8R8A8_UNORM, 0));
|
||||
winrt::hresult hr = m_swapChain->ResizeBuffers(2, m_width, m_height, DXGI_FORMAT_B8G8R8A8_UNORM, 0);
|
||||
if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
|
||||
{
|
||||
m_swapChain = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
winrt::check_hresult(hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -573,16 +581,15 @@ void SampleRemoteApp::Render(HolographicFrame holographicFrame)
|
|||
// * Holographic streamer
|
||||
// * Renderer
|
||||
// * Holographic space
|
||||
// The InitializeRemoteContext() function will call the functions necessary to recreate these resources.
|
||||
// Call the InitializeRemoteContextAndConnectOrListen() function will call the functions necessary to recreate these resources.
|
||||
ShutdownRemoteContext();
|
||||
InitializeRemoteContextAndConnectOrListen();
|
||||
}
|
||||
|
||||
// Determine whether or not to copy to the preview buffer.
|
||||
bool copyPreview;
|
||||
{
|
||||
std::lock_guard remoteContextLock(m_remoteContextAccess);
|
||||
copyPreview = m_remoteContext == nullptr || m_remoteContext.ConnectionState() != ConnectionState::Connected;
|
||||
copyPreview = m_swapChain && (m_remoteContext == nullptr || m_remoteContext.ConnectionState() != ConnectionState::Connected);
|
||||
}
|
||||
if (copyPreview && m_isInitialized)
|
||||
{
|
||||
|
@ -710,16 +717,29 @@ void SampleRemoteApp::InitializeRemoteContextAndConnectOrListen()
|
|||
});
|
||||
|
||||
#ifdef ENABLE_CUSTOM_DATA_CHANNEL_SAMPLE
|
||||
m_onDataChannelCreatedEventRevoker =
|
||||
m_remoteContext.OnDataChannelCreated(winrt::auto_revoke, [this](const IDataChannel& dataChannel, uint8_t channelId) {
|
||||
std::lock_guard lock(m_customDataChannelLock);
|
||||
m_customDataChannel = dataChannel.as<IDataChannel2>();
|
||||
m_onDataChannelCreatedEventRevoker = m_remoteContext.OnDataChannelCreated(
|
||||
winrt::auto_revoke, [weakThis = weak_from_this()](const IDataChannel& dataChannel, uint8_t channelId) {
|
||||
if (auto strongThis = weakThis.lock())
|
||||
{
|
||||
std::lock_guard lock(strongThis->m_customDataChannelLock);
|
||||
strongThis->m_customDataChannel = dataChannel.as<IDataChannel2>();
|
||||
|
||||
m_customChannelDataReceivedEventRevoker = m_customDataChannel.OnDataReceived(
|
||||
winrt::auto_revoke, [this](winrt::array_view<const uint8_t> dataView) { OnCustomDataChannelDataReceived(dataView); });
|
||||
strongThis->m_customChannelDataReceivedEventRevoker = strongThis->m_customDataChannel.OnDataReceived(
|
||||
winrt::auto_revoke, [weakThis](winrt::array_view<const uint8_t> dataView) {
|
||||
if (auto strongThis = weakThis.lock())
|
||||
{
|
||||
strongThis->OnCustomDataChannelDataReceived(dataView);
|
||||
}
|
||||
});
|
||||
|
||||
m_customChannelClosedEventRevoker =
|
||||
m_customDataChannel.OnClosed(winrt::auto_revoke, [this]() { OnCustomDataChannelClosed(); });
|
||||
strongThis->m_customChannelClosedEventRevoker =
|
||||
strongThis->m_customDataChannel.OnClosed(winrt::auto_revoke, [weakThis]() {
|
||||
if (auto strongThis = weakThis.lock())
|
||||
{
|
||||
strongThis->OnCustomDataChannelClosed();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
#endif
|
||||
|
||||
|
@ -866,23 +886,26 @@ void SampleRemoteApp::SavePosition()
|
|||
|
||||
auto position = SpatialAnchor::TryCreateRelativeTo(m_referenceFrame.CoordinateSystem(), m_spinningCubeRenderer->GetPosition());
|
||||
|
||||
auto storeRequest = SpatialAnchorManager::RequestStoreAsync();
|
||||
storeRequest.Completed([position](winrt::Windows::Foundation::IAsyncOperation<SpatialAnchorStore> result, auto asyncStatus) {
|
||||
if (result.Status() != winrt::Windows::Foundation::AsyncStatus::Completed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const SpatialAnchorStore& store = result.GetResults();
|
||||
if (store)
|
||||
{
|
||||
store.Clear();
|
||||
if (store.TrySave(L"position", position))
|
||||
if (position)
|
||||
{
|
||||
auto storeRequest = SpatialAnchorManager::RequestStoreAsync();
|
||||
storeRequest.Completed([position](winrt::Windows::Foundation::IAsyncOperation<SpatialAnchorStore> result, auto asyncStatus) {
|
||||
if (result.Status() != winrt::Windows::Foundation::AsyncStatus::Completed)
|
||||
{
|
||||
OutputDebugStringW(L"Saved cube position to SpatialAnchorStore.\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const SpatialAnchorStore& store = result.GetResults();
|
||||
if (store)
|
||||
{
|
||||
store.Clear();
|
||||
if (store.TrySave(L"position", position))
|
||||
{
|
||||
OutputDebugStringW(L"Saved cube position to SpatialAnchorStore.\n");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
winrt::fire_and_forget SampleRemoteApp::ExportPosition()
|
||||
|
@ -1087,17 +1110,6 @@ winrt::fire_and_forget SampleRemoteApp::RequestQRCodeWatcherUpdates()
|
|||
|
||||
m_qrWatcher = QRCodeWatcher();
|
||||
|
||||
m_qrAddedRevoker = m_qrWatcher.Added(
|
||||
winrt::auto_revoke,
|
||||
[&, weakThis = weak_from_this()](
|
||||
const winrt::Microsoft::MixedReality::QR::QRCodeWatcher&,
|
||||
const winrt::Microsoft::MixedReality::QR::QRCodeAddedEventArgs& args) {
|
||||
if (auto strongThis = weakThis.lock())
|
||||
{
|
||||
m_qrCodeRenderer->OnAddedQRCode(args.Code());
|
||||
}
|
||||
});
|
||||
|
||||
m_qrUpdatedRevoker = m_qrWatcher.Updated(
|
||||
winrt::auto_revoke,
|
||||
[&, weakThis = weak_from_this()](
|
||||
|
@ -1290,8 +1302,15 @@ void SampleRemoteApp::OnDisconnected(winrt::Microsoft::Holographic::AppRemoting:
|
|||
|
||||
m_hasSceneObserverAccess = false;
|
||||
|
||||
m_sceneUnderstandingRenderer->Reset();
|
||||
m_qrCodeRenderer->Reset();
|
||||
if (m_sceneUnderstandingRenderer)
|
||||
{
|
||||
m_sceneUnderstandingRenderer->Reset();
|
||||
}
|
||||
|
||||
if (m_qrCodeRenderer)
|
||||
{
|
||||
m_qrCodeRenderer->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void SampleRemoteApp::OnSendFrame(const winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DSurface& texture)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.200729.8" targetFramework="native" />
|
||||
<package id="Microsoft.Holographic.Remoting" version="2.6.0" targetFramework="native" />
|
||||
<package id="Microsoft.Holographic.Remoting" version="2.6.1" targetFramework="native" />
|
||||
<package id="Microsoft.MixedReality.QR" version="0.5.3011" targetFramework="native" />
|
||||
<package id="Microsoft.MixedReality.SceneUnderstanding" version="0.5.2069" targetFramework="native" />
|
||||
</packages>
|
||||
</packages>
|
||||
|
|
|
@ -259,6 +259,6 @@
|
|||
<Import Project="packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets" Condition="Exists('packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets')" />
|
||||
<Import Project="packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets" Condition="Exists('packages\OpenXR.Loader.1.0.10.2\build\native\OpenXR.Loader.targets')" />
|
||||
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
<Import Project="packages\Microsoft.Holographic.Remoting.OpenXr.2.6.0\build\native\Microsoft.Holographic.Remoting.OpenXr.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.OpenXr.2.6.0\build\native\Microsoft.Holographic.Remoting.OpenXr.targets')" />
|
||||
<Import Project="packages\Microsoft.Holographic.Remoting.OpenXr.2.6.1\build\native\Microsoft.Holographic.Remoting.OpenXr.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.OpenXr.2.6.1\build\native\Microsoft.Holographic.Remoting.OpenXr.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -3,5 +3,5 @@
|
|||
<package id="Microsoft.Windows.CppWinRT" version="2.0.200729.8" targetFramework="native" />
|
||||
<package id="OpenXR.Headers" version="1.0.10.2" targetFramework="native" />
|
||||
<package id="OpenXR.Loader" version="1.0.10.2" targetFramework="native" />
|
||||
<package id="Microsoft.Holographic.Remoting.OpenXr" version="2.6.0" targetFramework="native" />
|
||||
<package id="Microsoft.Holographic.Remoting.OpenXr" version="2.6.1" targetFramework="native" />
|
||||
</packages>
|
||||
|
|
|
@ -4363,7 +4363,7 @@ No such structures are defined in core OpenXR or this extension.</p>
|
|||
</dd>
|
||||
<dt class="hdlist1"><strong>Revision</strong></dt>
|
||||
<dd>
|
||||
<p>2</p>
|
||||
<p>3</p>
|
||||
</dd>
|
||||
<dt class="hdlist1"><strong>Extension and Version Dependencies</strong></dt>
|
||||
<dd>
|
||||
|
@ -4381,7 +4381,7 @@ No such structures are defined in core OpenXR or this extension.</p>
|
|||
<dl>
|
||||
<dt class="hdlist1"><strong>Last Modified Date</strong></dt>
|
||||
<dd>
|
||||
<p>2021-06-01</p>
|
||||
<p>2021-07-20</p>
|
||||
</dd>
|
||||
<dt class="hdlist1"><strong>IP Status</strong></dt>
|
||||
<dd>
|
||||
|
@ -4400,7 +4400,7 @@ Felix Reeh, Microsoft<br></p>
|
|||
<div class="sect3">
|
||||
<h4 id="_overview_6"><a class="anchor" href="#_overview_6"></a>1.2.1. Overview</h4>
|
||||
<div class="paragraph">
|
||||
<p>This holographic remoting extension allows the remote application to react to speech commands detected by the player application.</p>
|
||||
<p>This holographic remoting extension allows the remote application to react to speech commands recognized by the player application using Windows Speech Recognition API.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The <a href="#xrInitializeRemotingSpeechMSFT">xrInitializeRemotingSpeechMSFT</a> function is defined as:</p>
|
||||
|
@ -4433,7 +4433,7 @@ Felix Reeh, Microsoft<br></p>
|
|||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>To initialize a speech recognizer on the player application, the remote application <strong class="purple">can</strong> call <a href="#xrInitializeRemotingSpeechMSFT">xrInitializeRemotingSpeechMSFT</a>. This transmits speech initialization parameters, i.e. a language, a dictionary of phrases, and the contents of a grammar file, to the player application. The speech recognizer <strong class="purple">must</strong> only be initialized once per <a target="_blank" href="https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSession">XrSession</a>.</p>
|
||||
<p>To initialize a speech recognizer on the player application, the remote application <strong class="purple">can</strong> call <a href="#xrInitializeRemotingSpeechMSFT">xrInitializeRemotingSpeechMSFT</a>. This transmits speech initialization parameters, i.e. a language, a dictionary of phrases, and the contents of a grammar file, to the player application. it can also be used to reinitialize the speech recognizer with new parameters during a running <a target="_blank" href="https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSession">XrSession</a>.</p>
|
||||
</div>
|
||||
<div class="sidebarblock">
|
||||
<div class="content">
|
||||
|
@ -4493,9 +4493,6 @@ Felix Reeh, Microsoft<br></p>
|
|||
<li>
|
||||
<p><code>XR_ERROR_VALIDATION_FAILURE</code></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>XR_ERROR_REMOTING_SPEECH_ALREADY_INITIALIZED_MSFT</code></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</dd>
|
||||
|
@ -4739,10 +4736,10 @@ No such structures are defined in core OpenXR or this extension.</p>
|
|||
<p><code>packetId</code> is the is a <a href="#XrRemotingSpeechPacketIdMSFT">XrRemotingSpeechPacketIdMSFT</a> handle identifing the received recognized speech packet.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>confidence</code> is the <a href="#XrRemotingSpeechRecognitionConfidenceMSFT">XrRemotingSpeechRecognitionConfidenceMSFT</a>. it represents the confidence level: high, medium and low as returned by the Windows Speech Recognition API.</p>
|
||||
<p><code>confidence</code> is the <a href="#XrRemotingSpeechRecognitionConfidenceMSFT">XrRemotingSpeechRecognitionConfidenceMSFT</a>. it represents the confidence level: high, medium and low as returned by Windows Speech Recognition API.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>rawConfidence</code> is the confidence level of the speech recognition result on a scale from 0 to 1, as returned by the Windows Speech Recognition API.</p>
|
||||
<p><code>rawConfidence</code> is the confidence level of the speech recognition result on a scale from 0 to 1, as returned by Windows Speech Recognition API.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -4792,7 +4789,7 @@ No such structures are defined in core OpenXR or this extension.</p>
|
|||
<div class="openblock">
|
||||
<div class="content">
|
||||
<div class="paragraph">
|
||||
<p>The <a href="#XrRemotingSpeechRecognitionConfidenceMSFT">XrRemotingSpeechRecognitionConfidenceMSFT</a> is a direct mapping of the SpeechRecognitionConfidence enum returned with the speech recognition result by the Windows Speech Recognition API. It is defined as:</p>
|
||||
<p>The <a href="#XrRemotingSpeechRecognitionConfidenceMSFT">XrRemotingSpeechRecognitionConfidenceMSFT</a> is a direct mapping of the SpeechRecognitionConfidence enum returned with the speech recognition result by Windows Speech Recognition API. It is defined as:</p>
|
||||
</div>
|
||||
<div id="XrRemotingSpeechRecognitionConfidenceMSFT" class="paragraph">
|
||||
<p></p>
|
||||
|
@ -4831,7 +4828,7 @@ No such structures are defined in core OpenXR or this extension.</p>
|
|||
<p><strong>Retrieve recognized speech text</strong></p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>When the remote application is notified about a recognized text, it <strong class="purple">can</strong> query the recognized speech text by calling <a href="#xrRetrieveRemotingSpeechRecognizedTextMSFT">xrRetrieveRemotingSpeechRecognizedTextMSFT</a>.</p>
|
||||
<p>When the remote application is notified about a recognized speech, it <strong class="purple">can</strong> query the recognized speech text by calling <a href="#xrRetrieveRemotingSpeechRecognizedTextMSFT">xrRetrieveRemotingSpeechRecognizedTextMSFT</a>.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The <a href="#xrRetrieveRemotingSpeechRecognizedTextMSFT">xrRetrieveRemotingSpeechRecognizedTextMSFT</a> function is defined as:</p>
|
||||
|
@ -4985,9 +4982,6 @@ No such structures are defined in core OpenXR or this extension.</p>
|
|||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>XR_ERROR_REMOTING_SPEECH_ALREADY_INITIALIZED_MSFT</code></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>XR_ERROR_REMOTING_SPEECH_PACKET_EXPIRED_MSFT</code></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -5067,7 +5061,17 @@ No such structures are defined in core OpenXR or this extension.</p>
|
|||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p>Added <a href="#xrInitializeRemotingSpeechMSFT">xrInitializeRemotingSpeechMSFT</a> and <code>XR_ERROR_REMOTING_SPEECH_ALREADY_INITIALIZED_MSFT</code></p>
|
||||
<p>Added <a href="#xrInitializeRemotingSpeechMSFT">xrInitializeRemotingSpeechMSFT</a> and XR_ERROR_REMOTING_SPEECH_ALREADY_INITIALIZED_MSFT</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<p>Revision 3, 2021-07-20 (Felix Reeh, Hanaa Elghobashi)</p>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p>Updated <a href="#xrInitializeRemotingSpeechMSFT">xrInitializeRemotingSpeechMSFT</a> and removed XR_ERROR_REMOTING_SPEECH_ALREADY_INITIALIZED_MSFT</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -5075,7 +5079,6 @@ No such structures are defined in core OpenXR or this extension.</p>
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="XR_MSFT_remoting_frame_mirroring"><a class="anchor" href="#XR_MSFT_remoting_frame_mirroring"></a>1.3. XR_MSFT_remoting_frame_mirroring</h3>
|
||||
<div class="dlist">
|
||||
|
|
Загрузка…
Ссылка в новой задаче