aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/call_window
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2021-11-11 21:54:55 +0100
committerfiaxh <git@lightrise.org>2021-11-11 21:54:55 +0100
commite205743f0cb71e32eecf183d067a4f34a7a89d48 (patch)
tree516e6cd86ad0a628e66d0af8796d02e0f03badba /main/src/ui/call_window
parent1b157a20ab728a010eb85292177bcb62cef6a839 (diff)
downloaddino-e205743f0cb71e32eecf183d067a4f34a7a89d48.tar.gz
dino-e205743f0cb71e32eecf183d067a4f34a7a89d48.zip
Display target bitrates in connection details UI
Diffstat (limited to 'main/src/ui/call_window')
-rw-r--r--main/src/ui/call_window/call_connection_details_window.vala36
1 files changed, 28 insertions, 8 deletions
diff --git a/main/src/ui/call_window/call_connection_details_window.vala b/main/src/ui/call_window/call_connection_details_window.vala
index b292b971..95e00296 100644
--- a/main/src/ui/call_window/call_connection_details_window.vala
+++ b/main/src/ui/call_window/call_connection_details_window.vala
@@ -8,15 +8,19 @@ namespace Dino.Ui {
public Label audio_rtp_ready = new Label("?") { xalign=0, visible=true };
public Label audio_rtcp_ready = new Label("?") { xalign=0, visible=true };
- public Label audio_sent_bps = new Label("?") { xalign=0, visible=true };
- public Label audio_recv_bps = new Label("?") { xalign=0, visible=true };
+ public Label audio_sent_bps = new Label("?") { use_markup=true, xalign=0, visible=true };
+ public Label audio_recv_bps = new Label("?") { use_markup=true, xalign=0, visible=true };
public Label audio_codec = new Label("?") { xalign=0, visible=true };
+ public Label audio_target_receive_bitrate = new Label("n/a") { xalign=0, visible=true };
+ public Label audio_target_send_bitrate = new Label("n/a") { xalign=0, visible=true };
public Label video_rtp_ready = new Label("") { xalign=0, visible=true };
public Label video_rtcp_ready = new Label("") { xalign=0, visible=true };
- public Label video_sent_bps = new Label("") { xalign=0, visible=true };
- public Label video_recv_bps = new Label("") { xalign=0, visible=true };
+ public Label video_sent_bps = new Label("") { use_markup=true, xalign=0, visible=true };
+ public Label video_recv_bps = new Label("") { use_markup=true, xalign=0, visible=true };
public Label video_codec = new Label("") { xalign=0, visible=true };
+ public Label video_target_receive_bitrate = new Label("n/a") { xalign=0, visible=true };
+ public Label video_target_send_bitrate = new Label("n/a") { xalign=0, visible=true };
private int row_at = 0;
private bool video_added = false;
@@ -34,6 +38,10 @@ namespace Dino.Ui {
grid.attach(audio_recv_bps, 1, row_at++, 1, 1);
put_row("Codec");
grid.attach(audio_codec, 1, row_at++, 1, 1);
+ put_row("Target receive bitrate");
+ grid.attach(audio_target_receive_bitrate, 1, row_at++, 1, 1);
+ put_row("Target send bitrate");
+ grid.attach(audio_target_send_bitrate, 1, row_at++, 1, 1);
this.child = grid;
}
@@ -46,18 +54,26 @@ namespace Dino.Ui {
audio_rtp_ready.label = peer_info.audio_rtp_ready.to_string();
audio_rtcp_ready.label = peer_info.audio_rtcp_ready.to_string();
audio_codec.label = peer_info.audio_codec + " " + peer_info.audio_clockrate.to_string();
+ audio_target_receive_bitrate.label = peer_info.audio_target_receive_bitrate.to_string();
+ audio_target_send_bitrate.label = peer_info.audio_target_send_bitrate.to_string();
video_rtp_ready.label = peer_info.video_rtp_ready.to_string();
video_rtcp_ready.label = peer_info.video_rtcp_ready.to_string();
video_codec.label = peer_info.video_codec;
+ video_target_receive_bitrate.label = peer_info.video_target_receive_bitrate.to_string();
+ video_target_send_bitrate.label = peer_info.video_target_send_bitrate.to_string();
if (peer_info.video_content_exists) add_video_widgets();
if (prev_peer_info != null) {
- audio_sent_bps.label = (peer_info.audio_bytes_sent - prev_peer_info.audio_bytes_sent).to_string();
- audio_recv_bps.label = (peer_info.audio_bytes_received - prev_peer_info.audio_bytes_received).to_string();
- video_sent_bps.label = (peer_info.video_bytes_sent - prev_peer_info.video_bytes_sent).to_string();
- video_recv_bps.label = (peer_info.video_bytes_received - prev_peer_info.video_bytes_received).to_string();
+ ulong audio_sent_kbps = (peer_info.audio_bytes_sent - prev_peer_info.audio_bytes_sent) * 8 / 1000;
+ audio_sent_bps.label = "<span font_family='monospace'>%lu</span> kbps".printf(audio_sent_kbps);
+ ulong audio_recv_kbps = (peer_info.audio_bytes_received - prev_peer_info.audio_bytes_received) * 8 / 1000;
+ audio_recv_bps.label = "<span font_family='monospace'>%lu</span> kbps".printf(audio_recv_kbps);
+ ulong video_sent_kbps = (peer_info.video_bytes_sent - prev_peer_info.video_bytes_sent) * 8 / 1000;
+ video_sent_bps.label = "<span font_family='monospace'>%lu</span> kbps".printf(video_sent_kbps);
+ ulong video_recv_kbps = (peer_info.video_bytes_received - prev_peer_info.video_bytes_received) * 8 / 1000;
+ video_recv_bps.label = "<span font_family='monospace'>%lu</span> kbps".printf(video_recv_kbps);
}
prev_peer_info = peer_info;
}
@@ -76,6 +92,10 @@ namespace Dino.Ui {
grid.attach(video_recv_bps, 1, row_at++, 1, 1);
put_row("Codec");
grid.attach(video_codec, 1, row_at++, 1, 1);
+ put_row("Target receive bitrate");
+ grid.attach(video_target_receive_bitrate, 1, row_at++, 1, 1);
+ put_row("Target send bitrate");
+ grid.attach(video_target_send_bitrate, 1, row_at++, 1, 1);
video_added = true;
}