Commit graph

45 commits

Author SHA1 Message Date
Havard Graff
8f7962e1c3 rtpjitterbuffer: Fix stall when receiving already lost packet
When a packet arrives that has already been considered lost as part of a
large gap the "lost timer" for this will be cancelled. If the remaining
packets of this large gap never arrives, there will be missing entries
in the queue and the loop function will keep waiting for these packets
to arrive and never push another packet, effectively stalling the
pipeline.

The proposed fix conciders parts of a large gap definitely lost (since
they are calculated from latency) and ignores the late arrivals.

In practice the issue is rare since large gaps are scheduled immediately,
and for the stall to happen the late arrival needs to be processed
before this times out.

https://bugzilla.gnome.org/show_bug.cgi?id=765933
2016-05-06 14:32:42 +03:00
Tim-Philipp Müller
7335d03070 tests: fix indentation 2016-02-19 14:44:11 +00:00
Havard Graff
69436d5a61 tests: rtpjitterbuffer: port testharness to GstHarness and cleanup/improve
Probably found a bug as well, in that there are some timestamps in
there that are looking very wrong. (marked with FIXME)

https://bugzilla.gnome.org/show_bug.cgi?id=762267
2016-02-19 14:44:02 +00:00
Havard Graff
d52765fabb tests: rtpjitterbuffer: test cleanups/improvements
Use fail_unless and friends instead of g_assert
Factor seq-num checking out to separate function
Check more return-values from push and crank and others

https://bugzilla.gnome.org/show_bug.cgi?id=762254
2016-02-19 11:26:45 +00:00
Stian Selnes
fb4c2909ca tests: rtpjitterbuffer: fix leaks in unit test
https://bugzilla.gnome.org/show_bug.cgi?id=762214
2016-02-19 11:07:52 +00:00
Stian Selnes
3eeca9c7d2 rtpjitterbuffer: Add test for big seqnum gap handling
Make sure that the packets queued when detecting a big gap are pushed
after reset (5 consective seqnums) and not dropped.

https://bugzilla.gnome.org/show_bug.cgi?id=762211
2016-02-18 09:39:01 +02:00
Thiago Santos
241e0c2722 rtpjitterbuffer: fix build error with gcc (Debian 4.9.2-21) 4.9.2
Replace static constants with macros to make gcc happy

  CC       elements/elements_rtpjitterbuffer-rtpjitterbuffer.o
elements/rtpjitterbuffer.c:387:1: error: initializer element is not constant
 static const GstClockTime PCMU_BUF_DURATION = PCMU_BUF_MS * GST_MSECOND;
 ^
elements/rtpjitterbuffer.c:388:1: error: initializer element is not constant
 static const guint PCMU_BUF_SIZE = 64000 * PCMU_BUF_MS / 1000;
 ^
elements/rtpjitterbuffer.c:390:5: error: initializer element is not constant
     PCMU_BUF_CLOCK_RATE * PCMU_BUF_MS / 1000;
2015-07-08 23:49:12 -03:00
Thiago Santos
3edf9e4f58 rtpjitterbuffer: run indent and fix some comments
Fix indent on this file and break some comment lines into two to make
it fit 80 chars per line
2015-07-08 23:49:09 -03:00
Havard Graff
ddd032f56b rtpjitterbuffer: fix gap-time calculation and remove "late"
The amount of time that is completely expired and not worth waiting for,
is the duration of the packets in the gap (gap * duration) - the
latency (size) of the jitterbuffer (priv->latency_ns). This is the duration
that we make a "multi-lost" packet for.

The "late" concept made some sense in 0.10 as it reflected that a buffer
coming in had not been waited for at all, but had a timestamp that was
outside the jitterbuffer to wait for. With the rewrite of the waiting
(timeout) mechanism in 1.0, this no longer makes any sense, and the
variable no longer reflects anything meaningful (num > 0 is useless,
the duration is what matters)

Fixed up the tests that had been slightly modified in 1.0 to allow faulty
behavior to sneak in, and port some of them to use GstHarness.

https://bugzilla.gnome.org/show_bug.cgi?id=738363
2015-07-08 23:18:48 +03:00
Sebastian Dröge
3df0cce65d rtpjitterbuffer: If possible, always update the current time before looping over all timers
If we have a clock, update "now" now with the very latest running time we have.
If timers are unscheduled below we otherwise wouldn't update now (it's only updated
when timers expire), and also for the very first loop iteration now would otherwise
always be 0.

Also the time is used for the timeout functions, e.g. to calculate any times
for the next timeouts and we would otherwise pass too old times there.

https://bugzilla.gnome.org/show_bug.cgi?id=751636
2015-07-02 16:45:59 +02:00
Sebastian Dröge
91c8688ed7 rtpjitterbuffer: Fix RTX unit test
The calculations were a bit off everywhere, even before the changes done
recently to the delay for RTX of expected future packets. It only worked by
accident, but now the calculations are all correct again. Hopefully.
2015-04-27 16:37:23 +02:00
Wim Taymans
13804eab7d check: add jitterbuffer unit test
See https://bugzilla.gnome.org/show_bug.cgi?id=745539
2015-03-06 11:40:53 +01:00
Wim Taymans
b2e1598e4a rtpjitterbuffer: increment accepted packets after loss
When we detect a lost packet, expect packets with higher
seqnum on the input.

Also update the unit test.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=729524
2014-05-09 18:10:32 +02:00
Jason Litzinger
9068e1bb8e Add new test case. 2014-05-09 18:10:32 +02:00
Sebastian Dröge
02e62c139d rtpjitterbuffer: Fix hundreds of memory leaks in the test 2014-04-17 17:26:36 +02:00
Wim Taymans
eee515cb2c rtpjitterbuffer: serialize events in the buffer
Serialize events into the jitterbuffer by inserting them with a -1
seqnum.
Update unit test to expect events from the streaming thread.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=652986
2013-12-10 11:57:37 +01:00
Wim Taymans
29d9b1e7de check: fix jitterbuffer check
Don't advance the clock to 240ms too early.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=710013
2013-11-25 17:39:52 +01:00
Wim Taymans
710d1f3a2a rtpjitterbuffer: improve clear-pt-map handling
Don't reset the expected output seqnum when clearing the pt map because this
could stall the jitterbuffer forever.
Add a unit test for this.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=709800
2013-11-25 15:52:22 +01:00
George Kiagiadakis
387e3b918a rtpjitterbuffer: Fix stats property field names and documentation 2013-11-15 16:23:34 +02:00
Torrie Fischer
22ceb80ba9 rtpjitterbuffer: implement rtx statistics 2013-11-14 09:24:26 +01:00
Wim Taymans
3c69d65b85 tests: add test for retransmission because of reordering 2013-09-23 14:45:27 +02:00
Wim Taymans
f40d6689f2 tests: remove timeouts from check
Timeouts make the test unreliable and are not needed.
2013-09-23 14:45:26 +02:00
Wim Taymans
a71014518c tests: add test for packet delay and retransmission 2013-09-23 14:45:24 +02:00
Wim Taymans
c959cdc8c1 tests: check both PTS and DTS 2013-09-23 14:45:24 +02:00
Wim Taymans
2e3346eff9 tests: add unit-test for multiple missing packets
Check if multiple missing packets generate retransmission events and that the
retranmission requests are canceled when the missing packet arrives.
2013-09-23 14:45:24 +02:00
Wim Taymans
3b9e2ee5a0 tests: improve debug 2013-09-23 14:45:23 +02:00
Wim Taymans
ee817363c7 tests: add retransmission jitterbuffer test
Store both DTS and PTS on buffers.
Make a queue for srcpad events.
Activate pads after linking so that we don't get RECONFIGURE events.
Add test for retransmission.
2013-09-19 14:32:48 +02:00
Wim Taymans
ee75d4b01e tests: fix comments 2013-09-18 15:08:45 +02:00
Wim Taymans
5c1f2f0045 rtpjitterbuffer: add another test
The test is modified slightly because the late lost packets are only
generated now when a large gap is received.
2013-09-18 14:23:55 +02:00
Wim Taymans
5d5fc03e04 rtpjitterbuffer: round gap duration to multiple of duration
Make sure the gap duration in the lost event is a multiple of the packet
duration.
Enable another test.
2013-09-18 14:12:47 +02:00
Wim Taymans
6e4a051d40 rtpjitterbuffer: keep track of duration
Keep track of the estimated duration of missing packets and use it in the lost
event.
Enable another unit test
2013-09-18 12:29:38 +02:00
Wim Taymans
ac3bb3acf6 rtpjitterbuffer: handle large gaps with one lost event
When we have a large number of missing packets, generate one lost event for all
the packets that have no chance of being pushed out in time.
Fix and activate unit test for large gaps.
2013-09-18 11:59:28 +02:00
Nicolas Dufresne
7719b19aec rtpjitterbuffer-test: Send stream-start before caps followed by segment 2013-05-13 15:36:49 +02:00
Wim Taymans
50391c7773 check: add (but disable) more rtp jitterbuffer tests
Tests need to be ported to 1.0 before they can be enabled but added here so they
don't get forgotten.

See https://bugzilla.gnome.org/show_bug.cgi?id=667838
2012-12-13 12:36:20 +01:00
Tim-Philipp Müller
230cf41cc9 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:07:18 +00:00
Wim Taymans
f75fa8e3c3 tests: fix jitterbuffer test 2012-02-06 09:23:49 +01:00
Wim Taymans
a6370cdb50 tests: fix more tests 2012-01-31 15:39:09 +01:00
Wim Taymans
8e39d52bbb tests: make more tests compile 2012-01-03 14:16:28 +01:00
René Stadler
a806ae2edd tests: update for gstcheck API change 2011-11-24 21:41:03 +01:00
Wim Taymans
77ad0a1363 port more elements to new audio caps and API 2011-08-19 14:01:45 +02:00
Wim Taymans
5c8527bb20 check: fix jitterbuffer check
Make sure we set a base_time on the element.
Fix the timeout to at least twice the jitterbuffer latency.
Enable previously failing tests.
Remove impossible checks.
2009-11-28 12:25:06 +01:00
Stefan Kost
0079f98632 rtpjitterbuffertest: add one more test and file a bug now
CHange the backwards test to always send first buffer first to have a define
basetime. Add another test that sends buffers backwards to assert that only
first sent buffer is keep and used as basetime. Disabled those tests still,
as its not passing/failing consitently and file a bug for jitterbuffer.
2009-11-25 16:05:10 +02:00
Stefan Kost
38bd5e5106 jitterbuffertest: improve the test
the tests are a bit more solid now but still not produce reliable results.
Wonder if they are still flawky or if its a bug in jitterbuffer.
2009-11-25 10:19:12 +02:00
Tim-Philipp Müller
4fb9720cd7 tests: disable all jitterbuffer tests for now
Since even the one enabled seems to fail.
2009-10-23 11:21:44 +01:00
Stefan Kost
347caecbe9 tests: also include the new test for prev commit 2009-10-22 13:39:58 +03:00