Skip to content

Commit

Permalink
Windows 10 Anniversary Update - August 2016 Update 5
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnewthing committed Aug 25, 2016
2 parents 4ea76f7 + 8db2931 commit 52e1e0b
Show file tree
Hide file tree
Showing 32 changed files with 2,838 additions and 48 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,32 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
<td><a href="Samples/CameraResolution">Camera resolution</a></td>
</tr>
<tr>
<td><a href="Samples/CameraStreamCorrelation">Camera stream correlation</a></td>
<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>
</tr>
<tr>
<td><a href="Samples/MediaEditing">Media editing</a></td>
<td><a href="Samples/MediaImport">Media import</a></td>
<td><a href="Samples/XamlCustomMediaTransportControls">Media transport controls</a></td>
</tr>
<tr>
<td><a href="Samples/MIDI">MIDI</a></td>
<td><a href="Samples/Playlists">Playlists</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>
<td><a href="Samples/MediaImport">Windows media import</a></td>
</tr>
</table>

Expand Down
18 changes: 16 additions & 2 deletions Samples/AllJoyn/ConsumerExperiences/cs/Scenario2ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Input;
using Windows.Devices.AllJoyn;
using Windows.Devices.WiFi;
using Windows.Networking.Connectivity;
using Windows.Security.Credentials;
using Windows.Security.Cryptography;
using Windows.UI.Core;
using Windows.UI.Xaml;

Expand Down Expand Up @@ -884,7 +884,7 @@ private async void AttemptOnboardingAsync(string ssid, string password, short au
{
UpdateStatusAsync("Attempting to configure onboardee...", NotifyType.StatusMessage);

OnboardingConfigureWiFiResult configureWifiResult = await m_consumer.ConfigureWiFiAsync(ssid, password, authType);
OnboardingConfigureWiFiResult configureWifiResult = await m_consumer.ConfigureWiFiAsync(ssid, ConvertUtf8ToHex(password), authType);
if (configureWifiResult.Status == AllJoynStatus.Ok)
{
UpdateStatusAsync("Onboardee sucessfully configured.", NotifyType.StatusMessage);
Expand All @@ -908,6 +908,20 @@ private async void AttemptOnboardingAsync(string ssid, string password, short au
ClearPasswords();
}

private static string ConvertUtf8ToHex(string inputString)
{
if (string.IsNullOrEmpty(inputString))
{
return string.Empty;
}
else
{
var tempBuffer = CryptographicBuffer.ConvertStringToBinary(inputString, BinaryStringEncoding.Utf8);
var hexString = CryptographicBuffer.EncodeToHexString(tempBuffer);
return hexString;
}
}

private async void AttemptConnectionAsync()
{
OnboardingConnectResult connectResult = await m_consumer.ConnectAsync();
Expand Down
11 changes: 2 additions & 9 deletions Samples/AllJoyn/ConsumerExperiences/js/js/scenario2.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,15 +440,8 @@
}

function convertUtf8ToHex(str) {
var result = "";
var hex;

for (var i = 0; i < str.length; i++) {
hex = str.charCodeAt(i).toString(16);
result += hex;
}

return result;
var tempBuffer = Windows.Security.Cryptography.CryptographicBuffer.convertStringToBinary(str, Windows.Security.Cryptography.BinaryStringEncoding.Utf8);
return Windows.Security.Cryptography.CryptographicBuffer.encodeToHexString(tempBuffer);
}

function disposeConsumer() {
Expand Down
18 changes: 16 additions & 2 deletions Samples/AllJoyn/ProducerExperiences/cs/Scenario2ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Windows.Devices.AllJoyn;
using Windows.Security.Cryptography;
using Windows.UI.Core;
using Windows.UI.Xaml;

Expand Down Expand Up @@ -309,7 +309,7 @@ private async void OnboardingService_ConnectRequestRecieved(object sender, Event
}
else
{
if (AppData.OnboardingConfigurePassphrase.Equals(AppData.SampleNetworkPassword, StringComparison.OrdinalIgnoreCase))
if (AppData.OnboardingConfigurePassphrase.Equals(ConvertUtf8ToHex(AppData.SampleNetworkPassword), StringComparison.OrdinalIgnoreCase))
{
returnArg.Value1 = (short)ConnectionResultCode.Validated;
returnArg.Value2 = "Connected successfully";
Expand Down Expand Up @@ -352,6 +352,20 @@ private async void OnboardingService_ConnectRequestRecieved(object sender, Event
}
}

static private string ConvertUtf8ToHex(string inputString)
{
if (string.IsNullOrEmpty(inputString))
{
return string.Empty;
}
else
{
var tempBuffer = CryptographicBuffer.ConvertStringToBinary(inputString, BinaryStringEncoding.Utf8);
var hexString = CryptographicBuffer.EncodeToHexString(tempBuffer);
return hexString;
}
}

private async void UpdateStatusAsync(string status, NotifyType statusType)
{
await m_dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
Expand Down
11 changes: 2 additions & 9 deletions Samples/AllJoyn/ProducerExperiences/js/js/scenario2.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,8 @@
}

function convertUtf8ToHex(str) {
var result = "";
var hex;

for (var i = 0; i < str.length; i++) {
hex = str.charCodeAt(i).toString(16);
result += hex;
}

return result;
var tempBuffer = Windows.Security.Cryptography.CryptographicBuffer.convertStringToBinary(str, Windows.Security.Cryptography.BinaryStringEncoding.Utf8);
return Windows.Security.Cryptography.CryptographicBuffer.encodeToHexString(tempBuffer);
}

function reportStatus(message) {
Expand Down
88 changes: 88 additions & 0 deletions Samples/CameraStreamCorrelation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!---
category: AudioVideoAndCamera
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=825745
--->

# Camera stream correlation sample

This 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 a [DepthCorrelatedCoordinateMapper]
(https://msdn.microsoft.com/library/windows/apps/windows.media.devices.core.depthcorrelatedcoordinatemapper.aspx),
as well as decoding a vendor-specific media frame layout with a [BufferMediaFrame]
(https://msdn.microsoft.com/library/windows/apps/Windows.Media.Capture.Frames.BufferMediaFrame.aspx).

This sample demonstrates how to:

- Find cameras which support color, depth and pose tracking respectively.
- Create FrameReaders and read frames from multiple sources concurrently.
- Map depth camera's pixels onto correlated color camera.
- Process color and depth frames pixel by pixel to produce a background removal effect.
- Detect if a vendor-specific camera source exist using a vendor-specific sub type. In this sample, we look for a pose tracking stream.
- How to use vendor-specific buffer layout to decode a 1D BufferMediaFrame.
- Overlay skeletal tracking points to color camera coodinate system.

### Correlation of multiple capture sources

Use the DepthCorrelatedCoordinateMapper class to map depth space pixels to color
space pixels.

Use the camera intrinsics of the color camera to project skeletal
tracking points on top of the color image.

### 1D camera frame with BufferMediaFrame

With new BufferMediaFrame in media capture APIs, cameras can also support 1D media frame format.
Using the "Perception" major media type and a vendor's custom sub media type, a camera
in this sample can expose a PoseTrackingFrame and the app can overlay skeletal tracking points.

###Vendor specific media frame format

This sample also demonstrate how camera vendors can use a WinRT library to wrap vendor-specific
camera frame layout into WinRT class so that apps can easily consume the vendor specific data
with same coding patterns as Windows APIs.

**Note** The Windows universal samples for Windows 10 require Visual Studio 2015 Update 2
and Windows SDK version 14393 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)

### Reference

[Windows.Media.Capture.Frames namespace](https://msdn.microsoft.com/library/windows/apps/windows.media.capture.frames.aspx)

[Windows.Media.Devices.Core.DepthCorrelatedCoordinateMapper](https://msdn.microsoft.com/library/windows/apps/windows.media.devices.core.depthcorrelatedcoordinatemapper.aspx)

[Windows.Media.Devices.Core.CameraIntrinsics](https://msdn.microsoft.com/library/windows/apps/windows.media.devices.core.cameraintrinsics.aspx)

## System requirements

**Client:** Windows 10 build 14393

**Camera:** Correlated color and depth camera (For example a 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 2015 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 2015 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**.
54 changes: 54 additions & 0 deletions Samples/CameraStreamCorrelation/cpp/CameraStreamCorrelation.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CameraStreamCorrelation", "CameraStreamCorrelation.vcxproj", "{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PoseTrackingPreview", "PoseTrackingPreview\PoseTrackingPreview.vcxproj", "{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Debug|ARM.ActiveCfg = Debug|ARM
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Debug|ARM.Build.0 = Debug|ARM
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Debug|ARM.Deploy.0 = Debug|ARM
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Debug|x64.ActiveCfg = Debug|x64
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Debug|x64.Build.0 = Debug|x64
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Debug|x64.Deploy.0 = Debug|x64
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Debug|x86.ActiveCfg = Debug|Win32
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Debug|x86.Build.0 = Debug|Win32
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Debug|x86.Deploy.0 = Debug|Win32
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Release|ARM.ActiveCfg = Release|ARM
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Release|ARM.Build.0 = Release|ARM
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Release|ARM.Deploy.0 = Release|ARM
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Release|x64.ActiveCfg = Release|x64
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Release|x64.Build.0 = Release|x64
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Release|x64.Deploy.0 = Release|x64
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Release|x86.ActiveCfg = Release|Win32
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Release|x86.Build.0 = Release|Win32
{F710B9FD-4E6B-42D7-A99A-6D48888D48B0}.Release|x86.Deploy.0 = Release|Win32
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Debug|ARM.ActiveCfg = Debug|ARM
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Debug|ARM.Build.0 = Debug|ARM
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Debug|x64.ActiveCfg = Debug|x64
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Debug|x64.Build.0 = Debug|x64
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Debug|x86.ActiveCfg = Debug|Win32
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Debug|x86.Build.0 = Debug|Win32
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Release|ARM.ActiveCfg = Release|ARM
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Release|ARM.Build.0 = Release|ARM
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Release|x64.ActiveCfg = Release|x64
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Release|x64.Build.0 = Release|x64
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Release|x86.ActiveCfg = Release|Win32
{67B5157A-25B1-4EC3-98CF-50E1B9177DB4}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Loading

0 comments on commit 52e1e0b

Please sign in to comment.