mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Change image diff and quality adjust.
This commit is contained in:
parent
9ef92d67b8
commit
73e66d1f08
@ -59,7 +59,7 @@ namespace Remotely_ScreenCast.Capture
|
||||
Name = requesterName,
|
||||
ViewerConnectionID = viewerID,
|
||||
HasControl = Program.Mode == Enums.AppMode.Unattended,
|
||||
ImageQuality = 1
|
||||
ImageQuality = 100
|
||||
};
|
||||
|
||||
while (!success)
|
||||
@ -101,7 +101,6 @@ namespace Remotely_ScreenCast.Capture
|
||||
|
||||
while (viewer.PendingFrames > 10)
|
||||
{
|
||||
Logger.Write("Waiting on pending frames.");
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
@ -109,6 +108,11 @@ namespace Remotely_ScreenCast.Capture
|
||||
|
||||
var diffArea = ImageUtils.GetDiffArea(capturer.CurrentFrame, capturer.PreviousFrame, capturer.CaptureFullscreen);
|
||||
|
||||
if (diffArea.IsEmpty)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var newImage = capturer.CurrentFrame.Clone(diffArea, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
|
||||
if (capturer.CaptureFullscreen)
|
||||
@ -116,26 +120,28 @@ namespace Remotely_ScreenCast.Capture
|
||||
capturer.CaptureFullscreen = false;
|
||||
}
|
||||
|
||||
long newQuality;
|
||||
if (viewer.PendingFrames < 5)
|
||||
{
|
||||
newQuality = (long)Math.Min(1, viewer.ImageQuality + .1);
|
||||
}
|
||||
else
|
||||
{
|
||||
newQuality = (long)Math.Max(.1, viewer.ImageQuality - .1);
|
||||
}
|
||||
Logger.Write($"New quality: {newQuality}");
|
||||
if (newQuality != viewer.ImageQuality)
|
||||
{
|
||||
viewer.ImageQuality = newQuality;
|
||||
viewer.FullScreenRefreshNeeded = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
capturer.CaptureFullscreen = true;
|
||||
viewer.FullScreenRefreshNeeded = false;
|
||||
}
|
||||
//long newQuality;
|
||||
//if (viewer.PendingFrames < 8)
|
||||
//{
|
||||
// newQuality = Math.Min(100, viewer.ImageQuality + 10);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// newQuality = Math.Max(0, viewer.ImageQuality - 10);
|
||||
//}
|
||||
|
||||
//if (newQuality != viewer.ImageQuality)
|
||||
//{
|
||||
// Logger.Write($"New quality: {newQuality}");
|
||||
// viewer.ImageQuality = newQuality;
|
||||
// viewer.FullScreenRefreshNeeded = true;
|
||||
//}
|
||||
//else if (viewer.FullScreenRefreshNeeded)
|
||||
//{
|
||||
// Logger.Write($"Quality stabilized.");
|
||||
// capturer.CaptureFullscreen = true;
|
||||
// viewer.FullScreenRefreshNeeded = false;
|
||||
//}
|
||||
|
||||
var img = ImageUtils.EncodeBitmap(newImage, viewer.EncoderParams);
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ namespace Remotely_ScreenCast.Models
|
||||
{
|
||||
Param = new EncoderParameter[]
|
||||
{
|
||||
new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 75L)
|
||||
new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\Remotely_Agent\Resources\</OutputPath>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
@ -30,7 +30,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\Remotely_Agent\Resources\</OutputPath>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
||||
@ -72,7 +72,7 @@ namespace Remotely_Server.Services
|
||||
{
|
||||
EventType = EventTypes.Info,
|
||||
OrganizationID = Device.OrganizationID,
|
||||
Message = $"Device connection for {device.DeviceName} was denied because it is already connected."
|
||||
Message = $"Device connection for {device?.DeviceName} was denied because it is already connected."
|
||||
});
|
||||
Context.Abort();
|
||||
return;
|
||||
|
||||
@ -57,6 +57,13 @@ Set-Location -Path (Get-Item -Path $PSScriptRoot).Parent.FullName
|
||||
|
||||
|
||||
if ($ArgList.Contains("c")) {
|
||||
# Copy .NET Framework ScreenCaster to Agent resources for embedding.
|
||||
if ((Test-Path -Path ".\Remotely_ScreenCast\bin\Release\Remotely_ScreenCast.exe") -eq $true) {
|
||||
Move-Item -Path ".\Remotely_ScreenCast\bin\Release\Remotely_ScreenCast.exe" -Destination ".\Remotely_Agent\Resources\Remotely_ScreenCast.exe" -Force
|
||||
}
|
||||
elseif ((Test-Path -Path ".\Remotely_ScreenCast\bin\Debug\Remotely_ScreenCast.exe") -eq $true) {
|
||||
Move-Item -Path ".\Remotely_ScreenCast\bin\Debug\Remotely_ScreenCast.exe" -Destination ".\Remotely_Agent\Resources\Remotely_ScreenCast.exe" -Force
|
||||
}
|
||||
# Clear publish folders.
|
||||
if ((Test-Path -Path ".\Remotely_Agent\bin\Release\netcoreapp2.2\win10-x64\publish") -eq $true) {
|
||||
Get-ChildItem -Path ".\Remotely_Agent\bin\Release\netcoreapp2.2\win10-x64\publish" | Remove-Item -Force -Recurse
|
||||
|
||||
Loading…
Reference in New Issue
Block a user