├── .gitignore ├── LICENSE ├── README.md ├── VideoSocketApp ├── App.xaml ├── App.xaml.cs ├── Assets │ ├── LockScreenLogo.scale-200.png │ ├── SplashScreen.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── StoreLogo.png │ └── Wide310x150Logo.scale-200.png ├── Package.appxmanifest ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml ├── SocketApp.xaml ├── SocketApp.xaml.cs ├── VideoSocketApp.csproj └── project.json ├── VideoSocketAppServer ├── App.xaml ├── App.xaml.cs ├── Assets │ ├── LockScreenLogo.scale-200.png │ ├── SplashScreen.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── StoreLogo.png │ └── Wide310x150Logo.scale-200.png ├── Connection.cs ├── CurrentStream.cs ├── Package.appxmanifest ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml ├── SocketServer.xaml ├── SocketServer.xaml.cs ├── VideoSocketAppServer.csproj └── project.json └── VideoSocketServer.sln /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml 253 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 davetoland 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VideoSocketServer 2 | Streaming WebCam video, over a TCP socket connection, between UWP Apps in C# 3 | 4 | The server and client must run on different machines. 5 | I deploy the server to a Raspberry Pi 2, running Windows IOT and the app on either the Local Machine, or a Windows 10 Mobile (Emulator will work too). -------------------------------------------------------------------------------- /VideoSocketApp/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /VideoSocketApp/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace VideoSocketApp 19 | { 20 | /// 21 | /// Provides application-specific behavior to supplement the default Application class. 22 | /// 23 | sealed partial class App : Application 24 | { 25 | /// 26 | /// Initializes the singleton application object. This is the first line of authored code 27 | /// executed, and as such is the logical equivalent of main() or WinMain(). 28 | /// 29 | public App() 30 | { 31 | this.InitializeComponent(); 32 | this.Suspending += OnSuspending; 33 | } 34 | 35 | /// 36 | /// Invoked when the application is launched normally by the end user. Other entry points 37 | /// will be used such as when the application is launched to open a specific file. 38 | /// 39 | /// Details about the launch request and process. 40 | protected override void OnLaunched(LaunchActivatedEventArgs e) 41 | { 42 | #if DEBUG 43 | if (System.Diagnostics.Debugger.IsAttached) 44 | { 45 | this.DebugSettings.EnableFrameRateCounter = true; 46 | } 47 | #endif 48 | Frame rootFrame = Window.Current.Content as Frame; 49 | 50 | // Do not repeat app initialization when the Window already has content, 51 | // just ensure that the window is active 52 | if (rootFrame == null) 53 | { 54 | // Create a Frame to act as the navigation context and navigate to the first page 55 | rootFrame = new Frame(); 56 | 57 | rootFrame.NavigationFailed += OnNavigationFailed; 58 | 59 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 60 | { 61 | //TODO: Load state from previously suspended application 62 | } 63 | 64 | // Place the frame in the current Window 65 | Window.Current.Content = rootFrame; 66 | } 67 | 68 | if (e.PrelaunchActivated == false) 69 | { 70 | if (rootFrame.Content == null) 71 | { 72 | // When the navigation stack isn't restored navigate to the first page, 73 | // configuring the new page by passing required information as a navigation 74 | // parameter 75 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 76 | } 77 | // Ensure the current window is active 78 | Window.Current.Activate(); 79 | } 80 | } 81 | 82 | /// 83 | /// Invoked when Navigation to a certain page fails 84 | /// 85 | /// The Frame which failed navigation 86 | /// Details about the navigation failure 87 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 88 | { 89 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 90 | } 91 | 92 | /// 93 | /// Invoked when application execution is being suspended. Application state is saved 94 | /// without knowing whether the application will be terminated or resumed with the contents 95 | /// of memory still intact. 96 | /// 97 | /// The source of the suspend request. 98 | /// Details about the suspend request. 99 | private void OnSuspending(object sender, SuspendingEventArgs e) 100 | { 101 | var deferral = e.SuspendingOperation.GetDeferral(); 102 | //TODO: Save application state and stop any background activity 103 | deferral.Complete(); 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /VideoSocketApp/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketApp/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /VideoSocketApp/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketApp/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /VideoSocketApp/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketApp/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /VideoSocketApp/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketApp/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /VideoSocketApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /VideoSocketApp/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketApp/Assets/StoreLogo.png -------------------------------------------------------------------------------- /VideoSocketApp/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketApp/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /VideoSocketApp/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | VideoSocketApp 7 | dave 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 | -------------------------------------------------------------------------------- /VideoSocketApp/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("VideoSocketApp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("VideoSocketApp")] 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)] -------------------------------------------------------------------------------- /VideoSocketApp/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /VideoSocketApp/SocketApp.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /VideoSocketApp/SocketApp.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using Windows.Media.Core; 9 | using Windows.Media.Playback; 10 | using Windows.Networking; 11 | using Windows.Networking.Sockets; 12 | using Windows.Storage.Streams; 13 | using Windows.UI.Xaml; 14 | using Windows.UI.Xaml.Controls; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace VideoSocketApp 19 | { 20 | public sealed partial class MainPage : Page 21 | { 22 | private Guid _guid = Guid.NewGuid(); 23 | private MediaPlaybackList _playlist = null; 24 | private bool Buffering => _playlist.Items.Count == 0; 25 | 26 | public MainPage() 27 | { 28 | InitializeComponent(); 29 | Media.MediaEnded += Media_MediaEnded; 30 | 31 | _playlist = new MediaPlaybackList(); 32 | //remove played items from the list 33 | _playlist.CurrentItemChanged += (sender, args) => _playlist.Items.Remove(args.OldItem); 34 | _playlist.ItemOpened += Playlist_ItemOpened; 35 | _playlist.ItemFailed += Playlist_ItemFailed; 36 | Media.SetPlaybackSource(_playlist); 37 | } 38 | 39 | private void Playlist_ItemOpened(MediaPlaybackList sender, MediaPlaybackItemOpenedEventArgs args) 40 | { 41 | Debug.WriteLine("New playlist item Opened"); 42 | } 43 | 44 | private void Playlist_ItemFailed(MediaPlaybackList sender, MediaPlaybackItemFailedEventArgs args) 45 | { 46 | Debug.WriteLine("New playlist item Failed!"); 47 | } 48 | 49 | protected async override void OnNavigatedTo(NavigationEventArgs e) 50 | { 51 | base.OnNavigatedTo(e); 52 | //when we're testing this in VS, using Multiple Startup Projects 53 | //pause for a few seconds to allow the server to start up. 54 | await Task.Delay(TimeSpan.FromSeconds(5)); 55 | await Task.WhenAll( 56 | PlayNextVideo(), 57 | DownloadVideos()); 58 | } 59 | 60 | private async Task DownloadVideos() 61 | { 62 | var socket = new StreamSocket(); 63 | while (true) 64 | { 65 | try 66 | { 67 | //if the server hasn't yet started up, or we're having transient 68 | //network issues, keep retrying until we can connect. Obviously 69 | //we'd make this more robust in a non-testing scenario... 70 | await socket.ConnectAsync(new HostName("192.168.1.112"), "13337"); 71 | break; 72 | } 73 | catch { } 74 | } 75 | 76 | //after connecting to the server, block on the input stream until we receive 77 | //a response on it... the server will send a single byte to tell us it's ready 78 | byte[] inbuffer = new byte[1]; 79 | IBuffer result = await socket.InputStream.ReadAsync(inbuffer.AsBuffer(), inbuffer.AsBuffer().Capacity, InputStreamOptions.None); 80 | 81 | //once we're connected, and the server's ready, go into a continuous looop 82 | //of downloading bytes from the socket and reassemble to create MediaSource objects 83 | //In testing this is fine, in production this would need to be more robust 84 | while (true) 85 | { 86 | //in each packet of bytes, the first 16 are a Guid. 87 | //this Guid identifies that video segment. We pass this back 88 | //in on the next request to make sure we don't download the same segment twice 89 | Debug.WriteLine($"Requesting next download ({_guid})"); 90 | IBuffer outbuffer = Encoding.UTF8.GetBytes($"{_guid}").AsBuffer(); 91 | await socket.OutputStream.WriteAsync(outbuffer); 92 | inbuffer = new byte[10000000]; 93 | 94 | //again, block on the input stream until we've received the full packet, 95 | //but use the Partial option so that we don't have to fill the entire buffer before we continue. 96 | //this is important, because the idea is to set the buffer big enough to handle any packet we'll receive, 97 | //meaning we'll never fill the entire buffer... and we don't want to block here indefinitely 98 | result = await socket.InputStream.ReadAsync(inbuffer.AsBuffer(), inbuffer.AsBuffer().Capacity, InputStreamOptions.Partial); 99 | Debug.WriteLine($"Download complete: {result.Length} bytes"); 100 | 101 | //strip off the Guid, leaving just the video data 102 | byte[] guid = result.ToArray().Take(16).ToArray(); 103 | byte[] data = result.ToArray().Skip(16).ToArray(); 104 | _guid = new Guid(guid); 105 | 106 | //wrap the data in a stream, create a MediaSource from it, 107 | //then use that to create a MediaPlackbackItem which gets added 108 | //to the back of the playlist... 109 | var stream = new MemoryStream(data); 110 | var source = MediaSource.CreateFromStream(stream.AsRandomAccessStream(), "video/mp4"); 111 | var item = new MediaPlaybackItem(source); 112 | _playlist.Items.Add(item); 113 | Debug.WriteLine($"New playlist item added to list: {data.Length} bytes"); 114 | Debug.WriteLine($"Playlist now contains {_playlist.Items.Count} items"); 115 | if (_playlist.Items.Count > 2) 116 | { 117 | //this is a bug I haven't worked out yet.. 118 | //from time to time, the list seems to get stuck ?!? 119 | Debug.WriteLine("Playlist stuck, moving next"); 120 | //we can get things moving again by forcing this.. 121 | //TODO: Find out why and implement a more robust solution 122 | _playlist.MoveNext(); 123 | } 124 | 125 | Debug.WriteLine($"Media state: {Media.CurrentState}"); 126 | if (Media.CurrentState != MediaElementState.Playing) 127 | { 128 | //if this is the first cycle/video and we've not yet started playing, or 129 | //if the network is slow, the MediaElement may have reached the end of 130 | //the previous item and stopped, putting us into a state of "buffering"... 131 | Debug.WriteLine("Playing..."); 132 | Media.Play(); 133 | } 134 | 135 | //reset the buffer 136 | inbuffer = new byte[10000000]; 137 | } 138 | } 139 | 140 | private async Task PlayNextVideo() 141 | { 142 | Debug.WriteLine($"Playing next video..."); 143 | while (true) 144 | { 145 | if (!Buffering) 146 | { 147 | //as long as there's at least one item in the 148 | //playlist, start playing the MediaElement 149 | BufferingLbl.Visibility = Visibility.Collapsed; 150 | Media.Play(); 151 | break; 152 | } 153 | else 154 | { 155 | //else go into a 'buffering' loop 156 | Debug.WriteLine($"Buffering..."); 157 | BufferingLbl.Visibility = Visibility.Visible; 158 | await Task.Delay(500); 159 | } 160 | } 161 | } 162 | 163 | private async void Media_MediaEnded(object sender, RoutedEventArgs e) 164 | { 165 | //ideally, the media never stops, as it downloads video 166 | //segments faster than they're played back, but if it does, restart it... 167 | Debug.WriteLine($"Playback ended"); 168 | await PlayNextVideo(); 169 | } 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /VideoSocketApp/VideoSocketApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x86 7 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C} 8 | AppContainerExe 9 | Properties 10 | VideoSocketApp 11 | VideoSocketApp 12 | en-US 13 | UAP 14 | 10.0.10586.0 15 | 10.0.10240.0 16 | 14 17 | 512 18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 19 | VideoSocketApp_TemporaryKey.pfx 20 | SAK 21 | SAK 22 | SAK 23 | SAK 24 | 25 | 26 | true 27 | bin\x86\Debug\ 28 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 29 | ;2008 30 | full 31 | x86 32 | false 33 | prompt 34 | true 35 | 36 | 37 | bin\x86\Release\ 38 | TRACE;NETFX_CORE;WINDOWS_UWP 39 | true 40 | ;2008 41 | pdbonly 42 | x86 43 | false 44 | prompt 45 | true 46 | true 47 | 48 | 49 | true 50 | bin\ARM\Debug\ 51 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 52 | ;2008 53 | full 54 | ARM 55 | false 56 | prompt 57 | true 58 | 59 | 60 | bin\ARM\Release\ 61 | TRACE;NETFX_CORE;WINDOWS_UWP 62 | true 63 | ;2008 64 | pdbonly 65 | ARM 66 | false 67 | prompt 68 | true 69 | true 70 | 71 | 72 | true 73 | bin\x64\Debug\ 74 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 75 | ;2008 76 | full 77 | x64 78 | false 79 | prompt 80 | true 81 | 82 | 83 | bin\x64\Release\ 84 | TRACE;NETFX_CORE;WINDOWS_UWP 85 | true 86 | ;2008 87 | pdbonly 88 | x64 89 | false 90 | prompt 91 | true 92 | true 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | App.xaml 101 | 102 | 103 | SocketApp.xaml 104 | 105 | 106 | 107 | 108 | 109 | Designer 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | MSBuild:Compile 126 | Designer 127 | 128 | 129 | MSBuild:Compile 130 | Designer 131 | 132 | 133 | 134 | 14.0 135 | 136 | 137 | 144 | -------------------------------------------------------------------------------- /VideoSocketApp/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0" 4 | }, 5 | "frameworks": { 6 | "uap10.0": {} 7 | }, 8 | "runtimes": { 9 | "win10-arm": {}, 10 | "win10-arm-aot": {}, 11 | "win10-x86": {}, 12 | "win10-x86-aot": {}, 13 | "win10-x64": {}, 14 | "win10-x64-aot": {} 15 | } 16 | } -------------------------------------------------------------------------------- /VideoSocketAppServer/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /VideoSocketAppServer/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace VideoSocketAppServer 19 | { 20 | /// 21 | /// Provides application-specific behavior to supplement the default Application class. 22 | /// 23 | sealed partial class App : Application 24 | { 25 | /// 26 | /// Initializes the singleton application object. This is the first line of authored code 27 | /// executed, and as such is the logical equivalent of main() or WinMain(). 28 | /// 29 | public App() 30 | { 31 | this.InitializeComponent(); 32 | this.Suspending += OnSuspending; 33 | } 34 | 35 | /// 36 | /// Invoked when the application is launched normally by the end user. Other entry points 37 | /// will be used such as when the application is launched to open a specific file. 38 | /// 39 | /// Details about the launch request and process. 40 | protected override void OnLaunched(LaunchActivatedEventArgs e) 41 | { 42 | #if DEBUG 43 | if (System.Diagnostics.Debugger.IsAttached) 44 | { 45 | this.DebugSettings.EnableFrameRateCounter = true; 46 | } 47 | #endif 48 | Frame rootFrame = Window.Current.Content as Frame; 49 | 50 | // Do not repeat app initialization when the Window already has content, 51 | // just ensure that the window is active 52 | if (rootFrame == null) 53 | { 54 | // Create a Frame to act as the navigation context and navigate to the first page 55 | rootFrame = new Frame(); 56 | 57 | rootFrame.NavigationFailed += OnNavigationFailed; 58 | 59 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 60 | { 61 | //TODO: Load state from previously suspended application 62 | } 63 | 64 | // Place the frame in the current Window 65 | Window.Current.Content = rootFrame; 66 | } 67 | 68 | if (e.PrelaunchActivated == false) 69 | { 70 | if (rootFrame.Content == null) 71 | { 72 | // When the navigation stack isn't restored navigate to the first page, 73 | // configuring the new page by passing required information as a navigation 74 | // parameter 75 | rootFrame.Navigate(typeof(SocketAppServer), e.Arguments); 76 | } 77 | // Ensure the current window is active 78 | Window.Current.Activate(); 79 | } 80 | } 81 | 82 | /// 83 | /// Invoked when Navigation to a certain page fails 84 | /// 85 | /// The Frame which failed navigation 86 | /// Details about the navigation failure 87 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 88 | { 89 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 90 | } 91 | 92 | /// 93 | /// Invoked when application execution is being suspended. Application state is saved 94 | /// without knowing whether the application will be terminated or resumed with the contents 95 | /// of memory still intact. 96 | /// 97 | /// The source of the suspend request. 98 | /// Details about the suspend request. 99 | private void OnSuspending(object sender, SuspendingEventArgs e) 100 | { 101 | var deferral = e.SuspendingOperation.GetDeferral(); 102 | //TODO: Save application state and stop any background activity 103 | deferral.Complete(); 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /VideoSocketAppServer/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketAppServer/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /VideoSocketAppServer/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketAppServer/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /VideoSocketAppServer/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketAppServer/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /VideoSocketAppServer/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketAppServer/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /VideoSocketAppServer/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketAppServer/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /VideoSocketAppServer/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketAppServer/Assets/StoreLogo.png -------------------------------------------------------------------------------- /VideoSocketAppServer/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davetoland/VideoSocketServer/aefd875d61444a7a243f6197efb4c23ca58512d5/VideoSocketAppServer/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /VideoSocketAppServer/Connection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Runtime.InteropServices.WindowsRuntime; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Windows.Networking.Sockets; 7 | using Windows.Storage.Streams; 8 | 9 | namespace VideoSocketAppServer 10 | { 11 | internal class Connection 12 | { 13 | private StreamSocket _socket; 14 | private SocketAppServer _server; 15 | 16 | public Connection(StreamSocket socket, SocketAppServer server) 17 | { 18 | _socket = socket; 19 | _server = server; 20 | 21 | //spin up a thread from the pool 22 | //to listen for client app comms 23 | Task.Run(() => Listen()); 24 | } 25 | 26 | private async Task Listen() 27 | { 28 | //send an acknowledgement byte to the client app 29 | //to signal that we're ready to receive requests 30 | Debug.WriteLine($"Sending connection acknowledgement"); 31 | await _socket.OutputStream.WriteAsync(Encoding.UTF8.GetBytes("0").AsBuffer()); 32 | 33 | while (true) 34 | { 35 | //the client app is expected to request a new video, passing in a guid 36 | //as the "command", read 36 bytes from the buffer and try to parse it. 37 | Debug.WriteLine($"Listening for socket command..."); 38 | IBuffer inbuffer = new Windows.Storage.Streams.Buffer(36); 39 | await _socket.InputStream.ReadAsync(inbuffer, 36, InputStreamOptions.Partial); 40 | string command = Encoding.UTF8.GetString(inbuffer.ToArray()); 41 | Debug.WriteLine($"Command received: {command}"); 42 | 43 | //use the guid to either get the current video, or wait for the 44 | //next new one that's added by the server 45 | Guid guid = Guid.Empty; 46 | Guid.TryParse(command, out guid); 47 | byte[] data = _server.GetCurrentVideoDataAsync(guid); 48 | if (data != null) 49 | await _socket.OutputStream.WriteAsync(data.AsBuffer()); 50 | else 51 | Debug.WriteLine($"Could not intialise, video does not exist"); 52 | 53 | //add a brief delay to reduce system load 54 | await Task.Delay(50); 55 | } 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /VideoSocketAppServer/CurrentStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace VideoSocketAppServer 4 | { 5 | internal class CurrentVideo 6 | { 7 | public Guid Id { get; set; } 8 | public byte[] Data { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /VideoSocketAppServer/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | VideoSocketAppServer 7 | dave 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 | -------------------------------------------------------------------------------- /VideoSocketAppServer/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("VideoSocketAppServer")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("VideoSocketAppServer")] 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)] -------------------------------------------------------------------------------- /VideoSocketAppServer/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /VideoSocketAppServer/SocketServer.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /VideoSocketAppServer/SocketServer.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | using Windows.Devices.Enumeration; 9 | using Windows.Media.Capture; 10 | using Windows.Media.MediaProperties; 11 | using Windows.Networking; 12 | using Windows.Networking.Connectivity; 13 | using Windows.Networking.Sockets; 14 | using Windows.Storage; 15 | using Windows.Storage.Streams; 16 | using Windows.UI.Xaml.Controls; 17 | using Windows.UI.Xaml.Navigation; 18 | 19 | namespace VideoSocketAppServer 20 | { 21 | public sealed partial class SocketAppServer : Page 22 | { 23 | private int _port = 13337; 24 | private MediaCapture _mediaCap; 25 | private StreamSocketListener _listener; 26 | private ManualResetEvent _signal = new ManualResetEvent(false); 27 | private List _connections = new List(); 28 | internal CurrentVideo CurrentVideo = new CurrentVideo(); 29 | 30 | public SocketAppServer() 31 | { 32 | InitializeComponent(); 33 | } 34 | 35 | protected async override void OnNavigatedTo(NavigationEventArgs e) 36 | { 37 | base.OnNavigatedTo(e); 38 | await InitialiseVideo(); 39 | await StartListener(); 40 | await BeginRecording(); 41 | } 42 | 43 | private async Task InitialiseVideo() 44 | { 45 | //to be refactored 46 | Debug.WriteLine($"Initialising video..."); 47 | var settings = ApplicationData.Current.LocalSettings; 48 | string preferredDeviceName = $"{settings.Values["PreferredDeviceName"]}"; 49 | if (string.IsNullOrWhiteSpace(preferredDeviceName)) 50 | preferredDeviceName = "Microsoft® LifeCam HD-3000"; 51 | 52 | //select webcam device 53 | var videoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture); 54 | DeviceInformation device = videoDevices.FirstOrDefault(x => x.Name == preferredDeviceName); 55 | if (device == null) 56 | device = videoDevices.FirstOrDefault(); 57 | 58 | if (device == null) 59 | throw new Exception("Cannot find a camera device"); 60 | else 61 | { 62 | //initialise media capture 63 | _mediaCap = new MediaCapture(); 64 | var initSettings = new MediaCaptureInitializationSettings { VideoDeviceId = device.Id }; 65 | await _mediaCap.InitializeAsync(initSettings); 66 | _mediaCap.Failed += new MediaCaptureFailedEventHandler(MediaCaptureFailed); 67 | } 68 | 69 | Debug.WriteLine($"Video initialised"); 70 | } 71 | 72 | private void MediaCaptureFailed(MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs) 73 | { 74 | Debug.WriteLine($"Video capture failed: {errorEventArgs.Message}"); 75 | } 76 | 77 | private async Task BeginRecording() 78 | { 79 | while (true) 80 | { 81 | try 82 | { 83 | //record a 5 second video to stream 84 | Debug.WriteLine($"Recording started"); 85 | var memoryStream = new InMemoryRandomAccessStream(); 86 | await _mediaCap.StartRecordToStreamAsync(MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Vga), memoryStream); 87 | await Task.Delay(TimeSpan.FromSeconds(5)); 88 | await _mediaCap.StopRecordAsync(); 89 | Debug.WriteLine($"Recording finished, {memoryStream.Size} bytes"); 90 | 91 | //create a CurrentVideo object to hold stream data and give it a unique id 92 | //which the client app can use to ensure they only request each video once 93 | memoryStream.Seek(0); 94 | CurrentVideo.Id = Guid.NewGuid(); 95 | CurrentVideo.Data = new byte[memoryStream.Size]; 96 | 97 | //read the stream data into the CurrentVideo 98 | await memoryStream.ReadAsync(CurrentVideo.Data.AsBuffer(), (uint)memoryStream.Size, InputStreamOptions.None); 99 | Debug.WriteLine($"Bytes written to stream"); 100 | 101 | //signal to waiting connections that there's a new video 102 | _signal.Set(); 103 | _signal.Reset(); 104 | } 105 | catch (Exception ex) 106 | { 107 | Debug.WriteLine($"StartRecording -> {ex.Message}"); 108 | break; 109 | } 110 | } 111 | } 112 | 113 | private async Task StartListener() 114 | { 115 | //listen for client socket connections by binding to a host and port, 116 | //then wrap the socket in a Connection object and add it to the collection 117 | Debug.WriteLine($"Starting listener"); 118 | _listener = new StreamSocketListener(); 119 | _listener.ConnectionReceived += (sender, args) => 120 | { 121 | Debug.WriteLine($"Connection received from {args.Socket.Information.RemoteAddress}"); 122 | _connections.Add(new Connection(args.Socket, this)); 123 | }; 124 | 125 | HostName host = NetworkInformation.GetHostNames().FirstOrDefault(x => x.IPInformation != null && x.Type == HostNameType.Ipv4); 126 | await _listener.BindEndpointAsync(host, $"{_port}"); 127 | Debug.WriteLine($"Listener started on {host.DisplayName}:{_listener.Information.LocalPort}"); 128 | } 129 | 130 | internal byte[] GetCurrentVideoDataAsync(Guid guid) 131 | { 132 | //if this is the initial run, wait until the first video is available 133 | //or if this request is for the current video, wait for the next one 134 | if (CurrentVideo.Id == Guid.Empty || CurrentVideo.Id == guid) 135 | _signal.WaitOne(); 136 | 137 | //join the guid onto the start of the stream data 138 | return CurrentVideo.Id.ToByteArray().Concat(CurrentVideo.Data).ToArray(); 139 | } 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /VideoSocketAppServer/VideoSocketAppServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x86 7 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A} 8 | AppContainerExe 9 | Properties 10 | VideoSocketAppServer 11 | VideoSocketAppServer 12 | en-US 13 | UAP 14 | 10.0.10586.0 15 | 10.0.10240.0 16 | 14 17 | 512 18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 19 | VideoSocketAppServer_TemporaryKey.pfx 20 | SAK 21 | SAK 22 | SAK 23 | SAK 24 | 25 | 26 | true 27 | bin\x86\Debug\ 28 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 29 | ;2008 30 | full 31 | x86 32 | false 33 | prompt 34 | true 35 | 36 | 37 | bin\x86\Release\ 38 | TRACE;NETFX_CORE;WINDOWS_UWP 39 | true 40 | ;2008 41 | pdbonly 42 | ARM 43 | false 44 | prompt 45 | true 46 | true 47 | 48 | 49 | true 50 | bin\ARM\Debug\ 51 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 52 | ;2008 53 | full 54 | ARM 55 | false 56 | prompt 57 | true 58 | 59 | 60 | bin\ARM\Release\ 61 | TRACE;NETFX_CORE;WINDOWS_UWP 62 | true 63 | ;2008 64 | pdbonly 65 | ARM 66 | false 67 | prompt 68 | true 69 | true 70 | 71 | 72 | true 73 | bin\x64\Debug\ 74 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 75 | ;2008 76 | full 77 | x64 78 | false 79 | prompt 80 | true 81 | 82 | 83 | bin\x64\Release\ 84 | TRACE;NETFX_CORE;WINDOWS_UWP 85 | true 86 | ;2008 87 | pdbonly 88 | x64 89 | false 90 | prompt 91 | true 92 | true 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | App.xaml 101 | 102 | 103 | 104 | 105 | SocketServer.xaml 106 | 107 | 108 | 109 | 110 | 111 | Designer 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | MSBuild:Compile 128 | Designer 129 | 130 | 131 | MSBuild:Compile 132 | Designer 133 | 134 | 135 | 136 | 14.0 137 | 138 | 139 | 146 | -------------------------------------------------------------------------------- /VideoSocketAppServer/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0" 4 | }, 5 | "frameworks": { 6 | "uap10.0": {} 7 | }, 8 | "runtimes": { 9 | "win10-arm": {}, 10 | "win10-arm-aot": {}, 11 | "win10-x86": {}, 12 | "win10-x86-aot": {}, 13 | "win10-x64": {}, 14 | "win10-x64-aot": {} 15 | } 16 | } -------------------------------------------------------------------------------- /VideoSocketServer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoSocketApp", "VideoSocketApp\VideoSocketApp.csproj", "{11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoSocketAppServer", "VideoSocketAppServer\VideoSocketAppServer.csproj", "{13878BF4-07FB-4FA2-BE06-D40A12BAF60A}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|ARM = Debug|ARM 14 | Debug|x64 = Debug|x64 15 | Debug|x86 = Debug|x86 16 | Release|Any CPU = Release|Any CPU 17 | Release|ARM = Release|ARM 18 | Release|x64 = Release|x64 19 | Release|x86 = Release|x86 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Debug|Any CPU.ActiveCfg = Debug|x86 23 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Debug|ARM.ActiveCfg = Debug|x86 24 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Debug|ARM.Build.0 = Debug|x86 25 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Debug|ARM.Deploy.0 = Debug|x86 26 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Debug|x64.ActiveCfg = Debug|x64 27 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Debug|x64.Build.0 = Debug|x64 28 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Debug|x64.Deploy.0 = Debug|x64 29 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Debug|x86.ActiveCfg = Debug|x86 30 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Debug|x86.Build.0 = Debug|x86 31 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Debug|x86.Deploy.0 = Debug|x86 32 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Release|Any CPU.ActiveCfg = Release|x86 33 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Release|ARM.ActiveCfg = Release|x86 34 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Release|ARM.Build.0 = Release|x86 35 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Release|ARM.Deploy.0 = Release|x86 36 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Release|x64.ActiveCfg = Release|x64 37 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Release|x64.Build.0 = Release|x64 38 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Release|x64.Deploy.0 = Release|x64 39 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Release|x86.ActiveCfg = Release|x86 40 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Release|x86.Build.0 = Release|x86 41 | {11C65C6A-F7D9-4D9D-9C42-4028DB4BFC4C}.Release|x86.Deploy.0 = Release|x86 42 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Debug|Any CPU.ActiveCfg = Debug|x86 43 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Debug|ARM.ActiveCfg = Debug|ARM 44 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Debug|ARM.Build.0 = Debug|ARM 45 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Debug|ARM.Deploy.0 = Debug|ARM 46 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Debug|x64.ActiveCfg = Debug|x64 47 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Debug|x64.Build.0 = Debug|x64 48 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Debug|x64.Deploy.0 = Debug|x64 49 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Debug|x86.ActiveCfg = Debug|x86 50 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Debug|x86.Build.0 = Debug|x86 51 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Debug|x86.Deploy.0 = Debug|x86 52 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Release|Any CPU.ActiveCfg = Release|x86 53 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Release|ARM.ActiveCfg = Release|ARM 54 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Release|ARM.Build.0 = Release|ARM 55 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Release|ARM.Deploy.0 = Release|ARM 56 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Release|x64.ActiveCfg = Release|x64 57 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Release|x64.Build.0 = Release|x64 58 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Release|x64.Deploy.0 = Release|x64 59 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Release|x86.ActiveCfg = Release|x86 60 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Release|x86.Build.0 = Release|x86 61 | {13878BF4-07FB-4FA2-BE06-D40A12BAF60A}.Release|x86.Deploy.0 = Release|x86 62 | EndGlobalSection 63 | GlobalSection(SolutionProperties) = preSolution 64 | HideSolutionNode = FALSE 65 | EndGlobalSection 66 | EndGlobal 67 | --------------------------------------------------------------------------------