Commit graph

1109 commits

Author SHA1 Message Date
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
Sebastian Dröge 7046852e7d gst: Don't use deprecated gst_segment_to_position() 2015-09-26 00:12:46 +02:00
Sebastian Dröge 01c0f8723f rtpbin/rtpjitterbuffer/rtspsrc: Add property to set maximum ms between RTCP SR RTP time and last observed RTP time
https://bugzilla.gnome.org/show_bug.cgi?id=755125
2015-09-25 23:55:05 +02:00
Sebastian Dröge a0ae6b5b5a rtpbin/session: Allow RTCP sync to happen based on capture time or send time
Send time is the previous behaviour and the default, but there are use cases
where you want to synchronize based on the capture time.

https://bugzilla.gnome.org/show_bug.cgi?id=755125
2015-09-25 23:55:00 +02:00
Mark Nauwelaerts b7b244f356 rtpjitterbuffer: reset just a bit more upon flush_stop 2015-09-13 15:42:06 +02:00
Mark Nauwelaerts 1e7a3473fd rtpjitterbuffer: remove dead struct member 2015-09-13 15:41:03 +02:00
Sebastian Dröge 68a9209408 rtpjitterbuffer: Keep the DTS estimate if we got no DTS after a jitterbuffer reset
Otherwise we will just output buffers without timestamps after a reset if no
timestamps are provided by upstream, e.g. when using RTSP over TCP.

https://bugzilla.gnome.org/show_bug.cgi?id=749536
2015-08-13 16:45:16 +02:00
Hyunjun Ko b0d6020862 rtprtxsend: print valid type where guint32 is expected
https://bugzilla.gnome.org/show_bug.cgi?id=746445
2015-08-06 01:39:43 -03:00
Havard Graff 764bbf99a8 rtpmux: handle different ssrc's on sinkpads
Do this by not putting the ssrc from the src pads in the caps used to
probe other sinkpads, and then  intersecting with it later.

https://bugzilla.gnome.org/show_bug.cgi?id=752491
2015-07-16 16:46:11 -04:00
Sebastian Dröge 582ade2c42 rtpjitterbuffer: Fix indention 2015-07-10 00:13:32 +03:00
Sebastian Dröge ae8acc0973 rtpjitterbuffer: Always estimate DTS from the current clock time
Estimating it from the RTP time will give us the PTS, so in cases of PTS!=DTS
we would produce wrong DTS. As now the estimated DTS is based on the clock,
don't store it in the jitterbuffer items as it would otherwise be used in the
skew calculations and would influence the results. We only really need the DTS
for timer calculations.

https://bugzilla.gnome.org/show_bug.cgi?id=749536
2015-07-10 00:13:22 +03:00
Sebastian Dröge 6e7c724afa rtpjitterbuffer: Calculate DTS from the clock if we had none for the first packet after a reset
https://bugzilla.gnome.org/show_bug.cgi?id=749536
2015-07-08 23:19:52 +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
Stian Selnes 40524e5a49 Revert "rtpjitterbuffer: Fix expected_dts calc in calculate_expected"
This reverts commit 05bd708fc5.

The reverted patch is wrong and introduces a regression because there
may still be time to receive some of the packets included in the gap
if they are reordered.
2015-07-08 23:18:48 +03:00
Sebastian Dröge 4e23481d9f rtpjitterbuffer: Calculate receive time if we don't have any
This is required to properly schedule packet loss timers and make
sure all our calculations work properly.

https://bugzilla.gnome.org/show_bug.cgi?id=749536
2015-07-08 17:02:05 +03:00
Sebastian Dröge 243730ced4 rtpjitterbuffer: Handle seqnum gaps in TCP streams without erroring out or overflowing calculations
That is, handle DTS==GST_CLOCK_TIME_NONE correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=749536
2015-07-08 15:15:00 +03:00
Stefan Sauer 12930c2f8c docs: fix "Symbol name not found at the start of the comment block"
Add symbols or change comment into a regular comment.
2015-07-07 17:12:02 +02:00
Miguel París Díaz 5ae672fd22 rtpjitterbuffer: Consider timers len to compare with RTP_MAX_DROPOUT
When there are a lot of small gaps, we can consider that there is
a big gap (too losses) to reset the buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=751636
2015-07-02 18:38:46 +02: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
Miguel París Díaz 2176f31174 rtpjitterbuffer: refactor handle_next_buffer
The goal of this patch is making handle_next_buffer function
more readable avoiding unnecesary gotos and adding other
cosmetic changes.
2015-07-01 16:06:40 +02:00
Sebastian Dröge de5cd0995b Revert "rtpjitterbuffer: If we have an immediate timeout, don't try to find an earlier timeout"
This reverts commit 0c21cd7177.

If we have multiple immediate timers, we want to first handle the one with the
lowest sequence number... which would be broken now.

Instead of this we should just use a GSequence for the timers, and have them
sorted first by timestamp, and for equal timestamps by sequence number. Then
we would always only have to take the very first timer from the list and never
have to look at any others.
2015-06-29 10:36:58 +02:00
Sebastian Dröge 0c21cd7177 rtpjitterbuffer: If we have an immediate timeout, don't try to find an earlier timeout
If we have lots of such immediate timeouts, we would otherwise have quadratic
runtime in the number of timeouts.
2015-06-29 10:14:05 +02:00
Hyunjun Ko a1bff413a1 rtpbin/session: fix description
https://bugzilla.gnome.org/show_bug.cgi?id=751496
2015-06-25 16:31:51 +02:00
Sangkyu Park 2663388000 rtpjitterbuffer: Minor clean-up
1. Fix the code which is wrong coding style.
2. Fix a typing error of comment.

https://bugzilla.gnome.org/show_bug.cgi?id=751316
2015-06-22 13:08:12 +02:00
Jose Antonio Santos Cadenas 11f298a338 rtpsource: Do not try to push NULL buffers
If update_receiver_stats() fails, we can't really do anything with this buffer
anymore and have to drop it. This happens if there's a big seqnum
discontinuity for example.

https://bugzilla.gnome.org/show_bug.cgi?id=751311
2015-06-22 12:26:59 +02:00
Miguel París Díaz 40957a9212 rtprtxqueue: reverse pending list before pushing buffers
With this we send the RTX buffers in the same order
that they were requested.

https://bugzilla.gnome.org/show_bug.cgi?id=751297
2015-06-22 11:36:22 +02:00
Sebastian Dröge e9902430da rtpjitterbuffer: gst_rtp_buffer_ext_timestamp() modifies its first argument, keep a copy around 2015-06-16 11:43:39 +02:00
Sebastian Dröge 62a7bcb395 rtpjitterbuffer: Compare ext RTP times, not plain RTP time and ext RTP time when calculating elapsed time
Otherwise all RTP times after a wraparound would be considered as going
backwards, they will always be smaller than the ext RTP time.
2015-06-16 10:31:47 +02:00
Sebastian Dröge f4e01b13ee rtpbin: The default rtp-profile should be AVP, not AVPF 2015-06-15 19:25:12 +02:00
Sangkyu Park 6696bd62ef rtpjitterbuffer: Minor cleanup
1. Add Null check in 'free_item' function.
2. Fix a typing error of comment.

https://bugzilla.gnome.org/show_bug.cgi?id=750965
2015-06-15 11:55:57 +02:00
Sebastian Dröge dc513eb949 rtpbin/session: Add new ntp-time-source property and deprecate use-pipeline-clock property
The new property allows to select the time source that should be used for the
NTP time in RTCP packets. By default it will continue to calculate the NTP
timestamp (1900 epoch) based on the realtime clock. Alternatively it can use
the UNIX timestamp (1970 epoch), the pipeline's running time or the pipeline's
clock time. The latter is especially useful for synchronizing multiple
receivers if all of them share the same clock.

If use-pipeline-clock is set to TRUE, it will override the ntp-time-source
setting and continue to use the running time plus 70 years. This is only kept
for backwards compatibility.
2015-06-12 23:35:42 +02:00
Sebastian Dröge 37e3ca1447 rtpbin: Rename some variables and debug output to make more sense
Local and remote were mixed up in a few places, and the time we store here is
not UNIX time (1970 epoch), but NTP time (1900 epoch) in nanoseconds.
2015-06-12 23:07:27 +02:00
Sebastian Dröge dc059efa60 rtp: Use GST_BUFFER_PTS() instead of GST_BUFFER_TIMESTAMP()
The mix between all these in the RTP code is confusing, let's try to be
consistent.
2015-06-10 14:34:47 +02:00
Ilya Konstantinov c7e168ec70 rtpmanager: clarify negative lost packets in stats
Also:
- Move notes on units before field documentation.
- Unify documentation style.

https://bugzilla.gnome.org/show_bug.cgi?id=750653
2015-06-10 14:10:52 +02:00
Ilya Konstantinov 0a578c235a rtpmanager: document units of stats and arguments
Also, minor spelling and style corrections.

https://bugzilla.gnome.org/show_bug.cgi?id=750653
2015-06-09 18:21:59 +02: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
Sebastian Dröge d650a310da rtpsession: Only suggest our internal ssrc if it's not a random one and was selected as internal ssrc
https://bugzilla.gnome.org/show_bug.cgi?id=749581
2015-06-05 16:45:54 +02:00
Sebastian Dröge 8f5bdf9690 rtpjitterbuffer: Add support for receiving reduced size RTCP
It worked before but gave warnings, now we just ignore RTCP
packets that don't start with a SR. As all we're interested
in here are SRs.
2015-06-05 10:33:11 +02:00
Jose Antonio Santos Cadenas f563176349 rtpssrcdemux: Add support for reduce size rtcp
According to RFC 5506, reduce size packages can be sent, this
packages may not be compound, so we need to add support for
getting ssrc from other types of packages.

https://bugzilla.gnome.org/show_bug.cgi?id=750327
2015-06-05 10:30:15 +02:00
Jose Antonio Santos Cadenas f8f23bbf5d rtpsession: Add support for receiving reduced size rtcp
See RFC 5506

https://bugzilla.gnome.org/show_bug.cgi?id=750332
2015-06-05 10:24:17 +02:00
Sebastian Dröge 647eefea67 rtpsession: Only schedule a timer when we actually have to send RTCP
Otherwise we will have 10s-100s of thread wakeups in feedback profiles, create
RTCP packets, etc. just to suppress them in 99% of the cases (i.e. if no
feedback is actually pending and no regular RTCP has to be sent).

This improves CPU usage and battery life quite a lot.

https://bugzilla.gnome.org/show_bug.cgi?id=746543
2015-06-02 11:38:15 +02:00
Sebastian Dröge 8ada98964d rtpsession: Remove useless goto
https://bugzilla.gnome.org/show_bug.cgi?id=746543
2015-06-02 11:38:15 +02:00
Sebastian Dröge 506a8a8857 rtpbin: Add rtp-profile property for setting the default profile of newly created sessions
https://bugzilla.gnome.org/show_bug.cgi?id=746543
2015-06-02 11:38:15 +02:00