Commit b0c5530b authored by Simon Morlat's avatar Simon Morlat

propagation estimation refined

parent a5dc8518
......@@ -221,7 +221,7 @@ struct _RtpSession
unsigned int lost_packets_test_vector;
unsigned int interarrival_jitter_test_vector;
unsigned int delay_test_vector;
int rtt;/*last round trip delay calculated*/
float rtt;/*last round trip delay calculated*/
bool_t symmetric_rtp;
bool_t permissive; /*use the permissive algorithm*/
bool_t use_connect; /* use connect() on the socket */
......@@ -378,7 +378,7 @@ int rtp_session_get_last_recv_error_code(RtpSession *session);
void rtp_session_clear_recv_error_code(RtpSession *session);
int rtp_session_get_round_trip_propagation(RtpSession *session);
float rtp_session_get_round_trip_propagation(RtpSession *session);
void rtp_session_rtcp_set_lost_packet_value( RtpSession *session, const unsigned int value );
void rtp_session_rtcp_set_jitter_value(RtpSession *session, const unsigned int value );
......
......@@ -247,8 +247,7 @@ static void report_block_init(report_block_t *b, RtpSession *session){
packet_loss = 0;
/* The test value is the definite cumulative one, no need to increment it each time a packet is sent */
stream->stats.cum_packet_loss = packet_loss;
}
else {
}else {
/* Normal mode */
packet_loss = ( stream->hwrcv_extseq - stream->hwrcv_seq_at_last_SR ) - stream->hwrcv_since_last_SR;
if ( packet_loss < 0 )
......
......@@ -1602,9 +1602,9 @@ void rtp_session_clear_recv_error_code(RtpSession *session){
* This value might not be known: at the beginning when no RTCP packets have been exchanged yet, or simply because the
* rtcp channel is broken due to firewall problematics, or because the remote implementation does not support RTCP.
*
* @returns the round trip propagation time in milliseconds if known, -1 if unknown.
* @returns the round trip propagation time in seconds if known, -1 if unknown.
**/
int rtp_session_get_round_trip_propagation(RtpSession *session){
float rtp_session_get_round_trip_propagation(RtpSession *session){
return session->rtt;
}
......
......@@ -1038,8 +1038,8 @@ static void compute_rtt(RtpSession *session, rtcp_sr_t *sr){
double rtt_frac=approx_ntp-last_sr_time-sr_delay;
rtt_frac/=65536.0;
/*express the result in milliseconds*/
session->rtt=rtt_frac/1000.0;
/*ortp_message("rtt estimated to %i ms",session->rtt);*/
session->rtt=rtt_frac;
/*ortp_message("rtt estimated to %f ms",session->rtt);*/
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment