├── .gitattributes ├── .gitignore ├── Client ├── App.xaml ├── App.xaml.cs ├── Assets │ ├── Logo.scale-100.png │ ├── Microphone-100.png │ ├── No Microphone-100.png │ ├── No Selfie-100.png │ ├── No Video-100.png │ ├── Phone Disconnected-100.png │ ├── Phone-100.png │ ├── Selfie-100.png │ ├── Settings-100.png │ ├── SmallLogo.scale-100.png │ ├── SplashScreen.scale-100.png │ ├── SplashScreen.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── StoreLogo.png │ ├── Video-100.png │ └── WideLogo.scale-100.png ├── MVVM │ ├── BindableBase.cs │ └── DispatcherBindableBase.cs ├── Main │ ├── MainPage.xaml │ └── MainPage.xaml.cs ├── Model │ ├── IceServer.cs │ └── Peer.cs ├── Ortc-Required │ ├── AutoLock.cs │ ├── Helper.cs │ ├── Media.cs │ ├── MediaDevice.cs │ ├── ORTCStatsManager.cs │ └── WebRTC.cs ├── Package.Ortc.appxmanifest ├── Package.WebRtc.appxmanifest ├── PeerConnectionClient.Ortc.csproj ├── PeerConnectionClient.Ortc_TemporaryKey.pfx ├── PeerConnectionClient.WebRtc.csproj ├── PeerConnectionClient.WebRtc_TemporaryKey.pfx ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml ├── Utilities │ ├── ActionCommand.cs │ ├── BoolToVisConverter.cs │ ├── InvertedBooleanConverter.cs │ ├── NtpService.cs │ ├── NullToVisibleConverter.cs │ ├── SdpUtils.cs │ ├── ToggleImageConverter.cs │ ├── UI │ │ ├── ErrorControl.xaml │ │ └── ErrorControl.xaml.cs │ ├── ValidableBase.cs │ ├── ValidableIntegerString.cs │ ├── ValidableNonEmptyString.cs │ └── VideoCaptureFormat.cs ├── ViewModels │ └── MainViewModel.cs ├── config.txt └── ecc-key.p12 ├── ClientCore ├── Config.cs ├── PeerConnectionClientCore.csproj ├── PeerConnectionClientUnityCore.csproj ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml ├── Signalling │ ├── Conductor.cs │ └── Signalling.cs ├── Stats │ ├── PeerConnectionStateChange.cs │ ├── StatsController.cs │ └── WebRtcStats.cs └── Utilities │ ├── AppPerf.cs │ ├── SdpUtils.cs │ └── XmlSerializer.cs ├── ClientUnity ├── Assets │ ├── Materials.meta │ ├── Materials │ │ ├── CursorMaterial.mat │ │ ├── CursorMaterial.mat.meta │ │ ├── Default.mat │ │ ├── Default.mat.meta │ │ ├── EyeEffectShader.shader │ │ ├── EyeEffectShader.shader.meta │ │ ├── EyeMaterial.mat │ │ └── EyeMaterial.mat.meta │ ├── Models.meta │ ├── Models │ │ ├── Cursor.fbx │ │ └── Cursor.fbx.meta │ ├── Plugins.meta │ ├── Plugins │ │ ├── WSA.meta │ │ └── WSA │ │ │ ├── PeerConnectionClientCore.dll.meta │ │ │ ├── PeerConnectionClientCore.pdb.meta │ │ │ ├── x86.meta │ │ │ └── x86 │ │ │ ├── MediaEngineUWP.dll.meta │ │ │ ├── MediaEngineUWP.pdb.meta │ │ │ ├── Org.WebRtc.dll.meta │ │ │ ├── Org.WebRtc.pdb.meta │ │ │ ├── Org.WebRtc.winmd.meta │ │ │ ├── WebRtcScheme.dll.meta │ │ │ ├── WebRtcScheme.pdb.meta │ │ │ └── WebRtcScheme.winmd.meta │ ├── Prefabs.meta │ ├── Prefabs │ │ ├── TextItemPreftab.prefab │ │ └── TextItemPreftab.prefab.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── PeerCCScene.unity │ │ └── PeerCCScene.unity.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── ControlScript.cs │ │ ├── ControlScript.cs.meta │ │ ├── GazeGestureManager.cs │ │ ├── GazeGestureManager.cs.meta │ │ ├── MouseLook.cs │ │ ├── MouseLook.cs.meta │ │ ├── WorldCursor.cs │ │ └── WorldCursor.cs.meta │ ├── Textures.meta │ ├── Textures │ │ ├── eyeTexture.png │ │ ├── eyeTexture.png.meta │ │ ├── webrtc-logo.png │ │ └── webrtc-logo.png.meta │ ├── WSATestCertificate.pfx │ └── WSATestCertificate.pfx.meta └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ └── XRSettings.asset ├── MediaEnginePlayerPlugin ├── .gitignore ├── MediaEngineUWP │ ├── Shared │ │ ├── MediaEngine.cpp │ │ ├── MediaEngine.h │ │ ├── MediaEnginePlayer.cpp │ │ ├── MediaEnginePlayer.h │ │ ├── MediaHelpers.cpp │ │ ├── MediaHelpers.h │ │ ├── Shared.vcxitems │ │ ├── Shared.vcxitems.filters │ │ ├── Unity │ │ │ ├── IUnityGraphics.h │ │ │ ├── IUnityGraphicsD3D11.h │ │ │ ├── IUnityGraphicsD3D12.h │ │ │ ├── IUnityGraphicsD3D9.h │ │ │ ├── IUnityGraphicsMetal.h │ │ │ ├── IUnityInterface.h │ │ │ └── PlatformBase.h │ │ ├── d3dmanagerlock.hxx │ │ ├── dllmain.cpp │ │ └── targetver.h │ └── UWP │ │ ├── MediaEngineUWP.vcxproj │ │ ├── MediaEngineUWP.vcxproj.filters │ │ └── MediaPlayback.def └── WebRtcScheme │ ├── SchemeHandler.cpp │ ├── SchemeHandler.h │ ├── WebRtcScheme.vcxproj │ └── WebRtcScheme.vcxproj.filters ├── Org.WebRtc.Callstats ├── CallStats.cs ├── CallStatsClient.cs ├── Org.WebRtc.Callstats.csproj ├── Request │ ├── ApplicationErrorLogsData.cs │ ├── BridgeAliveData.cs │ ├── BridgeStatisticsData.cs │ ├── ConferenceStatsSubmissionData.cs │ ├── ConferenceUserFeedbackData.cs │ ├── ConnectedOrActiveDevicesData.cs │ ├── CreateConferenceData.cs │ ├── DominantSpeakerData.cs │ ├── FabricActionData.cs │ ├── FabricDroppedData.cs │ ├── FabricSetupData.cs │ ├── FabricSetupFailedData.cs │ ├── FabricStateChangeData.cs │ ├── FabricTerminatedData.cs │ ├── FabricTransportChangeData.cs │ ├── IceAbortedData.cs │ ├── IceCandidate.cs │ ├── IceCandidatePair.cs │ ├── IceConnectionDisruptionEndData.cs │ ├── IceConnectionDisruptionStartData.cs │ ├── IceDisruptionEndData.cs │ ├── IceDisruptionStartData.cs │ ├── IceFailedData.cs │ ├── IceRestartData.cs │ ├── IceTerminatedData.cs │ ├── MediaActionData.cs │ ├── MediaPlaybackData.cs │ ├── SDPEventData.cs │ ├── SSRCMapData.cs │ ├── SystemStatusStatsSubmissionData.cs │ ├── UserAliveData.cs │ ├── UserDetailsData.cs │ └── UserLeftData.cs └── Response │ ├── AuthenticationResponse.cs │ └── ConferenceResponse.cs └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | packages/ 4 | *.suo 5 | *.csproj.user 6 | project.lock.json 7 | *.sdf 8 | *.bak 9 | ClientUnity/Assets/Plugins/WSA/*.dll 10 | ClientUnity/Assets/Plugins/WSA/*.pdb 11 | ClientUnity/Assets/Plugins/WSA/x86/*.dll 12 | ClientUnity/Assets/Plugins/WSA/x86/*.winmd 13 | ClientUnity/Assets/Plugins/WSA/x86/*.pdb 14 | ClientUnity/Assets/Plugins/WSA/x64/*.dll 15 | ClientUnity/Assets/Plugins/WSA/x64/*.winmd 16 | ClientUnity/Assets/Plugins/WSA/x64/*.pdb 17 | ClientUnity/Assets/Plugins/WSA/arm/*.dll 18 | ClientUnity/Assets/Plugins/WSA/arm/*.winmd 19 | ClientUnity/Assets/Plugins/WSA/arm/*.pdb 20 | ClientUnity/Library 21 | ClientUnity/*.sln 22 | ClientUnity/*.csproj 23 | ClientUnity/.vs 24 | ClientUnity/Temp 25 | -------------------------------------------------------------------------------- /Client/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /Client/Assets/Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/Logo.scale-100.png -------------------------------------------------------------------------------- /Client/Assets/Microphone-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/Microphone-100.png -------------------------------------------------------------------------------- /Client/Assets/No Microphone-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/No Microphone-100.png -------------------------------------------------------------------------------- /Client/Assets/No Selfie-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/No Selfie-100.png -------------------------------------------------------------------------------- /Client/Assets/No Video-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/No Video-100.png -------------------------------------------------------------------------------- /Client/Assets/Phone Disconnected-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/Phone Disconnected-100.png -------------------------------------------------------------------------------- /Client/Assets/Phone-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/Phone-100.png -------------------------------------------------------------------------------- /Client/Assets/Selfie-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/Selfie-100.png -------------------------------------------------------------------------------- /Client/Assets/Settings-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/Settings-100.png -------------------------------------------------------------------------------- /Client/Assets/SmallLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/SmallLogo.scale-100.png -------------------------------------------------------------------------------- /Client/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /Client/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /Client/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /Client/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /Client/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /Client/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/StoreLogo.png -------------------------------------------------------------------------------- /Client/Assets/Video-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/Video-100.png -------------------------------------------------------------------------------- /Client/Assets/WideLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/Assets/WideLogo.scale-100.png -------------------------------------------------------------------------------- /Client/MVVM/BindableBase.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | using System.ComponentModel; 14 | using System.Linq.Expressions; 15 | using System.Reflection; 16 | using System.Runtime.CompilerServices; 17 | 18 | namespace PeerConnectionClient.MVVM 19 | { 20 | /// 21 | /// The BindableBase class of the MVVM pattern. 22 | /// 23 | public abstract class BindableBase : INotifyPropertyChanged 24 | { 25 | public event PropertyChangedEventHandler PropertyChanged; 26 | 27 | /// 28 | /// Checks if a property already matches a desired value. Sets the property and notifies listeners only when necessary. 29 | /// 30 | /// The type of the property. 31 | /// Reference to a property with both getter and setter. 32 | /// Desired value for the property. 33 | /// Name of the property used to notify listeners. 34 | /// True if the value was changed, false if the existing value matched the desired value. 35 | protected virtual bool SetProperty(ref T storage, T value, [CallerMemberName] string propertyName = null) 36 | { 37 | if (Equals(storage, value)) 38 | { 39 | return false; 40 | } 41 | storage = value; 42 | OnPropertyChanged(propertyName); 43 | return true; 44 | } 45 | 46 | /// 47 | /// Notifies listeners that a property value has changed. 48 | /// 49 | /// Name of the property used to notify listeners. 50 | protected virtual void OnPropertyChanged(string propertyName) 51 | { 52 | var changedEventHandler = PropertyChanged; 53 | if (changedEventHandler == null) 54 | { 55 | return; 56 | } 57 | changedEventHandler(this, new PropertyChangedEventArgs(propertyName)); 58 | } 59 | 60 | /// 61 | /// Raises this object's PropertyChanged event. 62 | /// 63 | /// The type of the property that has a new value. 64 | /// A Lambda expression representing the property that has a new value. 65 | protected void OnPropertyChanged(Expression> propertyExpression) 66 | { 67 | OnPropertyChanged(GetPropertyName(propertyExpression)); 68 | } 69 | 70 | /// 71 | /// Returns the name of a property identified by a lambda expression. 72 | /// 73 | /// The type of the property 74 | /// A lambda expression selecting the property. 75 | /// The name of the property accessed by expression. 76 | private static string GetPropertyName(Expression> propertyExpression) 77 | { 78 | if (propertyExpression == null) 79 | { 80 | throw new ArgumentNullException("propertyExpression"); 81 | } 82 | 83 | var memberExpression = propertyExpression.Body as MemberExpression; 84 | if (memberExpression == null) 85 | { 86 | throw new ArgumentException("propertyExpression"); 87 | } 88 | 89 | var propertyInfo = memberExpression.Member as PropertyInfo; 90 | if (propertyInfo == null) 91 | { 92 | throw new ArgumentException("propertyExpression"); 93 | } 94 | 95 | if (propertyInfo.GetMethod.IsStatic) 96 | { 97 | throw new ArgumentException("propertyExpression"); 98 | } 99 | 100 | return memberExpression.Member.Name; 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /Client/MVVM/DispatcherBindableBase.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | using Windows.UI.Core; 14 | 15 | namespace PeerConnectionClient.MVVM 16 | { 17 | /// 18 | /// Provides ability to run the UI updates in UI thread. 19 | /// 20 | public abstract class DispatcherBindableBase : BindableBase 21 | { 22 | // The UI dispatcher 23 | private readonly CoreDispatcher _uiDispatcher; 24 | 25 | /// 26 | /// Creates a DispatcherBindableBase instance. 27 | /// 28 | /// Core event message dispatcher. 29 | protected DispatcherBindableBase(CoreDispatcher uiDispatcher) 30 | { 31 | _uiDispatcher = uiDispatcher; 32 | } 33 | 34 | /// 35 | /// Overrides the BindableBase's OnPropertyChanged method. 36 | /// 37 | /// The name of the changed property. 38 | protected override void OnPropertyChanged(string propertyName) 39 | { 40 | RunOnUiThread(()=> base.OnPropertyChanged(propertyName)); 41 | } 42 | 43 | /// 44 | /// Schedules the provided callback on the UI thread from a worker thread, and 45 | // returns the results asynchronously. 46 | /// 47 | /// The function to execute 48 | protected void RunOnUiThread(Action fn) 49 | { 50 | var asyncOp = _uiDispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(fn)); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Client/Main/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using PeerConnectionClient.ViewModels; 13 | using System; 14 | using System.Collections.Generic; 15 | using System.IO; 16 | using System.Linq; 17 | using System.Runtime.InteropServices.WindowsRuntime; 18 | using Windows.Foundation; 19 | using Windows.Foundation.Collections; 20 | using Windows.UI.Xaml; 21 | using Windows.UI.Xaml.Controls; 22 | using Windows.UI.Xaml.Controls.Primitives; 23 | using Windows.UI.Xaml.Data; 24 | using Windows.UI.Xaml.Input; 25 | using Windows.UI.Xaml.Media; 26 | using Windows.UI.Xaml.Navigation; 27 | 28 | namespace PeerConnectionClient 29 | { 30 | /// 31 | /// The application main page. 32 | /// 33 | public sealed partial class MainPage : Page 34 | { 35 | private MainViewModel _mainViewModel; 36 | 37 | /// 38 | /// Constructor. 39 | /// 40 | public MainPage() 41 | { 42 | this.InitializeComponent(); 43 | } 44 | 45 | /// 46 | /// See Page.OnNavigatedTo() 47 | /// 48 | protected override void OnNavigatedTo(NavigationEventArgs e) 49 | { 50 | _mainViewModel = (MainViewModel)e.Parameter; 51 | this.DataContext = _mainViewModel; 52 | _mainViewModel.PeerVideo = PeerVideo; 53 | _mainViewModel.SelfVideo = SelfVideo; 54 | } 55 | 56 | /// 57 | /// Invoked when the Add button is clicked 58 | /// 59 | /// The object where the handler is attached. 60 | /// Details about the exception routed event. 61 | private void ConfirmAddButton_Click(object sender, RoutedEventArgs e) 62 | { 63 | this.AddButton.Flyout.Hide(); 64 | } 65 | 66 | /// 67 | /// Media Failed event handler for remote/peer video. 68 | /// Invoked when an error occurs in peer media source. 69 | /// 70 | /// The object where the handler is attached. 71 | /// Details about the exception routed event. 72 | private void PeerVideo_MediaFailed(object sender, Windows.UI.Xaml.ExceptionRoutedEventArgs e) 73 | { 74 | if(_mainViewModel!=null) 75 | { 76 | _mainViewModel.PeerVideo_MediaFailed(sender, e); 77 | } 78 | } 79 | 80 | /// 81 | /// Media Failed event handler for self video. 82 | /// Invoked when an error occurs in self media source. 83 | /// 84 | /// The object where the handler is attached. 85 | /// Details about the exception routed event. 86 | private void SelfVideo_MediaFailed(object sender, Windows.UI.Xaml.ExceptionRoutedEventArgs e) 87 | { 88 | if (_mainViewModel != null) 89 | { 90 | _mainViewModel.SelfVideo_MediaFailed(sender, e); 91 | } 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Client/Model/IceServer.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel; 15 | using System.Linq; 16 | using System.Xml.Serialization; 17 | using PeerConnectionClient.MVVM; 18 | using PeerConnectionClient.Utilities; 19 | 20 | namespace PeerConnectionClient.Model 21 | { 22 | /// 23 | /// Class represents an Ice server 24 | /// 25 | public class IceServer : BindableBase 26 | { 27 | /// 28 | /// Default constructor for Ice server. 29 | /// 30 | public IceServer() : this(string.Empty, ServerType.STUN) 31 | { 32 | } 33 | 34 | /// 35 | /// Creates an Ice server with specified host, port and server type. 36 | /// 37 | /// The host name of the Ice server. 38 | /// The type of the Ice server. 39 | public IceServer(string host, ServerType type) 40 | { 41 | Host.PropertyChanged += ValidableProperties_PropertyChanged; 42 | Host.Value = host; 43 | Type = type; 44 | } 45 | 46 | public enum ServerType { STUN, TURN }; 47 | 48 | /// 49 | /// Make the enumerable available in XAML. 50 | /// 51 | [XmlIgnore] 52 | public IEnumerable Types 53 | { 54 | get 55 | { 56 | return Enum.GetValues(typeof(ServerType)).Cast(); 57 | } 58 | } 59 | 60 | protected ServerType _type; 61 | 62 | /// 63 | /// Ice server type property. 64 | /// 65 | public ServerType Type 66 | { 67 | get 68 | { 69 | return _type; 70 | } 71 | set 72 | { 73 | switch (value) 74 | { 75 | case ServerType.STUN: 76 | _typeStr = "stun"; 77 | break; 78 | case ServerType.TURN: 79 | _typeStr = "turn"; 80 | break; 81 | default: 82 | _typeStr = "unknown"; 83 | break; 84 | } 85 | _type = value; 86 | } 87 | } 88 | 89 | protected string _typeStr; 90 | 91 | /// 92 | /// Ice server type string property. 93 | /// 94 | public string TypeStr 95 | { 96 | get { return _typeStr; } 97 | } 98 | 99 | /// 100 | /// Ice server's host and port. 101 | /// 102 | [XmlIgnore] 103 | public string HostAndPort 104 | { 105 | get { return string.Format("{0}", Host.Value); } 106 | } 107 | 108 | private ValidableIntegerString _port = new ValidableIntegerString(0, 65535); 109 | 110 | /// 111 | /// The Ice server's password. 112 | /// Used with the Username below to connect to the Ice server. 113 | /// 114 | public string Credential { get; set; } 115 | 116 | protected ValidableNonEmptyString _host = new ValidableNonEmptyString(); 117 | 118 | /// 119 | /// Ice server's host (IP). 120 | /// 121 | public ValidableNonEmptyString Host 122 | { 123 | get { return _host; } 124 | set { _host = value; } 125 | } 126 | 127 | /// 128 | /// Username for the Ice server. 129 | /// 130 | public string Username { get; set; } 131 | 132 | [XmlIgnore] 133 | protected bool _valid; 134 | 135 | /// 136 | /// Property to check the validity of Ice server information. 137 | /// 138 | [XmlIgnore] 139 | public bool Valid 140 | { 141 | get { return _valid; } 142 | set { SetProperty(ref _valid, value); } 143 | } 144 | 145 | 146 | /// 147 | /// Invokes when a property of an Ice server is changed and 148 | /// the new information needs validation. 149 | /// 150 | /// Information about event sender. 151 | /// Details about Property changed event. 152 | void ValidableProperties_PropertyChanged(object sender, PropertyChangedEventArgs e) 153 | { 154 | if (e.PropertyName == "Valid") 155 | { 156 | Valid = Host.Valid; 157 | } 158 | } 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /Client/Model/Peer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace PeerConnectionClient.Model 6 | { 7 | class Peer 8 | { 9 | public int Id { get; set; } 10 | public string Name { get; set; } 11 | 12 | public override string ToString() 13 | { 14 | return Id + ": " + Name; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Client/Ortc-Required/AutoLock.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using System.Threading; 15 | using System.Threading.Tasks; 16 | 17 | namespace PeerConnectionClient.Ortc.Utilities 18 | { 19 | internal class AutoLock : IDisposable 20 | { 21 | private readonly SemaphoreSlim _sem; 22 | private bool _isLocked; 23 | 24 | public AutoLock(SemaphoreSlim sem) 25 | { 26 | _sem = sem; 27 | } 28 | 29 | public Task WaitAsync() 30 | { 31 | if (_isLocked) return Task.Run(() => { }); 32 | _isLocked = true; 33 | var result = _sem.WaitAsync(); 34 | return result; 35 | } 36 | 37 | public void Dispose() 38 | { 39 | if (_isLocked) 40 | { 41 | _sem.Release(); 42 | } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Client/Ortc-Required/Media.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Windows.Foundation; 7 | using Windows.Media.Core; 8 | using Org.Ortc; 9 | using System.ComponentModel; 10 | using System.Runtime.CompilerServices; 11 | using System.Threading; 12 | using Org.Ortc.Adapter; 13 | using PeerConnectionClient.Ortc.Utilities; 14 | 15 | namespace PeerConnectionClient.Ortc 16 | { 17 | public class RTCPeerConnectionHealthStats 18 | { 19 | } 20 | public class MediaStreamEvent 21 | { 22 | public MediaStream Stream; 23 | } 24 | 25 | public class RTCMediaStreamConstraints 26 | { 27 | public Boolean audioEnabled; 28 | public Boolean videoEnabled; 29 | } 30 | public class Media 31 | { 32 | private readonly SemaphoreSlim _lock = new SemaphoreSlim(1, 1); 33 | 34 | private MediaDevice _audioCaptureDevice; 35 | private MediaDevice _videoDevice; 36 | private int _preferredFrameWidth; 37 | private int _preferredFrameHeight; 38 | private int _preferredFPS; 39 | 40 | public delegate void OnMediaCaptureDeviceFoundDelegate(MediaDevice param0); 41 | 42 | public static Media CreateMedia() 43 | { 44 | var ret = new Media(); 45 | 46 | return ret; 47 | } 48 | 49 | public static IAsyncOperation CreateMediaAsync() 50 | { 51 | return Task.Run(() => CreateMedia()).AsAsyncOperation(); 52 | } 53 | 54 | public Task> GetUserMedia(RTCMediaStreamConstraints mediaStreamConstraints) 55 | { 56 | return Task.Run(() => 57 | { 58 | var constraints = Helper.MakeConstraints(mediaStreamConstraints.audioEnabled, null, 59 | MediaDeviceKind.AudioInput, _audioCaptureDevice); 60 | constraints = Helper.MakeConstraints(mediaStreamConstraints.videoEnabled, constraints, 61 | MediaDeviceKind.VideoInput, _videoDevice); 62 | if (constraints.Video != null && constraints.Video.Advanced.Count > 0) 63 | { 64 | var constraintSet = constraints.Video.Advanced.First(); 65 | constraintSet.Width = new ConstrainLong { Value = _preferredFrameWidth }; 66 | constraintSet.Height = new ConstrainLong { Value = _preferredFrameHeight }; 67 | constraintSet.FrameRate = new ConstrainDouble { Value = _preferredFPS }; 68 | } 69 | 70 | var task = MediaDevices.GetUserMedia(constraints).AsTask(); 71 | return task.Result; 72 | }); 73 | } 74 | 75 | #if MISSING_CREATE_MEDIA 76 | public IMediaSource CreateMediaSource(MediaStreamTrack track, string id) 77 | { 78 | return track?.CreateMediaSource(); 79 | } 80 | #endif 81 | 82 | public static void OnAppSuspending() 83 | { 84 | //MediaDevices.OnAppSuspending(); 85 | } 86 | 87 | public void SelectAudioCaptureDevice(MediaDevice device) 88 | { 89 | using (var @lock = new AutoLock(_lock)) 90 | { 91 | @lock.WaitAsync().Wait(); 92 | _audioCaptureDevice = device; 93 | } 94 | } 95 | 96 | public void SelectVideoDevice(MediaDevice device) 97 | { 98 | using (var @lock = new AutoLock(_lock)) 99 | { 100 | @lock.WaitAsync().Wait(); 101 | _videoDevice = device; 102 | } 103 | } 104 | 105 | public void SetPreferredVideoCaptureFormat(int frameWidth, int frameHeight, int fps) 106 | { 107 | using (var @lock = new AutoLock(_lock)) 108 | { 109 | @lock.WaitAsync().Wait(); 110 | _preferredFrameWidth = frameWidth; 111 | _preferredFrameHeight = frameHeight; 112 | _preferredFPS = fps; 113 | } 114 | } 115 | } 116 | } -------------------------------------------------------------------------------- /Client/Ortc-Required/MediaDevice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Windows.Foundation; 7 | using Windows.Media.Core; 8 | using Windows.Media.MediaProperties; 9 | using Windows.Media.Capture; 10 | 11 | namespace PeerConnectionClient.Ortc 12 | { 13 | public class CaptureCapability 14 | { 15 | public uint Width { get; set; } 16 | public uint Height { get; set; } 17 | public uint FrameRate { get; set; } 18 | public String FullDescription { get; set; } 19 | public String ResolutionDescription { get; set; } 20 | public String FrameRateDescription { get; set; } 21 | public MediaRatio PixelAspectRatio { get; set; } 22 | } 23 | public class MediaDevice 24 | { 25 | public string Id { get; set; } 26 | public string Name { get; set; } 27 | 28 | public IAsyncOperation> GetVideoCaptureCapabilities() 29 | { 30 | MediaDevice device = this; 31 | return Task.Run(async () => 32 | { 33 | var settings = new MediaCaptureInitializationSettings() 34 | { 35 | VideoDeviceId = device.Id, 36 | MediaCategory = MediaCategory.Communications, 37 | }; 38 | using (var capture = new MediaCapture()) 39 | { 40 | await capture.InitializeAsync(settings); 41 | var caps = 42 | capture.VideoDeviceController.GetAvailableMediaStreamProperties( 43 | MediaStreamType.VideoRecord); 44 | 45 | var arr = new List(); 46 | foreach (var cap in caps) 47 | { 48 | if (cap.Type != "Video") 49 | { 50 | continue; 51 | } 52 | 53 | var videoCap = (VideoEncodingProperties) cap; 54 | 55 | if (videoCap.FrameRate.Denominator == 0 || 56 | videoCap.FrameRate.Numerator == 0 || 57 | videoCap.Width == 0 || 58 | videoCap.Height == 0) 59 | { 60 | continue; 61 | } 62 | var captureCap = new CaptureCapability() 63 | { 64 | Width = videoCap.Width, 65 | Height = videoCap.Height, 66 | FrameRate = videoCap.FrameRate.Numerator/videoCap.FrameRate.Denominator, 67 | }; 68 | captureCap.FrameRateDescription = $"{captureCap.FrameRate} fps"; 69 | captureCap.ResolutionDescription = $"{captureCap.Width} x {captureCap.Height}"; 70 | /*captureCap.PixelAspectRatio = new MediaRatio() 71 | { 72 | Numerator = videoCap.PixelAspectRatio.Numerator, 73 | Denominator = videoCap.PixelAspectRatio.Denominator, 74 | };*/ 75 | captureCap.FullDescription = 76 | $"{captureCap.ResolutionDescription} {captureCap.FrameRateDescription}"; 77 | arr.Add(captureCap); 78 | } 79 | return arr.GroupBy(o => o.FullDescription).Select(o => o.First()).ToList(); 80 | } 81 | }).AsAsyncOperation(); 82 | } 83 | } 84 | } -------------------------------------------------------------------------------- /Client/Ortc-Required/WebRTC.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Runtime; 7 | using Windows.UI.Core; 8 | using Windows.Storage; 9 | using Windows.Foundation; 10 | using Windows.Media.Capture; 11 | using Org.Ortc; 12 | using PeerConnectionClient.Ortc.Utilities; 13 | 14 | namespace PeerConnectionClient.Utilities 15 | { 16 | public enum LogLevel 17 | { 18 | LOGLVL_SENSITIVE = 0, 19 | LOGLVL_VERBOSE = 1, 20 | LOGLVL_INFO = 2, 21 | LOGLVL_WARNING = 3, 22 | LOGLVL_ERROR = 4 23 | } 24 | 25 | public class WebRTC 26 | { 27 | public static void DisableLogging() 28 | { 29 | 30 | } 31 | 32 | public static void EnableLogging(LogLevel level) 33 | { 34 | 35 | } 36 | 37 | public static IList GetAudioCodecs() 38 | { 39 | return Helper.GetCodecs("audio"); 40 | } 41 | 42 | //public static double GetCPUUsage(); 43 | //public static long GetMemUsage(); 44 | public static IList GetVideoCodecs() 45 | { 46 | return Helper.GetCodecs("video"); 47 | } 48 | 49 | public static void Initialize(CoreDispatcher dispatcher) 50 | { 51 | Settings.ApplyDefaults(); 52 | 53 | OrtcLib.Setup(EventQueueMaker.Bind(dispatcher)); 54 | } 55 | 56 | //public static bool IsTracing(); 57 | public static string LogFileName() 58 | { 59 | return ""; 60 | } 61 | 62 | public static StorageFolder LogFolder() 63 | { 64 | return null; 65 | } 66 | 67 | private static async Task RequestAccessForMediaCapturePrivate() //async 68 | { 69 | MediaCapture mediaAccessRequester = new MediaCapture(); 70 | MediaCaptureInitializationSettings mediaSettings = new MediaCaptureInitializationSettings 71 | { 72 | AudioDeviceId = "", 73 | VideoDeviceId = "", 74 | StreamingCaptureMode = StreamingCaptureMode.AudioAndVideo, 75 | PhotoCaptureSource = PhotoCaptureSource.VideoPreview 76 | }; 77 | 78 | await mediaAccessRequester.InitializeAsync(mediaSettings); 79 | 80 | if (mediaAccessRequester.MediaCaptureSettings.VideoDeviceId != "" && 81 | mediaAccessRequester.MediaCaptureSettings.AudioDeviceId != "") 82 | { 83 | return true; 84 | } 85 | 86 | return false; 87 | } 88 | 89 | public static IAsyncOperation RequestAccessForMediaCapture() 90 | { 91 | return RequestAccessForMediaCapturePrivate().AsAsyncOperation(); 92 | } 93 | 94 | //[Overload("SaveTrace2")] 95 | //public static bool SaveTrace(string filename); 96 | //[Overload("SaveTrace1")] 97 | public static bool SaveTrace(string host, int port) 98 | { 99 | return false; 100 | } 101 | 102 | public static void SetPreferredVideoCaptureFormat(int frameWidth, int frameHeight, int fps) 103 | { 104 | 105 | } 106 | 107 | public static void StartTracing() 108 | { 109 | 110 | } 111 | 112 | public static void StopTracing() 113 | { 114 | 115 | } 116 | 117 | public static void UpdateCPUUsage(double cpuUsage) 118 | { 119 | 120 | } 121 | 122 | public static void UpdateMemUsage(long memUsage) 123 | { 124 | 125 | } 126 | 127 | /// 128 | /// CPU usage statistics data (in percents). Should be set by application. 129 | /// 130 | public static double CpuUsage { get; set; } 131 | 132 | /// 133 | /// Memory usage statistics data (in bytes). Should be set by application. 134 | /// 135 | public static Int64 MemoryUsage { get; set; } 136 | } 137 | 138 | } -------------------------------------------------------------------------------- /Client/Package.Ortc.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | PeerConnectionClient.Ortc 7 | Optical Tone Ltd. 8 | Assets\StoreLogo.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Client/Package.WebRtc.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | PeerConnectionClient.WebRtc 7 | Optical Tone Ltd. 8 | Assets\StoreLogo.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Client/PeerConnectionClient.Ortc_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/PeerConnectionClient.Ortc_TemporaryKey.pfx -------------------------------------------------------------------------------- /Client/PeerConnectionClient.WebRtc_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/PeerConnectionClient.WebRtc_TemporaryKey.pfx -------------------------------------------------------------------------------- /Client/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PeerConnectionClient")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PeerConnectionClient")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Client/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Client/Utilities/ActionCommand.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | using System.Windows.Input; 14 | 15 | namespace PeerConnectionClient.Utilities 16 | { 17 | /// 18 | /// Defines an action command. 19 | /// 20 | public class ActionCommand : ICommand 21 | { 22 | public delegate bool CanExecuteDelegate(object parameter); 23 | 24 | private readonly Action _actionExecute; 25 | private readonly CanExecuteDelegate _actionCanExecute; 26 | 27 | /// 28 | /// Constructor. 29 | /// 30 | /// The action to execute. 31 | /// Parameter indicating if the action can be executed. 32 | public ActionCommand(Action actionExecute, CanExecuteDelegate actionCanExecute = null) 33 | { 34 | _actionExecute = actionExecute; 35 | _actionCanExecute = actionCanExecute; 36 | } 37 | 38 | /// 39 | /// Defines the method that determines whether the command can be executed 40 | // in the given context. 41 | /// 42 | /// Data used by the command. 43 | /// True if the action can be executed in the given context. 44 | public bool CanExecute(object parameter) 45 | { 46 | return _actionCanExecute == null || _actionCanExecute(parameter); 47 | } 48 | 49 | /// 50 | /// Defines the method to be called when the command is invoked. 51 | /// 52 | /// Data used by the command. 53 | public void Execute(object parameter) 54 | { 55 | _actionExecute(parameter); 56 | } 57 | 58 | /// 59 | /// Called when the current state of the application is changed 60 | /// and the condition of executing a command could be changed. 61 | /// 62 | public void RaiseCanExecuteChanged() 63 | { 64 | if (CanExecuteChanged != null) 65 | { 66 | CanExecuteChanged(this, null); 67 | } 68 | } 69 | 70 | public event EventHandler CanExecuteChanged; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Client/Utilities/BoolToVisConverter.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | using Windows.UI.Xaml; 14 | using Windows.UI.Xaml.Data; 15 | 16 | namespace PeerConnectionClient.Utilities 17 | { 18 | /// 19 | /// Class provides functionality to convert from boolean to Visibility. 20 | /// Implements the IValueConverter interface. 21 | /// 22 | public class BoolToVisConverter : IValueConverter 23 | { 24 | /// 25 | /// Converts a boolean to it's negated value. 26 | /// 27 | public bool Negated { get; set; } 28 | 29 | /// 30 | /// See the IValueConverter.Convert(). 31 | /// 32 | public object Convert(object value, Type targetType, object parameter, string language) 33 | { 34 | var result = (bool)value; 35 | result = Negated ? !result : result; 36 | return result ? Visibility.Visible : Visibility.Collapsed; 37 | } 38 | 39 | /// 40 | /// See the IValueConverter.ConvertBack(). 41 | /// 42 | public object ConvertBack(object value, Type targetType, object parameter, string language) 43 | { 44 | if (Negated) 45 | { 46 | return (bool)value ? Visibility.Collapsed : Visibility.Visible; 47 | } 48 | return (bool)value ? Visibility.Visible : Visibility.Collapsed; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Client/Utilities/InvertedBooleanConverter.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | using Windows.UI.Xaml.Data; 14 | 15 | namespace PeerConnectionClient.Utilities 16 | { 17 | /// 18 | /// Class to invert the boolean value. 19 | /// 20 | public class InvertedBooleanConverter : IValueConverter 21 | { 22 | /// 23 | /// See IValueConverter.Convert(). 24 | /// 25 | public object Convert(object value, Type targetType, object parameter, string language) 26 | { 27 | return !(bool)value; 28 | } 29 | 30 | /// 31 | /// See IValueConverter.ConvertBack(). 32 | /// 33 | public object ConvertBack(object value, Type targetType, object parameter, string language) 34 | { 35 | return !(bool)value; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Client/Utilities/NullToVisibleConverter.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | using Windows.UI.Xaml; 14 | using Windows.UI.Xaml.Data; 15 | 16 | namespace PeerConnectionClient.Utilities 17 | { 18 | /// 19 | /// Class to convert a null to a Visibility type. 20 | /// Implements the IValueConverter. 21 | /// 22 | class NullToVisibleConverter : IValueConverter 23 | { 24 | public bool Negated { get; set; } 25 | 26 | /// 27 | /// See IValueConverter.Convert(). 28 | /// 29 | public object Convert(object value, Type targetType, object parameter, string language) 30 | { 31 | return value == null ? Visibility.Collapsed : Visibility.Visible; 32 | } 33 | 34 | /// 35 | /// See IValueConverter.ConvertBack(). 36 | /// 37 | public object ConvertBack(object value, Type targetType, object parameter, string language) 38 | { 39 | return null; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Client/Utilities/SdpUtils.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Text.RegularExpressions; 15 | #if ORTCLIB 16 | using Org.Ortc; 17 | using CodecInfo= Org.Ortc.RTCRtpCodecCapability; 18 | #else 19 | using Org.WebRtc; 20 | #endif 21 | 22 | namespace PeerConnectionClient.Utilities 23 | { 24 | /// 25 | /// Utility class to organize SDP negotiation. 26 | /// 27 | class SdpUtils 28 | { 29 | /// 30 | /// Forces the SDP to use the selected audio and video codecs. 31 | /// 32 | /// Session description. 33 | /// Audio codec. 34 | /// Video codec. 35 | /// True if succeeds to force to use the selected audio/video codecs. 36 | #if ORTCLIB 37 | public static bool SelectCodecs(ref string sdp, CodecInfo audioCodec, CodecInfo videoCodec) 38 | #else 39 | public static bool SelectCodecs(ref string sdp, int audioCodecId, int videoCodecId) 40 | #endif 41 | { 42 | Regex mfdRegex = new Regex("\r\nm=audio.*RTP.*?( .\\d*)+\r\n"); 43 | Match mfdMatch = mfdRegex.Match(sdp); 44 | List mfdListToErase = new List(); //mdf = media format descriptor 45 | bool audioMediaDescFound = mfdMatch.Groups.Count > 1; //Group 0 is whole match 46 | #if ORTCLIB 47 | byte audioCodecId=audioCodec?.PreferredPayloadType ?? 0; 48 | byte videoCodecId=videoCodec?.PreferredPayloadType ?? 0; 49 | #endif 50 | if (audioMediaDescFound) 51 | { 52 | if (audioCodecId < 0) 53 | { 54 | return false; 55 | } 56 | for (int groupCtr = 1/*Group 0 is whole match*/; groupCtr < mfdMatch.Groups.Count; groupCtr++) 57 | { 58 | for (int captureCtr = 0; captureCtr < mfdMatch.Groups[groupCtr].Captures.Count; captureCtr++) 59 | { 60 | mfdListToErase.Add(mfdMatch.Groups[groupCtr].Captures[captureCtr].Value.TrimStart()); 61 | } 62 | } 63 | if (!mfdListToErase.Remove(audioCodecId.ToString())) 64 | { 65 | return false; 66 | } 67 | } 68 | 69 | mfdRegex = new Regex("\r\nm=video.*RTP.*?( .\\d*)+\r\n"); 70 | mfdMatch = mfdRegex.Match(sdp); 71 | bool videoMediaDescFound = mfdMatch.Groups.Count > 1; //Group 0 is whole match 72 | if (videoMediaDescFound) 73 | { 74 | if (videoCodecId < 0) 75 | { 76 | return false; 77 | } 78 | for (int groupCtr = 1/*Group 0 is whole match*/; groupCtr < mfdMatch.Groups.Count; groupCtr++) 79 | { 80 | for (int captureCtr = 0; captureCtr < mfdMatch.Groups[groupCtr].Captures.Count; captureCtr++) 81 | { 82 | mfdListToErase.Add(mfdMatch.Groups[groupCtr].Captures[captureCtr].Value.TrimStart()); 83 | } 84 | } 85 | if (!mfdListToErase.Remove(videoCodecId.ToString())) 86 | { 87 | return false; 88 | } 89 | } 90 | 91 | if (audioMediaDescFound) 92 | { 93 | // Alter audio entry 94 | Regex audioRegex = new Regex("\r\n(m=audio.*RTP.*?)( .\\d*)+"); 95 | sdp = audioRegex.Replace(sdp, "\r\n$1 " + audioCodecId); 96 | } 97 | 98 | if (videoMediaDescFound) 99 | { 100 | // Alter video entry 101 | Regex videoRegex = new Regex("\r\n(m=video.*RTP.*?)( .\\d*)+"); 102 | sdp = videoRegex.Replace(sdp, "\r\n$1 " + videoCodecId); 103 | } 104 | 105 | // Remove associated rtp mapping, format parameters, feedback parameters 106 | Regex removeOtherMdfs = new Regex("a=(rtpmap|fmtp|rtcp-fb):(" + String.Join("|", mfdListToErase) + ") .*\r\n"); 107 | sdp = removeOtherMdfs.Replace(sdp, ""); 108 | 109 | return true; 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Client/Utilities/ToggleImageConverter.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | using System.Diagnostics; 14 | using Windows.UI.Xaml.Data; 15 | 16 | namespace PeerConnectionClient.Utilities 17 | { 18 | public class ToggleImageConverter : IValueConverter 19 | { 20 | public object Convert(object value, Type targetType, object parameter, string language) 21 | { 22 | var isChecked = value as bool?; 23 | var imageName = parameter as string; 24 | Debug.Assert(isChecked != null); 25 | Debug.Assert(imageName != null); 26 | string noPrefix = (isChecked == true) ? "" : "No "; 27 | string pathBeginning = "/Assets/"; 28 | #if WINDOWS_PHONE_APP 29 | pathBeginning = "ms-appx:///Assets/"; 30 | #endif 31 | return string.Format("{0}{1}{2}", pathBeginning, noPrefix, imageName); 32 | } 33 | 34 | public object ConvertBack(object value, Type targetType, object parameter, string language) 35 | { 36 | throw new NotImplementedException(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Client/Utilities/UI/ErrorControl.xaml: -------------------------------------------------------------------------------- 1 |  12 | 13 | 14 | 15 | 16 | 17 | 18 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Client/Utilities/UI/ErrorControl.xaml.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using Windows.UI.Xaml; 13 | 14 | namespace PeerConnectionClient.Controls 15 | { 16 | public sealed partial class ErrorControl 17 | { 18 | /// 19 | /// Creates an ErrorControl instance. 20 | /// 21 | public ErrorControl() 22 | { 23 | InitializeComponent(); 24 | } 25 | 26 | /// 27 | /// Inner content property for error control element. 28 | /// 29 | public UIElement InnerContent 30 | { 31 | get { return (UIElement)GetValue(InnerContentProperty); } 32 | set { SetValue(InnerContentProperty, value); } 33 | } 34 | 35 | public static readonly DependencyProperty InnerContentProperty = 36 | DependencyProperty.Register("InnerContent", typeof(UIElement), 37 | typeof(ErrorControl), new PropertyMetadata(null, InnerContentChanged)); 38 | 39 | /// 40 | /// Property changed event handler. 41 | /// 42 | /// Dependency object. 43 | /// Details about DependencyPropertyChanged event. 44 | private static void InnerContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 45 | { 46 | ((ErrorControl)d).MyPresenter.Content = e.NewValue as UIElement; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Client/Utilities/ValidableBase.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System.Xml.Serialization; 13 | using PeerConnectionClient.MVVM; 14 | 15 | namespace PeerConnectionClient.Utilities 16 | { 17 | /// 18 | /// A base class for validable values. 19 | /// 20 | /// The type of the value. 21 | public abstract class ValidableBase : BindableBase 22 | { 23 | private T _value; 24 | 25 | /// 26 | /// The value to validate. 27 | /// 28 | public T Value 29 | { 30 | get { return _value; } 31 | set 32 | { 33 | if (SetProperty(ref _value, value)) 34 | { 35 | Validate(); 36 | } 37 | } 38 | } 39 | 40 | [XmlIgnore] 41 | bool _valid = true; 42 | 43 | /// 44 | /// Property to indicate if the value is valid. 45 | /// 46 | [XmlIgnore] 47 | public bool Valid 48 | { 49 | get { return _valid; } 50 | protected set { SetProperty(ref _valid, value); } 51 | } 52 | 53 | /// 54 | /// Validate that the value meets the requirements for the 55 | /// specific validable classes. 56 | /// 57 | abstract protected void Validate(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Client/Utilities/ValidableIntegerString.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | 14 | namespace PeerConnectionClient.Utilities 15 | { 16 | /// 17 | /// Class to validate that the string member variable can be converted 18 | /// to an integer in range [minValue, maxValue]. 19 | /// 20 | public class ValidableIntegerString : ValidableBase 21 | { 22 | // Minimum allowed value for the integer 23 | private readonly int _minValue; 24 | 25 | // Maximum allowed value for the integer 26 | private readonly int _maxValue; 27 | 28 | /// 29 | /// Default constructor to set minimum and maximum integer default values. 30 | /// 31 | public ValidableIntegerString() 32 | { 33 | _minValue = 0; 34 | _maxValue = 100; 35 | } 36 | 37 | /// 38 | /// Constructor 39 | /// 40 | /// Minimum allowed value for the integer. 41 | /// Maximum allowed value for the integer. 42 | public ValidableIntegerString(int minValue = 0, int maxValue = 100) 43 | { 44 | _minValue = minValue; 45 | _maxValue = maxValue; 46 | } 47 | 48 | /// 49 | /// Constructor. 50 | /// 51 | /// Default integer value. 52 | /// Minimum allowed value for the integer. 53 | /// Maximum allowed value for the integer. 54 | public ValidableIntegerString(int defaultValue, int minValue = 0, int maxValue = 100) 55 | : this(minValue, maxValue) 56 | { 57 | Value = defaultValue.ToString(); 58 | } 59 | 60 | /// 61 | /// Constructor 62 | /// 63 | /// Default integer value. 64 | public ValidableIntegerString(string defaultValue) 65 | { 66 | Value = defaultValue; 67 | } 68 | 69 | /// 70 | /// Validates that the string value can be converted to an integer 71 | /// and the intereger will be in range [minValue, maxValue]. 72 | /// 73 | override protected void Validate() 74 | { 75 | try 76 | { 77 | var intVal = Convert.ToInt32(Value); 78 | if (intVal >= _minValue && intVal <= _maxValue) 79 | { 80 | Valid = true; 81 | } 82 | else 83 | { 84 | Valid = false; 85 | } 86 | } 87 | catch (Exception) 88 | { 89 | Valid = false; 90 | } 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Client/Utilities/ValidableNonEmptyString.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | namespace PeerConnectionClient.Utilities 13 | { 14 | /// 15 | /// Class to validate that the string member variable is not empty. 16 | /// 17 | public class ValidableNonEmptyString : ValidableBase 18 | { 19 | /// 20 | /// Default constructor initializes Value with an empty string. 21 | /// 22 | public ValidableNonEmptyString() 23 | { 24 | Value = ""; 25 | } 26 | 27 | /// 28 | /// Constructor initializes the Value with the string value. 29 | /// 30 | /// String value 31 | public ValidableNonEmptyString(string value = "") 32 | { 33 | Value = value; 34 | } 35 | 36 | /// 37 | /// Overrides the ValidableBase.Validate() method. 38 | /// Validates the string is not empty. 39 | /// 40 | override protected void Validate() 41 | { 42 | Valid = !string.IsNullOrEmpty(Value); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Client/Utilities/VideoCaptureFormat.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | namespace PeerConnectionClient.Utilities 13 | { 14 | /// 15 | /// Enumerable representing video capture resolution. 16 | /// 17 | public enum CapRes 18 | { 19 | Default = 0, 20 | _640_480 = 1, 21 | _320_240 = 2, 22 | }; 23 | 24 | /// 25 | /// Enumerable representing video frames per second. 26 | /// 27 | public enum CapFPS 28 | { 29 | Default = 0, 30 | _5 = 1, 31 | _15 = 2, 32 | _30 = 3 33 | }; 34 | 35 | /// 36 | /// Class representing a combo box item with 37 | /// video capture enumerable value. 38 | /// 39 | public class ComboBoxItemCapRes 40 | { 41 | public CapRes ValueCapResEnum { get; set; } 42 | public string ValueCapResString { get; set; } 43 | } 44 | 45 | /// 46 | /// Class representing a combo box item with 47 | /// video frames per second enumerable value. 48 | /// 49 | public class ComboBoxItemCapFPS 50 | { 51 | public CapFPS ValueCapFPSEnum { get; set; } 52 | public string ValueCapFPSString { get; set; } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Client/config.txt: -------------------------------------------------------------------------------- 1 | appID = 2 | keyID = 3 | secret = 4 | -------------------------------------------------------------------------------- /Client/ecc-key.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/Client/ecc-key.p12 -------------------------------------------------------------------------------- /ClientCore/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net.NetworkInformation; 6 | using Windows.Storage; 7 | 8 | namespace PeerConnectionClientCore 9 | { 10 | public static class Config 11 | { 12 | public static ApplicationDataContainer localSettings = 13 | ApplicationData.Current.LocalSettings; 14 | 15 | public static void AppSettings() 16 | { 17 | string config = @"config.txt"; 18 | if (!File.Exists(config)) 19 | { 20 | localSettings.Values["appID"] = ""; 21 | localSettings.Values["keyID"] = ""; 22 | 23 | // secret string 24 | localSettings.Values["secret"] = ""; 25 | } 26 | else 27 | { 28 | Dictionary dict = File.ReadAllLines(config) 29 | .Select(l => l.Split(new[] { '=' })) 30 | .ToDictionary(s => s[0].Trim(), s => s[1].Trim()); 31 | 32 | localSettings.Values["appID"] = dict["appID"]; 33 | localSettings.Values["keyID"] = dict["keyID"]; 34 | localSettings.Values["secret"] = dict["secret"]; 35 | } 36 | 37 | Random rnd = new Random(); 38 | int rndnum = rnd.Next(); 39 | localSettings.Values["confID"] = rndnum.ToString(); 40 | 41 | localSettings.Values["userID"] = GetLocalPeerName(); 42 | localSettings.Values["localID"] = GetLocalPeerName(); 43 | } 44 | 45 | public static string GetLocalPeerName() => 46 | IPGlobalProperties.GetIPGlobalProperties().HostName?.ToLower() ?? ""; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ClientCore/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PeerConnectionClientCore")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PeerConnectionClientCore")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /ClientCore/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 2 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /ClientCore/Utilities/SdpUtils.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Text.RegularExpressions; 15 | #if ORTCLIB 16 | using Org.Ortc; 17 | using CodecInfo= Org.Ortc.RTCRtpCodecCapability; 18 | #else 19 | using Org.WebRtc; 20 | #endif 21 | 22 | namespace PeerConnectionClient.Utilities 23 | { 24 | /// 25 | /// Utility class to organize SDP negotiation. 26 | /// 27 | class SdpUtils 28 | { 29 | /// 30 | /// Forces the SDP to use the selected audio and video codecs. 31 | /// 32 | /// Session description. 33 | /// Audio codec. 34 | /// Video codec. 35 | /// True if succeeds to force to use the selected audio/video codecs. 36 | #if ORTCLIB 37 | public static bool SelectCodecs(ref string sdp, CodecInfo audioCodec, CodecInfo videoCodec) 38 | #else 39 | public static bool SelectCodecs(ref string sdp, int audioCodecId, int videoCodecId) 40 | #endif 41 | { 42 | Regex mfdRegex = new Regex("\r\nm=audio.*RTP.*?( .\\d*)+\r\n"); 43 | Match mfdMatch = mfdRegex.Match(sdp); 44 | List mfdListToErase = new List(); //mdf = media format descriptor 45 | bool audioMediaDescFound = mfdMatch.Groups.Count > 1; //Group 0 is whole match 46 | #if ORTCLIB 47 | byte audioCodecId=audioCodec?.PreferredPayloadType ?? 0; 48 | byte videoCodecId=videoCodec?.PreferredPayloadType ?? 0; 49 | #endif 50 | if (audioMediaDescFound) 51 | { 52 | if (audioCodecId < 0) 53 | { 54 | return false; 55 | } 56 | for (int groupCtr = 1/*Group 0 is whole match*/; groupCtr < mfdMatch.Groups.Count; groupCtr++) 57 | { 58 | for (int captureCtr = 0; captureCtr < mfdMatch.Groups[groupCtr].Captures.Count; captureCtr++) 59 | { 60 | mfdListToErase.Add(mfdMatch.Groups[groupCtr].Captures[captureCtr].Value.TrimStart()); 61 | } 62 | } 63 | if (!mfdListToErase.Remove(audioCodecId.ToString())) 64 | { 65 | return false; 66 | } 67 | } 68 | 69 | mfdRegex = new Regex("\r\nm=video.*RTP.*?( .\\d*)+\r\n"); 70 | mfdMatch = mfdRegex.Match(sdp); 71 | bool videoMediaDescFound = mfdMatch.Groups.Count > 1; //Group 0 is whole match 72 | if (videoMediaDescFound) 73 | { 74 | if (videoCodecId < 0) 75 | { 76 | return false; 77 | } 78 | for (int groupCtr = 1/*Group 0 is whole match*/; groupCtr < mfdMatch.Groups.Count; groupCtr++) 79 | { 80 | for (int captureCtr = 0; captureCtr < mfdMatch.Groups[groupCtr].Captures.Count; captureCtr++) 81 | { 82 | mfdListToErase.Add(mfdMatch.Groups[groupCtr].Captures[captureCtr].Value.TrimStart()); 83 | } 84 | } 85 | if (!mfdListToErase.Remove(videoCodecId.ToString())) 86 | { 87 | return false; 88 | } 89 | } 90 | 91 | if (audioMediaDescFound) 92 | { 93 | // Alter audio entry 94 | Regex audioRegex = new Regex("\r\n(m=audio.*RTP.*?)( .\\d*)+"); 95 | sdp = audioRegex.Replace(sdp, "\r\n$1 " + audioCodecId); 96 | } 97 | 98 | if (videoMediaDescFound) 99 | { 100 | // Alter video entry 101 | Regex videoRegex = new Regex("\r\n(m=video.*RTP.*?)( .\\d*)+"); 102 | sdp = videoRegex.Replace(sdp, "\r\n$1 " + videoCodecId); 103 | } 104 | 105 | // Remove associated rtp mapping, format parameters, feedback parameters 106 | Regex removeOtherMdfs = new Regex("a=(rtpmap|fmtp|rtcp-fb):(" + String.Join("|", mfdListToErase) + ") .*\r\n"); 107 | sdp = removeOtherMdfs.Replace(sdp, ""); 108 | 109 | return true; 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /ClientCore/Utilities/XmlSerializer.cs: -------------------------------------------------------------------------------- 1 | //********************************************************* 2 | // 3 | // Copyright (c) Microsoft. All rights reserved. 4 | // This code is licensed under the MIT License (MIT). 5 | // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 6 | // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 7 | // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 8 | // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 9 | // 10 | //********************************************************* 11 | 12 | using System.IO; 13 | using System.Text; 14 | using System.Xml; 15 | using System.Xml.Serialization; 16 | 17 | namespace PeerConnectionClient.Utilities 18 | { 19 | public static class XmlSerializer 20 | { 21 | /// 22 | /// Serialize to xml. 23 | /// 24 | public static string ToXml(T value) 25 | { 26 | XmlSerializer serializer = new XmlSerializer(typeof(T)); 27 | StringBuilder stringBuilder = new StringBuilder(); 28 | XmlWriterSettings settings = new XmlWriterSettings 29 | { 30 | Indent = true, 31 | OmitXmlDeclaration = true, 32 | }; 33 | 34 | using (XmlWriter xmlWriter = XmlWriter.Create(stringBuilder, settings)) 35 | { 36 | serializer.Serialize(xmlWriter, value); 37 | } 38 | return stringBuilder.ToString(); 39 | } 40 | 41 | /// 42 | /// Deserialize from xml. 43 | /// 44 | public static T FromXml(string xml) 45 | { 46 | XmlSerializer serializer = new XmlSerializer(typeof(T)); 47 | T value; 48 | using (StringReader stringReader = new StringReader(xml)) 49 | { 50 | object deserialized = serializer.Deserialize(stringReader); 51 | value = (T)deserialized; 52 | } 53 | 54 | return value; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1ec9ca77c2fa6649a84ee187f932e37 3 | folderAsset: yes 4 | timeCreated: 1513003196 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Materials/CursorMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: CursorMaterial 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _LIGHTMAPPING_REALTIME 12 | m_LightmapFlags: 5 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _EmissionScaleUI: 0 63 | - _Glossiness: 0.798 64 | - _Lightmapping: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SrcBlend: 1 70 | - _UVSec: 0 71 | - _ZWrite: 1 72 | m_Colors: 73 | - _Color: {r: 0.5265974, g: 0.9485294, b: 0.048821356, a: 1} 74 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} 75 | - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} 76 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Materials/CursorMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ea4fed5a14248a4b9b8be8394f8030c 3 | timeCreated: 1525366057 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Materials/Default.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Default 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 0.6, g: 0.6, b: 0.6, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} 77 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Materials/Default.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a4c834a2d488cf04bbe149a1c2e62d0f 3 | timeCreated: 1525366800 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 2100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Materials/EyeEffectShader.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | Shader "Hidden/EyeEffectShader" 4 | { 5 | Properties 6 | { 7 | _MainTex ("Texture", 2D) = "white" {} 8 | } 9 | SubShader 10 | { 11 | // No culling or depth 12 | Cull Off ZWrite Off ZTest Always 13 | 14 | Pass 15 | { 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | 20 | #include "UnityCG.cginc" 21 | 22 | struct appdata 23 | { 24 | float4 vertex : POSITION; 25 | float2 uv : TEXCOORD0; 26 | }; 27 | 28 | struct v2f 29 | { 30 | float2 uv : TEXCOORD0; 31 | float4 vertex : SV_POSITION; 32 | }; 33 | 34 | v2f vert (appdata v) 35 | { 36 | 37 | v2f o; 38 | o.vertex = UnityObjectToClipPos(v.vertex); 39 | o.uv = v.uv; 40 | o.uv.y = 1 - o.uv.y; 41 | return o; 42 | } 43 | 44 | sampler2D _MainTex; 45 | 46 | fixed4 frag (v2f i) : SV_Target 47 | { 48 | fixed4 col = tex2D(_MainTex, i.uv); 49 | // just invert the colors 50 | //col = 1 - col; 51 | return col; 52 | } 53 | ENDCG 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Materials/EyeEffectShader.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0d1ffde2e345054781fc32082017e6d 3 | timeCreated: 1512750565 4 | licenseType: Free 5 | ShaderImporter: 6 | externalObjects: {} 7 | defaultTextures: [] 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Materials/EyeMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: EyeMaterial 10 | m_Shader: {fileID: 4800000, guid: c0d1ffde2e345054781fc32082017e6d, type: 3} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 2800000, guid: 8ffb34771a297604cb7411c0a846707b, type: 3} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 1, g: 1, b: 1, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Materials/EyeMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 590c1a22047b3ce459cc07454f9a0c81 3 | timeCreated: 1512750514 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Models.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ba1e22d4ec7a1443a1951827c749c5b 3 | folderAsset: yes 4 | timeCreated: 1525366553 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Models/Cursor.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrtc-uwp/PeerCC/9bcdc04a9d0d8f8b66e313272312ebb608154aa0/ClientUnity/Assets/Models/Cursor.fbx -------------------------------------------------------------------------------- /ClientUnity/Assets/Models/Cursor.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb716534f18059041b276005aec48888 3 | timeCreated: 1525366574 4 | licenseType: Free 5 | ModelImporter: 6 | serializedVersion: 22 7 | fileIDToRecycleName: 8 | 100000: //RootNode 9 | 400000: //RootNode 10 | 2100000: Default 11 | 2300000: //RootNode 12 | 3300000: //RootNode 13 | 4300000: Mesh 14 | externalObjects: 15 | - first: 16 | type: UnityEngine:Material 17 | assembly: UnityEngine.CoreModule 18 | name: Default 19 | second: {fileID: 2100000, guid: a4c834a2d488cf04bbe149a1c2e62d0f, type: 2} 20 | materials: 21 | importMaterials: 1 22 | materialName: 0 23 | materialSearch: 1 24 | materialLocation: 0 25 | animations: 26 | legacyGenerateAnimations: 4 27 | bakeSimulation: 0 28 | resampleCurves: 1 29 | optimizeGameObjects: 0 30 | motionNodeName: 31 | rigImportErrors: 32 | rigImportWarnings: 33 | animationImportErrors: 34 | animationImportWarnings: 35 | animationRetargetingWarnings: 36 | animationDoRetargetingWarnings: 0 37 | importAnimatedCustomProperties: 0 38 | animationCompression: 1 39 | animationRotationError: 0.5 40 | animationPositionError: 0.5 41 | animationScaleError: 0.5 42 | animationWrapMode: 0 43 | extraExposedTransformPaths: [] 44 | extraUserProperties: [] 45 | clipAnimations: [] 46 | isReadable: 1 47 | meshes: 48 | lODScreenPercentages: [] 49 | globalScale: 1 50 | meshCompression: 2 51 | addColliders: 0 52 | importVisibility: 0 53 | importBlendShapes: 1 54 | importCameras: 0 55 | importLights: 0 56 | swapUVChannels: 0 57 | generateSecondaryUV: 0 58 | useFileUnits: 1 59 | optimizeMeshForGPU: 1 60 | keepQuads: 0 61 | weldVertices: 1 62 | preserveHierarchy: 0 63 | indexFormat: 1 64 | secondaryUVAngleDistortion: 8 65 | secondaryUVAreaDistortion: 15.000001 66 | secondaryUVHardAngle: 88 67 | secondaryUVPackMargin: 4 68 | useFileScale: 1 69 | tangentSpace: 70 | normalSmoothAngle: 60 71 | normalImportMode: 0 72 | tangentImportMode: 4 73 | normalCalculationMode: 4 74 | importAnimation: 1 75 | copyAvatar: 0 76 | humanDescription: 77 | serializedVersion: 2 78 | human: [] 79 | skeleton: [] 80 | armTwist: 0.5 81 | foreArmTwist: 0.5 82 | upperLegTwist: 0.5 83 | legTwist: 0.5 84 | armStretch: 0.05 85 | legStretch: 0.05 86 | feetSpacing: 0 87 | rootMotionBoneName: 88 | rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} 89 | hasTranslationDoF: 0 90 | hasExtraRoot: 0 91 | skeletonHasParents: 1 92 | lastHumanDescriptionAvatarSource: {instanceID: 0} 93 | animationType: 0 94 | humanoidOversampling: 1 95 | additionalBone: 0 96 | userData: 97 | assetBundleName: 98 | assetBundleVariant: 99 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0affd7ab385b2a641acb8c6b960dcfa0 3 | folderAsset: yes 4 | timeCreated: 1513004579 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 798473bd6dc230442b50ad5fa9f558b2 3 | folderAsset: yes 4 | timeCreated: 1513003362 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA/PeerConnectionClientCore.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b55408fd0dcd8c428c22609abf22886 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | isPreloaded: 0 9 | isOverridable: 0 10 | platformData: 11 | - first: 12 | Any: 13 | second: 14 | enabled: 0 15 | settings: {} 16 | - first: 17 | Editor: Editor 18 | second: 19 | enabled: 0 20 | settings: 21 | DefaultValueInitialized: true 22 | - first: 23 | Windows Store Apps: WindowsStoreApps 24 | second: 25 | enabled: 1 26 | settings: 27 | CPU: AnyCPU 28 | userData: 29 | assetBundleName: 30 | assetBundleVariant: 31 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA/PeerConnectionClientCore.pdb.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64069fbfffbf3a74ab062773b8d38c40 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85986dd9e9942274986ce8d96317c0e4 3 | folderAsset: yes 4 | timeCreated: 1513003380 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA/x86/MediaEngineUWP.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7576ed1d026e5c459267534cf9bed5c 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | isPreloaded: 0 9 | isOverridable: 0 10 | platformData: 11 | - first: 12 | Any: 13 | second: 14 | enabled: 0 15 | settings: {} 16 | - first: 17 | Editor: Editor 18 | second: 19 | enabled: 0 20 | settings: 21 | DefaultValueInitialized: true 22 | - first: 23 | Windows Store Apps: WindowsStoreApps 24 | second: 25 | enabled: 1 26 | settings: 27 | CPU: x86 28 | userData: 29 | assetBundleName: 30 | assetBundleVariant: 31 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA/x86/MediaEngineUWP.pdb.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd2d8085d150ce7469dbf53bd4cb3305 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA/x86/Org.WebRtc.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc8de339ff475584d844991f2ea4bbc5 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | isPreloaded: 0 9 | isOverridable: 0 10 | platformData: 11 | - first: 12 | '': Any 13 | second: 14 | enabled: 0 15 | settings: 16 | Exclude Editor: 1 17 | Exclude Linux: 1 18 | Exclude Linux64: 1 19 | Exclude LinuxUniversal: 1 20 | Exclude OSXUniversal: 1 21 | Exclude Win: 1 22 | Exclude Win64: 1 23 | Exclude WindowsStoreApps: 0 24 | - first: 25 | Any: 26 | second: 27 | enabled: 0 28 | settings: {} 29 | - first: 30 | Editor: Editor 31 | second: 32 | enabled: 0 33 | settings: 34 | CPU: AnyCPU 35 | DefaultValueInitialized: true 36 | OS: AnyOS 37 | - first: 38 | Facebook: Win 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: AnyCPU 43 | - first: 44 | Facebook: Win64 45 | second: 46 | enabled: 0 47 | settings: 48 | CPU: AnyCPU 49 | - first: 50 | Standalone: Linux 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: x86 55 | - first: 56 | Standalone: Linux64 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: x86_64 61 | - first: 62 | Standalone: OSXUniversal 63 | second: 64 | enabled: 0 65 | settings: 66 | CPU: AnyCPU 67 | - first: 68 | Standalone: Win 69 | second: 70 | enabled: 0 71 | settings: 72 | CPU: AnyCPU 73 | - first: 74 | Standalone: Win64 75 | second: 76 | enabled: 0 77 | settings: 78 | CPU: AnyCPU 79 | - first: 80 | Windows Store Apps: WindowsStoreApps 81 | second: 82 | enabled: 1 83 | settings: 84 | CPU: X86 85 | DontProcess: false 86 | PlaceholderPath: 87 | SDK: UWP 88 | ScriptingBackend: Il2Cpp 89 | userData: 90 | assetBundleName: 91 | assetBundleVariant: 92 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA/x86/Org.WebRtc.pdb.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14d0173a979b5b54d81ed16eb0d64aff 3 | timeCreated: 1513818647 4 | licenseType: Free 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA/x86/Org.WebRtc.winmd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62bf1948dba5c4a4ea5d248473ce114c 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | isPreloaded: 0 9 | isOverridable: 0 10 | platformData: 11 | - first: 12 | '': Any 13 | second: 14 | enabled: 0 15 | settings: 16 | Exclude Editor: 1 17 | Exclude Linux: 1 18 | Exclude Linux64: 1 19 | Exclude LinuxUniversal: 1 20 | Exclude OSXUniversal: 1 21 | Exclude Win: 1 22 | Exclude Win64: 1 23 | Exclude WindowsStoreApps: 0 24 | - first: 25 | Any: 26 | second: 27 | enabled: 0 28 | settings: {} 29 | - first: 30 | Editor: Editor 31 | second: 32 | enabled: 0 33 | settings: 34 | CPU: AnyCPU 35 | DefaultValueInitialized: true 36 | OS: AnyOS 37 | - first: 38 | Facebook: Win 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: AnyCPU 43 | - first: 44 | Facebook: Win64 45 | second: 46 | enabled: 0 47 | settings: 48 | CPU: AnyCPU 49 | - first: 50 | Standalone: Linux 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: x86 55 | - first: 56 | Standalone: Linux64 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: x86_64 61 | - first: 62 | Standalone: OSXUniversal 63 | second: 64 | enabled: 0 65 | settings: 66 | CPU: AnyCPU 67 | - first: 68 | Standalone: Win 69 | second: 70 | enabled: 0 71 | settings: 72 | CPU: AnyCPU 73 | - first: 74 | Standalone: Win64 75 | second: 76 | enabled: 0 77 | settings: 78 | CPU: AnyCPU 79 | - first: 80 | Windows Store Apps: WindowsStoreApps 81 | second: 82 | enabled: 1 83 | settings: 84 | CPU: AnyCPU 85 | DontProcess: false 86 | PlaceholderPath: 87 | SDK: UWP 88 | ScriptingBackend: Il2Cpp 89 | userData: 90 | assetBundleName: 91 | assetBundleVariant: 92 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA/x86/WebRtcScheme.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48ecaf3ff11e43642af804d39c704bcf 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | isPreloaded: 0 9 | isOverridable: 0 10 | platformData: 11 | - first: 12 | Any: 13 | second: 14 | enabled: 0 15 | settings: {} 16 | - first: 17 | Editor: Editor 18 | second: 19 | enabled: 0 20 | settings: 21 | DefaultValueInitialized: true 22 | - first: 23 | Windows Store Apps: WindowsStoreApps 24 | second: 25 | enabled: 1 26 | settings: 27 | CPU: x86 28 | userData: 29 | assetBundleName: 30 | assetBundleVariant: 31 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA/x86/WebRtcScheme.pdb.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 805420168698d384ca00909ea632e356 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Plugins/WSA/x86/WebRtcScheme.winmd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0cff5cbad38842947a2432bcfaa94d9f 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | isPreloaded: 0 9 | isOverridable: 0 10 | platformData: 11 | - first: 12 | Any: 13 | second: 14 | enabled: 0 15 | settings: {} 16 | - first: 17 | Editor: Editor 18 | second: 19 | enabled: 0 20 | settings: 21 | DefaultValueInitialized: true 22 | - first: 23 | Windows Store Apps: WindowsStoreApps 24 | second: 25 | enabled: 1 26 | settings: 27 | CPU: AnyCPU 28 | userData: 29 | assetBundleName: 30 | assetBundleVariant: 31 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ea82aafa7c55464dbcb2a644ebc5dcd 3 | folderAsset: yes 4 | timeCreated: 1514507021 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Prefabs/TextItemPreftab.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_SourcePrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1848430289707114} 13 | m_IsPrefabAsset: 1 14 | --- !u!1 &1848430289707114 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_CorrespondingSourceObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 6 20 | m_Component: 21 | - component: {fileID: 224042229428647162} 22 | - component: {fileID: 222409849478851958} 23 | - component: {fileID: 65051988509238408} 24 | - component: {fileID: 114523883484901600} 25 | - component: {fileID: 114871155001120210} 26 | - component: {fileID: 114284532978948954} 27 | m_Layer: 5 28 | m_Name: TextItemPreftab 29 | m_TagString: Untagged 30 | m_Icon: {fileID: 0} 31 | m_NavMeshLayer: 0 32 | m_StaticEditorFlags: 0 33 | m_IsActive: 1 34 | --- !u!65 &65051988509238408 35 | BoxCollider: 36 | m_ObjectHideFlags: 1 37 | m_CorrespondingSourceObject: {fileID: 0} 38 | m_PrefabInternal: {fileID: 100100000} 39 | m_GameObject: {fileID: 1848430289707114} 40 | m_Material: {fileID: 0} 41 | m_IsTrigger: 0 42 | m_Enabled: 1 43 | serializedVersion: 2 44 | m_Size: {x: 150, y: 20, z: 0} 45 | m_Center: {x: 0, y: 0, z: 0} 46 | --- !u!114 &114284532978948954 47 | MonoBehaviour: 48 | m_ObjectHideFlags: 1 49 | m_CorrespondingSourceObject: {fileID: 0} 50 | m_PrefabInternal: {fileID: 100100000} 51 | m_GameObject: {fileID: 1848430289707114} 52 | m_Enabled: 1 53 | m_EditorHideFlags: 0 54 | m_Script: {fileID: -1862395651, guid: f70555f144d8491a825f0804e09c671c, type: 3} 55 | m_Name: 56 | m_EditorClassIdentifier: 57 | m_Delegates: [] 58 | delegates: [] 59 | --- !u!114 &114523883484901600 60 | MonoBehaviour: 61 | m_ObjectHideFlags: 1 62 | m_CorrespondingSourceObject: {fileID: 0} 63 | m_PrefabInternal: {fileID: 100100000} 64 | m_GameObject: {fileID: 1848430289707114} 65 | m_Enabled: 1 66 | m_EditorHideFlags: 0 67 | m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} 68 | m_Name: 69 | m_EditorClassIdentifier: 70 | m_Material: {fileID: 0} 71 | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 72 | m_RaycastTarget: 1 73 | m_OnCullStateChanged: 74 | m_PersistentCalls: 75 | m_Calls: [] 76 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 77 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 78 | m_FontData: 79 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 80 | m_FontSize: 18 81 | m_FontStyle: 0 82 | m_BestFit: 0 83 | m_MinSize: 1 84 | m_MaxSize: 40 85 | m_Alignment: 0 86 | m_AlignByGeometry: 0 87 | m_RichText: 1 88 | m_HorizontalOverflow: 0 89 | m_VerticalOverflow: 0 90 | m_LineSpacing: 1 91 | m_Text: 92 | --- !u!114 &114871155001120210 93 | MonoBehaviour: 94 | m_ObjectHideFlags: 1 95 | m_CorrespondingSourceObject: {fileID: 0} 96 | m_PrefabInternal: {fileID: 100100000} 97 | m_GameObject: {fileID: 1848430289707114} 98 | m_Enabled: 1 99 | m_EditorHideFlags: 0 100 | m_Script: {fileID: -234403039, guid: f70555f144d8491a825f0804e09c671c, type: 3} 101 | m_Name: 102 | m_EditorClassIdentifier: 103 | m_Navigation: 104 | m_Mode: 3 105 | m_SelectOnUp: {fileID: 0} 106 | m_SelectOnDown: {fileID: 0} 107 | m_SelectOnLeft: {fileID: 0} 108 | m_SelectOnRight: {fileID: 0} 109 | m_Transition: 1 110 | m_Colors: 111 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 112 | m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} 113 | m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} 114 | m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} 115 | m_ColorMultiplier: 1 116 | m_FadeDuration: 0.1 117 | m_SpriteState: 118 | m_HighlightedSprite: {fileID: 0} 119 | m_PressedSprite: {fileID: 0} 120 | m_DisabledSprite: {fileID: 0} 121 | m_AnimationTriggers: 122 | m_NormalTrigger: Normal 123 | m_HighlightedTrigger: Highlighted 124 | m_PressedTrigger: Pressed 125 | m_DisabledTrigger: Disabled 126 | m_Interactable: 1 127 | m_TargetGraphic: {fileID: 114523883484901600} 128 | --- !u!222 &222409849478851958 129 | CanvasRenderer: 130 | m_ObjectHideFlags: 1 131 | m_CorrespondingSourceObject: {fileID: 0} 132 | m_PrefabInternal: {fileID: 100100000} 133 | m_GameObject: {fileID: 1848430289707114} 134 | m_CullTransparentMesh: 0 135 | --- !u!224 &224042229428647162 136 | RectTransform: 137 | m_ObjectHideFlags: 1 138 | m_CorrespondingSourceObject: {fileID: 0} 139 | m_PrefabInternal: {fileID: 100100000} 140 | m_GameObject: {fileID: 1848430289707114} 141 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 142 | m_LocalPosition: {x: 0, y: 0, z: 2} 143 | m_LocalScale: {x: 0.005, y: 0.005, z: 1} 144 | m_Children: [] 145 | m_Father: {fileID: 0} 146 | m_RootOrder: 0 147 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 148 | m_AnchorMin: {x: 0, y: 0} 149 | m_AnchorMax: {x: 0, y: 0} 150 | m_AnchoredPosition: {x: 0, y: 0} 151 | m_SizeDelta: {x: 150, y: 20} 152 | m_Pivot: {x: 0.5, y: 0.5} 153 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Prefabs/TextItemPreftab.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4fee78ef3f2d7ea4abe51fd64b984c87 3 | timeCreated: 1522783673 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3335c196679fa948a5478285d192d9f 3 | folderAsset: yes 4 | timeCreated: 1513003312 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Scenes/PeerCCScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c67180c4f8cc47f41b01822fcebd5980 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6e6ecfc2846635488dc557177d1962e 3 | folderAsset: yes 4 | timeCreated: 1513003430 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Scripts/ControlScript.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8fa28ed03f8f8024982c8f0794b9ab2b 3 | timeCreated: 1513004103 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /ClientUnity/Assets/Scripts/GazeGestureManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | using UnityEngine.EventSystems; 5 | using UnityEngine.XR.WSA.Input; 6 | 7 | public class GazeGestureManager : MonoBehaviour 8 | { 9 | public static GazeGestureManager Instance { get; private set; } 10 | 11 | public GameObject FocusedObject { get; private set; } 12 | 13 | GestureRecognizer recognizer; 14 | 15 | public Button ConnectButton; 16 | public Button CallButton; 17 | 18 | void Start() 19 | { 20 | Instance = this; 21 | 22 | recognizer = new GestureRecognizer(); 23 | recognizer.Tapped += (args) => 24 | { 25 | if (FocusedObject != null) 26 | { 27 | if (FocusedObject.GetComponent