From b15fa27457d4b6d9c8d16ad73ce0378cd1c0b239 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Thu, 16 Jan 2014 17:52:16 +0100 Subject: [PATCH] Add video resolution in call stat --- gtk/call_statistics.ui | 48 +++++++++++++++++++++++++++++++++++++++++- gtk/incall_view.c | 15 +++++++++++-- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/gtk/call_statistics.ui b/gtk/call_statistics.ui index a647a8dca..2412d9793 100644 --- a/gtk/call_statistics.ui +++ b/gtk/call_statistics.ui @@ -59,7 +59,7 @@ True False - 7 + 9 2 True @@ -224,6 +224,52 @@ 7 + + + True + False + Video resolution received + + + 7 + 8 + + + + + True + False + + + 1 + 2 + 7 + 8 + + + + + True + False + Video resolution sent + + + 8 + 9 + + + + + True + False + + + 1 + 2 + 8 + 9 + + diff --git a/gtk/incall_view.c b/gtk/incall_view.c index da954a45b..8f96cfb27 100644 --- a/gtk/incall_view.c +++ b/gtk/incall_view.c @@ -256,14 +256,25 @@ static void _refresh_call_stats(GtkWidget *callstats, LinphoneCall *call){ const char *audio_media_connectivity = _("Direct or through server"); const char *video_media_connectivity = _("Direct or through server"); gboolean has_video=linphone_call_params_video_enabled(linphone_call_get_current_params(call)); + MSVideoSize size_received = linphone_call_params_get_received_video_size(linphone_call_get_current_params(call)); + MSVideoSize size_sent = linphone_call_params_get_sent_video_size(linphone_call_get_current_params(call)); gchar *tmp=g_strdup_printf(_("download: %f\nupload: %f (kbit/s)"), as->download_bandwidth,as->upload_bandwidth); gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(callstats,"audio_bandwidth_usage")),tmp); g_free(tmp); - if (has_video) + if (has_video){ + gchar *size_r=g_strdup_printf(_("%ix%i"),size_received.width,size_received.height); + gchar *size_s=g_strdup_printf(_("%ix%i"),size_sent.width,size_sent.height); + gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(callstats,"video_size_recv")),size_r); + gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(callstats,"video_size_sent")),size_s); + tmp=g_strdup_printf(_("download: %f\nupload: %f (kbit/s)"),vs->download_bandwidth,vs->upload_bandwidth); - else tmp=NULL; + g_free(size_r); + g_free(size_s); + } else { + tmp=NULL; + } gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(callstats,"video_bandwidth_usage")),tmp); if (tmp) g_free(tmp); if(as->upnp_state != LinphoneUpnpStateNotAvailable && as->upnp_state != LinphoneUpnpStateIdle) {