Commit b0c5530b authored by Simon Morlat's avatar Simon Morlat
Browse files

propagation estimation refined

parent a5dc8518
...@@ -221,7 +221,7 @@ struct _RtpSession ...@@ -221,7 +221,7 @@ struct _RtpSession
unsigned int lost_packets_test_vector; unsigned int lost_packets_test_vector;
unsigned int interarrival_jitter_test_vector; unsigned int interarrival_jitter_test_vector;
unsigned int delay_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 symmetric_rtp;
bool_t permissive; /*use the permissive algorithm*/ bool_t permissive; /*use the permissive algorithm*/
bool_t use_connect; /* use connect() on the socket */ bool_t use_connect; /* use connect() on the socket */
...@@ -378,7 +378,7 @@ int rtp_session_get_last_recv_error_code(RtpSession *session); ...@@ -378,7 +378,7 @@ int rtp_session_get_last_recv_error_code(RtpSession *session);
void rtp_session_clear_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_lost_packet_value( RtpSession *session, const unsigned int value );
void rtp_session_rtcp_set_jitter_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){ ...@@ -247,8 +247,7 @@ static void report_block_init(report_block_t *b, RtpSession *session){
packet_loss = 0; packet_loss = 0;
/* The test value is the definite cumulative one, no need to increment it each time a packet is sent */ /* 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; stream->stats.cum_packet_loss = packet_loss;
} }else {
else {
/* Normal mode */ /* Normal mode */
packet_loss = ( stream->hwrcv_extseq - stream->hwrcv_seq_at_last_SR ) - stream->hwrcv_since_last_SR; packet_loss = ( stream->hwrcv_extseq - stream->hwrcv_seq_at_last_SR ) - stream->hwrcv_since_last_SR;
if ( packet_loss < 0 ) if ( packet_loss < 0 )
......
...@@ -1602,9 +1602,9 @@ void rtp_session_clear_recv_error_code(RtpSession *session){ ...@@ -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 * 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. * 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; return session->rtt;
} }
......
...@@ -1038,8 +1038,8 @@ static void compute_rtt(RtpSession *session, rtcp_sr_t *sr){ ...@@ -1038,8 +1038,8 @@ static void compute_rtt(RtpSession *session, rtcp_sr_t *sr){
double rtt_frac=approx_ntp-last_sr_time-sr_delay; double rtt_frac=approx_ntp-last_sr_time-sr_delay;
rtt_frac/=65536.0; rtt_frac/=65536.0;
/*express the result in milliseconds*/ /*express the result in milliseconds*/
session->rtt=rtt_frac/1000.0; session->rtt=rtt_frac;
/*ortp_message("rtt estimated to %i ms",session->rtt);*/ /*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