This commit is contained in:
Eric Smith 2017-04-06 09:35:25 -07:00 коммит произвёл Joseph Sheedy
Коммит ed1aac1c6e
65 изменённых файлов: 4107 добавлений и 0 удалений

303
HoloLensCameraStream/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,303 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Windows
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk

Просмотреть файл

@ -0,0 +1,22 @@
using System;
namespace HoloLensCameraStream
{
public struct CameraParameters
{
public CapturePixelFormat pixelFormat;
public int cameraResolutionHeight;
public int cameraResolutionWidth;
public int frameRate;
public CameraParameters(
CapturePixelFormat pixelFormat = CapturePixelFormat.BGRA32,
int cameraResolutionHeight = 720,
int cameraResolutionWidth = 1280,
int frameRate = 30)
{ throw new NotImplementedException(); }
}
}

Просмотреть файл

@ -0,0 +1,11 @@
namespace HoloLensCameraStream
{
public enum CapturePixelFormat
{
BGRA32,
NV12,
JPEG,
PNG,
Unknown
}
}

Просмотреть файл

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HoloLensCameraStream</RootNamespace>
<AssemblyName>HoloLensCameraStream</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CameraParameters.cs" />
<Compile Include="CapturePixelFormat.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resolution.cs" />
<Compile Include="ResultType.cs" />
<Compile Include="VideoCapture.cs" />
<Compile Include="VideoCaptureResult.cs" />
<Compile Include="VideoCaptureSample.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HoloLens Camera Stream for Unity (Placeholder Assembly)")]
[assembly: AssemblyDescription("A placeholder assembly to keep the Unity compiler quiet when using the real plugin.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Vulcan, Inc")]
[assembly: AssemblyProduct("HoloLens Camera Stream for Unity (Placeholder Assembly)")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("397322ef-b88f-47d6-b5fa-ebab474fe3a9")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]

Просмотреть файл

@ -0,0 +1,14 @@
namespace HoloLensCameraStream
{
public struct Resolution
{
public readonly int width;
public readonly int height;
public Resolution(int width, int height)
{
this.width = width;
this.height = height;
}
}
}

Просмотреть файл

@ -0,0 +1,9 @@
namespace HoloLensCameraStream
{
public enum ResultType
{
Success,
InappropriateState,
UnknownError
}
}

Просмотреть файл

@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
namespace HoloLensCameraStream
{
public delegate void OnVideoCaptureResourceCreatedCallback(VideoCapture captureObject);
public delegate void OnVideoModeStartedCallback(VideoCaptureResult result);
public delegate void FrameSampleAcquiredCallback(VideoCaptureSample videoCaptureSample);
public delegate void OnVideoModeStoppedCallback(VideoCaptureResult result);
public sealed class VideoCapture
{
public static IEnumerable<Resolution> SupportedResolutions
{
get
{
throw new NotImplementedException();
}
}
public static IEnumerable<float> SupportedFrameRatesForResolution(Resolution resolution)
{
throw new NotImplementedException();
}
#pragma warning disable 067
public event FrameSampleAcquiredCallback FrameSampleAcquired;
#pragma warning restore 067
public bool IsStreaming
{
get
{
throw new NotImplementedException();
}
}
public static void CreateAync(OnVideoCaptureResourceCreatedCallback onCreatedCallback)
{
throw new NotImplementedException();
}
public IEnumerable<Resolution> GetSupportedResolutions()
{
throw new NotImplementedException();
}
public IEnumerable<float> GetSupportedFrameRatesForResolution(Resolution resolution)
{
throw new NotImplementedException();
}
public void StartVideoModeAsync(CameraParameters setupParams, OnVideoModeStartedCallback onVideoModeStartedCallback)
{
throw new NotImplementedException();
}
public void RequestNextFrameSample(FrameSampleAcquiredCallback onFrameSampleAcquired)
{
throw new NotImplementedException();
}
public void StopVideoModeAsync(OnVideoModeStoppedCallback onVideoModeStoppedCallback)
{
throw new NotImplementedException();
}
public void Dispose()
{
throw new NotImplementedException();
}
}
}

Просмотреть файл

@ -0,0 +1,11 @@
namespace HoloLensCameraStream
{
public struct VideoCaptureResult
{
public readonly long hResult;
public readonly ResultType resultType;
public readonly bool success;
}
}

Просмотреть файл

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
namespace HoloLensCameraStream
{
public class VideoCaptureSample
{
public int dataLength { get; private set; }
public bool hasLocationData { get; private set; }
public CapturePixelFormat pixelFormat { get; private set; }
public void CopyRawImageDataIntoBuffer(byte[] byteBuffer)
{
throw new NotImplementedException();
}
public void CopyRawImageDataIntoBuffer(List<byte> byteBuffer)
{
throw new NotImplementedException();
}
public byte[] TryGetCameraToWorldMatrix()
{
throw new NotImplementedException();
}
public byte[] TryGetProjectionMatrix()
{
throw new NotImplementedException();
}
public void UploadImageDataToTexture(object targetTexture)
{
throw new NotImplementedException();
}
public void Dispose()
{
throw new NotImplementedException();
}
}
}

Просмотреть файл

@ -0,0 +1,58 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin", "Plugin Project\Plugin.csproj", "{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dummy", "Dummy Project\Dummy.csproj", "{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}"
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
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Debug|ARM.ActiveCfg = Debug|ARM
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Debug|ARM.Build.0 = Debug|ARM
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Debug|x64.ActiveCfg = Debug|x64
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Debug|x64.Build.0 = Debug|x64
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Debug|x86.ActiveCfg = Debug|x86
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Debug|x86.Build.0 = Debug|x86
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Release|Any CPU.Build.0 = Release|Any CPU
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Release|ARM.ActiveCfg = Release|ARM
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Release|ARM.Build.0 = Release|ARM
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Release|x64.ActiveCfg = Release|x64
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Release|x64.Build.0 = Release|x64
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Release|x86.ActiveCfg = Release|x86
{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}.Release|x86.Build.0 = Release|x86
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Debug|ARM.ActiveCfg = Debug|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Debug|ARM.Build.0 = Debug|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Debug|x64.Build.0 = Debug|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Debug|x86.ActiveCfg = Debug|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Debug|x86.Build.0 = Debug|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Release|Any CPU.Build.0 = Release|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Release|ARM.ActiveCfg = Release|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Release|ARM.Build.0 = Release|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Release|x64.ActiveCfg = Release|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Release|x64.Build.0 = Release|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Release|x86.ActiveCfg = Release|Any CPU
{397322EF-B88F-47D6-B5FA-EBAB474FE3A9}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,43 @@
namespace HoloLensCameraStream
{
/// <summary>
/// When calling VideoCapture.StartPhotoModeAsync, you must pass in a CameraParameters object
/// that contains the various settings that the web camera will use.
/// </summary>
public struct CameraParameters
{
/// <summary>
/// The pixel format used to capture and record your image data.
/// </summary>
public CapturePixelFormat pixelFormat;
/// <summary>
/// The height of the image frame. Must be a valid option.
/// Valid options can be obtained from VideoCapture.SupportedResolutions.
/// </summary>
public int cameraResolutionHeight;
/// <summary>
/// The width of the image frame. Must be a valid option.
/// Valid options can be obtained from VideoCapture.SupportedResolutions.
/// </summary>
public int cameraResolutionWidth;
/// <summary>
/// The frames per second that the video will stream at. Must be supported based on the selected resolution.
/// </summary>
public int frameRate;
public CameraParameters(
CapturePixelFormat pixelFormat = CapturePixelFormat.BGRA32,
int cameraResolutionHeight = 720,
int cameraResolutionWidth = 1280,
int frameRate = 30)
{
this.pixelFormat = pixelFormat;
this.cameraResolutionHeight = cameraResolutionHeight;
this.cameraResolutionWidth = cameraResolutionWidth;
this.frameRate = frameRate;
}
}
}

Просмотреть файл

@ -0,0 +1,15 @@

namespace HoloLensCameraStream
{
/// <summary>
/// The pixel format used to capture and record your image data.
/// </summary>
public enum CapturePixelFormat
{
BGRA32,
NV12,
JPEG,
PNG,
Unknown
}
}

Просмотреть файл

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EE916C57-B4F5-42A6-912A-132BCC4AC8F4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HoloLensCameraStream</RootNamespace>
<AssemblyName>HoloLensCameraStream</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<None Include="project.json" />
</ItemGroup>
<ItemGroup>
<Compile Include="CapturePixelFormat.cs" />
<Compile Include="CameraParameters.cs" />
<Compile Include="ResultType.cs" />
<Compile Include="VideoCaptureResult.cs" />
<Compile Include="Resolution.cs" />
<Compile Include="VideoCapture.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="VideoCaptureSample.cs" />
<EmbeddedResource Include="Properties\HLVideoFramesPlugin.rd.xml" />
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,32 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HoloLens Camera Stream for Unity")]
[assembly: AssemblyDescription("Makes the HoloLens' camera's video buffer available to Unity in memory with locatable attributes.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Vulcan Inc.")]
[assembly: AssemblyProduct("HoloLens Camera Stream for Unity")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("")]

Просмотреть файл

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains Runtime Directives, specifications about types your application accesses
through reflection and other dynamic code patterns. Runtime Directives are used to control the
.NET Native optimizer and ensure that it does not remove code accessed by your library. If your
library does not do any reflection, then you generally do not need to edit this file. However,
if your library reflects over types, especially types passed to it or derived from its types,
then you should write Runtime Directives.
The most common use of reflection in libraries is to discover information about types passed
to the library. Runtime Directives have three ways to express requirements on types passed to
your library.
1. Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter
Use these directives to reflect over types passed as a parameter.
2. SubTypes
Use a SubTypes directive to reflect over types derived from another type.
3. AttributeImplies
Use an AttributeImplies directive to indicate that your library needs to reflect over
types or methods decorated with an attribute.
For more information on writing Runtime Directives for libraries, please visit
http://go.microsoft.com/fwlink/?LinkID=391919
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Library Name="HLVideoFramesPlugin">
<!-- add directives for your library here -->
</Library>
</Directives>

Просмотреть файл

@ -0,0 +1,24 @@
namespace HoloLensCameraStream
{
/// <summary>
/// A structure for holding a resolution.
/// </summary>
public struct Resolution
{
/// <summary>
/// The width property.
/// </summary>
public readonly int width;
/// <summary>
/// The height property.
/// </summary>
public readonly int height;
public Resolution(int width, int height)
{
this.width = width;
this.height = height;
}
}
}

Просмотреть файл

@ -0,0 +1,26 @@
namespace HoloLensCameraStream
{
/// <summary>
/// Represents the reason why the callback fired.
/// </summary>
public enum ResultType
{
/// <summary>
/// Everything went okay, continue down the happy path.
/// </summary>
Success,
/// <summary>
/// A function was called when the VideoCapture object when in the wrong state.
/// For instance, alling StopVideoModeAsync() when video mode is already stopped
/// will result in an early calling of the callback as the video mode does not need
/// time to be stopped.
/// </summary>
InappropriateState,
/// <summary>
/// Something went wrong when performing the async operation.
/// VideoCapture should not be considered a stable, usable object.
/// </summary>
UnknownError
}
}

Просмотреть файл

@ -0,0 +1,397 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Windows.Devices.Enumeration;
using Windows.Media.Capture;
using Windows.Media.Capture.Frames;
using Windows.Media.MediaProperties;
using Windows.Foundation;
using System.Diagnostics;
namespace HoloLensCameraStream
{
/// <summary>
/// Called when a VideoCapture resource has been created.
/// If the instance failed to be created, the instance returned will be null.
/// </summary>
/// <param name="captureObject">The VideoCapture instance.</param>
public delegate void OnVideoCaptureResourceCreatedCallback(VideoCapture captureObject);
/// <summary>
/// Called when the web camera begins streaming video.
/// </summary>
/// <param name="result">Indicates whether or not video recording started successfully.</param>
public delegate void OnVideoModeStartedCallback(VideoCaptureResult result);
/// <summary>
/// This is called every time there is a new frame sample available.
/// See VideoCapture.FrameSampleAcquired and the VideoCaptureSample class for more information.
/// </summary>
/// <param name="videoCaptureSample">The recently captured frame sample.
/// It contains methods for accessing the bitmap, as well as supporting information
/// such as transform and projection matrices.</param>
public delegate void FrameSampleAcquiredCallback(VideoCaptureSample videoCaptureSample);
/// <summary>
/// Called when video mode has been stopped.
/// </summary>
/// <param name="result">Indicates whether or not video mode was successfully deactivated.</param>
public delegate void OnVideoModeStoppedCallback(VideoCaptureResult result);
/// <summary>
/// Streams video from the camera and makes the buffer available for reading.
/// </summary>
public sealed class VideoCapture
{
/// <summary>
/// Note: This function is not yet implemented. Help us out on GitHub!
/// There is an instance method on VideoCapture called GetSupportedResolutions().
/// Please use that until we can get this method working.
/// </summary>
public static IEnumerable<Resolution> SupportedResolutions
{
get
{
throw new NotImplementedException("Please use the instance method VideoCapture.GetSupportedResolutions() for now.");
}
}
/// <summary>
/// Returns the supported frame rates at which a video can be recorded given a resolution.
/// Use VideoCapture.SupportedResolutions to get the supported web camera recording resolutions.
/// </summary>
/// <param name="resolution">A recording resolution.</param>
/// <returns>The frame rates at which the video can be recorded.</returns>
public static IEnumerable<float> SupportedFrameRatesForResolution(Resolution resolution)
{
throw new NotImplementedException();
}
/// <summary>
/// This is called every time there is a new frame sample available.
/// You must properly initialize the VideoCapture object, including calling StartVideoModeAsync()
/// before this event will begin firing.
///
/// You should not subscribe to FrameSampleAcquired if you do not need access to most
/// of the video frame samples for your application (for instance, if you are doing image detection once per second),
/// because there is significant memory management overhead to processing every frame.
/// Instead, you can call RequestNextFrameSample() which will respond with the next available sample only.
///
/// See the VideoFrameSample class for more information about dealing with the memory
/// complications of the BitmapBuffer.
/// </summary>
public event FrameSampleAcquiredCallback FrameSampleAcquired;
/// <summary>
/// Indicates whether or not the VideoCapture instance is currently streaming video.
/// This becomes true when the OnVideoModeStartedCallback is called, and ends
/// when the OnVideoModeStoppedCallback is called.
///
/// "VideoMode", as I have interpreted means that the frame reader begins delivering
/// the bitmap buffer, making it available to be consumed.
/// </summary>
public bool IsStreaming
{
get
{
return _frameReader != null;
}
}
static MediaStreamType streamType = MediaStreamType.VideoPreview;
MediaFrameSourceGroup _frameSourceGroup;
MediaFrameSourceInfo _frameSourceInfo;
DeviceInformation _deviceInfo;
MediaCapture _mediaCapture;
MediaFrameReader _frameReader;
VideoCapture(MediaFrameSourceGroup frameSourceGroup, MediaFrameSourceInfo frameSourceInfo, DeviceInformation deviceInfo)
{
_frameSourceGroup = frameSourceGroup;
_frameSourceInfo = frameSourceInfo;
_deviceInfo = deviceInfo;
}
/// <summary>
/// Asynchronously creates an instance of a VideoCapture object that can be used to stream video frames from the camera to memory.
/// If the instance failed to be created, the instance returned will be null. Also, holograms will not appear in the video.
/// </summary>
/// <param name="onCreatedCallback">This callback will be invoked when the VideoCapture instance is created and ready to be used.</param>
public static async void CreateAync(OnVideoCaptureResourceCreatedCallback onCreatedCallback)
{
var allFrameSourceGroups = await MediaFrameSourceGroup.FindAllAsync(); //Returns IReadOnlyList<MediaFrameSourceGroup>
var candidateFrameSourceGroups = allFrameSourceGroups.Where(group => group.SourceInfos.Any(IsColorVideoPreview)); //Returns IEnumerable<MediaFrameSourceGroup>
var selectedFrameSourceGroup = candidateFrameSourceGroups.FirstOrDefault(); //Returns a single MediaFrameSourceGroup
if (selectedFrameSourceGroup == null)
{
onCreatedCallback?.Invoke(null);
return;
}
var selectedFrameSourceInfo = selectedFrameSourceGroup.SourceInfos.FirstOrDefault(); //Returns a MediaFrameSourceInfo
if (selectedFrameSourceInfo == null)
{
onCreatedCallback?.Invoke(null);
return;
}
var devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture); //Returns DeviceCollection
var deviceInformation = devices.FirstOrDefault(); //Returns a single DeviceInformation
if (deviceInformation == null)
{
onCreatedCallback(null);
return;
}
var videoCapture = new VideoCapture(selectedFrameSourceGroup, selectedFrameSourceInfo, deviceInformation);
await videoCapture.CreateMediaCaptureAsync();
onCreatedCallback?.Invoke(videoCapture);
}
public IEnumerable<Resolution> GetSupportedResolutions()
{
List<Resolution> resolutions = new List<Resolution>();
var allPropertySets = _mediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(streamType).Select(x => x as VideoEncodingProperties); //Returns IEnumerable<VideoEncodingProperties>
foreach (var propertySet in allPropertySets)
{
resolutions.Add(new Resolution((int)propertySet.Width, (int)propertySet.Height));
}
return resolutions.AsReadOnly();
}
public IEnumerable<float> GetSupportedFrameRatesForResolution(Resolution resolution)
{
//Get all property sets that match the supported resolution
var allPropertySets = _mediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(streamType).Select((x) => x as VideoEncodingProperties)
.Where((x) =>
{
return x != null &&
x.Width == (uint)resolution.width &&
x.Height == (uint)resolution.height;
}); //Returns IEnumerable<VideoEncodingProperties>
//Get all resolutions without duplicates.
var frameRatesDict = new Dictionary<float, bool>();
foreach (var propertySet in allPropertySets)
{
if (propertySet.FrameRate.Denominator != 0)
{
float frameRate = (float)propertySet.FrameRate.Numerator / (float)propertySet.FrameRate.Denominator;
frameRatesDict.Add(frameRate, true);
}
}
//Format resolutions as a list.
var frameRates = new List<float>();
foreach (KeyValuePair<float, bool> kvp in frameRatesDict)
{
frameRates.Add(kvp.Key);
}
return frameRates.AsReadOnly();
}
/// <summary>
/// Asynchronously starts video mode.
///
/// Activates the web camera with the various settings specified in CameraParameters.
/// Only one VideoCapture instance can start the video mode at any given time.
/// After starting the video mode, you listen for new video frame samples via the VideoCapture.FrameSampleAcquired event,
/// or by calling VideoCapture.RequestNextFrameSample() when will return the next available sample.
/// While in video mode, more power will be consumed so make sure that you call VideoCapture.StopVideoModeAsync qhen you can afford the start/stop video mode overhead.
/// </summary>
/// <param name="setupParams">Parameters that change how video mode is used.</param>
/// <param name="onVideoModeStartedCallback">This callback will be invoked once video mode has been activated.</param>
public async void StartVideoModeAsync(CameraParameters setupParams, OnVideoModeStartedCallback onVideoModeStartedCallback)
{
var mediaFrameSource = _mediaCapture.FrameSources[_frameSourceInfo.Id]; //Returns a MediaFrameSource
if (mediaFrameSource == null)
{
onVideoModeStartedCallback?.Invoke(new VideoCaptureResult(1, ResultType.UnknownError, false));
return;
}
var pixelFormat = ConvertCapturePixelFormatToMediaEncodingSubtype(setupParams.pixelFormat);
_frameReader = await _mediaCapture.CreateFrameReaderAsync(mediaFrameSource, pixelFormat);
_frameReader.FrameArrived += HandleFrameArrived;
await _frameReader.StartAsync();
VideoEncodingProperties properties = GetVideoEncodingPropertiesForCameraParams(setupParams);
//TODO: Cannot set the encoding properties yet. This is producing an error which I haven't solved.
//await _mediaCapture.SetEncodingPropertiesAsync(streamType, properties, null);
onVideoModeStartedCallback?.Invoke(new VideoCaptureResult(0, ResultType.Success, true));
}
/// <summary>
/// Returns a new VideoFrameSample as soon as the next one is available.
/// This method is preferable to listening to the FrameSampleAcquired event
/// in circumstances where most or all frames are not needed. For instance, if
/// you were planning on sending frames to a remote image recognition service twice per second,
/// you may consider using this method rather than ignoring most of the event dispatches from FrameSampleAcquired.
/// This will avoid the overhead of acquiring and disposing of unused frames.
///
/// If, for whatever reason, a frame reference cannot be obtained, it is possible that the callback will return a null sample.
/// </summary>
/// <param name="onFrameSampleAcquired"></param>
public void RequestNextFrameSample(FrameSampleAcquiredCallback onFrameSampleAcquired)
{
if (onFrameSampleAcquired == null)
{
throw new ArgumentNullException("onFrameSampleAcquired");
}
if (IsStreaming == false)
{
throw new Exception("You cannot request a frame sample until the video mode is started.");
}
TypedEventHandler<MediaFrameReader, MediaFrameArrivedEventArgs> handler = null;
handler = (MediaFrameReader sender, MediaFrameArrivedEventArgs args) =>
{
using (var frameReference = _frameReader.TryAcquireLatestFrame()) //frame: MediaFrameReference
{
if (frameReference != null)
{
onFrameSampleAcquired.Invoke(new VideoCaptureSample(frameReference));
}
else
{
onFrameSampleAcquired.Invoke(null);
}
}
_frameReader.FrameArrived -= handler;
};
_frameReader.FrameArrived += handler;
}
/// <summary>
/// Asynchronously stops video mode.
/// </summary>
/// <param name="onVideoModeStoppedCallback">This callback will be invoked once video mode has been deactivated.</param>
public async void StopVideoModeAsync(OnVideoModeStoppedCallback onVideoModeStoppedCallback)
{
if (IsStreaming == false)
{
onVideoModeStoppedCallback?.Invoke(new VideoCaptureResult(1, ResultType.InappropriateState, false));
return;
}
_frameReader.FrameArrived -= HandleFrameArrived;
await _frameReader.StopAsync();
_frameReader.Dispose();
_frameReader = null;
onVideoModeStoppedCallback?.Invoke(new VideoCaptureResult(0, ResultType.Success, true));
}
/// <summary>
/// Dispose must be called to shutdown the PhotoCapture instance.
///
/// If your VideoCapture instance successfully called VideoCapture.StartVideoModeAsync,
/// you must make sure that you call VideoCapture.StopVideoModeAsync before disposing your VideoCapture instance.
/// </summary>
public void Dispose()
{
if (IsStreaming)
{
throw new Exception("Please make sure StopVideoModeAsync() is called before displosing the VideoCapture object.");
}
_mediaCapture?.Dispose();
}
async Task CreateMediaCaptureAsync()
{
if (_mediaCapture != null)
{
throw new Exception("The MediaCapture object has already been created.");
}
_mediaCapture = new MediaCapture();
await _mediaCapture.InitializeAsync(new MediaCaptureInitializationSettings()
{
VideoDeviceId = _deviceInfo.Id,
SourceGroup = _frameSourceGroup,
MemoryPreference = MediaCaptureMemoryPreference.Cpu, //TODO: Should this be the other option, Auto? GPU is not an option.
StreamingCaptureMode = StreamingCaptureMode.Video
});
_mediaCapture.VideoDeviceController.Focus.TrySetAuto(true);
}
void HandleFrameArrived(MediaFrameReader sender, MediaFrameArrivedEventArgs args)
{
if (FrameSampleAcquired == null)
{
return;
}
using (var frameReference = _frameReader.TryAcquireLatestFrame()) //frameReference is a MediaFrameReference
{
if (frameReference != null)
{
var sample = new VideoCaptureSample(frameReference);
FrameSampleAcquired?.Invoke(sample);
}
}
}
VideoEncodingProperties GetVideoEncodingPropertiesForCameraParams(CameraParameters cameraParams)
{
var allPropertySets = _mediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(streamType).Select((x) => x as VideoEncodingProperties)
.Where((x) =>
{
if (x == null) return false;
if (x.FrameRate.Denominator == 0) return false;
double calculatedFrameRate = (double)x.FrameRate.Numerator / (double)x.FrameRate.Denominator;
return
x.Width == (uint)cameraParams.cameraResolutionWidth &&
x.Height == (uint)cameraParams.cameraResolutionHeight &&
(int)Math.Round(calculatedFrameRate) == cameraParams.frameRate;
}); //Returns IEnumerable<VideoEncodingProperties>
if (allPropertySets.Count() == 0)
{
throw new Exception("Could not find an encoding property set that matches the given camera parameters.");
}
var chosenPropertySet = allPropertySets.FirstOrDefault();
return chosenPropertySet;
}
static bool IsColorVideoPreview(MediaFrameSourceInfo sourceInfo)
{
//TODO: Determine whether 'VideoPreview' or 'VideoRecord' is the appropriate type. What's the difference?
return (sourceInfo.MediaStreamType == streamType &&
sourceInfo.SourceKind == MediaFrameSourceKind.Color);
}
static string ConvertCapturePixelFormatToMediaEncodingSubtype(CapturePixelFormat format)
{
switch (format)
{
case CapturePixelFormat.BGRA32:
return MediaEncodingSubtypes.Bgra8;
case CapturePixelFormat.NV12:
return MediaEncodingSubtypes.Nv12;
case CapturePixelFormat.JPEG:
return MediaEncodingSubtypes.Jpeg;
case CapturePixelFormat.PNG:
return MediaEncodingSubtypes.Png;
default:
return MediaEncodingSubtypes.Bgra8;
}
}
}
}

Просмотреть файл

@ -0,0 +1,27 @@
namespace HoloLensCameraStream
{
public struct VideoCaptureResult
{
/// <summary>
/// Not really used. Set to 1 when success=false, and is 0 when success=true
/// </summary>
public readonly long hResult;
/// <summary>
/// Represents the reason why the callback fired.
/// </summary>
public readonly ResultType resultType;
/// <summary>
/// A simple answer of whether or not everything worked out with the async process.
/// </summary>
public readonly bool success;
internal VideoCaptureResult(long hResult, ResultType resultType, bool success)
{
this.hResult = hResult;
this.resultType = resultType;
this.success = success;
}
}
}

Просмотреть файл

@ -0,0 +1,225 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Graphics.Imaging;
using Windows.Media.Capture.Frames;
namespace HoloLensCameraStream
{
public class VideoCaptureSample
{
/// <summary>
/// The guid for getting the view transform from the frame sample.
/// See https://developer.microsoft.com/en-us/windows/mixed-reality/locatable_camera#locating_the_device_camera_in_the_world
/// </summary>
static Guid viewTransformGuid = new Guid("4E251FA4-830F-4770-859A-4B8D99AA809B");
/// <summary>
/// The guid for getting the projection transform from the frame sample.
/// See https://developer.microsoft.com/en-us/windows/mixed-reality/locatable_camera#locating_the_device_camera_in_the_world
/// </summary>
static Guid projectionTransformGuid = new Guid("47F9FCB5-2A02-4F26-A477-792FDF95886A");
/// <summary>
/// How many bytes are in the frame.
/// There are four bytes per pixel, times the width and height of the bitmap.
/// </summary>
public int dataLength
{
get
{
return 4 * bitmap.PixelHeight * bitmap.PixelWidth;
}
}
/// <summary>
/// Note: This method has not been written. Help us out on GitHub!
/// Will be true if the HoloLens knows where it is and is tracking.
/// Indicates that obtaining the matrices will be successful.
/// </summary>
public bool hasLocationData
{
get
{
//TODO: Return if location data exists.
throw new NotImplementedException();
}
}
/// <summary>
/// The format of the frames that the bitmap stream is sending.
/// </summary>
public CapturePixelFormat pixelFormat { get; private set; }
//Internal members
internal SoftwareBitmap bitmap { get; private set; }
internal bool isBitmapCopied { get; private set; }
//Private members
MediaFrameReference frameReference;
internal VideoCaptureSample(MediaFrameReference frameReference)
{
if (frameReference == null)
{
throw new ArgumentNullException("frameReference.");
}
this.frameReference = frameReference;
bitmap = frameReference.VideoMediaFrame.SoftwareBitmap;
//TODO: Get location data
//var transformMatrix = frameReference.Properties[TransformMatrixGuid] as SomeMatrixOrArray;
//var projectionMatrix = frameReference.Properties[ProjectionMatrixGuid] as SomeMatrixOrArray;
}
/// <summary>
/// If you need safe, long term control over the image bytes in this frame, they will need to be
/// copied. You need to supply a byte[] to copy them into. It is best to pre-allocate and reuse
/// this byte array to minimize unecessarily high memory ceiling or unnecessary garbage collections.
/// </summary>
/// <param name="byteBuffer">A byte array with a length the size of VideoCaptureSample.dataLength</param>
public void CopyRawImageDataIntoBuffer(byte[] byteBuffer)
{
//Here is a potential way to get direct access to the buffer:
//http://stackoverflow.com/questions/25481840/how-to-change-mediacapture-to-byte
if (byteBuffer == null)
{
throw new ArgumentNullException("byteBuffer");
}
if (byteBuffer.Length < dataLength)
{
throw new IndexOutOfRangeException("Your byteBuffer is not big enough." +
" Please use the VideoCaptureSample.dataLength property to allocate a large enough array.");
}
bitmap.CopyToBuffer(byteBuffer.AsBuffer());
isBitmapCopied = true;
}
public void CopyRawImageDataIntoBuffer(List<byte> byteBuffer)
{
throw new NotSupportedException("This method is not yet supported with a List<byte>. Please provide a byte[] instead.");
}
/// <summary>
/// This returns the transform matrix at the time the photo was captured, if location data if available.
/// If it's not, that is probably an indication that the HoloLens is not tracking and its location is not known.
/// It could also mean the VideoCapture stream is not running.
/// If location data is unavailable then the camera to world matrix will be set to the identity matrix.
/// </summary>
/// <param name="matrix">The transform matrix used to convert between coordinate spaces.
/// The matrix will have to be converted to a Unity matrix before it can be used by methods in the UnityEngine namespace.
/// See https://forum.unity3d.com/threads/locatable-camera-in-unity.398803/ for details.</param>
public byte[] TryGetCameraToWorldMatrix()
{
//TODO: Figure out how to use a Unity matrix in a plugin.
if (frameReference.Properties.ContainsKey(viewTransformGuid) == false)
{
return GetIdentityMatrixByteArray();
}
return frameReference.Properties[viewTransformGuid] as byte[];
}
/// <summary>
/// This returns the transform matrix at the time the photo was captured, if location data if available.
/// If it's not, that is probably an indication that the HoloLens is not tracking and its location is not known.
/// It could also mean the VideoCapture stream is not running.
/// If location data is unavailable then the camera to world matrix will be set to the identity matrix.
/// </summary>
/// <param name="matrix">The projection matrix used to match the true camera projection.
/// The matrix will have to be converted to a Unity matrix before it can be used by methods in the UnityEngine namespace.
/// See https://forum.unity3d.com/threads/locatable-camera-in-unity.398803/ for details.</param>
public byte[] TryGetProjectionMatrix()
{
if (frameReference.Properties.ContainsKey(projectionTransformGuid) == false)
{
return GetIdentityMatrixByteArray();
}
return frameReference.Properties[projectionTransformGuid] as byte[];
}
/// <summary>
/// Note: This method hasn't been written yet. Help us out on GitHub!
/// </summary>
/// <param name="targetTexture"></param>
public void UploadImageDataToTexture(object targetTexture)
{
//TODO: Figure out how to use a Texture2D in a plugin.
throw new NotSupportedException("I'm not sure how to use a Texture2D within this plugin.");
}
/// <summary>
/// When done with the VideoCapture class, you will need to dispose it to release unmanaged memory.
/// </summary>
public void Dispose()
{
bitmap.Dispose();
frameReference.Dispose();
}
private Matrix4x4 ConvertByteArrayToMatrix4x4(byte[] matrixAsBytes)
{
if (matrixAsBytes == null)
{
throw new ArgumentNullException("matrixAsBytes");
}
if (matrixAsBytes.Length != 64)
{
throw new Exception("Cannot convert byte[] to Matrix4x4. Size of array should be 64, but it is " + matrixAsBytes.Length);
}
var m = matrixAsBytes;
return new Matrix4x4(
BitConverter.ToSingle(m, 0),
BitConverter.ToSingle(m, 4),
BitConverter.ToSingle(m, 8),
BitConverter.ToSingle(m, 12),
BitConverter.ToSingle(m, 16),
BitConverter.ToSingle(m, 20),
BitConverter.ToSingle(m, 24),
BitConverter.ToSingle(m, 28),
BitConverter.ToSingle(m, 32),
BitConverter.ToSingle(m, 36),
BitConverter.ToSingle(m, 40),
BitConverter.ToSingle(m, 44),
BitConverter.ToSingle(m, 48),
BitConverter.ToSingle(m, 52),
BitConverter.ToSingle(m, 56),
BitConverter.ToSingle(m, 60));
}
static CapturePixelFormat ConvertBitmapPixelFormatToCapturePixelFormat(BitmapPixelFormat format)
{
switch (format)
{
case BitmapPixelFormat.Bgra8:
return CapturePixelFormat.BGRA32;
case BitmapPixelFormat.Nv12:
return CapturePixelFormat.NV12;
default:
return CapturePixelFormat.Unknown;
}
}
/// <summary>
/// We're not yet returning real matrices from the plugin to Unity. Until we do that, we're passing byte[].
/// </summary>
static byte[] GetIdentityMatrixByteArray()
{
return new byte[] { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 };
}
}
}

Просмотреть файл

@ -0,0 +1,16 @@
{
"dependencies": {
"Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0"
},
"frameworks": {
"uap10.0": {}
},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}
}

36
HoloLensVideoCaptureExample/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,36 @@
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
/App
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.weights
# Unity3D generated meta files
*.pidb.meta
*.weights.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
# Builds
*.apk
*.unitypackage
UWP/

Просмотреть файл

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c4e8e4bcb06967849b0a31f41b561f55
folderAsset: yes
timeCreated: 1491327763
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 2515b3e74aa3fba4c9138bfd4226ce59
folderAsset: yes
timeCreated: 1491329850
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b1e5c02fd82503a44a51156f994af743
folderAsset: yes
timeCreated: 1491337411
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,297 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641252, b: 0.574817, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 4
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_DirectLightInLightProbes: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_LightingDataAsset: {fileID: 0}
m_RuntimeCPUUsage: 25
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
accuratePlacement: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &737556966
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 737556971}
- component: {fileID: 737556970}
- component: {fileID: 737556969}
- component: {fileID: 737556968}
- component: {fileID: 737556967}
- component: {fileID: 737556972}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &737556967
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 737556966}
m_Enabled: 1
--- !u!124 &737556968
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 737556966}
m_Enabled: 1
--- !u!92 &737556969
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 737556966}
m_Enabled: 1
--- !u!20 &737556970
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 737556966}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!4 &737556971
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 737556966}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &737556972
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 737556966}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9612561be963c9e41a8452cdb97dd03a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1354111021
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4360600529851436, guid: 4759f82451deb2749873e98fdd9945c7, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4360600529851436, guid: 4759f82451deb2749873e98fdd9945c7, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4360600529851436, guid: 4759f82451deb2749873e98fdd9945c7, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4360600529851436, guid: 4759f82451deb2749873e98fdd9945c7, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4360600529851436, guid: 4759f82451deb2749873e98fdd9945c7, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4360600529851436, guid: 4759f82451deb2749873e98fdd9945c7, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4360600529851436, guid: 4759f82451deb2749873e98fdd9945c7, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4360600529851436, guid: 4759f82451deb2749873e98fdd9945c7, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 4759f82451deb2749873e98fdd9945c7, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1986881456
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1986881458}
- component: {fileID: 1986881457}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1986881457
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1986881456}
m_Enabled: 1
serializedVersion: 7
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1986881458
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1986881456}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}

Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e913caf645897db42bbdacb4893c11d6
timeCreated: 1490739693
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5887e4762c153624585cf6f2616965a9
folderAsset: yes
timeCreated: 1491337452
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,74 @@
using UnityEngine;
using System;
using HoloLensCameraStream;
using System.Linq;
using System.Collections.Generic;
public class Example1 : MonoBehaviour
{
VideoCapture videoCapture;
byte[] latestImageBytes;
HoloLensCameraStream.Resolution resolution;
void Start()
{
//Call this in Start() to ensure that the CameraStreamManager is already "Awake".
CameraStreamHelper.Instance.GetVideoCaptureAsync(OnVideoCaptureCreated);
//You could also do this "shortcut":
//CameraStreamManager.Instance.GetVideoCaptureAsync(v => videoCapture = v);
}
private void OnDestroy()
{
if (videoCapture != null)
{
videoCapture.FrameSampleAcquired -= OnFrameSampleAcquired;
videoCapture.Dispose();
}
}
void OnVideoCaptureCreated(VideoCapture videoCapture)
{
if (videoCapture == null)
{
Debug.LogError("Did not find a video capture object. You may not be using the HoloLens.");
return;
}
resolution = CameraStreamHelper.Instance.GetLowestResolution();
float frameRate = CameraStreamHelper.Instance.GetHighestFrameRate(resolution);
this.videoCapture = videoCapture;
//videoCapture.FrameSampleAcquired += OnFrameSampleAcquired;
Debug.Log("Media capture started. Starting video mode...");
CameraParameters cameraParams = new CameraParameters();
cameraParams.cameraResolutionHeight = resolution.height;
cameraParams.cameraResolutionWidth = resolution.width;
cameraParams.frameRate = Mathf.RoundToInt(frameRate);
cameraParams.pixelFormat = CapturePixelFormat.BGRA32;
videoCapture.StartVideoModeAsync(cameraParams, OnVideoModeStarted);
}
void OnVideoModeStarted(VideoCaptureResult result)
{
if (result.success == false)
{
Debug.LogWarning("Could not start video mode.");
return;
}
Debug.Log("Video mode started. Capturing samples...");
videoCapture.RequestNextFrameSample(OnFrameSampleAcquired);
}
void OnFrameSampleAcquired(VideoCaptureSample sample)
{
if (latestImageBytes == null || latestImageBytes.Length < sample.dataLength)
{
latestImageBytes = new byte[sample.dataLength];
}
sample.CopyRawImageDataIntoBuffer(latestImageBytes);
sample.Dispose();
}
}

Просмотреть файл

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9612561be963c9e41a8452cdb97dd03a
timeCreated: 1490740471
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b3a70a4205ca28e4cbfade8d06688804
folderAsset: yes
timeCreated: 1490740220
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,73 @@
fileFormatVersion: 2
guid: 0d2e4eb7345909349aac59f7914e3124
timeCreated: 1491332359
licenseType: Pro
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
Any:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXIntel: 1
Exclude OSXIntel64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude WindowsStoreApps: 1
Editor:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
Linux:
enabled: 0
settings:
CPU: x86
Linux64:
enabled: 0
settings:
CPU: x86_64
LinuxUniversal:
enabled: 0
settings:
CPU: None
OSXIntel:
enabled: 0
settings:
CPU: AnyCPU
OSXIntel64:
enabled: 0
settings:
CPU: AnyCPU
OSXUniversal:
enabled: 0
settings:
CPU: None
Win:
enabled: 0
settings:
CPU: AnyCPU
Win64:
enabled: 0
settings:
CPU: AnyCPU
WindowsStoreApps:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
SDK: AnySDK
ScriptingBackend: AnyScriptingBackend
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 74493d538956d694887278e7636910a1
folderAsset: yes
timeCreated: 1490740226
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,73 @@
fileFormatVersion: 2
guid: b89ba6fc9bc2ee646b68305f8e19cc9f
timeCreated: 1491332410
licenseType: Pro
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
Any:
enabled: 0
settings:
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXIntel: 1
Exclude OSXIntel64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude WindowsStoreApps: 0
Editor:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
Linux:
enabled: 0
settings:
CPU: x86
Linux64:
enabled: 0
settings:
CPU: x86_64
LinuxUniversal:
enabled: 0
settings:
CPU: None
OSXIntel:
enabled: 0
settings:
CPU: AnyCPU
OSXIntel64:
enabled: 0
settings:
CPU: AnyCPU
OSXUniversal:
enabled: 0
settings:
CPU: None
Win:
enabled: 0
settings:
CPU: AnyCPU
Win64:
enabled: 0
settings:
CPU: AnyCPU
WindowsStoreApps:
enabled: 1
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath: Assets/CamStream/Plugins/HoloLensCameraStream.dll
SDK: UWP
ScriptingBackend: DotNet
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 70a9fe1ccdc03934db695023fc94574c
folderAsset: yes
timeCreated: 1491329881
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,53 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1039087494832438}
m_IsPrefabParent: 1
--- !u!1 &1039087494832438
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4360600529851436}
- component: {fileID: 114958086835192222}
m_Layer: 0
m_Name: Camera Stream
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4360600529851436
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1039087494832438}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114958086835192222
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1039087494832438}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8d7a303625e450b499551864fb15277d, type: 3}
m_Name:
m_EditorClassIdentifier:

Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4759f82451deb2749873e98fdd9945c7
timeCreated: 1491336715
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 302bd4847e31e924789c3121aa0421e2
folderAsset: yes
timeCreated: 1491329845
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,108 @@
using HoloLensCameraStream;
using System;
using System.Linq;
using UnityEngine;
public class CameraStreamHelper : MonoBehaviour
{
event OnVideoCaptureResourceCreatedCallback VideoCaptureCreated;
static VideoCapture videoCapture;
static CameraStreamHelper instance;
public static CameraStreamHelper Instance
{
get
{
return instance;
}
}
public void GetVideoCaptureAsync(OnVideoCaptureResourceCreatedCallback onVideoCaptureAvailable)
{
if (onVideoCaptureAvailable == null)
{
Debug.LogError("You must supply the onVideoCaptureAvailable delegate.");
}
if (videoCapture == null)
{
VideoCaptureCreated += onVideoCaptureAvailable;
}
else
{
onVideoCaptureAvailable(videoCapture);
}
}
public HoloLensCameraStream.Resolution GetHighestResolution()
{
if (videoCapture == null)
{
throw new Exception("Please call this method after a VideoCapture instance has been created.");
}
return videoCapture.GetSupportedResolutions().OrderByDescending((r) => r.width * r.height).FirstOrDefault();
}
public HoloLensCameraStream.Resolution GetLowestResolution()
{
if (videoCapture == null)
{
throw new Exception("Please call this method after a VideoCapture instance has been created.");
}
return videoCapture.GetSupportedResolutions().OrderBy((r) => r.width * r.height).FirstOrDefault();
}
public float GetHighestFrameRate(HoloLensCameraStream.Resolution forResolution)
{
if (videoCapture == null)
{
throw new Exception("Please call this method after a VideoCapture instance has been created.");
}
return videoCapture.GetSupportedFrameRatesForResolution(forResolution).OrderByDescending(r => r).FirstOrDefault();
}
public float GetLowestFrameRate(HoloLensCameraStream.Resolution forResolution)
{
if (videoCapture == null)
{
throw new Exception("Please call this method after a VideoCapture instance has been created.");
}
return videoCapture.GetSupportedFrameRatesForResolution(forResolution).OrderBy(r => r).FirstOrDefault();
}
private void Awake()
{
if (instance != null)
{
Debug.LogError("Cannot create two instances of CamStreamManager.");
return;
}
instance = this;
VideoCapture.CreateAync(OnVideoCaptureInstanceCreated);
}
private void OnDestroy()
{
if (instance == this)
{
instance = null;
}
}
private void OnVideoCaptureInstanceCreated(VideoCapture videoCapture)
{
if (videoCapture == null)
{
Debug.LogError("Creating the VideoCapture object failed.");
return;
}
CameraStreamHelper.videoCapture = videoCapture;
if (VideoCaptureCreated != null)
{
VideoCaptureCreated(videoCapture);
}
}
}

Просмотреть файл

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8d7a303625e450b499551864fb15277d
timeCreated: 1491329900
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,120 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class LocatableCameraUtils
{
public static Vector3 PixelCoordToWorldCoord(Matrix4x4 viewTransform, Matrix4x4 projectionTransform, HoloLensCameraStream.Resolution resolution, Vector2 pixelCoordinates, float depthOffset = 0, Vector3? referenceDepthPoint = null)
{
//TODO: This whole function is in progress and needs to be understood and fixed. It doesn't work properly.
pixelCoordinates = ConvertPixelCoordsToScaledCoords(pixelCoordinates, resolution);
float focalLengthX = projectionTransform.GetColumn(0).x;
float focalLengthY = projectionTransform.GetColumn(1).y;
float centerOffsetX = projectionTransform.m20;
float centerOffsetY = projectionTransform.m21;
var dirRay = new Vector3(pixelCoordinates.x / focalLengthX, pixelCoordinates.y / focalLengthY, 1.0f).normalized; //Direction is in camera space
var cameraPositionOffset = new Vector3(centerOffsetX / 2f, centerOffsetY / 2f);
Vector3 centerPosition = viewTransform.MultiplyPoint(cameraPositionOffset);
//centerPosition += frameSample.worldPosition;
var direction = new Vector3(Vector3.Dot(dirRay, viewTransform.GetRow(0)), Vector3.Dot(dirRay, viewTransform.GetRow(1)), Vector3.Dot(dirRay, viewTransform.GetRow(2)));
//Quaternion rotation = Quaternion.LookRotation(-cameraToWorldMatrix.GetColumn(2), cameraToWorldMatrix.GetColumn(1));
var ray = new Ray(centerPosition, direction);
var depth = 1f;
if (referenceDepthPoint.HasValue == false)
{
RaycastHit hit;
if (Physics.Raycast(ray, out hit))
{
depth = Vector3.Magnitude(hit.point - centerPosition);
}
}
else
{
depth = Vector3.Magnitude(referenceDepthPoint.Value - centerPosition);
}
depth -= depthOffset;
return centerPosition + direction * depth;
}
public static Quaternion GetRotationFacingView(Matrix4x4 viewTransform)
{
return Quaternion.LookRotation(-viewTransform.GetColumn(2), viewTransform.GetColumn(1));
}
public static Matrix4x4 BytesToMatrix(byte[] inMatrix)
{
//Then convert the floats to a matrix.
Matrix4x4 outMatrix = new Matrix4x4
{
m00 = inMatrix[0],
m01 = inMatrix[1],
m02 = inMatrix[2],
m03 = inMatrix[3],
m10 = inMatrix[4],
m11 = inMatrix[5],
m12 = inMatrix[6],
m13 = inMatrix[7],
m20 = inMatrix[8],
m21 = inMatrix[9],
m22 = inMatrix[10],
m23 = inMatrix[11],
m30 = inMatrix[12],
m31 = inMatrix[13],
m32 = inMatrix[14],
m33 = inMatrix[15]
};
return outMatrix;
//Not sure yet...but the given array might require that we transpose the Unity matrix to make it correct.
//It seems that C# Matrices are "row major" and Unity Matrices are "column major".
//return result.transpose;
}
public static Matrix4x4 ProcessRawViewTransform(byte[] inMatrix)
{
//TODO: Understand and verify that this is the proper way to change the view transform matrix.
Matrix4x4 outMatrix = BytesToMatrix(inMatrix);
Matrix4x4 zflip = Matrix4x4.identity;
zflip.SetColumn(2, -1 * zflip.GetColumn(2));
return zflip * outMatrix * zflip;
}
public static Matrix4x4 ProcessRawProjectionTransform(byte[] inMatrix)
{
Matrix4x4 outMatrix = BytesToMatrix(inMatrix);
//TODO: Some stuff might have to be done here.
return outMatrix;
}
/// <summary>
/// Converts pixel coordinates to screen-space coordinates that span from -1 to 1 on both axes.
/// This is the format that is required to determine the z-depth of a given pixel taken by the HoloLens camera.
/// </summary>
/// <param name="pixelCoords">The coordinate of the pixel that should be converted to screen-space.</param>
/// <param name="res">The resolution of the image that the pixel came from.</param>
/// <returns>A 2D vector with values between -1 and 1, representing the left-to-right scale within the image dimensions.</returns>
static Vector2 ConvertPixelCoordsToScaledCoords(Vector2 pixelCoords, HoloLensCameraStream.Resolution resolution)
{
float halfWidth = (float)resolution.width / 2f;
float halfHeight = (float)resolution.height / 2f;
//Translate registration to image center;
pixelCoords.x -= halfWidth;
pixelCoords.y -= halfHeight;
//Scale pixel coords to percentage coords (-1 to 1)
pixelCoords = new Vector2(pixelCoords.x / halfWidth, pixelCoords.y / halfHeight * -1f);
return pixelCoords;
}
}

Просмотреть файл

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 957e4a1c075fac543adbced84cc6381b
timeCreated: 1491415421
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Двоичные данные
HoloLensVideoCaptureExample/Assets/WSATestCertificate.pfx Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: df7a668e4b6ffcf43bbad772e1b5b2cb
timeCreated: 1491503736
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!11 &1
AudioManager:
m_ObjectHideFlags: 0
m_Volume: 1
Rolloff Scale: 1
Doppler Factor: 1
Default Speaker Mode: 2
m_SampleRate: 0
m_DSPBufferSize: 0
m_VirtualVoiceCount: 512
m_RealVoiceCount: 32
m_SpatializerPlugin:
m_DisableAudio: 0
m_VirtualizeEffects: 1

Просмотреть файл

@ -0,0 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!236 &1
ClusterInputManager:
m_ObjectHideFlags: 0
m_Inputs: []

Просмотреть файл

@ -0,0 +1,18 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!55 &1
PhysicsManager:
m_ObjectHideFlags: 0
serializedVersion: 3
m_Gravity: {x: 0, y: -9.81, z: 0}
m_DefaultMaterial: {fileID: 0}
m_BounceThreshold: 2
m_SleepThreshold: 0.005
m_DefaultContactOffset: 0.01
m_DefaultSolverIterations: 6
m_DefaultSolverVelocityIterations: 1
m_QueriesHitBackfaces: 0
m_QueriesHitTriggers: 1
m_EnableAdaptiveForce: 0
m_EnablePCM: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Просмотреть файл

@ -0,0 +1,9 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1045 &1
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/CamStream/Examples/Example1/Example 1.unity

Просмотреть файл

@ -0,0 +1,14 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!159 &1
EditorSettings:
m_ObjectHideFlags: 0
serializedVersion: 3
m_ExternalVersionControlSupport: Visible Meta Files
m_SerializationMode: 2
m_DefaultBehaviorMode: 0
m_SpritePackerMode: 2
m_SpritePackerPaddingPower: 1
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd
m_ProjectGenerationRootNamespace:
m_UserGeneratedProjectSuffix:

Просмотреть файл

@ -0,0 +1,64 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!30 &1
GraphicsSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Deferred:
m_Mode: 1
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
m_DeferredReflections:
m_Mode: 1
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
m_ScreenSpaceShadows:
m_Mode: 1
m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
m_LegacyDeferred:
m_Mode: 1
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
m_DepthNormals:
m_Mode: 1
m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
m_MotionVectors:
m_Mode: 1
m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
m_LightHalo:
m_Mode: 1
m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
m_LensFlare:
m_Mode: 1
m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
m_AlwaysIncludedShaders:
- {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
m_TierSettings_Tier1:
renderingPath: 1
useCascadedShadowMaps: 0
m_TierSettings_Tier2:
renderingPath: 1
useCascadedShadowMaps: 1
m_TierSettings_Tier3:
renderingPath: 1
useCascadedShadowMaps: 1
m_DefaultRenderingPath: 1
m_DefaultMobileRenderingPath: 1
m_TierSettings: []
m_LightmapStripping: 0
m_FogStripping: 0
m_LightmapKeepPlain: 1
m_LightmapKeepDirCombined: 1
m_LightmapKeepDirSeparate: 1
m_LightmapKeepDynamicPlain: 1
m_LightmapKeepDynamicDirCombined: 1
m_LightmapKeepDynamicDirSeparate: 1
m_FogKeepLinear: 1
m_FogKeepExp: 1
m_FogKeepExp2: 1

Просмотреть файл

@ -0,0 +1,295 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!13 &1
InputManager:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Axes:
- serializedVersion: 3
m_Name: Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
altNegativeButton: a
altPositiveButton: d
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
altNegativeButton: s
altPositiveButton: w
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire1
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left ctrl
altNegativeButton:
altPositiveButton: mouse 0
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire2
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left alt
altNegativeButton:
altPositiveButton: mouse 1
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire3
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left shift
altNegativeButton:
altPositiveButton: mouse 2
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Jump
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: space
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Mouse X
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Mouse Y
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 1
joyNum: 0
- serializedVersion: 3
m_Name: Mouse ScrollWheel
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 2
joyNum: 0
- serializedVersion: 3
m_Name: Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0.19
sensitivity: 1
snap: 0
invert: 0
type: 2
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0.19
sensitivity: 1
snap: 0
invert: 1
type: 2
axis: 1
joyNum: 0
- serializedVersion: 3
m_Name: Fire1
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 0
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire2
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 1
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire3
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 2
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Jump
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 3
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Submit
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: return
altNegativeButton:
altPositiveButton: joystick button 0
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Submit
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: enter
altNegativeButton:
altPositiveButton: space
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Cancel
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: escape
altNegativeButton:
altPositiveButton: joystick button 1
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0

Просмотреть файл

@ -0,0 +1,71 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!126 &1
NavMeshProjectSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
areas:
- name: Walkable
cost: 1
- name: Not Walkable
cost: 1
- name: Jump
cost: 2
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1

Просмотреть файл

@ -0,0 +1,8 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!149 &1
NetworkManager:
m_ObjectHideFlags: 0
m_DebugLevel: 0
m_Sendrate: 15
m_AssetToPrefab: {}

Просмотреть файл

@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!19 &1
Physics2DSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Gravity: {x: 0, y: -9.81}
m_DefaultMaterial: {fileID: 0}
m_VelocityIterations: 8
m_PositionIterations: 3
m_VelocityThreshold: 1
m_MaxLinearCorrection: 0.2
m_MaxAngularCorrection: 8
m_MaxTranslationSpeed: 100
m_MaxRotationSpeed: 360
m_MinPenetrationForPenalty: 0.01
m_BaumgarteScale: 0.2
m_BaumgarteTimeOfImpactScale: 0.75
m_TimeToSleep: 0.5
m_LinearSleepTolerance: 0.01
m_AngularSleepTolerance: 2
m_QueriesHitTriggers: 1
m_QueriesStartInColliders: 1
m_ChangeStopsCallbacks: 0
m_AlwaysShowColliders: 0
m_ShowColliderSleep: 1
m_ShowColliderContacts: 0
m_ShowColliderAABB: 0
m_ContactArrowScale: 0.2
m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Просмотреть файл

@ -0,0 +1,477 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!129 &1
PlayerSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
productGUID: d718ca43eb1463e4293a6c8755a26c44
AndroidProfiler: 0
defaultScreenOrientation: 4
targetDevice: 2
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: DefaultCompany
productName: HoloLensVideoCaptureExample
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21176471, a: 1}
m_ShowUnitySplashScreen: 1
m_ShowUnitySplashLogo: 1
m_SplashScreenOverlayOpacity: 1
m_SplashScreenAnimation: 1
m_SplashScreenLogoStyle: 1
m_SplashScreenDrawMode: 0
m_SplashScreenBackgroundAnimationZoom: 1
m_SplashScreenLogoAnimationZoom: 1
m_SplashScreenBackgroundLandscapeAspect: 1
m_SplashScreenBackgroundPortraitAspect: 1
m_SplashScreenBackgroundLandscapeUvs:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
m_SplashScreenBackgroundPortraitUvs:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
m_SplashScreenLogos: []
m_SplashScreenBackgroundLandscape: {fileID: 0}
m_SplashScreenBackgroundPortrait: {fileID: 0}
m_VirtualRealitySplashScreen: {fileID: 0}
m_HolographicTrackingLossScreen: {fileID: 0}
defaultScreenWidth: 1024
defaultScreenHeight: 768
defaultScreenWidthWeb: 960
defaultScreenHeightWeb: 600
m_StereoRenderingPath: 0
m_ActiveColorSpace: 0
m_MTRendering: 1
m_MobileMTRendering: 0
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1
tizenShowActivityIndicatorOnLoading: -1
iosAppInBackgroundBehavior: 0
displayResolutionDialog: 1
iosAllowHTTPDownload: 1
allowedAutorotateToPortrait: 1
allowedAutorotateToPortraitUpsideDown: 1
allowedAutorotateToLandscapeRight: 1
allowedAutorotateToLandscapeLeft: 1
useOSAutorotation: 1
use32BitDisplayBuffer: 1
disableDepthAndStencilBuffers: 0
defaultIsFullScreen: 1
defaultIsNativeResolution: 1
runInBackground: 0
captureSingleScreen: 0
muteOtherAudioSources: 0
Prepare IOS For Recording: 0
submitAnalytics: 1
usePlayerLog: 1
bakeCollisionMeshes: 0
forceSingleInstance: 0
resizableWindow: 0
useMacAppStoreValidation: 0
gpuSkinning: 0
graphicsJobs: 0
xboxPIXTextureCapture: 0
xboxEnableAvatar: 0
xboxEnableKinect: 0
xboxEnableKinectAutoTracking: 0
xboxEnableFitness: 0
visibleInBackground: 0
allowFullscreenSwitch: 1
macFullscreenMode: 2
d3d9FullscreenMode: 1
d3d11FullscreenMode: 1
xboxSpeechDB: 0
xboxEnableHeadOrientation: 0
xboxEnableGuest: 0
xboxEnablePIXSampling: 0
n3dsDisableStereoscopicView: 0
n3dsEnableSharedListOpt: 1
n3dsEnableVSync: 0
uiUse16BitDepthBuffer: 0
ignoreAlphaClear: 0
xboxOneResolution: 0
xboxOneMonoLoggingLevel: 0
xboxOneLoggingLevel: 1
videoMemoryForVertexBuffers: 0
psp2PowerMode: 0
psp2AcquireBGM: 1
wiiUTVResolution: 0
wiiUGamePadMSAA: 1
wiiUSupportsNunchuk: 0
wiiUSupportsClassicController: 0
wiiUSupportsBalanceBoard: 0
wiiUSupportsMotionPlus: 0
wiiUSupportsProController: 0
wiiUAllowScreenCapture: 1
wiiUControllerCount: 0
m_SupportedAspectRatios:
4:3: 1
5:4: 1
16:10: 1
16:9: 1
Others: 1
bundleIdentifier: com.Company.ProductName
bundleVersion: 1.0
preloadedAssets: []
metroInputSource: 0
m_HolographicPauseOnTrackingLoss: 1
xboxOneDisableKinectGpuReservation: 0
protectGraphicsMemory: 0
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 9
AndroidPreferredInstallLocation: 1
aotOptions:
apiCompatibilityLevel: 2
stripEngineCode: 1
iPhoneStrippingLevel: 0
iPhoneScriptCallOptimization: 0
iPhoneBuildNumber: 0
ForceInternetPermission: 0
ForceSDCardPermission: 0
CreateWallpaper: 0
APKExpansionFiles: 0
preloadShaders: 0
StripUnusedMeshComponents: 0
VertexChannelCompressionMask:
serializedVersion: 2
m_Bits: 238
iPhoneSdkVersion: 988
iOSTargetOSVersionString:
tvOSSdkVersion: 0
tvOSRequireExtendedGameController: 0
tvOSTargetOSVersionString:
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIRequiresFullScreen: 1
uIStatusBarHidden: 1
uIExitOnSuspend: 0
uIStatusBarStyle: 0
iPhoneSplashScreen: {fileID: 0}
iPhoneHighResSplashScreen: {fileID: 0}
iPhoneTallHighResSplashScreen: {fileID: 0}
iPhone47inSplashScreen: {fileID: 0}
iPhone55inPortraitSplashScreen: {fileID: 0}
iPhone55inLandscapeSplashScreen: {fileID: 0}
iPadPortraitSplashScreen: {fileID: 0}
iPadHighResPortraitSplashScreen: {fileID: 0}
iPadLandscapeSplashScreen: {fileID: 0}
iPadHighResLandscapeSplashScreen: {fileID: 0}
appleTVSplashScreen: {fileID: 0}
tvOSSmallIconLayers: []
tvOSLargeIconLayers: []
tvOSTopShelfImageLayers: []
tvOSTopShelfImageWideLayers: []
iOSLaunchScreenType: 0
iOSLaunchScreenPortrait: {fileID: 0}
iOSLaunchScreenLandscape: {fileID: 0}
iOSLaunchScreenBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreenFillPct: 100
iOSLaunchScreenSize: 100
iOSLaunchScreenCustomXibPath:
iOSLaunchScreeniPadType: 0
iOSLaunchScreeniPadImage: {fileID: 0}
iOSLaunchScreeniPadBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreeniPadFillPct: 100
iOSLaunchScreeniPadSize: 100
iOSLaunchScreeniPadCustomXibPath:
iOSDeviceRequirements: []
iOSURLSchemes: []
iOSBackgroundModes: 0
iOSMetalForceHardShadows: 0
appleDeveloperTeamID:
iOSManualSigningProvisioningProfileID:
tvOSManualSigningProvisioningProfileID:
appleEnableAutomaticSigning: 0
AndroidTargetDevice: 0
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
AndroidKeystoreName:
AndroidKeyaliasName:
AndroidTVCompatibility: 1
AndroidIsGame: 1
androidEnableBanner: 1
m_AndroidBanners:
- width: 320
height: 180
banner: {fileID: 0}
androidGamepadSupportLevel: 0
resolutionDialogBanner: {fileID: 0}
m_BuildTargetIcons: []
m_BuildTargetBatching: []
m_BuildTargetGraphicsAPIs: []
m_BuildTargetVRSettings:
- m_BuildTarget: Metro
m_Enabled: 1
m_Devices:
- HoloLens
openGLRequireES31: 0
openGLRequireES31AEP: 0
webPlayerTemplate: APPLICATION:Default
m_TemplateCustomTags: {}
wiiUTitleID: 0005000011000000
wiiUGroupID: 00010000
wiiUCommonSaveSize: 4096
wiiUAccountSaveSize: 2048
wiiUOlvAccessKey: 0
wiiUTinCode: 0
wiiUJoinGameId: 0
wiiUJoinGameModeMask: 0000000000000000
wiiUCommonBossSize: 0
wiiUAccountBossSize: 0
wiiUAddOnUniqueIDs: []
wiiUMainThreadStackSize: 3072
wiiULoaderThreadStackSize: 1024
wiiUSystemHeapSize: 128
wiiUTVStartupScreen: {fileID: 0}
wiiUGamePadStartupScreen: {fileID: 0}
wiiUDrcBufferDisabled: 0
wiiUProfilerLibPath:
actionOnDotNetUnhandledException: 1
enableInternalProfiler: 0
logObjCUncaughtExceptions: 1
enableCrashReportAPI: 0
cameraUsageDescription:
locationUsageDescription:
microphoneUsageDescription:
XboxTitleId:
XboxImageXexPath:
XboxSpaPath:
XboxGenerateSpa: 0
XboxDeployKinectResources: 0
XboxSplashScreen: {fileID: 0}
xboxEnableSpeech: 0
xboxAdditionalTitleMemorySize: 0
xboxDeployKinectHeadOrientation: 0
xboxDeployKinectHeadPosition: 0
ps4NPAgeRating: 12
ps4NPTitleSecret:
ps4NPTrophyPackPath:
ps4ParentalLevel: 1
ps4ContentID: ED1633-NPXX51362_00-0000000000000000
ps4Category: 0
ps4MasterVersion: 01.00
ps4AppVersion: 01.00
ps4AppType: 0
ps4ParamSfxPath:
ps4VideoOutPixelFormat: 0
ps4VideoOutInitialWidth: 1920
ps4VideoOutBaseModeInitialWidth: 1920
ps4VideoOutReprojectionRate: 120
ps4PronunciationXMLPath:
ps4PronunciationSIGPath:
ps4BackgroundImagePath:
ps4StartupImagePath:
ps4SaveDataImagePath:
ps4SdkOverride:
ps4BGMPath:
ps4ShareFilePath:
ps4ShareOverlayImagePath:
ps4PrivacyGuardImagePath:
ps4NPtitleDatPath:
ps4RemotePlayKeyAssignment: -1
ps4RemotePlayKeyMappingDir:
ps4PlayTogetherPlayerCount: 0
ps4EnterButtonAssignment: 1
ps4ApplicationParam1: 0
ps4ApplicationParam2: 0
ps4ApplicationParam3: 0
ps4ApplicationParam4: 0
ps4DownloadDataSize: 0
ps4GarlicHeapSize: 2048
ps4ProGarlicHeapSize: 2560
ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ
ps4UseDebugIl2cppLibs: 0
ps4pnSessions: 1
ps4pnPresence: 1
ps4pnFriends: 1
ps4pnGameCustomData: 1
playerPrefsSupport: 0
restrictedAudioUsageRights: 0
ps4UseResolutionFallback: 0
ps4ReprojectionSupport: 0
ps4UseAudio3dBackend: 0
ps4SocialScreenEnabled: 0
ps4ScriptOptimizationLevel: 3
ps4Audio3dVirtualSpeakerCount: 14
ps4attribCpuUsage: 0
ps4PatchPkgPath:
ps4PatchLatestPkgPath:
ps4PatchChangeinfoPath:
ps4PatchDayOne: 0
ps4attribUserManagement: 0
ps4attribMoveSupport: 0
ps4attrib3DSupport: 0
ps4attribShareSupport: 0
ps4attribExclusiveVR: 0
ps4disableAutoHideSplash: 0
ps4videoRecordingFeaturesUsed: 0
ps4contentSearchFeaturesUsed: 0
ps4attribEyeToEyeDistanceSettingVR: 0
ps4IncludedModules: []
monoEnv:
psp2Splashimage: {fileID: 0}
psp2NPTrophyPackPath:
psp2NPSupportGBMorGJP: 0
psp2NPAgeRating: 12
psp2NPTitleDatPath:
psp2NPCommsID:
psp2NPCommunicationsID:
psp2NPCommsPassphrase:
psp2NPCommsSig:
psp2ParamSfxPath:
psp2ManualPath:
psp2LiveAreaGatePath:
psp2LiveAreaBackroundPath:
psp2LiveAreaPath:
psp2LiveAreaTrialPath:
psp2PatchChangeInfoPath:
psp2PatchOriginalPackage:
psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui
psp2KeystoneFile:
psp2MemoryExpansionMode: 0
psp2DRMType: 0
psp2StorageType: 0
psp2MediaCapacity: 0
psp2DLCConfigPath:
psp2ThumbnailPath:
psp2BackgroundPath:
psp2SoundPath:
psp2TrophyCommId:
psp2TrophyPackagePath:
psp2PackagedResourcesPath:
psp2SaveDataQuota: 10240
psp2ParentalLevel: 1
psp2ShortTitle: Not Set
psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF
psp2Category: 0
psp2MasterVersion: 01.00
psp2AppVersion: 01.00
psp2TVBootMode: 0
psp2EnterButtonAssignment: 2
psp2TVDisableEmu: 0
psp2AllowTwitterDialog: 1
psp2Upgradable: 0
psp2HealthWarning: 0
psp2UseLibLocation: 0
psp2InfoBarOnStartup: 0
psp2InfoBarColor: 0
psp2UseDebugIl2cppLibs: 0
psmSplashimage: {fileID: 0}
splashScreenBackgroundSourceLandscape: {fileID: 0}
splashScreenBackgroundSourcePortrait: {fileID: 0}
spritePackerPolicy:
webGLMemorySize: 256
webGLExceptionSupport: 1
webGLDataCaching: 0
webGLDebugSymbols: 0
webGLEmscriptenArgs:
webGLModulesDirectory:
webGLTemplate: APPLICATION:Default
webGLAnalyzeBuildSize: 0
webGLUseEmbeddedResources: 0
webGLUseWasm: 0
webGLCompressionFormat: 1
scriptingDefineSymbols:
14:
platformArchitecture: {}
scriptingBackend: {}
incrementalIl2cppBuild: {}
additionalIl2CppArgs:
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: HoloLensVideoCaptureExample
metroPackageVersion:
metroCertificatePath: Assets\WSATestCertificate.pfx
metroCertificatePassword:
metroCertificateSubject: DefaultCompany
metroCertificateIssuer: DefaultCompany
metroCertificateNotAfter: 003c475808ced301
metroApplicationDescription: HoloLensVideoCaptureExample
wsaImages: {}
metroTileShortName:
metroCommandLineArgsFile:
metroTileShowName: 0
metroMediumTileShowName: 0
metroLargeTileShowName: 0
metroWideTileShowName: 0
metroDefaultTileSize: 1
metroTileForegroundText: 2
metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628,
a: 1}
metroSplashScreenUseBackgroundColor: 0
platformCapabilities:
WindowsStoreApps:
InternetClient: True
Microphone: True
SpatialPerception: True
WebCam: True
metroFTAName:
metroFTAFileTypes: []
metroProtocolName:
metroCompilationOverrides: 1
tizenProductDescription:
tizenProductURL:
tizenSigningProfileName:
tizenGPSPermissions: 0
tizenMicrophonePermissions: 0
tizenDeploymentTarget:
tizenDeploymentTargetType: 0
tizenMinOSVersion: 0
n3dsUseExtSaveData: 0
n3dsCompressStaticMem: 1
n3dsExtSaveDataNumber: 0x12345
n3dsStackSize: 131072
n3dsTargetPlatform: 2
n3dsRegion: 7
n3dsMediaSize: 0
n3dsLogoStyle: 3
n3dsTitle: GameName
n3dsProductCode:
n3dsApplicationId: 0xFF3FF
stvDeviceAddress:
stvProductDescription:
stvProductAuthor:
stvProductAuthorEmail:
stvProductLink:
stvProductCategory: 0
XboxOneProductId:
XboxOneUpdateKey:
XboxOneSandboxId:
XboxOneContentId:
XboxOneTitleId:
XboxOneSCId:
XboxOneGameOsOverridePath:
XboxOnePackagingOverridePath:
XboxOneAppManifestOverridePath:
XboxOnePackageEncryption: 0
XboxOnePackageUpdateGranularity: 2
XboxOneDescription:
XboxOneLanguage:
- enus
XboxOneCapability: []
XboxOneGameRating: {}
XboxOneIsContentPackage: 0
XboxOneEnableGPUVariability: 0
XboxOneSockets: {}
XboxOneSplashScreen: {fileID: 0}
XboxOneAllowedProductIds: []
XboxOnePersistentLocalStorageSize: 0
vrEditorSettings: {}
cloudServicesEnabled: {}
cloudProjectId:
projectName:
organizationId:
cloudEnabled: 0

Просмотреть файл

@ -0,0 +1 @@
m_EditorVersion: 5.5.1f1

Просмотреть файл

@ -0,0 +1,180 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!47 &1
QualitySettings:
m_ObjectHideFlags: 0
serializedVersion: 5
m_CurrentQuality: 5
m_QualitySettings:
- serializedVersion: 2
name: Fastest
pixelLightCount: 0
shadows: 0
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 15
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
blendWeights: 1
textureQuality: 1
anisotropicTextures: 0
antiAliasing: 0
softParticles: 0
softVegetation: 0
realtimeReflectionProbes: 0
billboardsFaceCameraPosition: 0
vSyncCount: 0
lodBias: 0.3
maximumLODLevel: 0
particleRaycastBudget: 4
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
excludedTargetPlatforms: []
- serializedVersion: 2
name: Fast
pixelLightCount: 0
shadows: 0
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 20
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
blendWeights: 2
textureQuality: 0
anisotropicTextures: 0
antiAliasing: 0
softParticles: 0
softVegetation: 0
realtimeReflectionProbes: 0
billboardsFaceCameraPosition: 0
vSyncCount: 0
lodBias: 0.4
maximumLODLevel: 0
particleRaycastBudget: 16
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
excludedTargetPlatforms: []
- serializedVersion: 2
name: Simple
pixelLightCount: 1
shadows: 1
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 20
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
blendWeights: 2
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
softParticles: 0
softVegetation: 0
realtimeReflectionProbes: 0
billboardsFaceCameraPosition: 0
vSyncCount: 1
lodBias: 0.7
maximumLODLevel: 0
particleRaycastBudget: 64
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
excludedTargetPlatforms: []
- serializedVersion: 2
name: Good
pixelLightCount: 2
shadows: 2
shadowResolution: 1
shadowProjection: 1
shadowCascades: 2
shadowDistance: 40
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
blendWeights: 2
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
softParticles: 0
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
lodBias: 1
maximumLODLevel: 0
particleRaycastBudget: 256
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
excludedTargetPlatforms: []
- serializedVersion: 2
name: Beautiful
pixelLightCount: 3
shadows: 2
shadowResolution: 2
shadowProjection: 1
shadowCascades: 2
shadowDistance: 70
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
blendWeights: 4
textureQuality: 0
anisotropicTextures: 2
antiAliasing: 2
softParticles: 1
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
lodBias: 1.5
maximumLODLevel: 0
particleRaycastBudget: 1024
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
excludedTargetPlatforms: []
- serializedVersion: 2
name: Fantastic
pixelLightCount: 4
shadows: 2
shadowResolution: 2
shadowProjection: 1
shadowCascades: 4
shadowDistance: 150
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
blendWeights: 4
textureQuality: 0
anisotropicTextures: 2
antiAliasing: 2
softParticles: 1
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
lodBias: 2
maximumLODLevel: 0
particleRaycastBudget: 4096
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
excludedTargetPlatforms: []
m_PerPlatformDefaultQuality:
Android: 2
Nintendo 3DS: 5
PS4: 5
PSM: 5
PSP2: 2
Samsung TV: 2
Standalone: 5
Tizen: 2
Web: 5
WebGL: 3
WiiU: 5
Windows Store Apps: 0
XboxOne: 5
iPhone: 2
tvOS: 5

Просмотреть файл

@ -0,0 +1,44 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!78 &1
TagManager:
serializedVersion: 2
tags:
- Tip
layers:
- Default
- TransparentFX
- Ignore Raycast
-
- Water
- UI
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
m_SortingLayers:
- name: Default
uniqueID: 0
locked: 0

Просмотреть файл

@ -0,0 +1,9 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!5 &1
TimeManager:
m_ObjectHideFlags: 0
Fixed Timestep: 0.02
Maximum Allowed Timestep: 0.33333334
m_TimeScale: 1
Maximum Particle Timestep: 0.03

Просмотреть файл

@ -0,0 +1,29 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!310 &1
UnityConnectSettings:
m_ObjectHideFlags: 0
m_Enabled: 0
m_TestMode: 0
m_TestEventUrl:
m_TestConfigUrl:
CrashReportingSettings:
m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes
m_Enabled: 0
m_CaptureEditorExceptions: 1
UnityPurchasingSettings:
m_Enabled: 0
m_TestMode: 0
UnityAnalyticsSettings:
m_Enabled: 0
m_InitializeOnStartup: 1
m_TestMode: 0
m_TestEventUrl:
m_TestConfigUrl:
UnityAdsSettings:
m_Enabled: 0
m_InitializeOnStartup: 1
m_TestMode: 0
m_EnabledPlatforms: 4294967295
m_IosGameId:
m_AndroidGameId:

201
LICENSE Normal file
Просмотреть файл

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2017 Vulcan, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

54
README.md Normal file
Просмотреть файл

@ -0,0 +1,54 @@
# HoloLensCameraStream for Unity
This Unity plugin makes the HoloLens video camera frames available to a Unity app in real time. This enables Unity devs to easily use the HoloLens camera for computer vision (or anything they want).
Use this if you need access to the HoloLens camera's frame buffer in Unity (including, soon, the locatable camera attributes).
## With this plugin, you can
* Do computer vision and machine learning on the frames in real time. (algorithms not included)
* Show a preview of what the HoloLens camera sees.
* Selectively save frames to disk, or send them to a server.
* Do whatever you want with the HoloLens camera.
## Getting Started
The tutorials below will show you how to **build the plugin (DLL)** or run the **Unity sample app**.
### What's in this repository
There are two separate "solutions" (if you will) in this repository:
* **The Plugin (HoloLensCameraStream/)** - This is a Video Studio solution that builds the Unity Plugin, which is just a DLL (library file). You can drop this DLL into a Unity project (in the appropriate directory) and then use its public methods, properties, and events from Unity.
* **The Unity example project (HoloLensVideoCaptureExample)/** - This shows you how to use the HoloLensCameraStream plugin in a Unity project. You can build it and run it on the HoloLens, or copy it and use it as a starter template for your own project.
### Things you need
* Unity (We compile against 5.5.1f1)
* Visual Studio (We compiled against 2015 Update 3)
* [The HoloLens development tools](https://developer.microsoft.com/en-us/windows/mixed-reality/install_the_tools)
### Building the Plugin
The plugin solution has two projects. One is the actual library project, and the other is a "dummy" or "placeholder" project that is used to keep the Unity editor from complaining ([more info here](https://docs.unity3d.com/Manual/windowsstore-plugins.html)). The placeholder project doesn't do anything, it just mimics the plugin's public API. To build the solution (including both projects), follow the steps below:
1. **Clone this repository.**
2. **Open the HoloLensCameraStream solution in Visual Studio.** It lives in `HoloLensCameraStream/HoloLensCameraStream/HoloLensCameraStream.sln`.
3. **Build the solution** In the VS menu, select **Build > Build Solution**. *Note: Make sure Visual Studio is set up to download missing NuGet packages, or you will get a spew of errors about missing namespaces.*
4. That's all! This will produce two DLLs, one is the real DLL, and the other is the "placeholder" described above.
### Integrating the plugin into a Unity project
If you made some changes to the plugin project, and you want to use your newly-built DLLs, follow these steps. If you haven't made changes to the plugin, but just want to learn how to *use the CameraStream plugin in Unity*, skip this part and read instead about running the example project.
1. **Find the DLLs you just build:** Look in the output window after you build the plugin solution. You will see two paths to the newly-build DLLs. Navigate to them.
2. **Paste the plugin DLL into Unity:** Copy the plugin DLL from the output directory and paste it into the your Unity app. It must be pasted into the `Assets/Plugins/WSA/` directory in your Unity project because it will only compile for WSA devices.
3. **Paste the placeholder DLL into Unity:** Copy the placeholder (dummy) DLL from its output directory and paste it into your Unity app. It must be in the `Assets/Plugins/` directory in your Unity project. This is the DLL that the Unity editor compiles against uses while you're coding in Unity.
4. **Edit the plugin's settings:** In the Unity editor, select the ``HoloLensCameraStream.dll plugin file that you pasted in step 2. In the inspector, uncheck all platforms except `WSAPlayer`. Set the SDK to `UWP`, and set the Scripting Backend to `Dot Net`. In the Placeholder dropdown, select the `HoloLensCameraStream.dll` option (it will likely be the only option).
5. **Click Apply.**
6. **Edit the placeholder plugin's settings:** Select the placeholder (dummy) plugin in `Assets/Plugins/HoloLensCameraStream.dll`. Uncheck all platforms except `Editor`.
7. **Click Apply.**
You should now be able to code against the HoloLensCameraStream plugin after importing said namespace in your Unity scripts. *Note: Your Unity project needs to be [appropriately configured for HoloLens development](https://developer.microsoft.com/en-us/windows/mixed-reality/holograms_100).*
### Running the example Unity project
The example Unity project can be found in the root `HoloLensVideoCaptureExample/` directory. This Unity project is a great way to learn how to use the CameraStream plugin in Unity, or to use as a template for your own Unity project. Read on to learn how to build and run the example project on your HoloLens. You should be familiar with creating and configuring a new Unity-HoloLens project [according to Microsoft's instructions](https://developer.microsoft.com/en-us/windows/mixed-reality/holograms_100). As Microsoft and Unity update their HoloLens documentation, I'm sure this tutorial will become out of date.
1. **Open the example project:** Navigate to and open the example project directory (`HoloLensVideoCaptureExample/`) in Unity.
2. **Configure build settings:** Once the project opens, select **File > Build Settings**. In the Platform list, select `Windows Store`. Set the SDK to `Universal 10`; set Target device to `HoloLens`; set UWP Build Type to `D3D`; check the Unity C# Projects checkbox; and finally, click **Switch Platform**.
3. **Build the project:** You can now build the Unity project, which generates a Visual Studio Solution (which you will then have to also build). In the Build window, click Build. In the explorer window that appears, make a new folder called `App`, which should live as a sibling next to the 'Assets` folder. Then click Select Folder to generate the VS solution in that folder. Then wait for Unity to build the solution.
4. **Open the VS Solution:** When the solution is build, a Windows explorer folder will open. Open the newly-built VS solution, which lives in 'App/HoloLensVideoCaptureExample.sln`. This is the solution that ultimately gets deployed to your HoloLens.
5. **Configure the deploy settings:** In the Visual Studio toolbar, change the solution platform from `ARM` to `x86`; Change the deploy target (the green play button) to `Device` (if your HoloLens is plugged into your computer), or 'Remote Machine' (if your HoloLens is connected via WiFi).
6. **Run the app:** Go to **Debug > Start Debugging**. Once the app is deployed to the HoloLens, you should see some confirmation output in the Output window.
## Contributing
We would love for you to contribute to this project. Take a look at the TODO list in the Plugin's solution, or look at the Issues tab on GitHub to see how you can contribute. Thanks, enjoy!