From 52d8d8c59af7877ce1e1f6a95628aac9b5030fc8 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 4 Jun 2014 18:10:21 +0200 Subject: [PATCH] Show RTP profile in call statistics dialog. --- coreapi/linphonecall.c | 6 +- coreapi/linphonecore.h | 7 ++ gtk/call_statistics.ui | 227 ++++++++++++++++++++--------------------- gtk/incall_view.c | 7 +- 4 files changed, 128 insertions(+), 119 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index c6087580c..aa1786891 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -337,7 +337,7 @@ void linphone_call_increment_local_media_description(LinphoneCall *call){ md->session_ver++; } -static SalMediaProto get_proto_from_call_params(LinphoneCallParams *params) { +static SalMediaProto get_proto_from_call_params(const LinphoneCallParams *params) { if ((params->media_encryption == LinphoneMediaEncryptionSRTP) && params->avpf_enabled) return SalProtoRtpSavpf; if (params->media_encryption == LinphoneMediaEncryptionSRTP) return SalProtoRtpSavp; if (params->avpf_enabled) return SalProtoRtpAvpf; @@ -1280,6 +1280,10 @@ MSVideoSize linphone_call_params_get_received_video_size(const LinphoneCallParam return cp->recv_vsize; } +const char * linphone_call_params_get_rtp_profile(const LinphoneCallParams *cp) { + return sal_media_proto_to_string(get_proto_from_call_params(cp)); +} + /** * @ingroup call_control * Use to know if this call has been configured in low bandwidth mode. diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index b7e297e0a..60813272c 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -429,6 +429,13 @@ LINPHONE_PUBLIC MSVideoSize linphone_call_params_get_sent_video_size(const Linph */ LINPHONE_PUBLIC MSVideoSize linphone_call_params_get_received_video_size(const LinphoneCallParams *cp); +/** + * Gets the RTP profile being used. + * @param[in] cp #LinphoneCallParams object + * @returns The RTP profile. + */ +LINPHONE_PUBLIC const char * linphone_call_params_get_rtp_profile(const LinphoneCallParams *cp); + /* * Note for developers: this enum must be kept synchronized with the SalPrivacy enum declared in sal.h diff --git a/gtk/call_statistics.ui b/gtk/call_statistics.ui index 2412d9793..d53c93a1f 100644 --- a/gtk/call_statistics.ui +++ b/gtk/call_statistics.ui @@ -1,115 +1,67 @@ - + - False 5 Call statistics dialog - + True - False 2 - - - True - False - end - - - - - - gtk-close - True - True - True - False - True - - - False - False - 1 - - - - - False - True - end - 0 - - True - False 0 none True - False 12 True - False - 9 + 10 2 True True - False Audio codec - + 1 + 2 + True - False Video codec - 1 - 2 - + 2 + 3 + True - False Audio IP bandwidth usage - 2 - 3 - + 3 + 4 + True - False - - - 1 - 2 - - - - - True - False 1 @@ -119,9 +71,8 @@ - + True - False 1 @@ -130,22 +81,53 @@ 3 + + + True + + + 1 + 2 + 3 + 4 + + True - False Audio Media connectivity - 4 - 5 - + 5 + 6 + True - False + + + 1 + 2 + 5 + 6 + + + + + True + Video IP bandwidth usage + + + 4 + 5 + + + + + + True 1 @@ -154,120 +136,106 @@ 5 - - - True - False - Video IP bandwidth usage - - - 3 - 4 - - - - - - True - False - - - 1 - 2 - 3 - 4 - - True - False Video Media connectivity - 5 - 6 + 6 + 7 True - False 1 2 - 5 - 6 + 6 + 7 True - False Round trip time - 6 - 7 + 7 + 8 True - False 1 2 - 6 - 7 + 7 + 8 True - False Video resolution received - 7 - 8 + 8 + 9 True - False 1 2 - 7 - 8 + 8 + 9 True - False Video resolution sent - 8 - 9 + 9 + 10 True - False 1 2 - 8 - 9 + 9 + 10 + + + + + True + RTP profile + + + + + + + + True + + + 1 + 2 @@ -277,7 +245,6 @@ True - False <b>Call statistics and information</b> True @@ -289,6 +256,34 @@ 1 + + + True + end + + + + + + gtk-close + True + True + True + True + + + False + False + 1 + + + + + False + end + 0 + + diff --git a/gtk/incall_view.c b/gtk/incall_view.c index 8ab6309f6..382e27746 100644 --- a/gtk/incall_view.c +++ b/gtk/incall_view.c @@ -258,9 +258,12 @@ static void _refresh_call_stats(GtkWidget *callstats, LinphoneCall *call){ 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)"), + const char *rtp_profile = linphone_call_params_get_rtp_profile(linphone_call_get_current_params(call)); + gchar *tmp = g_strdup_printf("%s", rtp_profile); + gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(callstats,"rtp_profile")),tmp); + g_free(tmp); + 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){