Skip to content

Commit

Permalink
Windows 10 Version 1709 - May 2018 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnewthing committed May 3, 2018
1 parent f6ad9bc commit de1bb52
Show file tree
Hide file tree
Showing 120 changed files with 6,554 additions and 461 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,35 +93,36 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
</tr>
<tr>
<td><a href="Samples/CameraResolution">Camera resolution</a></td>
<td><a href="Samples/CameraStreamCoordinateMapper">Camera stream coordinate mapper</a></td>
<td><a href="Samples/CameraStreamCorrelation">Camera stream correlation</a></td>
<td><a href="Samples/LiveDash">DASH streaming</a></td>
</tr>
<tr>
<td><a href="Samples/LiveDash">DASH streaming</a></td>
<td><a href="Samples/D2DPhotoAdjustment">Direct2D photo adjustment</a></td>
<td><a href="Samples/MediaEditing">Media editing</a></td>
<td><a href="Samples/MediaImport">Media import</a></td>
</tr>
<tr>
<td><a href="Samples/MediaImport">Media import</a></td>
<td><a href="Samples/XamlCustomMediaTransportControls">Media transport controls</a></td>
<td><a href="Samples/MIDI">MIDI</a></td>
<td><a href="Samples/Playlists">Playlists</a></td>
</tr>
<tr>
<td><a href="Samples/Playlists">Playlists</a></td>
<td><a href="Samples/PlayReady">PlayReady</a></td>
<td><a href="Samples/CameraOpenCV">Processing frames with OpenCV</a></td>
<td><a href="Samples/SimpleImaging">Simple imaging</a></td>
</tr>
<tr>
<td><a href="Samples/SimpleImaging">Simple imaging</a></td>
<td><a href="Samples/SpatialSound">Spatial audio</a></td>
<td><a href="Samples/SystemMediaTransportControls">System media transport controls</a></td>
<td><a href="Samples/MediaTranscoding">Transcoding media</a></td>
</tr>
<tr>
<td><a href="Samples/MediaTranscoding">Transcoding media</a></td>
<td><a href="Samples/VideoPlayback">Video playback</a></td>
<td><a href="Samples/VideoPlaybackSynchronization">Video playback synchronization</a></td>
<td><a href="Samples/CameraVideoStabilization">Video stabilization</a></td>
</tr>
<tr>
<td><a href="Samples/CameraVideoStabilization">Video stabilization</a></td>
<td><a href="Samples/WindowsAudioSession">Windows audio session (WASAPI)</a></td>
</tr>
</table>
Expand Down Expand Up @@ -284,6 +285,7 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
<tr>
<td><a href="Samples/ShareSource">Sharing content source app</a></td>
<td><a href="Samples/ShareTarget">Sharing content target app</a></td>
<td><a href="Samples/UserActivity">User activities</a></td>
</tr>
</table>

Expand Down
19 changes: 0 additions & 19 deletions Samples/360VideoPlayback/cpp/Common/DeviceResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,25 +361,6 @@ void DX::DeviceResources::Present(HolographicFrame^ frame)
// holographic frame predictions.
HolographicFramePresentResult presentResult = frame->PresentUsingCurrentPrediction();

HolographicFramePrediction^ prediction = frame->CurrentPrediction;
UseHolographicCameraResources<void>([this, prediction](std::map<UINT32, std::unique_ptr<CameraResources>>& cameraResourceMap)
{
for (auto cameraPose : prediction->CameraPoses)
{
// This represents the device-based resources for a HolographicCamera.
DX::CameraResources* pCameraResources = cameraResourceMap[cameraPose->HolographicCamera->Id].get();

// Discard the contents of the render target.
// This is a valid operation only when the existing contents will be
// entirely overwritten. If dirty or scroll rects are used, this call
// should be removed.
m_d3dContext->DiscardView(pCameraResources->GetBackBufferRenderTargetView());

// Discard the contents of the depth stencil.
m_d3dContext->DiscardView(pCameraResources->GetDepthStencilView());
}
});

// The PresentUsingCurrentPrediction API will detect when the graphics device
// changes or becomes invalid. When this happens, it is considered a Direct3D
// device lost scenario.
Expand Down
19 changes: 0 additions & 19 deletions Samples/360VideoPlayback/cs/Common/DeviceResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -363,25 +363,6 @@ public void Present(ref HolographicFrame frame)
HolographicFramePresentWaitBehavior.WaitForFrameToFinish
);

HolographicFramePrediction prediction = frame.CurrentPrediction;
UseHolographicCameraResources((Dictionary<uint, CameraResources> cameraResourcesDictionary) =>
{
foreach (var cameraPose in prediction.CameraPoses)
{
// This represents the device-based resources for a HolographicCamera.
CameraResources cameraResources = cameraResourcesDictionary[cameraPose.HolographicCamera.Id];

// Discard the contents of the render target.
// This is a valid operation only when the existing contents will be
// entirely overwritten. If dirty or scroll rects are used, this call
// should be removed.
d3dContext.DiscardView(cameraResources.BackBufferRenderTargetView);

// Discard the contents of the depth stencil.
d3dContext.DiscardView(cameraResources.DepthStencilView);
}
});

// The PresentUsingCurrentPrediction API will detect when the graphics device
// changes or becomes invalid. When this happens, it is considered a Direct3D
// device lost scenario.
Expand Down
3 changes: 2 additions & 1 deletion Samples/360VideoPlayback/cs/ms.fxcompile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@
</ItemGroup>

<PropertyGroup>
<FXCPath>$(MSBuildProgramFiles32)\Windows Kits\10\bin\x86</FXCPath>
<FXCPath Condition="Exists('$(MSBuildProgramFiles32)\Windows Kits\10\bin\$(TargetPlatformVersion)\x86\fxc.exe')">$(MSBuildProgramFiles32)\Windows Kits\10\bin\$(TargetPlatformVersion)\x86</FXCPath>
<FXCPath Condition="'$(FXCPath)' == ''">$(MSBuildProgramFiles32)\Windows Kits\10\bin\x86</FXCPath>
</PropertyGroup>

<Message Text="Using 'fxc.exe' from '$(FXCPath)'." />
Expand Down
5 changes: 3 additions & 2 deletions Samples/Advertising/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ Specifically, this sample shows how to:

## Prerequisites

This sample requires the [Microsoft Advertising SDK Libraries for XAML or JavaScript](http://go.microsoft.com/fwlink/?LinkID=619694).
[Download it here](http://go.microsoft.com/fwlink/p/?LinkId=518026).
This sample requires the [Microsoft Advertising SDK Libraries for XAML or JavaScript](http://go.microsoft.com/fwlink/?LinkID=619694),
which is obtained via NuGet package,
or you can [download it here](http://go.microsoft.com/fwlink/p/?LinkId=518026).
It also requires the [internet client capability](https://msdn.microsoft.com/library/windows/apps/mt270968#general-use_capabilities) to be added to the manifest.

When you incorporate this sample into your own app,
Expand Down
10 changes: 10 additions & 0 deletions Samples/Advertising/cpp/Advertising.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,17 @@
<ItemGroup>
<SDKReference Include="Microsoft.Advertising.Xaml, Version=10.0" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="packages\Microsoft.Advertising.XAML.10.1705.16001\build\Microsoft.Advertising.XAML.targets" Condition="Exists('packages\Microsoft.Advertising.XAML.10.1705.16001\build\Microsoft.Advertising.XAML.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\Microsoft.Advertising.XAML.10.1705.16001\build\Microsoft.Advertising.XAML.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Advertising.XAML.10.1705.16001\build\Microsoft.Advertising.XAML.targets'))" />
</Target>
</Project>
3 changes: 3 additions & 0 deletions Samples/Advertising/cpp/Advertising.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,7 @@
<Filter>Assets</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions Samples/Advertising/cpp/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Advertising.XAML" version="10.1705.16001" targetFramework="native" />
</packages>
3 changes: 2 additions & 1 deletion Samples/Advertising/cs/project.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"dependencies": {
"Microsoft.Advertising.XAML": "10.1705.16001",
"Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
},
"frameworks": {
"uap10.0": {}
"uap10.0.16299": {}
},
"runtimes": {
"win10-arm": {},
Expand Down
16 changes: 8 additions & 8 deletions Samples/Advertising/js/Advertising.jsproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
Expand All @@ -17,10 +13,6 @@
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
Expand Down Expand Up @@ -127,12 +119,20 @@
<Content Include="..\..\..\SharedContent\js\sample-utils\scenario-select.html">
<Link>sample-utils\scenario-select.html</Link>
</Content>
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<SDKReference Include="Microsoft.Advertising.JavaScript, Version=10.0" />
<SDKReference Include="Microsoft.VCLibs, Version=14.0" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
<Import Project="packages\Microsoft.Advertising.JS.10.1705.16001\build\Microsoft.Advertising.JS.targets" Condition="Exists('packages\Microsoft.Advertising.JS.10.1705.16001\build\Microsoft.Advertising.JS.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\Microsoft.Advertising.JS.10.1705.16001\build\Microsoft.Advertising.JS.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Advertising.JS.10.1705.16001\build\Microsoft.Advertising.JS.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below then uncomment
that target and the DisableFastUpToDateCheck PropertyGroup.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
11 changes: 3 additions & 8 deletions Samples/Advertising/js/Advertising.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@ Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "Advertising", "Advertising.
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Debug|ARM.ActiveCfg = Debug|ARM
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Debug|ARM.Build.0 = Debug|ARM
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Debug|ARM.Deploy.0 = Debug|ARM
Expand All @@ -29,9 +24,6 @@ Global
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Debug|x86.ActiveCfg = Debug|x86
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Debug|x86.Build.0 = Debug|x86
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Debug|x86.Deploy.0 = Debug|x86
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Release|Any CPU.Build.0 = Release|Any CPU
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Release|Any CPU.Deploy.0 = Release|Any CPU
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Release|ARM.ActiveCfg = Release|ARM
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Release|ARM.Build.0 = Release|ARM
{8DDA8DD7-9CB3-51AE-8B7C-0B871449EB8D}.Release|ARM.Deploy.0 = Release|ARM
Expand All @@ -45,4 +37,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D2744A49-435A-4262-9369-233CAC016A5C}
EndGlobalSection
EndGlobal
4 changes: 4 additions & 0 deletions Samples/Advertising/js/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Advertising.JS" version="10.1705.16001" targetFramework="uap10.0.16299" />
</packages>
2 changes: 1 addition & 1 deletion Samples/BackgroundActivation/cs/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
Square44x44Logo="Assets\SmallTile-sdk.png"
Description="Background Activation C# Sample"
BackgroundColor="#00b2f0">
<uap:LockScreen Notification="badgeAndTileText" BadgeLogo="Assets\smalltile-Windows-sdk.png" />
<uap:LockScreen Notification="badgeAndTileText" BadgeLogo="Assets\smalltile-sdk.png" />
<uap:SplashScreen Image="Assets\Splash-sdk.png" />
<uap:DefaultTile Wide310x150Logo="Assets\tile-sdk.png" >
<uap:ShowNameOnTiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
Square44x44Logo="Assets\SmallTile-sdk.png"
Description="Background Tasks C# Sample"
BackgroundColor="#00b2f0">
<uap:LockScreen Notification="badgeAndTileText" BadgeLogo="Assets\smalltile-Windows-sdk.png" />
<uap:LockScreen Notification="badgeAndTileText" BadgeLogo="Assets\smalltile-sdk.png" />
<uap:SplashScreen Image="Assets\Splash-sdk.png" />
<uap:DefaultTile Wide310x150Logo="Assets\tile-sdk.png" >
<uap:ShowNameOnTiles>
Expand Down
2 changes: 1 addition & 1 deletion Samples/BluetoothRfcommChat/cs/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</Extensions>
<uap:VisualElements
DisplayName="Bluetooth Rfcomm Chat C# Sample"
Square150x150Logo="Assets\StoreLogo-sdk.png"
Square150x150Logo="Assets\SquareTile-sdk.png"
Square44x44Logo="Assets\SmallTile-sdk.png"
Description="Bluetooth Rfcomm Chat C# Sample"
BackgroundColor="#00b2f0">
Expand Down
2 changes: 1 addition & 1 deletion Samples/CameraGetPreviewFrame/cpp/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Properties>
<DisplayName>CameraGetPreviewFrame</DisplayName>
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
<Logo>Assets\StoreLogo-sdk.png</Logo>
</Properties>

<Dependencies>
Expand Down
2 changes: 1 addition & 1 deletion Samples/CameraGetPreviewFrame/cs/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Properties>
<DisplayName>CameraGetPreviewFrame</DisplayName>
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
<Logo>Assets\StoreLogo-sdk.png</Logo>
</Properties>

<Dependencies>
Expand Down
71 changes: 71 additions & 0 deletions Samples/CameraStreamCoordinateMapper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!---
category: AudioVideoAndCamera
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=870775
--->

# Camera stream coordinate mapper sample

Shows how to use spatially correlated color and depth cameras and the depth frames to map image pixels from one camera to another using [CameraIntrinsics](https://docs.microsoft.com/uwp/api/windows.media.devices.core.cameraintrinsics) and [SpatialCoordinateSystem](https://docs.microsoft.com/uwp/api/windows.perception.spatial.spatialcoordinatesystem) using DirectX and shaders for real time applications.

> **Note:** This sample is part of a large collection of UWP feature samples.
> If you are unfamiliar with Git and GitHub, you can download the entire collection as a
> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/master.zip), but be
> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file,
> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq).
> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center.
This sample demonstrates how to:

- Find cameras which support color and depth formats.
- Create MediaFrameReaders to read frames from multiple sources concurrently.
- Map depth camera's pixels onto a correlated color camera using DirectX shaders.

### Correlation of multiple capture sources

This sample is intended to demonstrate how to map entire images from one camera to another using depth information from the depth camera, [CameraIntrinsics](https://docs.microsoft.com/uwp/api/windows.media.devices.core.cameraintrinsics), and [SpatialCoordinateSystem](https://docs.microsoft.com/uwp/api/windows.perception.spatial.spatialcoordinatesystem). This is similar to the functionality of the [DepthCorrelatedCoordinateMapper](https://docs.microsoft.com/uwp/api/windows.media.devices.core.depthcorrelatedcoordinatemapper) except this sample is designed for processing an entire image using DirectX and shaders. The [DepthCorrelatedCoordinateMapper](https://docs.microsoft.com/uwp/api/windows.media.devices.core.depthcorrelatedcoordinatemapper) has a member function "MapPoints" which will map an array of pixels from one camera to another using the depth data for correlation, but was not performant on lower-end hardware for a full image of pixels. The performance of the Gpu algorithm in this sample, running on an Xbox One running as a UWP app is < 2ms per frame. Using a desktop PC with a GTX 1060 resulted in < 0.25ms per frame.

There are multiple ways to interpret the result of the image mapping. This sample demonstrates how to visualize the resulting data as a 3D point cloud from different perspectives. This sample also demonstrates how to project the correlated 3D data back onto one of the cameras to correlate the results in 2D (i.e. use the depth data to discard pixels that are too far away from the camera).

**Note** The Windows universal samples for Windows 10 require Visual Studio 2017 Update 2 and Windows SDK version 15063 or above to build.

To obtain information about Windows 10 development, go to the [Windows Dev Center](https://dev.windows.com).

## See also

### Samples

* [CameraFrames](/Samples/CameraFrames)
* [CameraStreamCorrelation](/Samples/CameraStreamCorrelation)

### Reference

* [Windows.Media.Capture.Frames namespace](https://docs.microsoft.com/uwp/api/windows.media.capture.frames)
* [Windows.Media.Devices.Core.CameraIntrinsics](https://docs.microsoft.com/uwp/api/windows.media.devices.core.cameraintrinsics)
* [Windows.Perception.Spatial.SpatialCoordinateSystem](https://docs.microsoft.com/uwp/api/windows.perception.spatial.spatialcoordinatesystem)

## System requirements

**Client:** Windows 10 build 15063

**Camera:** Correlated color and depth camera (e.g. Kinect V2 sensor)

## Build the sample

1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with
the sample you want to build.
2. Start Microsoft Visual Studio 2017 and select **File** \> **Open** \> **Project/Solution**.
3. Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the
subfolder for this specific sample, then the subfolder for your preferred language (C++, C#, or
JavaScript). Double-click the Visual Studio Solution (.sln) file.
4. Press Ctrl+Shift+B, or select **Build** \> **Build Solution**.

## Run the sample

The next steps depend on whether you just want to deploy the sample or you want to both deploy and
run it.

### Deploying and running the sample

- To debug the sample and then run it, follow the steps listed above to connect your
developer-unlocked Microsoft HoloLens, then press F5 or select **Debug** \> **Start Debugging**.
To run the sample without debugging, press Ctrl+F5 or select **Debug** \> **Start Without Debugging**.
Loading

0 comments on commit de1bb52

Please sign in to comment.