diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index 181395baa6..271bf9ff90 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -2554,7 +2554,7 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected, } } else { while (gst_rtp_buffer_compare_seqnum (expected, seqnum) > 0) { - rtp_timer_queue_set_lost (priv->timers, expected, 0, expected_pts, + rtp_timer_queue_set_lost (priv->timers, expected, expected_pts, duration, timeout_offset (jitterbuffer)); expected_pts += duration; expected++; @@ -3887,13 +3887,10 @@ do_lost_timeout (GstRtpJitterBuffer * jitterbuffer, RtpTimer * timer, GstClockTime now) { GstRtpJitterBufferPrivate *priv = jitterbuffer->priv; - guint lost_packets; GstClockTime timestamp; timestamp = apply_offset (jitterbuffer, get_pts_timeout (timer)); - lost_packets = MAX (timer->num, 1); - - insert_lost_event (jitterbuffer, timer->seqnum, lost_packets, timestamp, + insert_lost_event (jitterbuffer, timer->seqnum, 1, timestamp, timer->duration, timer->num_rtx_retry); if (GST_CLOCK_TIME_IS_VALID (timer->rtx_last)) { diff --git a/gst/rtpmanager/rtptimerqueue.c b/gst/rtpmanager/rtptimerqueue.c index b32a510dbe..9e540df40a 100644 --- a/gst/rtpmanager/rtptimerqueue.c +++ b/gst/rtpmanager/rtptimerqueue.c @@ -555,7 +555,6 @@ rtp_timer_queue_remove_all (RtpTimerQueue * queue) * @queue: the #RtpTimerQueue * @type: the #RtpTimerType * @senum: the timer seqnum - * @num: the number of seqnum in the range (partially supported) * @timeout: the timer timeout * @delay: the additional delay (will be added to @timeout) * @duration: the duration of the event related to the timer @@ -567,7 +566,7 @@ rtp_timer_queue_remove_all (RtpTimerQueue * queue) */ void rtp_timer_queue_set_timer (RtpTimerQueue * queue, RtpTimerType type, - guint16 seqnum, guint num, GstClockTime timeout, GstClockTime delay, + guint16 seqnum, GstClockTime timeout, GstClockTime delay, GstClockTime duration, GstClockTimeDiff offset) { RtpTimer *timer; @@ -591,7 +590,6 @@ rtp_timer_queue_set_timer (RtpTimerQueue * queue, RtpTimerType type, timer->type = type; timer->seqnum = seqnum; - timer->num = num; if (timeout == -1) timer->timeout = -1; @@ -623,7 +621,7 @@ void rtp_timer_queue_set_expected (RtpTimerQueue * queue, guint16 seqnum, GstClockTime timeout, GstClockTime delay, GstClockTime duration) { - rtp_timer_queue_set_timer (queue, RTP_TIMER_EXPECTED, seqnum, 0, timeout, + rtp_timer_queue_set_timer (queue, RTP_TIMER_EXPECTED, seqnum, timeout, delay, duration, 0); } @@ -631,7 +629,6 @@ rtp_timer_queue_set_expected (RtpTimerQueue * queue, guint16 seqnum, * rtp_timer_queue_set_lost: * @queue: the #RtpTimerQueue * @senum: the timer seqnum - * @num: the number of seqnum in the range (partially supported) * @timeout: the timer timeout * @duration: the duration of the event related to the timer * @offset: offset that can be used to convert the timeout to timestamp @@ -641,10 +638,9 @@ rtp_timer_queue_set_expected (RtpTimerQueue * queue, guint16 seqnum, */ void rtp_timer_queue_set_lost (RtpTimerQueue * queue, guint16 seqnum, - guint num, GstClockTime timeout, GstClockTime duration, - GstClockTimeDiff offset) + GstClockTime timeout, GstClockTime duration, GstClockTimeDiff offset) { - rtp_timer_queue_set_timer (queue, RTP_TIMER_LOST, seqnum, num, timeout, 0, + rtp_timer_queue_set_timer (queue, RTP_TIMER_LOST, seqnum, timeout, 0, duration, offset); } @@ -662,8 +658,7 @@ void rtp_timer_queue_set_eos (RtpTimerQueue * queue, GstClockTime timeout, GstClockTimeDiff offset) { - rtp_timer_queue_set_timer (queue, RTP_TIMER_EOS, -1, 0, timeout, 0, 0, - offset); + rtp_timer_queue_set_timer (queue, RTP_TIMER_EOS, -1, timeout, 0, 0, offset); } /** @@ -681,7 +676,7 @@ void rtp_timer_queue_set_deadline (RtpTimerQueue * queue, guint16 seqnum, GstClockTime timeout, GstClockTimeDiff offset) { - rtp_timer_queue_set_timer (queue, RTP_TIMER_DEADLINE, seqnum, 0, timeout, 0, + rtp_timer_queue_set_timer (queue, RTP_TIMER_DEADLINE, seqnum, timeout, 0, 0, offset); } diff --git a/gst/rtpmanager/rtptimerqueue.h b/gst/rtpmanager/rtptimerqueue.h index b172125497..969cbd37ff 100644 --- a/gst/rtpmanager/rtptimerqueue.h +++ b/gst/rtpmanager/rtptimerqueue.h @@ -60,7 +60,6 @@ typedef struct gboolean queued; guint16 seqnum; - guint num; RtpTimerType type; GstClockTime timeout; GstClockTimeDiff offset; @@ -107,14 +106,14 @@ void rtp_timer_queue_remove_until (RtpTimerQueue * queue, GstClockTim void rtp_timer_queue_remove_all (RtpTimerQueue * queue); void rtp_timer_queue_set_timer (RtpTimerQueue * queue, RtpTimerType type, - guint16 seqnum, guint num, GstClockTime timeout, + guint16 seqnum, GstClockTime timeout, GstClockTime delay, GstClockTime duration, GstClockTimeDiff offset); void rtp_timer_queue_set_expected (RtpTimerQueue * queue, guint16 seqnum, GstClockTime timeout, GstClockTime delay, GstClockTime duration); void rtp_timer_queue_set_lost (RtpTimerQueue * queue, guint16 seqnum, - guint num, GstClockTime timeout, + GstClockTime timeout, GstClockTime duration, GstClockTimeDiff offset); void rtp_timer_queue_set_eos (RtpTimerQueue * queue, GstClockTime timeout, GstClockTimeDiff offset); diff --git a/tests/check/elements/rtptimerqueue.c b/tests/check/elements/rtptimerqueue.c index e7ba45f34e..a39da7f91f 100644 --- a/tests/check/elements/rtptimerqueue.c +++ b/tests/check/elements/rtptimerqueue.c @@ -27,12 +27,11 @@ GST_START_TEST (test_timer_queue_set_timer) RtpTimerQueue *queue = rtp_timer_queue_new (); RtpTimer *timer10, *timer0; - rtp_timer_queue_set_timer (queue, RTP_TIMER_EXPECTED, 10, 0, + rtp_timer_queue_set_timer (queue, RTP_TIMER_EXPECTED, 10, 1 * GST_SECOND, 2 * GST_SECOND, 5 * GST_SECOND, 0); timer10 = rtp_timer_queue_find (queue, 10); fail_unless (timer10); fail_unless_equals_int (10, timer10->seqnum); - fail_unless_equals_int (0, timer10->num); fail_unless_equals_int (RTP_TIMER_EXPECTED, timer10->type); /* timer10->timeout = timerout + delay */ fail_unless_equals_uint64 (3 * GST_SECOND, timer10->timeout); @@ -44,12 +43,11 @@ GST_START_TEST (test_timer_queue_set_timer) fail_unless_equals_int (0, timer10->num_rtx_retry); fail_unless_equals_int (0, timer10->num_rtx_received); - rtp_timer_queue_set_timer (queue, RTP_TIMER_LOST, 0, 10, + rtp_timer_queue_set_timer (queue, RTP_TIMER_LOST, 0, 0 * GST_SECOND, 2 * GST_SECOND, 0, 0); timer0 = rtp_timer_queue_find (queue, 0); fail_unless (timer0); fail_unless_equals_int (0, timer0->seqnum); - fail_unless_equals_int (10, timer0->num); fail_unless_equals_int (RTP_TIMER_LOST, timer0->type); fail_unless_equals_uint64 (2 * GST_SECOND, timer0->timeout); fail_unless_equals_uint64 (0, timer0->duration); @@ -291,7 +289,7 @@ GST_START_TEST (test_timer_queue_timer_offset) RtpTimerQueue *queue = rtp_timer_queue_new (); RtpTimer *timer; - rtp_timer_queue_set_timer (queue, RTP_TIMER_EXPECTED, 2, 0, 2 * GST_SECOND, + rtp_timer_queue_set_timer (queue, RTP_TIMER_EXPECTED, 2, 2 * GST_SECOND, GST_MSECOND, 0, GST_USECOND); timer = rtp_timer_queue_find (queue, 2);