mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Added monitoring and throttling of WebRTC output buffer.
This commit is contained in:
parent
2a8d718243
commit
071fe5df29
@ -96,6 +96,12 @@ namespace Remotely.ScreenCast.Core.Capture
|
||||
continue;
|
||||
}
|
||||
|
||||
if (viewer.RtcSession?.CurrentBuffer > 100_000)
|
||||
{
|
||||
Debug.WriteLine($"Throttling output due to WebRTC buffer. Size: {viewer.RtcSession.CurrentBuffer}");
|
||||
await Task.Delay((int)(viewer.RtcSession.CurrentBuffer - 100_000));
|
||||
}
|
||||
|
||||
capturer.GetNextFrame();
|
||||
|
||||
var diffArea = ImageUtils.GetDiffArea(capturer.CurrentFrame, capturer.PreviousFrame, capturer.CaptureFullscreen);
|
||||
|
||||
@ -16,6 +16,8 @@ namespace Remotely.ScreenCast.Core.Communication
|
||||
|
||||
public event EventHandler<string> LocalSdpReady;
|
||||
|
||||
public ulong CurrentBuffer { get; private set; }
|
||||
|
||||
public bool IsDataChannelOpen => CaptureChannel?.State == DataChannel.ChannelState.Open;
|
||||
private DataChannel CaptureChannel { get; set; }
|
||||
private PeerConnection PeerConnection { get; set; }
|
||||
@ -84,6 +86,7 @@ namespace Remotely.ScreenCast.Core.Communication
|
||||
private void DataChannel_BufferingChanged(ulong previous, ulong current, ulong limit)
|
||||
{
|
||||
Debug.WriteLine($"DataChannel buffering changed. Previous: {previous}. Current: {current}. Limit: {limit}.");
|
||||
CurrentBuffer = current;
|
||||
}
|
||||
|
||||
private void PeerConnection_Connected()
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="deviceGrid" class="table table-responsive table-hover table-striped">
|
||||
<table id="deviceGrid" class="table table-hover table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Online</th>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user