Commit graph

1011 commits

Author SHA1 Message Date
Santiago Carot-Nemesio e05378ec16 rtp: Add Full Intra Request (FIR) packets to statistics
https://bugzilla.gnome.org/show_bug.cgi?id=745587
2015-03-04 12:04:40 +01:00
Santiago Carot-Nemesio 22791413f9 rtp: Add Packet Loss Indication (PLI) to statistics
This is helpful to provide statistics in the format defined in
http://w3c.github.io/webrtc-stats/#dictionary-rtcrtpstreamstats-members.

https://bugzilla.gnome.org/show_bug.cgi?id=745587
2015-03-04 12:04:07 +01:00
Sebastian Dröge 8984e18ef7 rtpsession: Add explanation why we have space for 32 hash tables
And also create only one, there's no need yet to create all 32 until
we implement RFC2762.
2015-03-04 11:30:43 +01:00
Sebastian Dröge af2bdd6e15 Revert "rtpsession: Do not use an array of maps if they are not being used"
This reverts commit 1591adf4cd.

https://bugzilla.gnome.org/show_bug.cgi?id=745586#c1:
It's the beginning of an implementation of RFC 2762, which is needed for
large multicast groups. The implementation is not yet complete but why
not leave what is there and implement RFC 2762 instead?
2015-03-04 11:26:57 +01:00
Santiago Carot-Nemesio 1591adf4cd rtpsession: Do not use an array of maps if they are not being used
rtpsession declares an array of maps to store srrcs but only the
the key 0 is being used. This patch replaces the array of maps
for just one map and remove useless parameters in rtpsession

https://bugzilla.gnome.org/show_bug.cgi?id=745586
2015-03-04 11:25:30 +01:00
Sebastian Dröge 939a95d44b rtpsession: Send initial events on sync_rtcp pad when using RTP/RTCP muxing
Otherwise we will just send buffers on the pad without any events beforehand
and will get g_warnings() about that.
2015-02-19 13:34:47 +02:00
Sebastian Dröge 735c6c40f8 rtpjitterbuffer: When resetting the jitterbuffer because of packet discont, don't flush sticky events
We will otherwise flush away STREAM_START, CAPS or SEGMENT events and will
confuse downstream with buffers that come before such events.
2015-02-17 16:57:55 +02:00
Sebastian Dröge b79eff7f9b rtpsession: Handle first RTCP packet and early feedback correctly
According to RFC 4585 section 3.5.3 step 1 we are not allowed to send
an early RTCP packet for the very first one. It must be a regular one.

Also make sure to not use last_rtcp_send_time in any calculations until
we actually sent an RTCP packet already. In specific this means that we
must not use it for forward reconsideration of the current RTCP send time.
Instead we don't do any forward reconsideration for the first RTCP packet.
2015-02-11 10:32:46 +01:00
Sebastian Dröge 075eb10e65 rtpsession: Fix signal name
This wasn't meant to be pushed at all yet, but now that it's there
already it won't hurt to make it correct at least.
2015-01-30 18:22:31 +01:00
Sebastian Dröge ec99bbb5e1 rtpstats: Fix typo in documentation 2015-01-30 16:56:35 +01:00
Sebastian Dröge 77511b156e rtpsession: Add new on-receiving-rtcp signal
This will be emitted whenever an RTCP packet is received. Different to
on-feedback-rtcp, this signal gets every complete RTCP packet and not
just the individual feedback packets.
2015-01-30 16:50:36 +01:00
Sebastian Dröge e4ed852041 rtpsession: Deprecate rtcp-immediate-feedback-threshold property
It had no effect since quite some time and also is not needed in general,
especially not to switch between immediate feedback mode and early feedback
mode. The latest understanding of the RFC is that from the endpoint point of
view, both modes are exactly the same. RTCP is only allowed to use the
bandwidth as given by the RFC constraints, as such it is only ever possible
to schedule a RTCP packet early but it's against the RFC to schedule more RTCP
packets.

The difference between immediate feedback mode and early feedback mode is that
the former guarantees that an RTCP packet can be sent for every event
"immediately", which means that the bandwidth calculations from the RFC have
resulted in an RTCP scheduling interval that is small enough. Early feedback
mode on the other hand means that we can schedule some packets early to make
that happen, but it's not guaranteed at all that it's possible to schedule
an RTCP packet per event (i.e. they need to be accumulated or dropped).
2015-01-26 18:49:31 +01:00
Sebastian Dröge b07b7736b3 rtpsession: Delay the next regular RTCP packet after early RTCP
This is required to not exceed the short term average RTCP bitrate when
using early feedback as compared to without early feedback.
2015-01-26 18:49:31 +01:00
Sebastian Dröge bc9111a03d rtpsession: Add new send-rtcp-full signal
This indicates with a boolean return value if scheduling a new RTCP packet
within the requested delay was possible. Otherwise it behaves exactly like
send-rtcp. The only reason for adding a new signal is ABI compatibility.
2015-01-26 18:49:31 +01:00
Sebastian Dröge 60e2d0c84f rtpsession: Fix indention 2015-01-22 11:03:25 +01:00
Sebastian Dröge 87c8c163a8 rtpjitterbuffer: If we get a gap with a buffer without DTS, error out
We (currently?) can't really handle gaps between RTP packets if they're not
properly timestamped. The current code would go into calculations with
GST_CLOCK_TIME_NONE and then cause assertions everywhere. It's probably
better to error out cleanly instead.
2015-01-07 18:05:18 +01:00
Tim-Philipp Müller c62209d050 rtpptdemux: just drop invalid rtp packets instead of erroring out
Apparently linphone sends an invalid RTP packet as very
first packet. We want to ignore that instead of erroring
out (same for any other invalid packets really).

https://bugzilla.gnome.org/show_bug.cgi?id=741398
2014-12-25 15:48:04 +00:00
Tim-Philipp Müller bcad30510b rtpptdemux: fix 0.10-ism in docs 2014-12-25 15:44:15 +00:00
Thibault Saunier 52a1773b40 rtpsession: Use an empty iterator in iterate_internal_link when no links
And not a NULL Iterator, so it is consistent with the way it usually
works and avoid user to need a different code paths to handle that.
2014-12-09 20:38:22 +01:00
Thibault Saunier aa89278ade rtpjitterbuffer: Use an empty iterator in iterate_internal_link when no links
We used to setup an iterator with 1 GValue set with a NULL object
pointer which is not the normal way to do that. Instead we should make
sure that the first call to gst_iterator_next returns GST_ITERATOR_DONE.
2014-12-03 11:17:11 +01:00
Olivier Crête ccac1f8c0b rtprtxreceive: Use offset when copying header
The header is not always at the start of the packet, so we need to compute
the offset first.
2014-11-29 18:38:12 -05:00
Miguel París Díaz 6daa57868f rtpjitterbuffer: ensure rtx_retry_period >= 0
https://bugzilla.gnome.org/show_bug.cgi?id=739344
2014-11-22 14:48:57 +00:00
Arun Raghavan 45e716e75d rtpbin: Fix up new_jitterbuffer signal prototype 2014-11-20 22:42:59 +05:30
Arun Raghavan 56436ccced rtpbin: Document how to control per-SSRC retransmission 2014-11-20 20:24:42 +05:30
Arun Raghavan 1c3b233fef rtpmanager: Trivial typo fix 2014-11-10 13:16:50 +05:30
Tim-Philipp Müller d940c21b78 rtpjitterbuffer: implement get/set for new rtx-min-retry-timeout property
Properties are so much more useful if you can actually set
and get their values.
2014-11-02 13:06:33 +00:00
Tim-Philipp Müller b02d73a0ed rtpjitterbuffer: fix crash on some 32-bit systems
Make sure to pass right number of bits to gst_structure_new()
which is a vararg function.

Fixes elements/rtpaux unit test on ppc32.
2014-10-25 12:45:31 +01:00
Wim Taymans bd09dc96e9 rtpjitterbuffer: limit the retry frequency
When the RTT and jitter are very low (such as on a local network), the
calculated retransmission timeout is very small. Set some sensible lower
boundary to the timeout by adding a new property. We use the packet
spacing as a lower boundary by default.
2014-10-22 15:04:24 +02:00
Miguel París Díaz 4b5243c43d gstrtpjitterbuffer: add "rtx-min-delay" property
This property is useful to set a min time to wait before sending a
retransmission event.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=735378
2014-10-22 15:00:27 +02:00
Wim Taymans 0b81b316b5 jitterbuffer: Refactor code
Refactor some code dealing with calculating various timeouts.

See https://bugzilla.gnome.org/show_bug.cgi?id=735378
2014-10-22 14:59:57 +02:00
Miguel París Díaz e6504e3a65 rtpsession: fix Early Feedback Transmission
In early retransmission we are allowed to schedule 1 regular RTCP packet
at an earlier time. When we do that, we need to set allow_early to FALSE
and ignore/drop (or merge) all future requests for early transmission.
We now first check if we can schedule an early RTCP and if we can,
actually prepare the data for the next RTCP interval.

After we send the next regular RTCP after the early RTCP, we set
allow_early to TRUE again to allow more early requests.

Remove the condition for the immediate feedback for now.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=738319
2014-10-22 13:13:47 +02:00
Wim Taymans 09f179139d rtpjitterbuffer: make debug line less confusing 2014-10-21 13:10:53 +02:00
Wim Taymans 2e7f5c08cf jitterbuffer: rework resync handling
Add a need-resync state, this is when we need to try to lock on to a
time/RTPtime pair.
Always check the RTP timestamps and if they go backwards, mark ourselves
as need-resync.
Only resync when need-resync is TRUE and we have a valid time. Otherwise
we keep the old values. This avoids locking on to an invalid time and
causing us to timestamp everything with -1.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=730417
2014-10-21 11:57:34 +02:00
Sjoerd Simons 0ee384b251 rtpmux: Don't set PROXY_CAPS flag on the src pad
rtpmux behaves like a funnel in that it forwards whatever upstream is
sending buffers. So setting proxy caps doesn't make sense as the
upstream don't have to have compatible caps, thus resulting in an empty
caps set as a result of a caps query. Instead set fixed caps just
as funnel does.

https://bugzilla.gnome.org/show_bug.cgi?id=738722
2014-10-21 10:52:00 +02:00
Olivier Crête 51a8bedced rtpsource: Rename seqnum-base to seqnum-offset in caps
This was modified back in 1.0 in GstRtpBasePayload
2014-10-10 18:33:34 -04:00
Olivier Crête b3069634bd rtpmux: clock-base and seqnum-base -> timestamp-offset and seqnum-offset
These were renamed in GstRTPBasePayload in 1.0
2014-10-10 18:12:23 -04:00
Stefan Sauer 98222a67ff rtpjitterbuffer: don't log all clock_rate changes as warnings.
We never initialize clock_rate explicitly, therefore it is 0 by default. The
parameter is a uint32 and the only caller ensure that it is >0, therefore it
won't become -1 ever.
2014-10-04 17:17:13 +02:00
Sanjay NM 26a1344f37 Miscellaneous minor cleanups
Fix redundant variables and assignments,
and unreachable breaks.

https://bugzilla.gnome.org/show_bug.cgi?id=736875
https://bugzilla.gnome.org/show_bug.cgi?id=736876
https://bugzilla.gnome.org/show_bug.cgi?id=736879
https://bugzilla.gnome.org/show_bug.cgi?id=736880
https://bugzilla.gnome.org/show_bug.cgi?id=736881
https://bugzilla.gnome.org/show_bug.cgi?id=736888
https://bugzilla.gnome.org/show_bug.cgi?id=736890
https://bugzilla.gnome.org/show_bug.cgi?id=736892
https://bugzilla.gnome.org/show_bug.cgi?id=736893
https://bugzilla.gnome.org/show_bug.cgi?id=736894
2014-09-24 00:45:31 +01:00
Ognyan Tonchev f7ae4288a2 rtpbin: do not leak encsink pad in error case
https://bugzilla.gnome.org/show_bug.cgi?id=736807
2014-09-18 12:49:53 +03:00
Youness Alaoui a98341397d jitterbuffer: Allow rtp caps without clock-rate
The jitterbuffer shouldn't force clock-rate on its sink pad, this will cause a negotiation issue since rtpssrcdemux doesn't have the clock-rate and doesn't add it to the caps. The documentation states that the clock-rate can either be specified through the caps or through the request-pt-map signal, so we must remove clock-rate from the pad templates and we must accept the GST_EVENT_CAPS if the caps don't have the clock-rate.

https://bugzilla.gnome.org/show_bug.cgi?id=734322
2014-08-21 18:32:58 -04:00
Sebastian Rasmussen 1a35bf9647 rtpmux: Unref pad template caps after usage
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734473
2014-08-08 15:38:32 -03:00
Sebastian Rasmussen ca22ad8da9 rtpdtmfmux: Avoid taking an unnecessary ref
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=733122
2014-07-16 16:45:31 +02:00
Sebastian Dröge 2f47105129 rtpbin: Don't leak caps 2014-06-29 23:55:19 +02:00
Sebastian Dröge bbca040336 rtpssrcdemux: Fix compiler warning when compiling with G_DISABLE_ASSERT 2014-06-29 19:59:53 +02:00
Wim Taymans ca9cfd40dd jitterbuffer: improve SR packet handling
Implement 3 different cases for handling the SR:

 1) we don't have enough timing information to handle the SR packet and
    we need to wait a little for more RTP packets. In that case we keep
    the SR packet around and retry when we get an RTP packet in the
    chain function.

 2) the SR packet has a too old timestamp and should be discarded. It is
    labeled invalid and the last_sr is cleared.

 3) the SR packet is ok and there is enough timing information, proceed
    with processing the SR packet.

Before this patch, case 2) and 1) were handled in the same way,
resulting that SR packets with too old timestamps were checked over and
over again for each RTP packet.
2014-06-25 16:14:46 +02:00
Miguel París Díaz b22aed9bbc gstrtpssrcdemux: manage ssrc of RTCP RR packets
https://bugzilla.gnome.org/show_bug.cgi?id=731324
2014-06-23 16:23:00 -04:00
Wim Taymans d004eda79d rtpsession: update last_activity when sending RTP
Also update last_activity when doing something with the internal
source to make sure don't timeout early.

See https://bugzilla.gnome.org/show_bug.cgi?id=730217
2014-05-16 16:55:17 +02:00
Aleix Conchillo Flaqué a62b280873 rtpbin: update rtp encoder/decoder docs
Use %u in RTP encoder/decoder pads to match other rtpbin pads.

https://bugzilla.gnome.org/show_bug.cgi?id=730146
2014-05-15 15:48:21 +02:00
George Kiagiadakis 7e2138794f rtpsession: remove unused if branch
1) sources that have sent BYE in the past cannot be senders, since
they would have timed out to being receivers in the meantime...
2) sources that have sent BYE are now being removed earlier inside
this function
2014-05-14 16:01:50 +02:00
George Kiagiadakis 85d4c031d4 rtpsession: cleanup sources that have sent BYE 2014-05-14 16:01:50 +02:00