From 574f492441002911b7d0f8a44df7a42d2cf233b8 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 20 May 2010 12:10:50 +0200 Subject: [PATCH] add support for retrieving RTP statistics. --- coreapi/linphonecore.c | 39 +++++++++++++++++++++++++++++++++++++++ coreapi/linphonecore.h | 6 ++++++ 2 files changed, 45 insertions(+) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 3d5cb9a4e..5b4016ffe 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -379,6 +379,23 @@ char * linphone_call_log_to_str(LinphoneCallLog *cl){ return tmp; } +/** + * Returns RTP statistics computed locally regarding the call. + * +**/ +const rtp_stats_t *linphone_call_log_get_local_stats(const LinphoneCallLog *cl){ + return &cl->local_stats; +} + +/** + * Returns RTP statistics computed by remote end and sent back via RTCP. + * + * @note Not implemented yet. +**/ +const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl){ + return &cl->remote_stats; +} + void linphone_call_log_set_user_pointer(LinphoneCallLog *cl, void *up){ cl->user_pointer=up; } @@ -3354,6 +3371,28 @@ void linphone_core_set_audio_transports(LinphoneCore *lc, RtpTransport *rtp, Rtp lc->a_rtcp=rtcp; } +/** + * Retrieve RTP statistics regarding current call. + * @param local RTP statistics computed locally. + * @param remote RTP statistics computed by far end (obtained via RTCP feedback). + * + * @note Remote RTP statistics is not implemented yet. + * + * @returns 0 or -1 if no call is running. +**/ + +int linphone_core_get_current_call_stats(LinphoneCore *lc, rtp_stats_t *local, rtp_stats_t *remote){ + LinphoneCall *call=linphone_core_get_current_call (lc); + if (call!=NULL){ + if (lc->audiostream!=NULL){ + memset(remote,0,sizeof(*remote)); + audio_stream_get_local_rtp_stats (lc->audiostream,local); + return 0; + } + } + return -1; +} + void net_config_uninit(LinphoneCore *lc) { net_config_t *config=&lc->net_conf; diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 945ea25ea..a19f1f7b3 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -127,6 +127,8 @@ typedef struct _LinphoneCallLog{ int duration; /**