add support for retrieving RTP statistics.

This commit is contained in:
Simon Morlat 2010-05-20 12:10:50 +02:00
parent f159efb812
commit 574f492441
2 changed files with 45 additions and 0 deletions

View file

@ -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;

View file

@ -127,6 +127,8 @@ typedef struct _LinphoneCallLog{
int duration; /**<Duration of the call in seconds*/
char *refkey;
void *user_pointer;
rtp_stats_t local_stats;
rtp_stats_t remote_stats;
struct _LinphoneCore *lc;
} LinphoneCallLog;
@ -137,6 +139,8 @@ void linphone_call_log_set_user_pointer(LinphoneCallLog *cl, void *up);
void *linphone_call_log_get_user_pointer(const LinphoneCallLog *cl);
void linphone_call_log_set_ref_key(LinphoneCallLog *cl, const char *refkey);
const char *linphone_call_log_get_ref_key(const LinphoneCallLog *cl);
const rtp_stats_t *linphone_call_log_get_local_stats(const LinphoneCallLog *cl);
const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl);
char * linphone_call_log_to_str(LinphoneCallLog *cl);
typedef enum{
@ -785,6 +789,8 @@ void linphone_core_destroy(LinphoneCore *lc);
/*for advanced users:*/
void linphone_core_set_audio_transports(LinphoneCore *lc, RtpTransport *rtp, RtpTransport *rtcp);
int linphone_core_get_current_call_stats(LinphoneCore *lc, rtp_stats_t *local, rtp_stats_t *remote);
#ifdef __cplusplus
}
#endif