to recveive a rtp packet to queue,rtp_session_rtp_parse calls
jitter_control_new_packet(&session->rtp.jittctl,rtp->timestamp,local_str_ts)
to calculate jittctl's slide and jitter

/*
 The algorithm computes two values:
    slide: an average of difference between the expected and the
socket-received timestamp
    jitter: an average of the absolute value of the difference between
socket-received timestamp and slide.
    slide is used to make clock-slide detection and correction.
    jitter is added to the initial jitt_comp_time value. It compensates
bursty packets arrival (packets
    not arriving at regular interval ).
*/
void jitter_control_new_packet(JitterControl *ctl, uint32_t packet_ts,
uint32_t cur_str_ts){
    int64_t diff=(int64_t)packet_ts - (int64_t)cur_str_ts;

the first line, diff=the received packet's timestamp  -  the user's
timestamp( 0,160,320,...)
not the received packet's timestamp  -  oRTP exptected timestamp

and as the code shows ,slide is near the diff
slide=((double)ctl->slide*(1-JC_BETA)) + ((double)diff*JC_BETA) where
JC_BETA=0.01


My problem is:
when packet_ts near the max of uint32(4294967295),the next packet's
timestamp will be 0~200,cause the slide change a lot:

ortp-debug-rtp_parse ssrc=177072159, timestamp=4294967120,
seq_number=27231, local_str_ts=178720
ortp-debug-slide=4294789160, adapt_jitt_comp_ts=1280

ortp-debug-rtp_parse ssrc=177072159, timestamp=4294967280,
seq_number=27232, local_str_ts=178880
ortp-debug-slide=4294789152, adapt_jitt_comp_ts=1280

the next packet:
ortp-debug-rtp_parse ssrc=177072159, timestamp=144, seq_number=27233,
local_str_ts=179040
ortp-debug-slide=4251839471, adapt_jitt_comp_ts=1280

and in my program,I need to get this receveid packet and send it out,but
because
rtp_session_recvm_with_ts calls
ts =
jitter_control_get_compensated_timestamp(&session->rtp.jittctl,user_ts);

the ts is changed a lot, and I can't get the right packet after this point:

ortp-debug-rtp_parse ssrc=177072159, timestamp=4294967120,
seq_number=27231, local_str_ts=178720
ortp-debug-slide=4294789160, adapt_jitt_comp_ts=1280
ortp-debug-rtp_putq(): Enqueuing packet with ts=-176 and seq=27231
ortp-debug-rtp_putq(): Seeing packet with seq=27230
ortp-debug-jitter_control_get_compensated_timestamp: user_ts=178720,
ts=4294966600
ortp-debug-rtp_getq(): Timestamp -696 wanted.
ortp-debug-rtp_getq: Seeing packet with ts=-816
ortp-debug-rtp_getq: Found packet with ts=-816
ortp-debug-rtp_getq: Seeing packet with ts=-656
ortp-debug-Returning mp with ts=-816

ortp-debug-rtp_parse ssrc=177072159, timestamp=4294967280,
seq_number=27232, local_str_ts=178880
ortp-debug-slide=4294789152, adapt_jitt_comp_ts=1280
ortp-debug-rtp_putq(): Enqueuing packet with ts=-16 and seq=27232
ortp-debug-rtp_putq(): Seeing packet with seq=27231
ortp-debug-jitter_control_get_compensated_timestamp: user_ts=178880,
ts=4294966752
ortp-debug-rtp_getq(): Timestamp -544 wanted.
ortp-debug-rtp_getq: Seeing packet with ts=-656
ortp-debug-rtp_getq: Found packet with ts=-656
ortp-debug-rtp_getq: Seeing packet with ts=-496
ortp-debug-Returning mp with ts=-656

ortp-debug-rtp_parse ssrc=177072159, timestamp=144, seq_number=27233,
local_str_ts=179040
ortp-debug-slide=4251839471, adapt_jitt_comp_ts=1280
ortp-debug-rtp_putq(): Enqueuing packet with ts=144 and seq=27233
ortp-debug-rtp_putq(): Seeing packet with seq=27232
ortp-debug-jitter_control_get_compensated_timestamp: user_ts=179040, ts=
4252017231
ortp-debug-rtp_getq(): Timestamp -42950065 wanted.
ortp-debug-rtp_getq: Seeing packet with ts=-496
ortp-debug-No mp for timestamp queried

...

ortp-debug-rtp_parse ssrc=177072159, timestamp=6704, seq_number=27274,
local_str_ts=185600
ortp-debug-slide=2815856491, adapt_jitt_comp_ts=1280
ortp-debug-rtp_putq(): Enqueuing packet with ts=6704 and seq=27274
ortp-debug-rtp_putq(): Seeing packet with seq=27273
ortp-debug-jitter_control_get_compensated_timestamp: user_ts=185600,
ts=2816040811
ortp-debug-rtp_getq(): Timestamp -1478926485 wanted.
ortp-debug-rtp_getq: Seeing packet with ts=-496
ortp-debug-No mp for timestamp queried


the oRTP version I use is 0.16.1,but I found the newest 0.24.2 doesn't
change jitter_control_new_packet at all.

Can any one help?Thanks !
_______________________________________________
Linphone-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/linphone-users

Reply via email to