diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-04 14:09:45 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-04 14:09:45 +0200 |
| commit | 565e48de649d3d14e6b82012b6aa2e3819a3c82c (patch) | |
| tree | 16e766f6bd45e62c48d6046a21841526aafaed73 /Software/Visual_Studio/Tango.RemoteDesktop/Comparers | |
| parent | b0ccae10fa6025838195c42fa6c9dd72b4321579 (diff) | |
| download | Tango-565e48de649d3d14e6b82012b6aa2e3819a3c82c.tar.gz Tango-565e48de649d3d14e6b82012b6aa2e3819a3c82c.zip | |
Improved BitmapCliper.
Implemented auto throw when max differences reached.
Implemented fallback TurboJpeg encoder.
Fixed issue with UpdateMachine.xml script removing DISPENSERS before IDS_PACKS.
Added GlobalHost.Configuration.MaxIncomingWebSocketMessageSize for WebSockets support for large messages on SignalR.
Diffstat (limited to 'Software/Visual_Studio/Tango.RemoteDesktop/Comparers')
| -rw-r--r-- | Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs | 15 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.RemoteDesktop/Comparers/VectorBitmapComparer.cs | 13 |
2 files changed, 28 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs index b1b186065..7aa6a07a0 100644 --- a/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs +++ b/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/RasterBitmapComparer.cs @@ -16,6 +16,12 @@ namespace Tango.RemoteDesktop.Comparers public class RasterBitmapComparer : IBitmapComparer<RasterFrame> { /// <summary> + /// When max number of differences reached, the comparer will immediately return the current difference frame. + /// This should enforce the screen capture engine to report 'No Difference Available'. + /// </summary> + public long? MaxDifferencesThrow { get; set; } + + /// <summary> /// Creates the difference as <see cref="RasterFrame"/>. /// </summary> /// <param name="previousBitmap">The previous bitmap.</param> @@ -94,6 +100,15 @@ namespace Tango.RemoteDesktop.Comparers if (same != 4) { count++; + + if (MaxDifferencesThrow != null && count > MaxDifferencesThrow.Value) + { + previousBitmap.UnlockBits(data1); + currentBitmap.UnlockBits(data2); + diffImage.UnlockBits(diffData); + diffImage.Dispose(); + throw new MaxDifferencesReachedException(); + } } } diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/VectorBitmapComparer.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/VectorBitmapComparer.cs index 7f6dd9ccf..338318177 100644 --- a/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/VectorBitmapComparer.cs +++ b/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/VectorBitmapComparer.cs @@ -17,6 +17,12 @@ namespace Tango.RemoteDesktop.Comparers public class VectorBitmapComparer : IBitmapComparer<VectorFrame> { /// <summary> + /// When max number of differences reached, the comparer will immediately return the current difference frame. + /// This should enforce the screen capture engine to report 'No Difference Available'. + /// </summary> + public long? MaxDifferencesThrow { get; set; } + + /// <summary> /// Creates the difference as <see cref="VectorFrame"/>. /// </summary> /// <param name="previousBitmap">The previous bitmap.</param> @@ -105,6 +111,13 @@ namespace Tango.RemoteDesktop.Comparers }); count++; + + if (MaxDifferencesThrow != null && count > MaxDifferencesThrow.Value) + { + previousBitmap.UnlockBits(data1); + currentBitmap.UnlockBits(data2); + throw new MaxDifferencesReachedException(); + } } } |
