Commit graph

56 commits

Author SHA1 Message Date
Thibault Saunier
5ff769d731 Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
Tulio Beloqui
266c2d0619 rtptwcc: changes to use rtp buffer arrival time and current time.
For TWCC we are more interested to track the arrival time (receive side)
and the current time (sender side) of the buffers rather than the
running time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/927>
2021-08-25 08:36:06 +00:00
Tulio Beloqui
4ef0ce282e rtptwcc: fixes and optimizations around run-length chunks
Co-authored-by: Havard Graff <havard.graff@gmail.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/927>
2021-08-25 08:36:06 +00:00
Havard Graff
219749c40c rtptwcc: fix seqnum-wrap
Using the proper API to do this is obviously an improvement, and
adding a test for the case of a packet-loss when the seqnum wrap
is also a good idea.

Co-authored-by: Tulio Beloqui <tulio.beloqui@pexip.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/927>
2021-08-25 08:36:06 +00:00
Tulio Beloqui
3b14a24630 rtptwcc: fixed feedback packet count overflow that allowed late
packets to be processed

Co-authored-by: Havard Graff <havard.graff@gmail.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/927>
2021-08-25 08:36:06 +00:00
Tulio Beloqui
3484f21b95 rtptwcc: fixed parsing of old sequence number
Co-authored-by: Havard Graff <havard.graff@gmail.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/927>
2021-08-25 08:36:06 +00:00
Tulio Beloqui
abf4b57a1c rtptwcc: fixed guint8 overflow of feedback packet count
Co-authored-by: Havard Graff <havard.graff@gmail.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/927>
2021-08-25 08:36:06 +00:00
Havard Graff
be5fab15e0 rtptwcc: add feedback-interval
To allow RTCP TWCC reports to be scheduled on a timer instead of per
marker-bit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/927>
2021-08-25 08:36:06 +00:00
Havard Graff
c8400120f1 rtptwcc: make twcc-tests more deterministic
They were a bit racy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/927>
2021-08-25 08:36:06 +00:00
Doug Nazar
b289cc6788 rtp: fix test_twcc_header_and_run to support big endian.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/942>
2021-04-13 11:35:15 +00:00
Havard Graff
79748dab2b rtpsession: never send on a non-internal source
This will end up as a "received" packet, due to the code in
source_push_rtp, which will think this is a packet being received.

Instead drop the packet and hope that either:
1. Something upstream responds to the GstRTPCollision event and changes
   SSRC used for sending.
2. That the application responds to the "on-ssrc-collision" signal, and
   forces the sender (payloader) to change its SSRC.
3. That the BYE sent to the existing user of this SSRC will respond to
   the BYE, and that we timeout this source, so we can continue sending
   using the chosen SSRC.

The test reproduces a scenario where we previously would have sent
on a non-internal source.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/817>
2020-11-13 21:35:58 +01:00
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