Commit graph

1151 commits

Author SHA1 Message Date
Aurélien Zanelli
f8f8935c77 rtpjitterbuffer: fix RTPJitterBufferMode documentation
Documentation lacks '@' before each enum values and there was an extra
line after symbol section which confuses GTK-Doc parser.

https://bugzilla.gnome.org/show_bug.cgi?id=767788
2016-06-17 15:16:45 +03:00
Miguel París Díaz
83f4c08747 rtpsession: take the lock when changing stats
https://bugzilla.gnome.org/show_bug.cgi?id=766025
2016-06-17 12:52:29 +03:00
Olivier Crête
5328378132 rtpjitterbuffer: Work with non-TIME segments
With non-time segments, it now assumes that the arrival time of packets
is not relevant and that only the RTP timestamp matter and it produces
an output segment start at running time 0.

https://bugzilla.gnome.org/show_bug.cgi?id=766438
2016-06-08 14:49:49 -04:00
Miguel París Díaz
389e0abeb0 rtpsource: complete warn log with SSRC
https://bugzilla.gnome.org/show_bug.cgi?id=767195
2016-06-06 10:47:17 +03: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
Sebastian Dröge
fe34f46f32 rtpsession: Take the lock already when reading the other stats, not just for the hash table
https://bugzilla.gnome.org/show_bug.cgi?id=766025
2016-05-15 12:31:33 +03:00
Olivier Crête
0ebdb97797 jitterbuffer: Upgrade debug message to error
It causes the entire pipeline to fail, it should be easier to find.
2016-05-14 12:36:08 +02:00
Sebastian Dröge
204a86af97 rtpsession: Don't notify about stats property changes while taking the session lock
The signal handlers might want to actually get the value of the stats
property, which would take the session lock again and deadlock.

This was introduced by 2e960e7075.

https://bugzilla.gnome.org/show_bug.cgi?id=766025
2016-05-11 09:28:13 +03:00
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
Miguel París Díaz
2e960e7075 rtpsession: Take session lock when creating stats
The access to the session hash table must happen while the session lock is
taken, otherwise another thread might modify the hash table while we're
creating the stats.

https://bugzilla.gnome.org/show_bug.cgi?id=766025
2016-05-06 09:24:22 +03:00
Sebastian Dröge
608b4ee53c rtpjitterbuffer: Ensure to not take caps with the wrong pt for getting the clock-rate
Especially the caps on the pad might be out of date, and the new caps would be
provided for the current pt via the request-pt-map signal.

https://bugzilla.gnome.org/show_bug.cgi?id=765689
2016-04-27 20:52:27 +03:00
Jan Schmidt
a660ac7e88 rtpjitterbuffer: Fix debug output when resyncing
Don't output the pointer value of the time() function as a timestamp
by using the correct variable.

Fixes build on Raspberry Pi 3.
2016-04-15 14:35:07 +00:00
Paolo Pettinato
40fbffc208 rtpmux: Forward sticky events on buffer lists too, not only on buffers
https://bugzilla.gnome.org/show_bug.cgi?id=764933
2016-04-12 15:22:14 +03:00
Sebastian Dröge
4a0de53cc1 rtpjitterbuffer: Fix rtp_jitter_buffer_get_ts_diff() fill level calculation
The head of the queue is the oldest packet (as in lowest seqnum), the tail is
the newest packet. To calculate the fill level, we should calculate tail-head
while considering wraparounds. Not the other way around.

Other code is already doing this in the correct order.

https://bugzilla.gnome.org/show_bug.cgi?id=764889
2016-04-12 10:17:57 +03:00
Sebastian Dröge
95dc198563 rtpmanager: It's GST_LIBS, not GST_LIBS_LIBS 2016-04-11 10:44:56 +03:00
Edward Hervey
5fa1c2ba59 jiterbuffer: Move assertion to the right location
We shouldn't have "late" lost timers at that point
2016-04-07 13:01:52 +02:00
Edward Hervey
b82da62922 jitterbuffer: Speed up lost timeout handling
When downstream blocks, "lost" timers are created to notify the
outgoing thread that packets are lost.

The problem is that for high packet-rate streams, we might end up with
a big list of lost timeouts (had a use-case with ~1000...).

The problem isn't so much the amount of lost timeouts to handle, but
rather the way they were handled. All timers would first be iterated,
then the one selected would be handled ... to re-iterate the list again.

All of this is being done while the jbuf lock is taken, which in some use-cases
would return in holding that lock for 10s... blocking any buffers from
being accepted in input... which would then arrive late ... which would
create plenty of lost timers ... which would cause the same issue.

In order to avoid that situation, handle the lost timers immediately when
iterating the list of pending timers. This modifies the complexity from
a quadratic to a linear complexity.

https://bugzilla.gnome.org/show_bug.cgi?id=762988
2016-04-07 10:14:24 +02:00
Edward Hervey
d656fe8d54 jitterbuffer: Don't create lost events if we don't need them
When "do-lost" is set to FALSE we don't use/send the lost events.
In that case, don't create them to start with :)

https://bugzilla.gnome.org/show_bug.cgi?id=762988
2016-04-07 10:13:56 +02:00
Edward Hervey
cf866a8469 jitterbuffer: Add tracing of lock usage
Helps with debugging lock usage

https://bugzilla.gnome.org/show_bug.cgi?id=762988
2016-04-07 10:06:18 +02:00
Sebastian Dröge
df247f091c rtpjitterbuffer: Add RFC7273 media clock handling
https://bugzilla.gnome.org/show_bug.cgi?id=762259
2016-04-03 11:24:34 +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
Minjae Kim
eb13a1d607 rtpmanager: Set to initial value for 'ntpns' in get_current_times()
Initialize "ntpns" variable to -1 as the OE compiler for some reason doesn't
realize that the variable is set in all code paths.

https://bugzilla.gnome.org/show_bug.cgi?id=764119
2016-03-29 10:21:07 +03:00
Vineeth TM
1071309870 good: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763076
2016-03-24 14:32:20 +02:00
Nirbheek Chauhan
78847d03cf rtpmanager: Some comment and documentation clarifications/fixes 2016-03-15 09:32:47 +00:00
Sebastian Dröge
b6e10be278 Revert "rtpjitterbuffer: don't forget to unlock mutex in error code path in two cases"
This reverts commit a7fb7b5359.

The mutex is taken by the caller, we should keep it locked when returning so
the caller can unlock it again.
2016-03-02 13:13:24 +02:00
Tim-Philipp Müller
a7fb7b5359 rtpjitterbuffer: don't forget to unlock mutex in error code path in two cases 2016-03-01 14:14:36 +00:00
Stian Selnes
5a2cc41398 rtpmanager: Don't warn for duplicate/reordered packets
This is a normal scenario and should not be a warning.

https://bugzilla.gnome.org/show_bug.cgi?id=762208
2016-02-21 22:37:57 +00:00
Miguel París Díaz
92affe2dec rtpbin: add "get-session" signal
This gets the GstRTPSession element, as compared to the RTPSession object
that is returned by get-internal-session.

https://bugzilla.gnome.org/show_bug.cgi?id=759293
2016-02-16 13:39:52 +02:00
Sebastian Dröge
366bbffcd8 Revert "WIP: rtpjitterbuffer: Add RFC7273 media clock handling"
This reverts commit 271501f657.

It wasn't meant to be pushed yet as the commit message indicates.
2016-01-18 11:30:45 +02:00
Sebastian Dröge
271501f657 WIP: rtpjitterbuffer: Add RFC7273 media clock handling 2016-01-18 08:58:59 +02:00
Sebastian Dröge
e4b2360e6e rtpjitterbuffer: Fix packet dropping after a big discont
We would queue 5 consective packets before considering a reset and a proper
discont here. Instead of expecting the next output packet to have the current
seqnum (i.e. the fifth), expect it to have the first seqnum. Otherwise we're
going to drop all queued up packets.
2015-12-09 12:24:09 +02:00
Sebastian Dröge
b13b80ea39 rtpsession: Add a warning if an empty RTCP packet is tried to be sent
https://bugzilla.gnome.org/show_bug.cgi?id=759119
2015-12-07 14:41:51 +02:00
Alessandro Decina
dd4df554d5 rtpmanager: rtpsession: don't send empty RTCP packets
generate_rtcp can produce empty packets when reduced size RTCP is turned on.
Skip them since it doesn't make sense to push them and they cause errors with
elements that expect RTCP packets to contain data (like srtpenc).
2015-11-25 14:54:58 +11:00
Arun Raghavan
7e22ea5d5a rtpmanager: Document properties that are expressed in bits per second
This changed in 928cd110bc and
73c0c2920f but was not documented.

https://bugzilla.gnome.org/show_bug.cgi?id=747863
2015-11-05 09:48:59 +05:30
Arun Raghavan
e9692e4207 rtpmanager: Trivial gst-indent fixes 2015-11-05 09:48:59 +05:30
Luis de Bethencourt
9fee2c7c9f rtpmanager: switch G_GINT64_FORMAT for GST_STIME_ARGS
No need to use G_GINT64_FORMAT for potentially negative values of
GstClockTimeDiff. Since 1.6 these can be handled with GST_STIME_ARGS.
Plus it creates more readable values in the logs.

https://bugzilla.gnome.org/show_bug.cgi?id=757480
2015-11-03 14:47:00 +00:00
Luis de Bethencourt
d4f094f587 rtpmanager: use GST_STIME_ARGS for GstClockTimeDiff
No need to manually handle negative values of diff, GST_STIME_ARGS does
exactly this.
2015-11-03 14:26:32 +00:00
Mischa Spiegelmock
cdd7091c1c docs: Minor fixes in various places
https://bugzilla.gnome.org/show_bug.cgi?id=756996
2015-10-23 10:42:19 +03:00
Stian Selnes
91a78053c7 rtpmanager: Add 'source-stats' to stats and notify
Add statitics from each rtp source to the rtp session property.
'source-stats' is a GValueArray where each element is a GstStructure of
stats for one rtp source.

The availability of new stats is signaled via g_object_notify.

https://bugzilla.gnome.org/show_bug.cgi?id=752669
2015-10-11 10:57:09 +01:00
Sebastian Dröge
f09da189aa rtpsession: Implement sending of reduced size RTCP packets
https://bugzilla.gnome.org/show_bug.cgi?id=750456
2015-10-11 10:47:47 +01:00
Sebastian Dröge
2be5416e4a rtpbin: Add missing break 2015-10-07 23:23:45 +01:00
Miguel París Díaz
f321bfeaf4 rtpmanager: Take into account packet rate for max-dropout and max-misorder calculations
https://bugzilla.gnome.org/show_bug.cgi?id=751311
2015-10-07 12:07:18 +01:00
Miguel París Díaz
4c96094fbb rtpmanager: add "max-dropout-time" and "max-misorder-time" props
https://bugzilla.gnome.org/show_bug.cgi?id=751311
2015-10-07 12:06:47 +01:00
Olivier Crête
58073eaa7a rtpmux: Use default upstream event handling
https://bugzilla.gnome.org/show_bug.cgi?id=752694
2015-10-02 17:39:10 -04:00
Olivier Crête
43c213fc5d rtpmux: As 0xFFFFFFFF is a valid ssrc, check if it has been set
https://bugzilla.gnome.org/show_bug.cgi?id=752694
2015-10-02 17:39:10 -04:00
Havard Graff
d5e26ab909 gstrtpmux: allow the ssrc-property to decide ssrc on outgoing buffers
By not doing this, the muxer is not effectively a rtpmuxer, rather a
funnel, since it should be a single stream that exists the muxer.

If not specified, take the first ssrc seen on a sinkpad, allowing upstream
to decide ssrc in "passthrough" with only one sinkpad.

Also, let downstream ssrc overrule internal configured one

We hence has the following order for determining the ssrc used by
rtpmux:

0. Suggestion from GstRTPCollision event
1. Downstream caps
2. ssrc-Property
3. (First) upstream caps containing ssrc
4. Randomly generated

https://bugzilla.gnome.org/show_bug.cgi?id=752694
2015-10-02 17:39:06 -04:00
Miguel París Díaz
bf0e4f65b4 rtpstats: add utility for calculating RTP packet rate 2015-10-02 19:25:27 +01:00
Hyunjun Ko
b814d7ed25 rtpsource: doesn't handle probation and rtp gap in case of sender
https://bugzilla.gnome.org/show_bug.cgi?id=754548
2015-10-02 16:42:36 +03:00
Hyunjun Ko
2b1f52755d rtpmanager: add new on-new-sender-ssrc, on-sender-ssrc-active signals
Allows for applications to get internal source's RTP statistics.
(eg. sender sources for a server/client)

https://bugzilla.gnome.org/show_bug.cgi?id=746747
2015-10-02 16:39:29 +03:00
Jan Schmidt
866c86dd37 Fix some compiler warnings when building with G_DISABLE_ASSERT
Touches rtpmanager and gdkpixbufsink
2015-09-26 22:18:26 +10:00