mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
rtptimerqueue: remove ->num from the timer
This concept was only used by the "multi"-lost timer, and since that one is not around any longer, the "num" concept is superfluous.
This commit is contained in:
parent
f1ff80ced0
commit
a710bda1ab
4 changed files with 13 additions and 24 deletions
|
@ -2554,7 +2554,7 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (gst_rtp_buffer_compare_seqnum (expected, seqnum) > 0) {
|
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));
|
duration, timeout_offset (jitterbuffer));
|
||||||
expected_pts += duration;
|
expected_pts += duration;
|
||||||
expected++;
|
expected++;
|
||||||
|
@ -3887,13 +3887,10 @@ do_lost_timeout (GstRtpJitterBuffer * jitterbuffer, RtpTimer * timer,
|
||||||
GstClockTime now)
|
GstClockTime now)
|
||||||
{
|
{
|
||||||
GstRtpJitterBufferPrivate *priv = jitterbuffer->priv;
|
GstRtpJitterBufferPrivate *priv = jitterbuffer->priv;
|
||||||
guint lost_packets;
|
|
||||||
GstClockTime timestamp;
|
GstClockTime timestamp;
|
||||||
|
|
||||||
timestamp = apply_offset (jitterbuffer, get_pts_timeout (timer));
|
timestamp = apply_offset (jitterbuffer, get_pts_timeout (timer));
|
||||||
lost_packets = MAX (timer->num, 1);
|
insert_lost_event (jitterbuffer, timer->seqnum, 1, timestamp,
|
||||||
|
|
||||||
insert_lost_event (jitterbuffer, timer->seqnum, lost_packets, timestamp,
|
|
||||||
timer->duration, timer->num_rtx_retry);
|
timer->duration, timer->num_rtx_retry);
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (timer->rtx_last)) {
|
if (GST_CLOCK_TIME_IS_VALID (timer->rtx_last)) {
|
||||||
|
|
|
@ -555,7 +555,6 @@ rtp_timer_queue_remove_all (RtpTimerQueue * queue)
|
||||||
* @queue: the #RtpTimerQueue
|
* @queue: the #RtpTimerQueue
|
||||||
* @type: the #RtpTimerType
|
* @type: the #RtpTimerType
|
||||||
* @senum: the timer seqnum
|
* @senum: the timer seqnum
|
||||||
* @num: the number of seqnum in the range (partially supported)
|
|
||||||
* @timeout: the timer timeout
|
* @timeout: the timer timeout
|
||||||
* @delay: the additional delay (will be added to @timeout)
|
* @delay: the additional delay (will be added to @timeout)
|
||||||
* @duration: the duration of the event related to the timer
|
* @duration: the duration of the event related to the timer
|
||||||
|
@ -567,7 +566,7 @@ rtp_timer_queue_remove_all (RtpTimerQueue * queue)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_timer_queue_set_timer (RtpTimerQueue * queue, RtpTimerType type,
|
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)
|
GstClockTime duration, GstClockTimeDiff offset)
|
||||||
{
|
{
|
||||||
RtpTimer *timer;
|
RtpTimer *timer;
|
||||||
|
@ -591,7 +590,6 @@ rtp_timer_queue_set_timer (RtpTimerQueue * queue, RtpTimerType type,
|
||||||
|
|
||||||
timer->type = type;
|
timer->type = type;
|
||||||
timer->seqnum = seqnum;
|
timer->seqnum = seqnum;
|
||||||
timer->num = num;
|
|
||||||
|
|
||||||
if (timeout == -1)
|
if (timeout == -1)
|
||||||
timer->timeout = -1;
|
timer->timeout = -1;
|
||||||
|
@ -623,7 +621,7 @@ void
|
||||||
rtp_timer_queue_set_expected (RtpTimerQueue * queue, guint16 seqnum,
|
rtp_timer_queue_set_expected (RtpTimerQueue * queue, guint16 seqnum,
|
||||||
GstClockTime timeout, GstClockTime delay, GstClockTime duration)
|
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);
|
delay, duration, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,7 +629,6 @@ rtp_timer_queue_set_expected (RtpTimerQueue * queue, guint16 seqnum,
|
||||||
* rtp_timer_queue_set_lost:
|
* rtp_timer_queue_set_lost:
|
||||||
* @queue: the #RtpTimerQueue
|
* @queue: the #RtpTimerQueue
|
||||||
* @senum: the timer seqnum
|
* @senum: the timer seqnum
|
||||||
* @num: the number of seqnum in the range (partially supported)
|
|
||||||
* @timeout: the timer timeout
|
* @timeout: the timer timeout
|
||||||
* @duration: the duration of the event related to the timer
|
* @duration: the duration of the event related to the timer
|
||||||
* @offset: offset that can be used to convert the timeout to timestamp
|
* @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
|
void
|
||||||
rtp_timer_queue_set_lost (RtpTimerQueue * queue, guint16 seqnum,
|
rtp_timer_queue_set_lost (RtpTimerQueue * queue, guint16 seqnum,
|
||||||
guint num, GstClockTime timeout, GstClockTime duration,
|
GstClockTime timeout, GstClockTime duration, GstClockTimeDiff offset)
|
||||||
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);
|
duration, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -662,8 +658,7 @@ void
|
||||||
rtp_timer_queue_set_eos (RtpTimerQueue * queue, GstClockTime timeout,
|
rtp_timer_queue_set_eos (RtpTimerQueue * queue, GstClockTime timeout,
|
||||||
GstClockTimeDiff offset)
|
GstClockTimeDiff offset)
|
||||||
{
|
{
|
||||||
rtp_timer_queue_set_timer (queue, RTP_TIMER_EOS, -1, 0, timeout, 0, 0,
|
rtp_timer_queue_set_timer (queue, RTP_TIMER_EOS, -1, timeout, 0, 0, offset);
|
||||||
offset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -681,7 +676,7 @@ void
|
||||||
rtp_timer_queue_set_deadline (RtpTimerQueue * queue, guint16 seqnum,
|
rtp_timer_queue_set_deadline (RtpTimerQueue * queue, guint16 seqnum,
|
||||||
GstClockTime timeout, GstClockTimeDiff offset)
|
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);
|
0, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@ typedef struct
|
||||||
gboolean queued;
|
gboolean queued;
|
||||||
|
|
||||||
guint16 seqnum;
|
guint16 seqnum;
|
||||||
guint num;
|
|
||||||
RtpTimerType type;
|
RtpTimerType type;
|
||||||
GstClockTime timeout;
|
GstClockTime timeout;
|
||||||
GstClockTimeDiff offset;
|
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_remove_all (RtpTimerQueue * queue);
|
||||||
|
|
||||||
void rtp_timer_queue_set_timer (RtpTimerQueue * queue, RtpTimerType type,
|
void rtp_timer_queue_set_timer (RtpTimerQueue * queue, RtpTimerType type,
|
||||||
guint16 seqnum, guint num, GstClockTime timeout,
|
guint16 seqnum, GstClockTime timeout,
|
||||||
GstClockTime delay, GstClockTime duration,
|
GstClockTime delay, GstClockTime duration,
|
||||||
GstClockTimeDiff offset);
|
GstClockTimeDiff offset);
|
||||||
void rtp_timer_queue_set_expected (RtpTimerQueue * queue, guint16 seqnum,
|
void rtp_timer_queue_set_expected (RtpTimerQueue * queue, guint16 seqnum,
|
||||||
GstClockTime timeout, GstClockTime delay,
|
GstClockTime timeout, GstClockTime delay,
|
||||||
GstClockTime duration);
|
GstClockTime duration);
|
||||||
void rtp_timer_queue_set_lost (RtpTimerQueue * queue, guint16 seqnum,
|
void rtp_timer_queue_set_lost (RtpTimerQueue * queue, guint16 seqnum,
|
||||||
guint num, GstClockTime timeout,
|
GstClockTime timeout,
|
||||||
GstClockTime duration, GstClockTimeDiff offset);
|
GstClockTime duration, GstClockTimeDiff offset);
|
||||||
void rtp_timer_queue_set_eos (RtpTimerQueue * queue, GstClockTime timeout,
|
void rtp_timer_queue_set_eos (RtpTimerQueue * queue, GstClockTime timeout,
|
||||||
GstClockTimeDiff offset);
|
GstClockTimeDiff offset);
|
||||||
|
|
|
@ -27,12 +27,11 @@ GST_START_TEST (test_timer_queue_set_timer)
|
||||||
RtpTimerQueue *queue = rtp_timer_queue_new ();
|
RtpTimerQueue *queue = rtp_timer_queue_new ();
|
||||||
RtpTimer *timer10, *timer0;
|
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);
|
1 * GST_SECOND, 2 * GST_SECOND, 5 * GST_SECOND, 0);
|
||||||
timer10 = rtp_timer_queue_find (queue, 10);
|
timer10 = rtp_timer_queue_find (queue, 10);
|
||||||
fail_unless (timer10);
|
fail_unless (timer10);
|
||||||
fail_unless_equals_int (10, timer10->seqnum);
|
fail_unless_equals_int (10, timer10->seqnum);
|
||||||
fail_unless_equals_int (0, timer10->num);
|
|
||||||
fail_unless_equals_int (RTP_TIMER_EXPECTED, timer10->type);
|
fail_unless_equals_int (RTP_TIMER_EXPECTED, timer10->type);
|
||||||
/* timer10->timeout = timerout + delay */
|
/* timer10->timeout = timerout + delay */
|
||||||
fail_unless_equals_uint64 (3 * GST_SECOND, timer10->timeout);
|
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_retry);
|
||||||
fail_unless_equals_int (0, timer10->num_rtx_received);
|
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);
|
0 * GST_SECOND, 2 * GST_SECOND, 0, 0);
|
||||||
timer0 = rtp_timer_queue_find (queue, 0);
|
timer0 = rtp_timer_queue_find (queue, 0);
|
||||||
fail_unless (timer0);
|
fail_unless (timer0);
|
||||||
fail_unless_equals_int (0, timer0->seqnum);
|
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_int (RTP_TIMER_LOST, timer0->type);
|
||||||
fail_unless_equals_uint64 (2 * GST_SECOND, timer0->timeout);
|
fail_unless_equals_uint64 (2 * GST_SECOND, timer0->timeout);
|
||||||
fail_unless_equals_uint64 (0, timer0->duration);
|
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 ();
|
RtpTimerQueue *queue = rtp_timer_queue_new ();
|
||||||
RtpTimer *timer;
|
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);
|
GST_MSECOND, 0, GST_USECOND);
|
||||||
|
|
||||||
timer = rtp_timer_queue_find (queue, 2);
|
timer = rtp_timer_queue_find (queue, 2);
|
||||||
|
|
Loading…
Reference in a new issue