From 9fc6aa155cff3a919a91d66abadd9c3449b80ed4 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Mon, 13 Apr 2020 16:50:31 -0700 Subject: [PATCH] Add RTC message DTOs. --- .../ViewModels/MainWindowViewModel.cs | 1 + Desktop.Win/ViewModels/MainWindowViewModel.cs | 1 + ScreenCast.Core/Communication/CasterSocket.cs | 71 +++++----- .../Communication/WebRtcSession.cs | 42 ++++-- ScreenCast.Core/Models/Viewer.cs | 95 ++++++++++++- ScreenCast.Core/Services/ScreenCasterBase.cs | 110 ++++++--------- ScreenCast.Linux/Program.cs | 2 + .../Services/ScreenCasterLinux.cs | 9 +- ScreenCast.Win/Program.cs | 17 +-- ScreenCast.Win/ScreenCast.Win.csproj | 1 + .../Services/KeyboardMouseInputWin.cs | 7 +- ScreenCast.Win/Services/ScreenCapturerWin.cs | 130 +++++++++++------- ScreenCast.Win/Services/ScreenCasterWin.cs | 8 +- Server/Server.csproj | 21 ++- Server/Services/RCDeviceSocketHub.cs | 7 +- .../wwwroot/scripts/Enums/DynamicDtoType.js | 8 ++ .../{Models => Enums}/DynamicDtoType.js.map | 2 +- .../wwwroot/scripts/Enums/DynamicDtoType.ts | 6 + Server/wwwroot/scripts/Models/DynamicDto.ts | 5 - .../wwwroot/scripts/Models/DynamicDtoType.js | 5 - .../wwwroot/scripts/Models/DynamicDtoType.ts | 3 - Server/wwwroot/scripts/Models/FrameInfo.js | 1 - .../wwwroot/scripts/Models/FrameInfo.js.map | 1 - .../{Models => RemoteControl}/DynamicDto.js | 0 .../DynamicDto.js.map | 0 .../scripts/RemoteControl/DynamicDto.ts | 5 + Server/wwwroot/scripts/RemoteControl/Main.js | 2 + .../wwwroot/scripts/RemoteControl/Main.js.map | 2 +- Server/wwwroot/scripts/RemoteControl/Main.ts | 2 + .../scripts/RemoteControl/RCBrowserSockets.js | 22 +-- .../RemoteControl/RCBrowserSockets.js.map | 2 +- .../scripts/RemoteControl/RCBrowserSockets.ts | 22 +-- .../RemoteControl/RtcDtos/CaptureFrameDto.js | 1 + .../RtcDtos/CaptureFrameDto.js.map | 1 + .../RtcDtos/CaptureFrameDto.ts} | 2 +- .../RemoteControl/RtcDtos/MachineNameDto.js | 1 + .../RtcDtos/MachineNameDto.js.map | 1 + .../RemoteControl/RtcDtos/MachineNameDto.ts | 3 + .../RemoteControl/RtcDtos/ScreenDataDto.js | 1 + .../RtcDtos/ScreenDataDto.js.map | 1 + .../RemoteControl/RtcDtos/ScreenDataDto.ts | 4 + .../RemoteControl/RtcDtos/ScreenSizeDto.js | 1 + .../RtcDtos/ScreenSizeDto.js.map | 1 + .../RemoteControl/RtcDtos/ScreenSizeDto.ts | 4 + .../RemoteControl/RtcMessageHandler.js | 64 +++++++++ .../RemoteControl/RtcMessageHandler.js.map | 1 + .../RemoteControl/RtcMessageHandler.ts | 71 ++++++++++ .../scripts/RemoteControl/RtcSession.js | 43 +----- .../scripts/RemoteControl/RtcSession.js.map | 2 +- .../scripts/RemoteControl/RtcSession.ts | 44 +----- Server/wwwroot/scripts/RemoteControl/UI.js | 24 ++++ .../wwwroot/scripts/RemoteControl/UI.js.map | 2 +- Server/wwwroot/scripts/RemoteControl/UI.ts | 26 ++++ Shared/Enums/DynamicDtoType.cs | 10 +- .../CaptureFrameDto.cs} | 6 +- Shared/Models/RtcDtos/ClipboardTextDto.cs | 19 +++ Shared/Models/RtcDtos/MachineNameDto.cs | 23 ++++ Shared/Models/RtcDtos/ScreenDataDto.cs | 28 ++++ Shared/Models/RtcDtos/ScreenSizeDto.cs | 27 ++++ Shared/Win32/Win32Interop.cs | 2 +- 60 files changed, 672 insertions(+), 351 deletions(-) create mode 100644 Server/wwwroot/scripts/Enums/DynamicDtoType.js rename Server/wwwroot/scripts/{Models => Enums}/DynamicDtoType.js.map (50%) create mode 100644 Server/wwwroot/scripts/Enums/DynamicDtoType.ts delete mode 100644 Server/wwwroot/scripts/Models/DynamicDto.ts delete mode 100644 Server/wwwroot/scripts/Models/DynamicDtoType.js delete mode 100644 Server/wwwroot/scripts/Models/DynamicDtoType.ts delete mode 100644 Server/wwwroot/scripts/Models/FrameInfo.js delete mode 100644 Server/wwwroot/scripts/Models/FrameInfo.js.map rename Server/wwwroot/scripts/{Models => RemoteControl}/DynamicDto.js (100%) rename Server/wwwroot/scripts/{Models => RemoteControl}/DynamicDto.js.map (100%) create mode 100644 Server/wwwroot/scripts/RemoteControl/DynamicDto.ts create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcDtos/CaptureFrameDto.js create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcDtos/CaptureFrameDto.js.map rename Server/wwwroot/scripts/{Models/FrameInfo.ts => RemoteControl/RtcDtos/CaptureFrameDto.ts} (79%) create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.js create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.js.map create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.ts create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.js create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.js.map create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.ts create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.js create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.js.map create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.ts create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.js create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.js.map create mode 100644 Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.ts rename Shared/Models/{FrameInfo.cs => RtcDtos/CaptureFrameDto.cs} (81%) create mode 100644 Shared/Models/RtcDtos/ClipboardTextDto.cs create mode 100644 Shared/Models/RtcDtos/MachineNameDto.cs create mode 100644 Shared/Models/RtcDtos/ScreenDataDto.cs create mode 100644 Shared/Models/RtcDtos/ScreenSizeDto.cs diff --git a/Desktop.Linux/ViewModels/MainWindowViewModel.cs b/Desktop.Linux/ViewModels/MainWindowViewModel.cs index 545514a48..59dc4e6bf 100644 --- a/Desktop.Linux/ViewModels/MainWindowViewModel.cs +++ b/Desktop.Linux/ViewModels/MainWindowViewModel.cs @@ -231,6 +231,7 @@ private void BuildServices() serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddTransient(); + serviceCollection.AddTransient(); ServiceContainer.Instance = serviceCollection.BuildServiceProvider(); diff --git a/Desktop.Win/ViewModels/MainWindowViewModel.cs b/Desktop.Win/ViewModels/MainWindowViewModel.cs index 117ad88db..ab2cfaf2c 100644 --- a/Desktop.Win/ViewModels/MainWindowViewModel.cs +++ b/Desktop.Win/ViewModels/MainWindowViewModel.cs @@ -259,6 +259,7 @@ private void BuildServices() serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddTransient(); + serviceCollection.AddTransient(); ServiceContainer.Instance = serviceCollection.BuildServiceProvider(); diff --git a/ScreenCast.Core/Communication/CasterSocket.cs b/ScreenCast.Core/Communication/CasterSocket.cs index bf7719287..605210a8c 100644 --- a/ScreenCast.Core/Communication/CasterSocket.cs +++ b/ScreenCast.Core/Communication/CasterSocket.cs @@ -83,9 +83,9 @@ public async Task SendAudioSample(byte[] buffer, List viewerIDs) await Connection.SendAsync("SendAudioSample", buffer, viewerIDs); } - public async Task SendClipboardText(string clipboardText, List viewerIDs) + public async Task SendClipboardText(string clipboardText, string viewerID) { - await Connection.SendAsync("SendClipboardText", clipboardText, viewerIDs); + await Connection.SendAsync("SendClipboardText", clipboardText, viewerID); } public async Task SendConnectionFailedToViewers(List viewerIDs) @@ -118,7 +118,7 @@ public async Task SendRtcOfferToBrowser(string sdp, string viewerID) await Connection.SendAsync("SendRtcOfferToBrowser", sdp, viewerID); } - public async Task SendScreenCapture(byte[] captureBytes, string viewerID, int left, int top, int width, int height, long imageQuality) + public async Task SendScreenCapture(byte[] captureBytes, string viewerID, int left, int top, int width, int height, int imageQuality) { await Connection.SendAsync("SendScreenCapture", captureBytes, viewerID, left, top, width, height, imageQuality); } @@ -405,35 +405,36 @@ private void ApplyConnectionHandlers() KeyboardMouseInput.SendLeftMouseUp(percentX, percentY, viewer); } }); - Connection.On("SharedFileIDs", (List fileIDs) => - { - fileIDs.ForEach(id => - { - var url = $"{conductor.Host}/API/FileSharing/{id}"; - var webRequest = WebRequest.CreateHttp(url); - var response = webRequest.GetResponse(); - var contentDisp = response.Headers["Content-Disposition"]; - var fileName = contentDisp - .Split(";".ToCharArray()) - .FirstOrDefault(x => x.Trim().StartsWith("filename")) - .Split("=".ToCharArray())[1]; - - var legalChars = fileName.ToCharArray().Where(x => !Path.GetInvalidFileNameChars().Any(y => x == y)); - - fileName = new string(legalChars.ToArray()); - - var dirPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "RemotelySharedFiles")).FullName; - var filePath = Path.Combine(dirPath, fileName); - using (var fs = new FileStream(filePath, FileMode.Create)) - { - using (var rs = response.GetResponseStream()) - { - rs.CopyTo(fs); - } - } - Process.Start("explorer.exe", dirPath); - }); - }); + + //Connection.On("SharedFileIDs", (List fileIDs) => + //{ + // fileIDs.ForEach(id => + // { + // var url = $"{conductor.Host}/API/FileSharing/{id}"; + // var webRequest = WebRequest.CreateHttp(url); + // var response = webRequest.GetResponse(); + // var contentDisp = response.Headers["Content-Disposition"]; + // var fileName = contentDisp + // .Split(";".ToCharArray()) + // .FirstOrDefault(x => x.Trim().StartsWith("filename")) + // .Split("=".ToCharArray())[1]; + + // var legalChars = fileName.ToCharArray().Where(x => !Path.GetInvalidFileNameChars().Any(y => x == y)); + + // fileName = new string(legalChars.ToArray()); + + // var dirPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "RemotelySharedFiles")).FullName; + // var filePath = Path.Combine(dirPath, fileName); + // using (var fs = new FileStream(filePath, FileMode.Create)) + // { + // using (var rs = response.GetResponseStream()) + // { + // rs.CopyTo(fs); + // } + // } + // Process.Start("explorer.exe", dirPath); + // }); + //}); Connection.On("SessionID", (string sessionID) => { @@ -444,10 +445,10 @@ private void ApplyConnectionHandlers() private async void ClipboardService_ClipboardTextChanged(object sender, string clipboardText) { var conductor = ServiceContainer.Instance.GetRequiredService(); - var viewerIDs = conductor.Viewers.Keys.ToList(); - if (viewerIDs.Any()) + var viewerIDs = conductor.Viewers.Values.ToList(); + foreach (var viewer in viewerIDs) { - await SendClipboardText(clipboardText, viewerIDs); + await viewer.SendClipboardText(clipboardText); } } } diff --git a/ScreenCast.Core/Communication/WebRtcSession.cs b/ScreenCast.Core/Communication/WebRtcSession.cs index 137ce2484..603ed902e 100644 --- a/ScreenCast.Core/Communication/WebRtcSession.cs +++ b/ScreenCast.Core/Communication/WebRtcSession.cs @@ -2,6 +2,7 @@ using Microsoft.MixedReality.WebRTC; using Remotely.ScreenCast.Core.Services; using Remotely.Shared.Models; +using Remotely.Shared.Models.RtcDtos; using System; using System.Collections.Generic; using System.Linq; @@ -62,7 +63,7 @@ public void SendCaptureFrame(int left, int top, int width, int height, byte[] im { for (var i = 0; i < imageBytes.Length; i += 50_000) { - CaptureChannel.SendMessage(MessagePackSerializer.Serialize(new FrameInfo() + SendDto(new CaptureFrameDto() { Left = left, Top = top, @@ -70,20 +71,38 @@ public void SendCaptureFrame(int left, int top, int width, int height, byte[] im Height = height, EndOfFrame = false, ImageBytes = imageBytes.Skip(i).Take(50_000).ToArray(), - ImageQuality = imageQuality, - DtoType = Shared.Enums.DynamicDtoType.FrameInfo - })); + ImageQuality = imageQuality + }); } - CaptureChannel.SendMessage(MessagePackSerializer.Serialize(new FrameInfo() + SendDto(new CaptureFrameDto() { Left = left, Top = top, Width = width, Height = height, EndOfFrame = true, - ImageQuality = imageQuality, - DtoType = Shared.Enums.DynamicDtoType.FrameInfo - })); + ImageQuality = imageQuality + }); + } + + public void SendClipboardText(string clipboardText) + { + SendDto(new ClipboardTextDto(clipboardText)); + } + + public void SendMachineName(string machineName) + { + SendDto(new MachineNameDto(machineName)); + } + + public void SendScreenData(string selectedScreen, string[] displayNames) + { + SendDto(new ScreenDataDto(selectedScreen, displayNames)); + } + + public void SendScreenSize(int width, int height) + { + SendDto(new ScreenSizeDto(width, height)); } public void SetRemoteDescription(string type, string sdp) @@ -94,7 +113,6 @@ public void SetRemoteDescription(string type, string sdp) PeerConnection.CreateAnswer(); } } - private void CaptureChannel_MessageReceived(byte[] obj) { Logger.Debug($"DataChannel message received. Size: {obj.Length}"); @@ -108,7 +126,6 @@ private async void CaptureChannel_StateChanged() await Init(); } } - private void DataChannel_BufferingChanged(ulong previous, ulong current, ulong limit) { Logger.Debug($"DataChannel buffering changed. Previous: {previous}. Current: {current}. Limit: {limit}."); @@ -136,5 +153,10 @@ private void PeerConnection_LocalSdpReadytoSend(string type, string sdp) Logger.Debug($"Local SDP ready."); LocalSdpReady?.Invoke(this, sdp); } + + private void SendDto(T dto) + { + CaptureChannel.SendMessage(MessagePackSerializer.Serialize(dto)); + } } } diff --git a/ScreenCast.Core/Models/Viewer.cs b/ScreenCast.Core/Models/Viewer.cs index de3af0801..8fc8f2720 100644 --- a/ScreenCast.Core/Models/Viewer.cs +++ b/ScreenCast.Core/Models/Viewer.cs @@ -11,17 +11,19 @@ public class Viewer : IDisposable { private int imageQuality; - public Viewer() + public Viewer(IScreenCapturer screenCapturer, + CasterSocket casterSocket) { + Capturer = screenCapturer; + CasterSocket = casterSocket; EncoderParams = new EncoderParameters(); ImageQuality = 60; } - public bool AutoAdjustQuality { get; internal set; } = true; - public IScreenCapturer Capturer { get; set; } + public bool AutoAdjustQuality { get; set; } = true; + public IScreenCapturer Capturer { get; } public bool DisconnectRequested { get; set; } public EncoderParameters EncoderParams { get; private set; } - public bool FullScreenRefreshNeeded { get; internal set; } - public bool HasControl { get; set; } + public bool HasControl { get; set; } = true; public int ImageQuality { get @@ -43,15 +45,44 @@ public int ImageQuality EncoderParams.Param[0] = new EncoderParameter(Encoder.Quality, value); } } + + public bool IsConnected => CasterSocket.IsConnected; public string Name { get; set; } public WebRtcSession RtcSession { get; set; } public string ViewerConnectionID { get; set; } public int WebSocketBuffer { get; set; } + private CasterSocket CasterSocket { get; } + public void Disconnect() + { + RtcSession.Dispose(); + } + public void Dispose() { RtcSession?.Dispose(); } + public async Task InitializeWebRtc() + { + try + { + RtcSession = new WebRtcSession(); + RtcSession.LocalSdpReady += async (sender, sdp) => + { + await CasterSocket.SendRtcOfferToBrowser(sdp, ViewerConnectionID); + }; + RtcSession.IceCandidateReady += async (sender, args) => + { + await CasterSocket.SendIceCandidateToBrowser(args.candidate, args.sdpMlineIndex, args.sdpMid, ViewerConnectionID); + }; + await RtcSession.Init(); + } + catch (Exception ex) + { + Logger.Write(ex); + } + } + public bool IsStalled() { return RtcSession?.CurrentBuffer > 1_000_000 || WebSocketBuffer > 1_000_000; @@ -62,9 +93,46 @@ public bool IsUsingWebRtc() return RtcSession?.IsPeerConnected == true && RtcSession?.IsDataChannelOpen == true; } + public async Task SendClipboardText(string clipboardText) + { + await SendToViewer(() => RtcSession.SendClipboardText(clipboardText), + () => CasterSocket.SendClipboardText(clipboardText, ViewerConnectionID)); + } + + public async Task SendMachineName(string machineName, string viewerID) + { + await SendToViewer(()=> RtcSession.SendMachineName(machineName), + () => CasterSocket.SendMachineName(machineName, viewerID)); + } + + public async Task SendScreenCapture(byte[] encodedImageBytes, string viewerID, int left, int top, int width, int height, int imageQuality) + { + await SendToViewer(() => + { + RtcSession.SendCaptureFrame(left, top, width, height, encodedImageBytes, ImageQuality); + WebSocketBuffer = 0; + }, async () => + { + await CasterSocket.SendScreenCapture(encodedImageBytes, viewerID, left, top, width, height, imageQuality); + WebSocketBuffer += encodedImageBytes.Length; + }); + } + + public async Task SendScreenData(string selectedScreen, string[] displayNames, string viewerID) + { + await SendToViewer(() => RtcSession.SendScreenData(selectedScreen, displayNames), + () => CasterSocket.SendScreenData(selectedScreen, displayNames, viewerID)); + } + + public async Task SendScreenSize(int width, int height, string viewerID) + { + await SendToViewer(() => RtcSession.SendScreenSize(width, height), + () => CasterSocket.SendScreenSize(width, height, viewerID)); + } + public async Task ThrottleIfNeeded() { - var currentBuffer = IsUsingWebRtc() ? + var currentBuffer = IsUsingWebRtc() ? (int)RtcSession.CurrentBuffer : WebSocketBuffer; @@ -75,7 +143,7 @@ public async Task ThrottleIfNeeded() ImageQuality = Math.Max(ImageQuality - (150_000 / currentBuffer), 0); Logger.Debug($"Auto-adjusting image quality. Quality: {ImageQuality}"); } - + var delay = (int)Math.Ceiling((currentBuffer - 150_000) * .0025); Logger.Debug($"Throttling output due to buffer size. Size: {currentBuffer}. Delay: {delay}"); await Task.Delay(delay); @@ -85,5 +153,18 @@ public async Task ThrottleIfNeeded() ImageQuality = Math.Min(ImageQuality + 1, 60); } } + + private Task SendToViewer(Action webRtcSend, Func websocketSend) + { + if (IsUsingWebRtc()) + { + webRtcSend(); + return Task.CompletedTask; + } + else + { + return websocketSend(); + } + } } } diff --git a/ScreenCast.Core/Services/ScreenCasterBase.cs b/ScreenCast.Core/Services/ScreenCasterBase.cs index 9fed63bcc..86541a3a6 100644 --- a/ScreenCast.Core/Services/ScreenCasterBase.cs +++ b/ScreenCast.Core/Services/ScreenCasterBase.cs @@ -15,60 +15,61 @@ namespace Remotely.ScreenCast.Core.Services { public class ScreenCasterBase { + public ScreenCasterBase(Viewer viewer) + { + Viewer = viewer; + } + + protected Viewer Viewer { get; } + public async Task BeginScreenCasting(string viewerID, - string requesterName, - IScreenCapturer capturer) + string requesterName) { var conductor = ServiceContainer.Instance.GetRequiredService(); var viewers = conductor.Viewers; var mode = conductor.Mode; - var casterSocket = ServiceContainer.Instance.GetRequiredService(); - Logger.Write($"Starting screen cast. Requester: {requesterName}. Viewer ID: {viewerID}. Capturer: {capturer.GetType().ToString()}. App Mode: {mode}"); + Logger.Write($"Starting screen cast. Requester: {requesterName}. Viewer ID: {viewerID}. App Mode: {mode}"); byte[] encodedImageBytes; var fpsQueue = new Queue(); - var viewer = new Viewer() - { - Capturer = capturer, - DisconnectRequested = false, - Name = requesterName, - ViewerConnectionID = viewerID, - HasControl = true - }; + Viewer.Name = requesterName; + Viewer.ViewerConnectionID = viewerID; - viewers.AddOrUpdate(viewerID, viewer, (id, v) => viewer); + viewers.AddOrUpdate(viewerID, Viewer, (id, v) => Viewer); if (mode == Enums.AppMode.Normal) { - conductor.InvokeViewerAdded(viewer); + conductor.InvokeViewerAdded(Viewer); } if (EnvironmentHelper.IsWindows) { - await InitializeWebRtc(viewer, casterSocket); + await Viewer.InitializeWebRtc(); } - await casterSocket.SendMachineName(Environment.MachineName, viewerID); - - await casterSocket.SendScreenData( - capturer.SelectedScreen, - capturer.GetDisplayNames().ToArray(), + await Viewer.SendMachineName(Environment.MachineName, viewerID); + + await Viewer.SendScreenData( + Viewer.Capturer.SelectedScreen, + Viewer.Capturer.GetDisplayNames().ToArray(), viewerID); - await casterSocket.SendScreenSize(capturer.CurrentScreenBounds.Width, capturer.CurrentScreenBounds.Height, viewerID); + await Viewer.SendScreenSize(Viewer.Capturer.CurrentScreenBounds.Width, + Viewer.Capturer.CurrentScreenBounds.Height, + viewerID); - capturer.ScreenChanged += async (sender, bounds) => + Viewer.Capturer.ScreenChanged += async (sender, bounds) => { - await casterSocket.SendScreenSize(bounds.Width, bounds.Height, viewerID); + await Viewer.SendScreenSize(bounds.Width, bounds.Height, viewerID); }; - while (!viewer.DisconnectRequested && casterSocket.IsConnected) + while (!Viewer.DisconnectRequested && Viewer.IsConnected) { try { - if (viewer.IsStalled()) + if (Viewer.IsStalled()) { // Viewer isn't responding. Abort sending. break; @@ -84,38 +85,30 @@ await casterSocket.SendScreenData( Debug.WriteLine($"Capture FPS: {fpsQueue.Count}"); } - await viewer.ThrottleIfNeeded(); + await Viewer.ThrottleIfNeeded(); - capturer.GetNextFrame(); + Viewer.Capturer.GetNextFrame(); - var diffArea = ImageUtils.GetDiffArea(capturer.CurrentFrame, capturer.PreviousFrame, capturer.CaptureFullscreen); + var diffArea = ImageUtils.GetDiffArea(Viewer.Capturer.CurrentFrame, Viewer.Capturer.PreviousFrame, Viewer.Capturer.CaptureFullscreen); if (diffArea.IsEmpty) { continue; } - using (var newImage = capturer.CurrentFrame.Clone(diffArea, PixelFormat.Format32bppArgb)) + using (var newImage = Viewer.Capturer.CurrentFrame.Clone(diffArea, PixelFormat.Format32bppArgb)) { - if (capturer.CaptureFullscreen) + if (Viewer.Capturer.CaptureFullscreen) { - capturer.CaptureFullscreen = false; + Viewer.Capturer.CaptureFullscreen = false; } - encodedImageBytes = ImageUtils.EncodeBitmap(newImage, viewer.EncoderParams); + encodedImageBytes = ImageUtils.EncodeBitmap(newImage, Viewer.EncoderParams); if (encodedImageBytes?.Length > 0) { - if (viewer.IsUsingWebRtc()) - { - viewer.RtcSession.SendCaptureFrame(diffArea.Left, diffArea.Top, diffArea.Width, diffArea.Height, encodedImageBytes, viewer.ImageQuality); - viewer.WebSocketBuffer = 0; - } - else - { - await casterSocket.SendScreenCapture(encodedImageBytes, viewerID, diffArea.Left, diffArea.Top, diffArea.Width, diffArea.Height, viewer.ImageQuality); - viewer.WebSocketBuffer += encodedImageBytes.Length; - } + + await Viewer.SendScreenCapture(encodedImageBytes, viewerID, diffArea.Left, diffArea.Top, diffArea.Width, diffArea.Height, Viewer.ImageQuality); } } } @@ -127,18 +120,14 @@ await casterSocket.SendScreenData( Logger.Write($"Ended screen cast. Requester: {requesterName}. Viewer ID: {viewerID}."); viewers.TryRemove(viewerID, out _); - var shouldExit = viewers.Count == 0 && mode == Enums.AppMode.Unattended; try { - viewer.Dispose(); + Viewer.Dispose(); - if (shouldExit) - { - capturer.Dispose(); + Viewer.Capturer.Dispose(); - await casterSocket.Disconnect(); - } + Viewer.Disconnect(); } catch (Exception ex) @@ -148,7 +137,7 @@ await casterSocket.SendScreenData( finally { // Close if no one is viewing. - if (shouldExit) + if (viewers.Count == 0 && mode == Enums.AppMode.Unattended) { Logger.Debug($"Exiting process ID {Process.GetCurrentProcess().Id}."); Environment.Exit(0); @@ -156,25 +145,6 @@ await casterSocket.SendScreenData( } } - private async Task InitializeWebRtc(Viewer viewer, CasterSocket casterSocket) - { - try - { - viewer.RtcSession = new WebRtcSession(); - viewer.RtcSession.LocalSdpReady += async (sender, sdp) => - { - await casterSocket.SendRtcOfferToBrowser(sdp, viewer.ViewerConnectionID); - }; - viewer.RtcSession.IceCandidateReady += async (sender, args) => - { - await casterSocket.SendIceCandidateToBrowser(args.candidate, args.sdpMlineIndex, args.sdpMid, viewer.ViewerConnectionID); - }; - await viewer.RtcSession.Init(); - } - catch (Exception ex) - { - Logger.Write(ex); - } - } + } } diff --git a/ScreenCast.Linux/Program.cs b/ScreenCast.Linux/Program.cs index 93339faf5..f5981836f 100644 --- a/ScreenCast.Linux/Program.cs +++ b/ScreenCast.Linux/Program.cs @@ -8,6 +8,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System.Linq; +using Remotely.ScreenCast.Core.Models; namespace Remotely.ScreenCast.Linux { @@ -68,6 +69,7 @@ private static void BuildServices() serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddTransient(); + serviceCollection.AddTransient(); ServiceContainer.Instance = serviceCollection.BuildServiceProvider(); } diff --git a/ScreenCast.Linux/Services/ScreenCasterLinux.cs b/ScreenCast.Linux/Services/ScreenCasterLinux.cs index 41230e967..52ad34f5c 100644 --- a/ScreenCast.Linux/Services/ScreenCasterLinux.cs +++ b/ScreenCast.Linux/Services/ScreenCasterLinux.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.DependencyInjection; using Remotely.ScreenCast.Core; using Remotely.ScreenCast.Core.Interfaces; +using Remotely.ScreenCast.Core.Models; using Remotely.ScreenCast.Core.Services; using Remotely.Shared.Models; using System; @@ -12,13 +13,19 @@ namespace Remotely.ScreenCast.Linux.Services { public class ScreenCasterLinux : ScreenCasterBase, IScreenCaster { + public ScreenCasterLinux(Viewer viewer) + : base(viewer) + { + + } + public async Task BeginScreenCasting(ScreenCastRequest screenCastRequest) { try { var conductor = ServiceContainer.Instance.GetRequiredService(); await conductor.CasterSocket.SendCursorChange(new CursorInfo(null, Point.Empty, "default"), new List() { screenCastRequest.ViewerID }); - _ = BeginScreenCasting(screenCastRequest.ViewerID, screenCastRequest.RequesterName, ServiceContainer.Instance.GetRequiredService()); + _ = BeginScreenCasting(screenCastRequest.ViewerID, screenCastRequest.RequesterName); } catch (Exception ex) { diff --git a/ScreenCast.Win/Program.cs b/ScreenCast.Win/Program.cs index 894364387..e6aa86fd7 100644 --- a/ScreenCast.Win/Program.cs +++ b/ScreenCast.Win/Program.cs @@ -11,6 +11,7 @@ using Remotely.ScreenCast.Core.Communication; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using Remotely.ScreenCast.Core.Models; namespace Remotely.ScreenCast.Win { @@ -76,11 +77,17 @@ private static void BuildServices() serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddTransient(); + serviceCollection.AddTransient(); ServiceContainer.Instance = serviceCollection.BuildServiceProvider(); } - private static async Task CheckForRelaunch() + private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) + { + Logger.Write((Exception)e.ExceptionObject); + } + + private static async Task SendReadyNotificationToViewers() { if (Conductor.ArgDict.ContainsKey("relaunch")) @@ -95,12 +102,6 @@ private static async Task CheckForRelaunch() await Conductor.CasterSocket.NotifyRequesterUnattendedReady(Conductor.RequesterID); } } - - private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) - { - Logger.Write((Exception)e.ExceptionObject); - } - private static void StartScreenCasting() { CursorIconWatcher = Services.GetRequiredService(); @@ -124,7 +125,7 @@ private static void StartScreenCasting() { Logger.Write("Failed to get initial desktop name."); } - await CheckForRelaunch(); + await SendReadyNotificationToViewers(); Services.GetRequiredService().Start(); CursorIconWatcher.OnChange += CursorIconWatcher_OnChange; Services.GetRequiredService().BeginWatching(); diff --git a/ScreenCast.Win/ScreenCast.Win.csproj b/ScreenCast.Win/ScreenCast.Win.csproj index 4377e42d9..78f79a233 100644 --- a/ScreenCast.Win/ScreenCast.Win.csproj +++ b/ScreenCast.Win/ScreenCast.Win.csproj @@ -23,6 +23,7 @@ + diff --git a/ScreenCast.Win/Services/KeyboardMouseInputWin.cs b/ScreenCast.Win/Services/KeyboardMouseInputWin.cs index 5a75fc503..afb48bd41 100644 --- a/ScreenCast.Win/Services/KeyboardMouseInputWin.cs +++ b/ScreenCast.Win/Services/KeyboardMouseInputWin.cs @@ -17,18 +17,14 @@ public class KeyboardMouseInputWin : IKeyboardMouseInput { public KeyboardMouseInputWin() { - StartInputActionTask(); Application.ApplicationExit += Application_ApplicationExit; + StartInputActionTask(); } - public Conductor Conductor { get; } - private ConcurrentQueue InputActions { get; } = new ConcurrentQueue(); private Task InputActionsTask { get; set; } - private bool IsInputBlocked { get; set; } - private bool ShutdownStarted { get; set; } public Tuple GetAbsolutePercentFromRelativePercent(double percentX, double percentY, IScreenCapturer capturer) @@ -186,7 +182,6 @@ public void ToggleBlockInput(bool toggleOn) { InputActions.Enqueue(() => { - IsInputBlocked = toggleOn; var result = BlockInput(toggleOn); Logger.Write($"Result of ToggleBlockInput set to {toggleOn}: {result}"); }); diff --git a/ScreenCast.Win/Services/ScreenCapturerWin.cs b/ScreenCast.Win/Services/ScreenCapturerWin.cs index 21e9063a3..82b8fd97a 100644 --- a/ScreenCast.Win/Services/ScreenCapturerWin.cs +++ b/ScreenCast.Win/Services/ScreenCapturerWin.cs @@ -21,6 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +using Microsoft.Win32; using Remotely.ScreenCast.Core.Interfaces; using Remotely.ScreenCast.Core.Services; using Remotely.ScreenCast.Win.Models; @@ -41,8 +42,10 @@ public class ScreenCapturerWin : IScreenCapturer { private readonly Dictionary bitBltScreens = new Dictionary(); private readonly Dictionary directxScreens = new Dictionary(); + private bool directXCapable = true; public ScreenCapturerWin() { + SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged; Init(); } @@ -58,6 +61,7 @@ public ScreenCapturerWin() public void Dispose() { + SystemEvents.DisplaySettingsChanged -= SystemEvents_DisplaySettingsChanged; ClearDirectXOutputs(); CurrentFrame?.Dispose(); @@ -120,7 +124,12 @@ public void Init() PreviousFrame = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb); InitBitBlt(); - InitDirectX(); + if (directXCapable) + { + InitDirectX(); + } + + ScreenChanged?.Invoke(this, CurrentScreenBounds); } public void SetSelectedScreen(string displayName) @@ -138,10 +147,7 @@ public void SetSelectedScreen(string displayName) { SelectedScreen = bitBltScreens.Keys.First(); } - CurrentScreenBounds = Screen.AllScreens[bitBltScreens[SelectedScreen]].Bounds; - CaptureFullscreen = true; - NeedsInit = true; - ScreenChanged?.Invoke(this, CurrentScreenBounds); + RefreshCurrentScreenBounds(); } private void ClearDirectXOutputs() @@ -152,6 +158,7 @@ private void ClearDirectXOutputs() } directxScreens.Clear(); } + private void GetBitBltFrame() { try @@ -178,16 +185,15 @@ private void GetDirectXFrame() { try { - SharpDX.DXGI.Resource screenResource; - OutputDuplicateFrameInformation duplicateFrameInformation; - var duplicatedOutput = directxScreens[SelectedScreen].OutputDuplication; var device = directxScreens[SelectedScreen].Device; var texture2D = directxScreens[SelectedScreen].Texture2D; - + // Try to get duplicated frame within given time is ms - var result = duplicatedOutput.TryAcquireNextFrame(100, out duplicateFrameInformation, out screenResource); + var result = duplicatedOutput.TryAcquireNextFrame(100, + out var duplicateFrameInformation, + out var screenResource); if (result.Failure && result.Code != SharpDX.DXGI.ResultCode.WaitTimeout.Code) { @@ -210,7 +216,7 @@ private void GetDirectXFrame() // TODO: Get dirty rects. //RawRectangle[] dirtyRectsBuffer = new RawRectangle[duplicateFrameInformation.TotalMetadataBufferSize]; //duplicatedOutput.GetFrameDirtyRects(duplicateFrameInformation.TotalMetadataBufferSize, dirtyRectsBuffer, out var dirtyRectsSizeRequired); - + // copy resource into memory that can be accessed by the CPU using (var screenTexture2D = screenResource.QueryInterface()) { @@ -262,57 +268,79 @@ private void InitBitBlt() bitBltScreens.Add(Screen.AllScreens[i].DeviceName, i); } } + private void InitDirectX() { - ClearDirectXOutputs(); - - using (var factory = new Factory1()) + try { - foreach (var adapter in factory.Adapters1.Where(x => (x.Outputs?.Length ?? 0) > 0)) + ClearDirectXOutputs(); + + using (var factory = new Factory1()) { - try + foreach (var adapter in factory.Adapters1.Where(x => (x.Outputs?.Length ?? 0) > 0)) { - var device = new SharpDX.Direct3D11.Device(adapter); - var output = adapter.Outputs.FirstOrDefault(); - var output1 = output.QueryInterface(); - - var bounds = output1.Description.DesktopBounds; - var width = bounds.Right - bounds.Left; - var height = bounds.Bottom - bounds.Top; - - // Create Staging texture CPU-accessible - var textureDesc = new Texture2DDescription + try { - CpuAccessFlags = CpuAccessFlags.Read, - BindFlags = BindFlags.None, - Format = Format.B8G8R8A8_UNorm, - Width = width, - Height = height, - OptionFlags = ResourceOptionFlags.None, - MipLevels = 1, - ArraySize = 1, - SampleDescription = { Count = 1, Quality = 0 }, - Usage = ResourceUsage.Staging - }; - - var texture2D = new Texture2D(device, textureDesc); - - directxScreens.Add( - output1.Description.DeviceName, - new DirectXOutput(adapter, - device, - output1.DuplicateOutput(device), - texture2D)); - } - catch (Exception ex) - { - Logger.Write(ex); + var device = new SharpDX.Direct3D11.Device(adapter); + var output = adapter.Outputs.FirstOrDefault(); + var output1 = output.QueryInterface(); + + var bounds = output1.Description.DesktopBounds; + var width = bounds.Right - bounds.Left; + var height = bounds.Bottom - bounds.Top; + + // Create Staging texture CPU-accessible + var textureDesc = new Texture2DDescription + { + CpuAccessFlags = CpuAccessFlags.Read, + BindFlags = BindFlags.None, + Format = Format.B8G8R8A8_UNorm, + Width = width, + Height = height, + OptionFlags = ResourceOptionFlags.None, + MipLevels = 1, + ArraySize = 1, + SampleDescription = { Count = 1, Quality = 0 }, + Usage = ResourceUsage.Staging + }; + + var texture2D = new Texture2D(device, textureDesc); + + directxScreens.Add( + output1.Description.DeviceName, + new DirectXOutput(adapter, + device, + output1.DuplicateOutput(device), + texture2D)); + } + catch (Exception ex) + { + Logger.Write(ex); + } } } + + + NeedsInit = false; + } + catch (Exception ex) + { + Logger.Write(ex); + directXCapable = false; } + } + private void RefreshCurrentScreenBounds() + { + CurrentScreenBounds = Screen.AllScreens[bitBltScreens[SelectedScreen]].Bounds; + CaptureFullscreen = true; + NeedsInit = true; + ScreenChanged?.Invoke(this, CurrentScreenBounds); + } - NeedsInit = false; + private void SystemEvents_DisplaySettingsChanged(object sender, EventArgs e) + { + RefreshCurrentScreenBounds(); } } } diff --git a/ScreenCast.Win/Services/ScreenCasterWin.cs b/ScreenCast.Win/Services/ScreenCasterWin.cs index 6a0e1d883..f7825f401 100644 --- a/ScreenCast.Win/Services/ScreenCasterWin.cs +++ b/ScreenCast.Win/Services/ScreenCasterWin.cs @@ -7,17 +7,19 @@ using Remotely.Shared.Models; using Remotely.Shared.Win32; using Microsoft.Extensions.DependencyInjection; +using Remotely.ScreenCast.Core.Models; namespace Remotely.ScreenCast.Win.Services { public class ScreenCasterWin : ScreenCasterBase, IScreenCaster { - public ScreenCasterWin(CursorIconWatcher cursorIconWatcher) + public ScreenCasterWin(CursorIconWatcher cursorIconWatcher, Viewer viewer) + : base(viewer) { CursorIconWatcher = cursorIconWatcher; } - public CursorIconWatcher CursorIconWatcher { get; } + protected CursorIconWatcher CursorIconWatcher { get; } public async Task BeginScreenCasting(ScreenCastRequest screenCastRequest) { @@ -35,7 +37,7 @@ public async Task BeginScreenCasting(ScreenCastRequest screenCastRequest) var conductor = ServiceContainer.Instance.GetRequiredService(); await conductor.CasterSocket.SendCursorChange(CursorIconWatcher.GetCurrentCursor(), new List() { screenCastRequest.ViewerID }); - _ = BeginScreenCasting(screenCastRequest.ViewerID, screenCastRequest.RequesterName, ServiceContainer.Instance.GetRequiredService()); + _ = BeginScreenCasting(screenCastRequest.ViewerID, screenCastRequest.RequesterName); } catch (Exception ex) { diff --git a/Server/Server.csproj b/Server/Server.csproj index eeed32ce5..0922f02a0 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -35,17 +35,18 @@ + - - + + @@ -53,6 +54,8 @@ + + @@ -152,10 +155,17 @@ - - - + + + + + Code + + + Code + + @@ -165,6 +175,7 @@ + diff --git a/Server/Services/RCDeviceSocketHub.cs b/Server/Services/RCDeviceSocketHub.cs index ca346425b..571bffc54 100644 --- a/Server/Services/RCDeviceSocketHub.cs +++ b/Server/Services/RCDeviceSocketHub.cs @@ -144,11 +144,12 @@ public override async Task OnDisconnectedAsync(Exception exception) await base.OnDisconnectedAsync(exception); } - public void ReceiveDeviceInfo(string serviceID, string machineName, string deviceID) + public Task ReceiveDeviceInfo(string serviceID, string machineName, string deviceID) { SessionInfo.ServiceID = serviceID; SessionInfo.MachineName = machineName; SessionInfo.DeviceID = deviceID; + return Task.CompletedTask; } public Task SendAudioSample(byte[] buffer, List viewerIDs) @@ -156,9 +157,9 @@ public Task SendAudioSample(byte[] buffer, List viewerIDs) return RCBrowserHub.Clients.Clients(viewerIDs).SendAsync("AudioSample", buffer); } - public Task SendClipboardText(string clipboardText, List viewerIDs) + public Task SendClipboardText(string clipboardText, string viewerID) { - return RCBrowserHub.Clients.Clients(viewerIDs).SendAsync("ClipboardTextChanged", clipboardText); + return RCBrowserHub.Clients.Client(viewerID).SendAsync("ClipboardTextChanged", clipboardText); } public Task SendConnectionFailedToViewers(List viewerIDs) diff --git a/Server/wwwroot/scripts/Enums/DynamicDtoType.js b/Server/wwwroot/scripts/Enums/DynamicDtoType.js new file mode 100644 index 000000000..76ef12aa7 --- /dev/null +++ b/Server/wwwroot/scripts/Enums/DynamicDtoType.js @@ -0,0 +1,8 @@ +export var DynamicDtoType; +(function (DynamicDtoType) { + DynamicDtoType[DynamicDtoType["CaptureFrame"] = 0] = "CaptureFrame"; + DynamicDtoType[DynamicDtoType["ScreenData"] = 1] = "ScreenData"; + DynamicDtoType[DynamicDtoType["ScreenSize"] = 2] = "ScreenSize"; + DynamicDtoType[DynamicDtoType["MachineName"] = 3] = "MachineName"; +})(DynamicDtoType || (DynamicDtoType = {})); +//# sourceMappingURL=DynamicDtoType.js.map \ No newline at end of file diff --git a/Server/wwwroot/scripts/Models/DynamicDtoType.js.map b/Server/wwwroot/scripts/Enums/DynamicDtoType.js.map similarity index 50% rename from Server/wwwroot/scripts/Models/DynamicDtoType.js.map rename to Server/wwwroot/scripts/Enums/DynamicDtoType.js.map index 40ceceb61..64a546ad2 100644 --- a/Server/wwwroot/scripts/Models/DynamicDtoType.js.map +++ b/Server/wwwroot/scripts/Enums/DynamicDtoType.js.map @@ -1 +1 @@ -{"version":3,"file":"DynamicDtoType.js","sourceRoot":"","sources":["DynamicDtoType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACtB,6DAAa,CAAA;AACjB,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB"} \ No newline at end of file +{"version":3,"file":"DynamicDtoType.js","sourceRoot":"","sources":["DynamicDtoType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACtB,mEAAgB,CAAA;IAChB,+DAAc,CAAA;IACd,+DAAc,CAAA;IACd,iEAAe,CAAA;AACnB,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/Enums/DynamicDtoType.ts b/Server/wwwroot/scripts/Enums/DynamicDtoType.ts new file mode 100644 index 000000000..ac7ff8bb4 --- /dev/null +++ b/Server/wwwroot/scripts/Enums/DynamicDtoType.ts @@ -0,0 +1,6 @@ +export enum DynamicDtoType { + CaptureFrame = 0, + ScreenData = 1, + ScreenSize = 2, + MachineName = 3 +} \ No newline at end of file diff --git a/Server/wwwroot/scripts/Models/DynamicDto.ts b/Server/wwwroot/scripts/Models/DynamicDto.ts deleted file mode 100644 index d570721bb..000000000 --- a/Server/wwwroot/scripts/Models/DynamicDto.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { DynamicDtoType } from "./DynamicDtoType.js"; - -export interface DynamicDto { - DtoType: DynamicDtoType -} \ No newline at end of file diff --git a/Server/wwwroot/scripts/Models/DynamicDtoType.js b/Server/wwwroot/scripts/Models/DynamicDtoType.js deleted file mode 100644 index 667ebeb12..000000000 --- a/Server/wwwroot/scripts/Models/DynamicDtoType.js +++ /dev/null @@ -1,5 +0,0 @@ -export var DynamicDtoType; -(function (DynamicDtoType) { - DynamicDtoType[DynamicDtoType["FrameInfo"] = 0] = "FrameInfo"; -})(DynamicDtoType || (DynamicDtoType = {})); -//# sourceMappingURL=DynamicDtoType.js.map \ No newline at end of file diff --git a/Server/wwwroot/scripts/Models/DynamicDtoType.ts b/Server/wwwroot/scripts/Models/DynamicDtoType.ts deleted file mode 100644 index 465189658..000000000 --- a/Server/wwwroot/scripts/Models/DynamicDtoType.ts +++ /dev/null @@ -1,3 +0,0 @@ -export enum DynamicDtoType { - FrameInfo = 0 -} \ No newline at end of file diff --git a/Server/wwwroot/scripts/Models/FrameInfo.js b/Server/wwwroot/scripts/Models/FrameInfo.js deleted file mode 100644 index 7e07c2baa..000000000 --- a/Server/wwwroot/scripts/Models/FrameInfo.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=FrameInfo.js.map \ No newline at end of file diff --git a/Server/wwwroot/scripts/Models/FrameInfo.js.map b/Server/wwwroot/scripts/Models/FrameInfo.js.map deleted file mode 100644 index 20668393c..000000000 --- a/Server/wwwroot/scripts/Models/FrameInfo.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"FrameInfo.js","sourceRoot":"","sources":["FrameInfo.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Server/wwwroot/scripts/Models/DynamicDto.js b/Server/wwwroot/scripts/RemoteControl/DynamicDto.js similarity index 100% rename from Server/wwwroot/scripts/Models/DynamicDto.js rename to Server/wwwroot/scripts/RemoteControl/DynamicDto.js diff --git a/Server/wwwroot/scripts/Models/DynamicDto.js.map b/Server/wwwroot/scripts/RemoteControl/DynamicDto.js.map similarity index 100% rename from Server/wwwroot/scripts/Models/DynamicDto.js.map rename to Server/wwwroot/scripts/RemoteControl/DynamicDto.js.map diff --git a/Server/wwwroot/scripts/RemoteControl/DynamicDto.ts b/Server/wwwroot/scripts/RemoteControl/DynamicDto.ts new file mode 100644 index 000000000..68fe2cd88 --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/DynamicDto.ts @@ -0,0 +1,5 @@ +import { DynamicDtoType } from "../Enums/DynamicDtoType.js"; + +export interface DynamicDto { + DtoType: DynamicDtoType +} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/Main.js b/Server/wwwroot/scripts/RemoteControl/Main.js index 437ba6708..b4f1fec60 100644 --- a/Server/wwwroot/scripts/RemoteControl/Main.js +++ b/Server/wwwroot/scripts/RemoteControl/Main.js @@ -4,11 +4,13 @@ import { RtcSession } from "./RtcSession.js"; import * as UI from "./UI.js"; import { RemoteControlMode } from "../Enums/RemoteControlMode.js"; import { ClipboardWatcher } from "./ClipboardWatcher.js"; +import { RtcMessageHandler } from "./RtcMessageHandler.js"; var queryString = Utilities.ParseSearchString(); export const Remotely = { ClipboardWatcher: new ClipboardWatcher(), Debug: false, RCBrowserSockets: new RCBrowserSockets(), + RtcMessageHandler: new RtcMessageHandler(), RtcSession: new RtcSession(), ClientID: queryString["clientID"] ? decodeURIComponent(queryString["clientID"]) : "", ServiceID: queryString["serviceID"] ? decodeURIComponent(queryString["serviceID"]) : "", diff --git a/Server/wwwroot/scripts/RemoteControl/Main.js.map b/Server/wwwroot/scripts/RemoteControl/Main.js.map index 48789cea1..4fd13fb26 100644 --- a/Server/wwwroot/scripts/RemoteControl/Main.js.map +++ b/Server/wwwroot/scripts/RemoteControl/Main.js.map @@ -1 +1 @@ -{"version":3,"file":"Main.js","sourceRoot":"","sources":["Main.ts"],"names":[],"mappings":"AAAA,OA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C,WAAW,CAAC,CAAC,CAAC;YACvE,IAAI,WAAW,CAAC,eAAe,CAAC,EAAE;gBAC9B,EAAE,CAAC,kBAAkB,CAAC,KAAK,GAAG,kBAAkB,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC;gBAC/E,IAAI,CAAC,eAAe,EAAE,CAAC;aAC1B;SACJ;IACL,CAAC;IACD,eAAe,EAAE,GAAG,EAAE;QAClB,EAAE,CAAC,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC;QACjC,QAAQ,CAAC,QAAQ,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChE,QAAQ,CAAC,aAAa,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC;QACrD,QAAQ,CAAC,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC;QACzC,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;QACpC,EAAE,CAAC,aAAa,CAAC,SAAS,GAAG,+BAA+B,CAAC;IACjE,CAAC;CACJ,CAAA;AAED,MAAM,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/Main.ts b/Server/wwwroot/scripts/RemoteControl/Main.ts index 495c3d30c..ae3c099fc 100644 --- a/Server/wwwroot/scripts/RemoteControl/Main.ts +++ b/Server/wwwroot/scripts/RemoteControl/Main.ts @@ -4,6 +4,7 @@ import { RtcSession } from "./RtcSession.js"; import * as UI from "./UI.js"; import { RemoteControlMode } from "../Enums/RemoteControlMode.js"; import { ClipboardWatcher } from "./ClipboardWatcher.js"; +import { RtcMessageHandler } from "./RtcMessageHandler.js"; var queryString = Utilities.ParseSearchString(); @@ -12,6 +13,7 @@ export const Remotely = { ClipboardWatcher: new ClipboardWatcher(), Debug: false, RCBrowserSockets: new RCBrowserSockets(), + RtcMessageHandler: new RtcMessageHandler(), RtcSession: new RtcSession(), ClientID: queryString["clientID"] ? decodeURIComponent(queryString["clientID"]) : "", ServiceID: queryString["serviceID"] ? decodeURIComponent(queryString["serviceID"]) : "", diff --git a/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js b/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js index 7f31b3f46..cc6ffecf8 100644 --- a/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js +++ b/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js @@ -121,28 +121,10 @@ export class RCBrowserSockets { PopupMessage("Clipboard updated."); }); hubConnection.on("ScreenData", (selectedDisplay, displayNames) => { - UI.ScreenSelectBar.innerHTML = ""; - for (let i = 0; i < displayNames.length; i++) { - var button = document.createElement("button"); - button.innerHTML = `Monitor ${i}`; - button.classList.add("horizontal-bar-button"); - if (displayNames[i] == selectedDisplay) { - button.classList.add("toggled"); - } - document.querySelector("#screenSelectBar").appendChild(button); - button.onclick = (ev) => { - this.SendSelectScreen(displayNames[i]); - document.querySelectorAll("#screenSelectBar .horizontal-bar-button").forEach(button => { - button.classList.remove("toggled"); - }); - ev.currentTarget.classList.add("toggled"); - }; - } + UI.UpdateDisplays(selectedDisplay, displayNames); }); hubConnection.on("ScreenSize", (width, height) => { - UI.ScreenViewer.width = width; - UI.ScreenViewer.height = height; - UI.Screen2DContext.clearRect(0, 0, width, height); + UI.SetScreenSize(width, height); }); hubConnection.on("ScreenCapture", (buffer, left, top, width, height, imageQuality) => { this.SendFrameReceived(buffer.byteLength); diff --git a/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js.map b/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js.map index 31fc8a138..3057697d4 100644 --- a/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js.map +++ b/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js.map @@ -1 +1 @@ -{"version":3,"file":"RCBrowserSockets.js","sourceRoot":"","sources":["RCBrowserSockets.ts"],"names":[],"mappings":"AA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AE,MAAc,EAAE,EAAE;YACjG,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;YACvC,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC;gBACjC,SAAS,EAAE,SAAS;gBACpB,aAAa,EAAE,aAAa;gBAC5B,MAAM,EAAE,MAAM;aACV,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QACH,aAAa,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,OAAe,EAAE,EAAE;YAChD,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts b/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts index f364b07aa..d14c7a822 100644 --- a/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts +++ b/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts @@ -135,28 +135,10 @@ export class RCBrowserSockets { PopupMessage("Clipboard updated."); }); hubConnection.on("ScreenData", (selectedDisplay: string, displayNames: string[]) => { - UI.ScreenSelectBar.innerHTML = ""; - for (let i = 0; i < displayNames.length; i++) { - var button = document.createElement("button"); - button.innerHTML = `Monitor ${i}`; - button.classList.add("horizontal-bar-button"); - if (displayNames[i] == selectedDisplay) { - button.classList.add("toggled"); - } - document.querySelector("#screenSelectBar").appendChild(button); - button.onclick = (ev: MouseEvent) => { - this.SendSelectScreen(displayNames[i]); - document.querySelectorAll("#screenSelectBar .horizontal-bar-button").forEach(button => { - button.classList.remove("toggled"); - }); - (ev.currentTarget as HTMLButtonElement).classList.add("toggled"); - }; - } + UI.UpdateDisplays(selectedDisplay, displayNames); }); hubConnection.on("ScreenSize", (width: number, height: number) => { - UI.ScreenViewer.width = width; - UI.ScreenViewer.height = height; - UI.Screen2DContext.clearRect(0, 0, width, height); + UI.SetScreenSize(width, height); }); hubConnection.on("ScreenCapture", (buffer: Uint8Array, left:number, top:number, width:number, height:number, imageQuality: number) => { this.SendFrameReceived(buffer.byteLength); diff --git a/Server/wwwroot/scripts/RemoteControl/RtcDtos/CaptureFrameDto.js b/Server/wwwroot/scripts/RemoteControl/RtcDtos/CaptureFrameDto.js new file mode 100644 index 000000000..1d662d4ca --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/CaptureFrameDto.js @@ -0,0 +1 @@ +//# sourceMappingURL=CaptureFrameDto.js.map \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcDtos/CaptureFrameDto.js.map b/Server/wwwroot/scripts/RemoteControl/RtcDtos/CaptureFrameDto.js.map new file mode 100644 index 000000000..07b33cec8 --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/CaptureFrameDto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CaptureFrameDto.js","sourceRoot":"","sources":["CaptureFrameDto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Server/wwwroot/scripts/Models/FrameInfo.ts b/Server/wwwroot/scripts/RemoteControl/RtcDtos/CaptureFrameDto.ts similarity index 79% rename from Server/wwwroot/scripts/Models/FrameInfo.ts rename to Server/wwwroot/scripts/RemoteControl/RtcDtos/CaptureFrameDto.ts index f876468f6..c527e7db1 100644 --- a/Server/wwwroot/scripts/Models/FrameInfo.ts +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/CaptureFrameDto.ts @@ -1,4 +1,4 @@ -declare interface FrameInfo { +declare interface CaptureFrameDto { EndOfFrame: boolean; Left: number; Top: number; diff --git a/Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.js b/Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.js new file mode 100644 index 000000000..5189401af --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.js @@ -0,0 +1 @@ +//# sourceMappingURL=MachineNameDto.js.map \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.js.map b/Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.js.map new file mode 100644 index 000000000..e6ee4c381 --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MachineNameDto.js","sourceRoot":"","sources":["MachineNameDto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.ts b/Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.ts new file mode 100644 index 000000000..e767734a8 --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/MachineNameDto.ts @@ -0,0 +1,3 @@ +declare interface MachineNameDto { + MachineName: string; +} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.js b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.js new file mode 100644 index 000000000..a6db3f8be --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.js @@ -0,0 +1 @@ +//# sourceMappingURL=ScreenDataDto.js.map \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.js.map b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.js.map new file mode 100644 index 000000000..ae049b491 --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ScreenDataDto.js","sourceRoot":"","sources":["ScreenDataDto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.ts b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.ts new file mode 100644 index 000000000..f2798ec4e --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenDataDto.ts @@ -0,0 +1,4 @@ +declare interface ScreenDataDto { + DisplayNames: string[]; + SelectedScreen: string; +} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.js b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.js new file mode 100644 index 000000000..a0fdc0119 --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.js @@ -0,0 +1 @@ +//# sourceMappingURL=ScreenSizeDto.js.map \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.js.map b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.js.map new file mode 100644 index 000000000..0d7b4416f --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ScreenSizeDto.js","sourceRoot":"","sources":["ScreenSizeDto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.ts b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.ts new file mode 100644 index 000000000..a08068d51 --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcDtos/ScreenSizeDto.ts @@ -0,0 +1,4 @@ +declare interface ScreenSizeDto { + Width: number; + Height: number; +} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.js b/Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.js new file mode 100644 index 000000000..11823b857 --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.js @@ -0,0 +1,64 @@ +import * as UI from "./UI.js"; +import { DynamicDtoType } from "../Enums/DynamicDtoType.js"; +import { Remotely } from "./Main.js"; +export class RtcMessageHandler { + constructor() { + this.FpsStack = []; + this.MessagePack = window['MessagePack']; + this.PartialCaptureFrames = []; + } + ParseBinaryMessage(data) { + var model = this.MessagePack.decode(data); + switch (model.DtoType) { + case DynamicDtoType.CaptureFrame: + this.ProcessCaptureFrame(model); + break; + case DynamicDtoType.MachineName: + this.ProcessMachineName(model); + break; + case DynamicDtoType.ScreenData: + this.ProcessScreenData(model); + break; + case DynamicDtoType.ScreenSize: + this.ProcessScreenSize(model); + break; + default: + } + } + ProcessMachineName(machineNameDto) { + document.title = `${machineNameDto.MachineName} - Remotely Session`; + } + ProcessScreenData(screenDataDto) { + UI.UpdateDisplays(screenDataDto.SelectedScreen, screenDataDto.DisplayNames); + } + ProcessScreenSize(screenSizeDto) { + UI.SetScreenSize(screenSizeDto.Width, screenSizeDto.Height); + } + ProcessCaptureFrame(captureFrame) { + if (UI.AutoQualityAdjustCheckBox.checked && + Number(UI.QualitySlider.value) != captureFrame.ImageQuality) { + UI.QualitySlider.value = String(captureFrame.ImageQuality); + } + if (captureFrame.EndOfFrame) { + var url = window.URL.createObjectURL(new Blob(this.PartialCaptureFrames)); + var img = document.createElement("img"); + img.onload = () => { + UI.Screen2DContext.drawImage(img, captureFrame.Left, captureFrame.Top, captureFrame.Width, captureFrame.Height); + window.URL.revokeObjectURL(url); + }; + img.src = url; + this.PartialCaptureFrames = []; + if (Remotely.Debug) { + this.FpsStack.push(Date.now()); + while (Date.now() - this.FpsStack[0] > 1000) { + this.FpsStack.shift(); + } + console.log("FPS: " + String(this.FpsStack.length)); + } + } + else { + this.PartialCaptureFrames.push(captureFrame.ImageBytes); + } + } +} +//# sourceMappingURL=RtcMessageHandler.js.map \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.js.map b/Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.js.map new file mode 100644 index 000000000..acf6ad2b2 --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RtcMessageHandler.js","sourceRoot":"","sources":["RtcMessageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAA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C,CAAC;SAC3D;IACL,CAAC;CACJ"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.ts b/Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.ts new file mode 100644 index 000000000..92eb834f5 --- /dev/null +++ b/Server/wwwroot/scripts/RemoteControl/RtcMessageHandler.ts @@ -0,0 +1,71 @@ +import * as UI from "./UI.js"; +import { DynamicDtoType } from "../Enums/DynamicDtoType.js"; +import { DynamicDto } from "./DynamicDto.js"; +import { Remotely } from "./Main.js"; + +export class RtcMessageHandler { + FpsStack: Array = []; + MessagePack: any = window['MessagePack']; + PartialCaptureFrames: Uint8Array[] = []; + ParseBinaryMessage(data: ArrayBuffer) { + var model = this.MessagePack.decode(data) as DynamicDto; + switch (model.DtoType) { + case DynamicDtoType.CaptureFrame: + this.ProcessCaptureFrame(model as unknown as CaptureFrameDto); + break; + case DynamicDtoType.MachineName: + this.ProcessMachineName(model as unknown as MachineNameDto); + break; + case DynamicDtoType.ScreenData: + this.ProcessScreenData(model as unknown as ScreenDataDto); + break; + case DynamicDtoType.ScreenSize: + this.ProcessScreenSize(model as unknown as ScreenSizeDto) + break; + default: + } + } + ProcessMachineName(machineNameDto: MachineNameDto) { + document.title = `${machineNameDto.MachineName} - Remotely Session`; + } + ProcessScreenData(screenDataDto: ScreenDataDto) { + UI.UpdateDisplays(screenDataDto.SelectedScreen, screenDataDto.DisplayNames); + } + + ProcessScreenSize(screenSizeDto: ScreenSizeDto) { + UI.SetScreenSize(screenSizeDto.Width, screenSizeDto.Height); + } + + ProcessCaptureFrame(captureFrame: CaptureFrameDto) { + if (UI.AutoQualityAdjustCheckBox.checked && + Number(UI.QualitySlider.value) != captureFrame.ImageQuality) { + UI.QualitySlider.value = String(captureFrame.ImageQuality); + } + + if (captureFrame.EndOfFrame) { + var url = window.URL.createObjectURL(new Blob(this.PartialCaptureFrames)); + var img = document.createElement("img"); + img.onload = () => { + UI.Screen2DContext.drawImage(img, + captureFrame.Left, + captureFrame.Top, + captureFrame.Width, + captureFrame.Height); + window.URL.revokeObjectURL(url); + }; + img.src = url; + this.PartialCaptureFrames = []; + + if (Remotely.Debug) { + this.FpsStack.push(Date.now()); + while (Date.now() - this.FpsStack[0] > 1000) { + this.FpsStack.shift(); + } + console.log("FPS: " + String(this.FpsStack.length)); + } + } + else { + this.PartialCaptureFrames.push(captureFrame.ImageBytes); + } + } +} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcSession.js b/Server/wwwroot/scripts/RemoteControl/RtcSession.js index cdaeffb0b..ef69b0dae 100644 --- a/Server/wwwroot/scripts/RemoteControl/RtcSession.js +++ b/Server/wwwroot/scripts/RemoteControl/RtcSession.js @@ -1,13 +1,7 @@ import * as UI from "./UI.js"; import * as Utilities from "../Utilities.js"; import { Remotely } from "./Main.js"; -import { DynamicDtoType } from "../Models/DynamicDtoType.js"; export class RtcSession { - constructor() { - this.FpsStack = []; - this.MessagePack = window['MessagePack']; - this.PartialFrames = []; - } Init() { this.PeerConnection = new RTCPeerConnection({ iceServers: [ @@ -34,7 +28,7 @@ export class RtcSession { }; this.DataChannel.onmessage = async (ev) => { var data = ev.data; - this.ParseBinaryMessage(data); + Remotely.RtcMessageHandler.ParseBinaryMessage(data); }; this.DataChannel.onopen = (ev) => { console.log("Data channel opened."); @@ -52,41 +46,6 @@ export class RtcSession { await Remotely.RCBrowserSockets.SendIceCandidate(ev.candidate); }; } - ParseBinaryMessage(data) { - var model = this.MessagePack.decode(data); - switch (model.DtoType) { - case DynamicDtoType.FrameInfo: - this.ProcessFrameInfo(model); - break; - default: - } - } - ProcessFrameInfo(frameInfo) { - if (UI.AutoQualityAdjustCheckBox.checked && - Number(UI.QualitySlider.value) != frameInfo.ImageQuality) { - UI.QualitySlider.value = String(frameInfo.ImageQuality); - } - if (frameInfo.EndOfFrame) { - var url = window.URL.createObjectURL(new Blob(this.PartialFrames)); - var img = document.createElement("img"); - img.onload = () => { - UI.Screen2DContext.drawImage(img, frameInfo.Left, frameInfo.Top, frameInfo.Width, frameInfo.Height); - window.URL.revokeObjectURL(url); - }; - img.src = url; - this.PartialFrames = []; - if (Remotely.Debug) { - this.FpsStack.push(Date.now()); - while (Date.now() - this.FpsStack[0] > 1000) { - this.FpsStack.shift(); - } - console.log("FPS: " + String(this.FpsStack.length)); - } - } - else { - this.PartialFrames.push(frameInfo.ImageBytes); - } - } Disconnect() { this.PeerConnection.close(); } diff --git a/Server/wwwroot/scripts/RemoteControl/RtcSession.js.map b/Server/wwwroot/scripts/RemoteControl/RtcSession.js.map index ed06461e8..63709b8b6 100644 --- a/Server/wwwroot/scripts/RemoteControl/RtcSession.js.map +++ b/Server/wwwroot/scripts/RemoteControl/RtcSession.js.map @@ -1 +1 @@ -{"version":3,"file":"RtcSession.js","sourceRoot":"","sources":["RtcSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,MAAM,OAAO,UAAU;IAAvB;QAGI,aAAQ,GAAkB,EAAE,CAAC;QAC7B,gBAAW,GAAQ,MAAM,CAAC,aAAa,CAAC,CAAC;QACzC,kBAAa,GAAiB,EAAE,CAAC;IA2GrC,CAAC;IA1GG,IAAI;QACA,IAAI,CAAC,cAAc,GAAG,IAAI,iBAAiB,CAAC;YACxC,UAAU,EAAE;gBACR,EAAE,IAAI,EAAE,+BAA+B,EAAE;gBACzC,EAAE,IAAI,EAAE,+BAA+B,EAAE;aAC5C;SACJ,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,CAAC,aAAa,GAAG,CAAC,EAAE,EAAE,EAAE;YACvC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;YACtC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,OAAO,CAAC;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AAI,CAAC,GAAG,EAAE;YAChB,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;YACf,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;YACrD,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QACtC,CAAC,CAAC,CAAA;IACN,CAAC;CACJ"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcSession.ts b/Server/wwwroot/scripts/RemoteControl/RtcSession.ts index db7a25661..abaa7c19e 100644 --- a/Server/wwwroot/scripts/RemoteControl/RtcSession.ts +++ b/Server/wwwroot/scripts/RemoteControl/RtcSession.ts @@ -1,15 +1,10 @@ import * as UI from "./UI.js"; import * as Utilities from "../Utilities.js"; import { Remotely } from "./Main.js"; -import { DynamicDto } from "../Models/DynamicDto.js"; -import { DynamicDtoType } from "../Models/DynamicDtoType.js"; export class RtcSession { PeerConnection: RTCPeerConnection; DataChannel: RTCDataChannel; - FpsStack: Array = []; - MessagePack: any = window['MessagePack']; - PartialFrames: Uint8Array[] = []; Init() { this.PeerConnection = new RTCPeerConnection({ iceServers: [ @@ -37,8 +32,7 @@ export class RtcSession { }; this.DataChannel.onmessage = async (ev) => { var data = ev.data as ArrayBuffer; - - this.ParseBinaryMessage(data); + Remotely.RtcMessageHandler.ParseBinaryMessage(data); }; this.DataChannel.onopen = (ev) => { @@ -58,43 +52,7 @@ export class RtcSession { await Remotely.RCBrowserSockets.SendIceCandidate(ev.candidate); }; } - ParseBinaryMessage(data: ArrayBuffer) { - var model = this.MessagePack.decode(data) as DynamicDto; - switch (model.DtoType) { - case DynamicDtoType.FrameInfo: - this.ProcessFrameInfo(model as unknown as FrameInfo); - break; - default: - } - } - ProcessFrameInfo(frameInfo: FrameInfo) { - if (UI.AutoQualityAdjustCheckBox.checked && - Number(UI.QualitySlider.value) != frameInfo.ImageQuality) { - UI.QualitySlider.value = String(frameInfo.ImageQuality); - } - if (frameInfo.EndOfFrame) { - var url = window.URL.createObjectURL(new Blob(this.PartialFrames)); - var img = document.createElement("img"); - img.onload = () => { - UI.Screen2DContext.drawImage(img, frameInfo.Left, frameInfo.Top, frameInfo.Width, frameInfo.Height); - window.URL.revokeObjectURL(url); - }; - img.src = url; - this.PartialFrames = []; - - if (Remotely.Debug) { - this.FpsStack.push(Date.now()); - while (Date.now() - this.FpsStack[0] > 1000) { - this.FpsStack.shift(); - } - console.log("FPS: " + String(this.FpsStack.length)); - } - } - else { - this.PartialFrames.push(frameInfo.ImageBytes); - } - } Disconnect() { this.PeerConnection.close(); } diff --git a/Server/wwwroot/scripts/RemoteControl/UI.js b/Server/wwwroot/scripts/RemoteControl/UI.js index e546af882..49f7f28b7 100644 --- a/Server/wwwroot/scripts/RemoteControl/UI.js +++ b/Server/wwwroot/scripts/RemoteControl/UI.js @@ -405,6 +405,11 @@ export function Prompt(promptMessage) { }; }); } +export function SetScreenSize(width, height) { + ScreenViewer.width = width; + ScreenViewer.height = height; + Screen2DContext.clearRect(0, 0, width, height); +} export function ShowMessage(message) { var messageDiv = document.createElement("div"); messageDiv.classList.add("float-message"); @@ -414,6 +419,25 @@ export function ShowMessage(message) { messageDiv.remove(); }, 5000); } +export function UpdateDisplays(selectedDisplay, displayNames) { + ScreenSelectBar.innerHTML = ""; + for (let i = 0; i < displayNames.length; i++) { + var button = document.createElement("button"); + button.innerHTML = `Monitor ${i}`; + button.classList.add("horizontal-bar-button"); + if (displayNames[i] == selectedDisplay) { + button.classList.add("toggled"); + } + ScreenSelectBar.appendChild(button); + button.onclick = (ev) => { + this.SendSelectScreen(displayNames[i]); + document.querySelectorAll("#screenSelectBar .horizontal-bar-button").forEach(button => { + button.classList.remove("toggled"); + }); + ev.currentTarget.classList.add("toggled"); + }; + } +} function uploadFiles(fileList) { ShowMessage("File upload started..."); FileTransferProgress.value = 0; diff --git a/Server/wwwroot/scripts/RemoteControl/UI.js.map b/Server/wwwroot/scripts/RemoteControl/UI.js.map index 54532ca26..5f8432e43 100644 --- a/Server/wwwroot/scripts/RemoteControl/UI.js.map +++ b/Server/wwwroot/scripts/RemoteControl/UI.js.map @@ -1 +1 @@ -{"version":3,"file":"UI.js","sourceRoot":"","sources":["UI.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,CAAC,IAAI,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,aAAa,CAAsB,CAAC;AACrF,MAAM,CAAC,IAAI,UAAU,GAAG,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAsB,CAAC;AACnF,MAAM,CAAC,IAAI,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAmB,CAAC;AAC9E,MAAM,CAAC,IAAI,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAqB,CAAC;AAC1F,MAAM,CAAC,IAAI,aAAa,GAAG,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAsB,CAAC;AACzF,MAAM,CAAC,IAAI,kBAAkB,GAAG,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAqB,CAAC;AACzF,MAAM,CAAC,IAAI,aAAa,GAAG,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAmB,CAAC;AACtF,MAAM,CAAC,IAAI,YAAY,GAAG,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAsB,CAAC;AACvF,MAAM,CAAC,IAAI,mBAAmB,GAAG,QAAQ,CAAC,cAAc,CAAC,qBAAqB,CAAmB,CAAC;AAClG,MAAM,CAAC,IAAI,eAAe,GAAG,YAAY,CAAC,UAAU,CAA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,CAAC,EAAE,IAAI,WAAW,EAAE;YACrB,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAC9B;IACL,CAAC,CAAC,CAAA;AACN,CAAC;AAED,SAAS,cAAc,CAAC,EAAc;IAClC,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,EAAE;QAC/C,IAAI,EAAE,CAAC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE;YACnD,OAAO;SACV;QACD,oBAAoB,GAAG,IAAI,CAAC;QAC5B,UAAU,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,OAAO,IAAI,CAAC;KAC5C;AACL,CAAC;AAED,SAAS,gCAAgC,CAAC,EAAc;IACpD,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IACxD,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,gCAAgC,CAAC,CAAC;IACxE,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,gCAAgC,CAAC,CAAC;AAC/E,CAAC"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/UI.ts b/Server/wwwroot/scripts/RemoteControl/UI.ts index 1c1c85ac2..805a589d8 100644 --- a/Server/wwwroot/scripts/RemoteControl/UI.ts +++ b/Server/wwwroot/scripts/RemoteControl/UI.ts @@ -448,6 +448,12 @@ export function Prompt(promptMessage: string): Promise { }); } +export function SetScreenSize(width: number, height: number) { + ScreenViewer.width = width; + ScreenViewer.height = height; + Screen2DContext.clearRect(0, 0, width, height); +} + export function ShowMessage(message: string) { var messageDiv = document.createElement("div"); messageDiv.classList.add("float-message"); @@ -458,6 +464,26 @@ export function ShowMessage(message: string) { }, 5000); } +export function UpdateDisplays(selectedDisplay: string, displayNames: string[]) { + ScreenSelectBar.innerHTML = ""; + for (let i = 0; i < displayNames.length; i++) { + var button = document.createElement("button"); + button.innerHTML = `Monitor ${i}`; + button.classList.add("horizontal-bar-button"); + if (displayNames[i] == selectedDisplay) { + button.classList.add("toggled"); + } + ScreenSelectBar.appendChild(button); + button.onclick = (ev: MouseEvent) => { + this.SendSelectScreen(displayNames[i]); + document.querySelectorAll("#screenSelectBar .horizontal-bar-button").forEach(button => { + button.classList.remove("toggled"); + }); + (ev.currentTarget as HTMLButtonElement).classList.add("toggled"); + }; + } +} + function uploadFiles(fileList: FileList) { ShowMessage("File upload started..."); FileTransferProgress.value = 0; diff --git a/Shared/Enums/DynamicDtoType.cs b/Shared/Enums/DynamicDtoType.cs index c7929feaa..d6ff70aa5 100644 --- a/Shared/Enums/DynamicDtoType.cs +++ b/Shared/Enums/DynamicDtoType.cs @@ -5,7 +5,13 @@ namespace Remotely.Shared.Enums [DataContract] public enum DynamicDtoType { - [EnumMember(Value = "FrameInfo")] - FrameInfo = 0 + [EnumMember(Value = "CaptureFrame")] + CaptureFrame = 0, + [EnumMember(Value = "ScreenData")] + ScreenData = 1, + [EnumMember(Value = "ScreenSize")] + ScreenSize = 2, + [EnumMember(Value = "MachineName")] + MachineName = 3 } } diff --git a/Shared/Models/FrameInfo.cs b/Shared/Models/RtcDtos/CaptureFrameDto.cs similarity index 81% rename from Shared/Models/FrameInfo.cs rename to Shared/Models/RtcDtos/CaptureFrameDto.cs index f4fff79de..76508f8d6 100644 --- a/Shared/Models/FrameInfo.cs +++ b/Shared/Models/RtcDtos/CaptureFrameDto.cs @@ -1,13 +1,13 @@ using Remotely.Shared.Enums; using System.Runtime.Serialization; -namespace Remotely.Shared.Models +namespace Remotely.Shared.Models.RtcDtos { [DataContract] - public class FrameInfo : IDynamicDto + public class CaptureFrameDto : IDynamicDto { [DataMember(Name = "DtoType")] - public DynamicDtoType DtoType { get; set; } + public DynamicDtoType DtoType { get; } = DynamicDtoType.CaptureFrame; [DataMember(Name = "EndOfFrame")] public bool EndOfFrame { get; set; } diff --git a/Shared/Models/RtcDtos/ClipboardTextDto.cs b/Shared/Models/RtcDtos/ClipboardTextDto.cs new file mode 100644 index 000000000..897729e01 --- /dev/null +++ b/Shared/Models/RtcDtos/ClipboardTextDto.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; + +namespace Remotely.Shared.Models.RtcDtos +{ + [DataContract] + public class ClipboardTextDto + { + public ClipboardTextDto(string clipboardText) + { + ClipboardText = clipboardText; + } + + [DataMember(Name = "ClipboardText")] + public string ClipboardText { get; } + } +} diff --git a/Shared/Models/RtcDtos/MachineNameDto.cs b/Shared/Models/RtcDtos/MachineNameDto.cs new file mode 100644 index 000000000..576060152 --- /dev/null +++ b/Shared/Models/RtcDtos/MachineNameDto.cs @@ -0,0 +1,23 @@ +using Remotely.Shared.Enums; +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; + +namespace Remotely.Shared.Models.RtcDtos +{ + [DataContract] + public class MachineNameDto : IDynamicDto + { + public MachineNameDto(string machineName) + { + MachineName = machineName; + } + + [DataMember(Name = "DtoType")] + public DynamicDtoType DtoType { get; } = DynamicDtoType.MachineName; + + [DataMember(Name = "MachineName")] + public string MachineName { get; } + } +} diff --git a/Shared/Models/RtcDtos/ScreenDataDto.cs b/Shared/Models/RtcDtos/ScreenDataDto.cs new file mode 100644 index 000000000..d2d6fb17d --- /dev/null +++ b/Shared/Models/RtcDtos/ScreenDataDto.cs @@ -0,0 +1,28 @@ +using Remotely.Shared.Enums; +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; + +namespace Remotely.Shared.Models.RtcDtos +{ + [DataContract] + public class ScreenDataDto : IDynamicDto + { + public ScreenDataDto(string selectedScreen, string[] displayNames) + { + SelectedScreen = selectedScreen; + DisplayNames = displayNames; + } + + [DataMember(Name = "DisplayNames")] + public string[] DisplayNames { get; } + + + [DataMember(Name = "DtoType")] + public DynamicDtoType DtoType { get; } = DynamicDtoType.ScreenData; + + [DataMember(Name = "SelectedScreen")] + public string SelectedScreen { get; } + } +} diff --git a/Shared/Models/RtcDtos/ScreenSizeDto.cs b/Shared/Models/RtcDtos/ScreenSizeDto.cs new file mode 100644 index 000000000..50449b574 --- /dev/null +++ b/Shared/Models/RtcDtos/ScreenSizeDto.cs @@ -0,0 +1,27 @@ +using Remotely.Shared.Enums; +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; + +namespace Remotely.Shared.Models.RtcDtos +{ + [DataContract] + public class ScreenSizeDto : IDynamicDto + { + public ScreenSizeDto(int width, int height) + { + Width = width; + Height = height; + } + + [DataMember(Name = "Width")] + public int Width { get; } + + [DataMember(Name = "Height")] + public int Height { get; } + + [DataMember(Name = "DtoType")] + public DynamicDtoType DtoType { get; } = DynamicDtoType.ScreenSize; + } +} diff --git a/Shared/Win32/Win32Interop.cs b/Shared/Win32/Win32Interop.cs index df9894faf..66fc87383 100644 --- a/Shared/Win32/Win32Interop.cs +++ b/Shared/Win32/Win32Interop.cs @@ -174,7 +174,7 @@ public static bool OpenInteractiveProcess(string applicationName, string desktop public static void SetMonitorState(MonitorState state) { - User32.SendMessage(0xFFFF, 0x112, 0xF170, (int)state); + SendMessage(0xFFFF, 0x112, 0xF170, (int)state); } public static bool SwitchToInputDesktop()