aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/call_window/call_connection_details_window.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2021-11-04 17:35:11 +0100
committerfiaxh <git@lightrise.org>2021-11-10 11:05:34 +0100
commit3dc4d7f1558bb574eb99dade9a05727604e2e2ca (patch)
treea936dede1f2f41a27d7931ee7f668ef85deaa93b /main/src/ui/call_window/call_connection_details_window.vala
parent26d10d1dcb95f11b65611473c9840e13683cb5ec (diff)
downloaddino-3dc4d7f1558bb574eb99dade9a05727604e2e2ca.tar.gz
dino-3dc4d7f1558bb574eb99dade9a05727604e2e2ca.zip
Add (disabled) multi-party call UI
Diffstat (limited to 'main/src/ui/call_window/call_connection_details_window.vala')
-rw-r--r--main/src/ui/call_window/call_connection_details_window.vala84
1 files changed, 84 insertions, 0 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
new file mode 100644
index 00000000..b292b971
--- /dev/null
+++ b/main/src/ui/call_window/call_connection_details_window.vala
@@ -0,0 +1,84 @@
+using Gtk;
+
+namespace Dino.Ui {
+
+ public class CallConnectionDetailsWindow : Gtk.Window {
+
+ public Grid grid = new Grid() { column_spacing=5, margin=10, halign=Align.CENTER, valign=Align.CENTER, visible=true };
+
+ 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_codec = new Label("?") { 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_codec = new Label("") { xalign=0, visible=true };
+
+ private int row_at = 0;
+ private bool video_added = false;
+ private PeerInfo? prev_peer_info = null;
+
+ public CallConnectionDetailsWindow() {
+ grid.attach(new Label("<b>Audio</b>") { use_markup=true, xalign=0, visible=true }, 0, row_at++, 1, 1);
+ put_row("RTP");
+ grid.attach(audio_rtp_ready, 1, row_at++, 1, 1);
+ put_row("RTCP");
+ grid.attach(audio_rtcp_ready, 1, row_at++, 1, 1);
+ put_row("Sent bp/s");
+ grid.attach(audio_sent_bps, 1, row_at++, 1, 1);
+ put_row("Received bp/s");
+ grid.attach(audio_recv_bps, 1, row_at++, 1, 1);
+ put_row("Codec");
+ grid.attach(audio_codec, 1, row_at++, 1, 1);
+
+ this.child = grid;
+ }
+
+ private void put_row(string label) {
+ grid.attach(new Label(label) { xalign=0, visible=true }, 0, row_at, 1, 1);
+ }
+
+ public void update_content(PeerInfo peer_info) {
+ 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();
+
+ 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;
+
+ 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();
+ }
+ prev_peer_info = peer_info;
+ }
+
+ private void add_video_widgets() {
+ if (video_added) return;
+
+ grid.attach(new Label("<b>Video</b>") { use_markup=true, xalign=0, visible=true }, 0, row_at++, 1, 1);
+ put_row("RTP");
+ grid.attach(video_rtp_ready, 1, row_at++, 1, 1);
+ put_row("RTCP");
+ grid.attach(video_rtcp_ready, 1, row_at++, 1, 1);
+ put_row("Sent bp/s");
+ grid.attach(video_sent_bps, 1, row_at++, 1, 1);
+ put_row("Received bp/s");
+ grid.attach(video_recv_bps, 1, row_at++, 1, 1);
+ put_row("Codec");
+ grid.attach(video_codec, 1, row_at++, 1, 1);
+
+ video_added = true;
+ }
+ }
+}
+