Commit graph

45 commits

Author SHA1 Message Date
Havard Graff
cdba5952ed rtpsession: make tests more stable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/410>
2020-06-20 19:45:33 +00:00
Xavier Claessens
6e1758d509 Fix usage of C99
It's 2020, way too early for that, let's stick to C89 for now.
2020-03-23 21:32:04 -04:00
Håvard Graff
fdf002d069 rtpsession: fix crash when no extension-header present for twcc 2020-02-24 13:06:27 +00:00
Havard Graff
1df706448c rtpmanager: Google Transport-Wide Congestion Control RTP Extension
Generating and parsing the RTCP-messages described in:
https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01
2020-02-14 10:09:02 +00:00
Olivier Crête
c00796eaa5 rtpsession: Add test for packet rate maths 2020-02-06 14:01:38 -05:00
Havard Graff
eb6d8791e8 rtpsession: add test for requesting FIR after having requested PLI 2019-11-29 20:17:29 +00:00
Havard Graff
f997859913 rtpsession: add locking for clear-pt-map
...or it will segfault from time to time...
2019-11-29 14:23:49 +01:00
Aaron Boxer
46989dca96 documentation: fix a number of typos 2019-10-05 22:38:11 +00:00
Olivier Crête
efed059b9a rtp session: Add test for collision loopback detection
Ignore further collisions if the remote SSRC change with ours, it's
probably because someone is sending us back the packets we send out.
2019-07-06 14:23:20 +00:00
Olivier Crête
b5faed910e rtpsession tests: Add test for third-party collision detection
Add tests to validate the code that ignores the same packets coming
from 2 different sources (an third-party collision).
2019-07-06 14:23:20 +00:00
Olivier Crête
3574e6c176 rtpsession: Add test for collision on incoming packets
Make sure that the collision is properly detected on incoming packets.
2019-07-06 14:23:20 +00:00
Olivier Crête
4e18567863 rtpsession test: Verify that on-ssrc-collision message is emitted 2019-07-06 14:23:20 +00:00
Olivier Crête
9d9d543d5c rtpsession: Also send conflict event when sending packet
If the conflict is detected when sending a packet, then also send an
upstream event to tell the source to reconfigure itself.

Also ignore the collision if we see more than one collision from the same
remote source to avoid problems on loops.
2019-07-06 14:23:20 +00:00
Nicolas Dufresne
947a37f3c8 rtpsession: Always keep at least one NACK on early RTCP
We recently added code to remove outdate NACK to avoid using bandwidth
for packet that have no chance of arriving on time. Though, this had a
side effect, which is that it was to get an early RTCP packet with no
feedback into it. This was pretty useless but also had a side effect,
which is that the RTX RTT value would never be updated. So we we stared
having late RTX request due to high RTT, we'd never manage to recover.

This fixes the regression by making sure we keep at least one NACK in
this situation. This is really light on the bandwidth and allow for
quick recover after the RTT have spiked higher then the jitterbuffer
capacity.
2019-05-17 19:13:22 +00:00
Nicolas Dufresne
84c102b6fe rtpsession: Call on-new-ssrc earlier
Right now, we may call on-new-ssrc after we have processed the first
RTP packet. This prevents properly configuring the source as some
property like "probation" are copied internally for use as a
decreasing counter. For this specific property, it prevents the
application from disabling probation on auxiliary sparse stream.

Probation is harmful on sparse streams since the probation algorithm
assume frequent and contiguous RTP packets.
2019-05-02 14:44:58 -04:00
Nicolas Dufresne
a8ea9f0d05 test: rtpsession: Verify on-sending-nacks callback 2019-04-07 12:00:49 -04:00
Mathieu Duponchelle
280d86a841 rtpsession: Add disable-sr-timestamp property
The Onvif Streaming Spec, in section 6.11, mandates that when
Rate-Control is disabled potential RTCP packets shall have
their timestamps set to 0.

<https://www.onvif.org/specs/stream/ONVIF-Streaming-Spec.pdf>
2019-04-05 20:23:08 +02:00
Nicolas Dufresne
464ada3f29 test: rtpsession: Test FB Nack packing
We used to split the NACK if a smaller seqnum of a range of seqnum was
submited. This test also make sure that the three operations (append,
prepend, update) works properly.
2019-04-05 14:53:09 +00:00
Nicolas Dufresne
a31569713f test: rtpsession: Test handling of NACK surplus
This test verify that NACKs that didn't fit in one packet are properly
filtered and inserted into the following pipeline.
2019-04-05 14:53:09 +00:00
John Bassett
74a74bfc99 rtpsession: Fix race when sending PLI, FIR and NACK packets
Calling rtp_session_send_rtcp before marking the source as requiring a
pli/fir/nack meant the rtcp_thread could be scheduled and start running
before the source was updated. This meant the request would not be sent
early but instead was transmitted with the next regular RTCP packet.

Add test for nack generation.
2019-04-05 14:53:09 +00:00
Jordan Petridis
515ada7e22
Run gst-indent through the files
This is required before we enabled an indent test in the CI.

https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/33
2018-11-28 05:52:16 +02:00
Linus Svensson
ac94c706da rtpsession: test: Plug memory leak 2018-11-13 12:30:35 +00:00
Olivier Crête
cc69c876fe rtpsession: Allow changing the SDES at runtime
Make it possible to modify the SDES in a packet at runtime.

https://bugzilla.gnome.org/show_bug.cgi?id=763502
2018-10-28 12:10:36 +00:00
Havard Graff
13aa805943 rtpsession: fix up GHashTable-behavior dependent tests
GHashTable iteration order changed in recent GLib,
and tests were relying on that.

https://mail.gnome.org/archives/desktop-devel-list/2018-October/msg00016.html
2018-10-20 12:32:44 +01:00
Havard Graff
ac6e77acad rtpsession: Don't start the RTCP thread until it's needed
Always wait with starting the RTCP thread until either a RTP or RTCP
packet is sent or received. Special handling is needed to make sure the
RTCP thread is started when requesting an early RTCP packet.

We want to wait with starting the RTCP thread until it's needed in order
to not send RTCP packets for an inactive source.

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-07-12 18:37:33 +02:00
Havard Graff
77f3ce2e45 rtpsession: Add tests for PLI and FIR
https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-15 11:52:45 +01:00
Stian Selnes
457fdf95c4 rtpsession: Drop packet if trying to send from non-internal source
If obtain_internal_source() returns a source that is not internal it
means there exists a non-internal source with the same ssrc. Such an
ssrc collision should be handled by sending a GstRTPCollision event
upstream and choose a new ssrc, but for now we simply drop the packet.
Trying to process the packet further will cause it to be pushed
usptream (!) since the source is not internal (see source_push_rtp()).

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-15 10:34:29 +01:00
Havard Graff
b43ee8f5b1 rtpsession: Try media_ssrc if no src can be found for PLI sender_ssrc
Some RTP stacks out there does not set the sender_ssrc. In order to be
more robust, try to lookup the media_ssrc before dropping the PLI.

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 20:41:39 +01:00
Mikhail Fludkov
386ca1d378 rtpsession: Fix on-feedback-rtcp race
If there is an external source which is about to timeout and be removed
from the source hashtable and we receive feedback RTCP packet with the
media ssrc of the source, we unlock the session in
rtp_session_process_feedback before emitting 'on-feedback-rtcp' signal
allowing rtcp timer to kick in and grab the lock. It will get rid of
the source and rtp_session_process_feedback will be left with RTPSource
with ref count 0.

The fix is to grab the ref to the RTPSource object in
rtp_session_process_feedback.

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 20:33:56 +01:00
John-Mark Bell
0a2b55ac3c rtpsession: do not emit RBs for internal senders.
These are the sources we send from, so there is no reason to
report receive statistics for them (as we do not receive on them,
and the remote side has no knowledge of them).

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 19:16:59 +01:00
Havard Graff
cd8c12f240 tests: rtpsession: fix indentation
https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 19:09:29 +01:00
Haakon Sporsheim
3c0d006c03 rtpsession: Handle zero length feedback packets
https://bugzilla.gnome.org/show_bug.cgi?id=791074
2017-12-02 13:58:34 +00:00
Havard Graff
96d837b301 tests: rtpsession: refactor tests to use GstHarness
This patch simplifies the tests (44% less code) and
makes them much more readable.

The provided SessionHarness also makes it much easier
to write new tests for rtpsession.

https://bugzilla.gnome.org/show_bug.cgi?id=791070
2017-12-02 13:05:01 +00:00
Tim-Philipp Müller
e6d188967a tests: fix indentation 2016-09-15 09:53:07 +01:00
Mikhail Fludkov
ee7e80d615 rtpsession: don't act on suspicious BYE RTCP
Some endpoints (like Tandberg E20) can send BYE packet containing our
internal SSRC. I this case we would detect SSRC collision and get rid
of the source at some point. But because we are still sending packets
with that SSRC the source will be recreated immediately.
This brand new internal source will not have some variables incorrectly
set in its state. For example 'seqnum-base` and `clock-rate` values will be
-1.
The fix is not to act on BYE RTCP if it contains internal or unknown
SSRC.

https://bugzilla.gnome.org/show_bug.cgi?id=762219
2016-05-20 09:28:39 +03:00
Mikhail Fludkov
fa1c711a2f rtpsession: Add test for locking of the stats signal
Keeping the lock while emitting the stats signal introduces potential
deadlock in those situations when the signal callback wants the access
to rtpsession's properties which also requre the lock.

https://bugzilla.gnome.org/show_bug.cgi?id=762216
2016-05-20 09:26:20 +03:00
Stian Selnes
4c0e509328 rtpsession: Add new signal 'on-app-rtcp'
Similar to the 'on-feedback-rtcp' signal, but emitted for RTCP APP
packets.

https://bugzilla.gnome.org/show_bug.cgi?id=762217
2016-03-30 15:42:01 +03:00
Olivier Crête
7cc59fcdf6 tests: Fix rtpsession test failure
The time of the first RTCP packet is semi-random, so
sometimes it was produced before enough packets from
the second SSRC were received. First drop queued RTCP
packets, then advance the clock enough to ensure
that at least one new RTCP packet is produced.

https://bugzilla.gnome.org/show_bug.cgi?id=750731
2015-08-31 16:42:30 -04:00
Sebastian Dröge
b549ebd066 rtpsession: Override the SSRC from the packets' SSRC if none was given via caps or property 2015-06-07 10:33:27 +02:00
Edward Hervey
d524439b35 check: Use GST_CHECK_MAIN () macro everywhere
Makes source code smaller, and ensures we go through common initialization
path (like the one that sets up XML unit test output ...)
2015-06-02 16:27:24 +02:00
Sebastian Dröge
0e13172837 rtpsession: Fix memory leaks in unit test 2014-06-30 00:00:43 +02:00
George Kiagiadakis
b19c830a1c tests/check: rtpsession: test internal sources timing out 2014-05-14 16:01:50 +02:00
Sebastian Dröge
02d9b5e6f8 rtpsession: Fix memory leaks in test 2014-04-17 17:33:46 +02:00
George Kiagiadakis
f9b7f44938 tests/check: add an rtpsession unit test to verify all RBs are included in all SRs, roundrobin
This test checks that when we have multiple internal sender sources
in rtpsession, SRs contain RBs for every other sender source, and that
they are included roundrobin when they exceed ST_RTCP_MAX_RB_COUNT,
which is the max number of RBs that can fit in a SR.
2013-12-12 16:02:56 +01:00
Wim Taymans
3623ebf01e check: add rtpsession test
Add a basic rtpsession test to ensure that RR blocks are generated when
multiple SSRC senders are active.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=711270
2013-11-11 14:28:52 +01:00