Commit graph

1238 commits

Author SHA1 Message Date
Mikhail Fludkov
40eb462591 rtpsession: Avoid unnecessary copy of stats structure
The code before copied GstStructure twice. The first time inside
gst_value_set_structure and the second time in g_value_array_append.
Optimized version does no copies, just transfers ownership to
GValueArray. It takes advantage of the fact that array has already
enough elements preallocated and the memory is zero initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-15 11:33:01 +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
Stian Selnes
29f26e8768 rtpsession: Add missing lock around sess->ssrcs iteration
https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 19:17:02 +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
Xavier Claessens
edd9c8f6b8 Meson: Generate pc file for all plugins in good
https://bugzilla.gnome.org/show_bug.cgi?id=794568
2018-04-25 11:07:06 +01:00
Mathieu Duponchelle
8270cbacb4 rtxsend: fix wrong memory layout assumption
The code responsible for creating retransmitted buffers
assumed the stored buffer had been created with
rtp_buffer_new_allocate when copying the extension data,
which isn't necessarily the case, for example when
the rtp buffers come from a udpsrc.

https://bugzilla.gnome.org/show_bug.cgi?id=794958
2018-04-06 20:25:04 +02:00
Mathieu Duponchelle
4f8b34ab85 rtpbin: new signal "get-storage"
Similar to the get-session and get-internal-session signals,
we expose a get-storage signal in addition to the
get-internal-storage signal to give access to the actual
element for applications that need to set properties on the
element, in particular "size-time"

https://bugzilla.gnome.org/show_bug.cgi?id=794910
2018-04-06 20:21:43 +02:00
Tim-Philipp Müller
b387989bc6 docs: rtpbin: add some Since markers for new properties 2018-03-12 13:21:08 +00:00
Mathieu Duponchelle
d2b51bd727 rtpptdemux: provide example usage for ignored-payload-types 2018-02-26 17:02:52 +01:00
Mathieu Duponchelle
55ecde7ee5 rtpbin, rtpptdemux: Add missing Since markers 2018-02-26 16:53:08 +01:00
Mathieu Duponchelle
359b0a86f1 rtpptdemux: do no assume sink caps are non NULL 2018-02-21 19:59:04 +01:00
Mathieu Duponchelle
fdf64195ac rtpbin: Expose FEC support signals
Also slightly refactor complete_session_src

https://bugzilla.gnome.org/show_bug.cgi?id=792696
2018-02-21 14:15:22 +01:00
Mathieu Duponchelle
82d0950254 rtpptdemux: Add ignored-payload-types property
Packets with these payload types will be dropped. A use case
for this is FEC, where we want FEC packets to go through the
jitterbuffer, but not be output by rtpbin.

https://bugzilla.gnome.org/show_bug.cgi?id=792696
2018-02-21 14:15:22 +01:00
Mathieu Duponchelle
36b991f0b3 rtpptdemux: Add ssrc to output caps
It may be useful downstream

https://bugzilla.gnome.org/show_bug.cgi?id=792696
2018-02-21 14:15:22 +01:00
Patrick Radizi
364dbb5fc7 rtpjitterbuffer: allow timestamps to move backwards
The original solution for #784002 incorrectly assumed that timestamps
may not move backwards and changed timestamps that did so.

https://bugzilla.gnome.org/show_bug.cgi?id=784002
2018-02-15 10:05:39 +02:00
Mathieu Duponchelle
03dc22951b rtpbin: fix leak of elements requested by signals
When the signal returns a floating reference, as its return type
is transfer full, we need to sink it ourselves before passing
it to gst_bin_add (which is transfer floating).

This allows us to unref it in bin_remove_element later on, and
thus to also release the reference we now own if the signal
returns a non-floating reference as well.

As we now still hold a reference to the element when removing it,
we also need to lock its state and setting it to NULL before
unreffing it

Also update the request_aux_sender test.

https://bugzilla.gnome.org/show_bug.cgi?id=792543
2018-01-18 15:26:43 +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
Justin Kim
2a5aafe425 rtpsesson: downgrade message level to debug when detected XR
When XR packet is detected, warning message leads to misunderstandings.
Until RFC3611 is implemented in gst-plugins-base, the level needs to
be downgraded to avoid confusion.

https://bugzilla.gnome.org/show_bug.cgi?id=789746
2017-11-01 10:57:00 +02:00
Tim-Philipp Müller
6cb51bd8cf rtpjitterbuffer: fix debug message on pt mismatch 2017-10-08 00:07:43 +01:00
Tim-Philipp Müller
d5f72418c8 rtpbin, rtspsrc: fix compiler warnings about 64-bit integer signednes
"warning: this decimal constant is unsigned only in ISO C90" with
gcc 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.3)
2017-10-07 15:55:24 +01:00
Tim-Philipp Müller
a802f5df42 rtpjitterbuffer: implement basic chain_list function
Doesn't do anything fancy yet, but still avoids lots of
unnecessary locking/unlocking that would happen if the
default chain_list fallback function in GstPad got invoked.
2017-09-17 16:33:15 +01:00
Patrick Radizi
3de0244532 rtpbin: add option for sanity checking timestamp offset
Timestamp offsets needs to be checked to detect unrealistic values
caused for example by NTP clocks not in sync. The new parameter
max-ts-offset lets the user decide an upper offset limit. There
are two different cases for checking the offset based on if
ntp-sync is used or not:
1) ntp-sync enabled
   Only negative offsest are allowed since a positive offset would
   mean that the sender and receiver clocks are not in sync.
   Default vaule of max-ts-offset = 0 (disabled)
2) ntp-sync disabled
   Both positive and negative offsets are allowed.
   Default vaule of max-ts-offset = 3000000000
The reason for different default values is to be backwards
compatible.

https://bugzilla.gnome.org/show_bug.cgi?id=785733
2017-09-15 13:33:14 +03:00
Patrick Radizi
23f7739ba4 rtpbin: add option for increasing ts_offset gradually
Instant large changes to ts_offset may cause timestamps to move
backwards and also cause visible effects in media playback. The new
option max-ts-offset-adjustment lets the application control the rate to
apply changes to ts_offset.

https://bugzilla.gnome.org/show_bug.cgi?id=784002
2017-09-14 13:15:56 +03:00
George Kiagiadakis
286e1e62be rtprtx{send,receive}: improve the debug messages
* use INFO/DEBUG/LOG/TRACE equaly and meaningfully;
  previously rtprtxsend:LOG and rtprtxreceive:LOG would generate
  a totally different amount of log traffic and sometimes it was
  impossible to see the information you wanted without useless
  spam being printed around
* improve the wording, give a reasonable and self-explanatory
  amount of information
* print SSRCs in hex
* avoid G_FOO_FORMAT for readability (we are just printing integers)
2017-09-07 14:43:32 +03:00
Sebastian Dröge
71104f452e rtpbin: Also log local and SR RTP running times when doing ntp-sync=true 2017-08-29 19:14:25 +03:00
Matthew Waters
f602b8e5b0 rtpbin: also create session when creating the send_rtcp_src_%u pad
If one requests the send_rtcp_src_%u pad before a recv_rtcp_sink_%u pad,
the session/pad would never be created and NULL was returned.
Switching the request order would work.

https://bugzilla.gnome.org/show_bug.cgi?id=786718
2017-08-29 12:47:30 +10:00
Mathieu Duponchelle
5e48e85fb7 rtpstats: fix unsigned integer comparisons.
Callers of the API (rtpsource, rtpjitterbuffer) pass clock_rate
as a signed integer, and the comparison "<= 0" is used against
it, leading me to think the intention was to have the field
be typed as gint32, not guint32.

This led to situations where we could call scale_int with
a MAX_UINT32 (-1) guint32 as the denom, thus raising an
assertion.

https://bugzilla.gnome.org/show_bug.cgi?id=785991
2017-08-11 13:29:24 +02:00
Olivier Crête
96e71b0286 rtpsession: Send EOS if all internal sources sent bye
The ones which are not internal should not matter, and we should
wait for all sources to have sent their BYEs.

And add unit test

https://bugzilla.gnome.org/show_bug.cgi?id=773218
2017-07-04 21:14:10 -04:00
Olivier Crête
7e7e52caa0 rtpsession: Only send EOS if all sources have been marked bye
Now that multiple sender RTPSource can share the same RTPSession, we
must not send an EOS unless they're all marked bye.
2017-07-04 13:36:44 -04:00
Nicolas Dufresne
bf5cbce3b4 rtprtxreceive: Add memory and boudary checks
This element was not checking if mapping the RTP buffer and the payload
worked, and was not checking if the RTX payload was large enough.

https://bugzilla.gnome.org/show_bug.cgi?id=784484
2017-07-04 09:58:15 -04:00
Julien Isorce
afbabaefbe rtpstats: fix assertion 'denom > 0' failed
gst_util_uint64_scale_int takes a gint as denom parameter
whereas ctx->clock_rate is a guint32.

It happens when gst_rtp_packet_rate_ctx_reset set clock_rate
to -1.

So just define clock_rate as gint like it is done in rtpsource.h

https://bugzilla.gnome.org/show_bug.cgi?id=784250
2017-06-29 15:58:44 -04:00
Nicolas Dufresne
bbe0053f8a rtpjitterbuffer: Add a faststart-min-packets property
When set this property will allow the jitterbuffer to start delivering
packets as soon as N most recent packets have consecutive seqnum. A
faststart-min-packets of zero disables this feature. This heuristic is
also used in rtpsource which implements the probation mechanism and a
similar heuristic is used to handle long gaps.

https://bugzilla.gnome.org/show_bug.cgi?id=769536
2017-06-28 11:51:10 -04:00
Juan Navarro
72d2afda18 rtpsession: print value of unknown RTCP Payload Type
This adds printing the actual value of any unknown RTCP PT
to the already existing WARNING log message.

https://bugzilla.gnome.org/show_bug.cgi?id=783248
2017-05-31 10:20:27 +03:00
Nicolas Dufresne
b68d936ae0 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 14:41:19 -04:00
Tim-Philipp Müller
50a4b5bc0d Revert "rtpbin: pipeline gets an EOS when any rtpsources byes"
This reverts commit eeea2a7fe8.

It breaks EOS in some sender pipelines, see
https://bugzilla.gnome.org/show_bug.cgi?id=773218#c20
2017-04-19 12:28:12 +01:00
George Kiagiadakis
7f6c783930 rtprtxqueue: implement handling of the max-size-time property
https://bugzilla.gnome.org/show_bug.cgi?id=780867
2017-04-11 09:44:33 +03:00
George Kiagiadakis
501bf0e8d1 rtpmux: fix output segment and buffer DTS to correspond to the flattened PTS
https://bugzilla.gnome.org/show_bug.cgi?id=780347
2017-03-24 11:09:46 +02:00
George Kiagiadakis
3e91601fbb rtprtxqueue: add basic documentation and example pipelines
Mostly explaining the difference between rtprtxqueue and rtprtxsend.
2017-03-20 12:10:55 +02:00
George Kiagiadakis
ba606b96d3 rtprtxreceive: fix example pipelines and improve the documentation
https://bugzilla.gnome.org/show_bug.cgi?id=771383
2017-03-17 19:07:34 +02:00
George Kiagiadakis
0e65304d5c rtpsession: print the correct variable in debug statement
This debug statement is meant to print the time since the last (early)
RTCP transmission, not the last regular RTCP transmission (which also
happens to be set a few lines above to current_time, so the debug output
is just confusing)
2017-03-16 17:46:46 +02:00
George Kiagiadakis
1622d4c894 rtprtxsend: convert LOG message to TRACE
This is printed too often (for every chained buffer!) and just clutters the logs.
2017-03-16 17:46:46 +02:00
Miguel París Díaz
9ffef7ecd5 rtpsource: fix warning message
https://bugzilla.gnome.org/show_bug.cgi?id=780105
2017-03-16 16:33:02 +02:00
Miguel París Díaz
54a2f33e47 rtpsource: get clock-rate from pt if needed to generate SR
https://bugzilla.gnome.org/show_bug.cgi?id=780105
2017-03-16 15:48:37 +02:00
George Kiagiadakis
71b63d54fe rtprtxreceive: fix potential leak of old, unassociated, association requests
https://bugzilla.gnome.org/show_bug.cgi?id=722560
2017-03-01 10:50:43 +02:00
Andrew
76792a5c20 rtpjitterbuffer: Don't always reset PTS to 0 after a gap
In function rtp_jitter_buffer_calculate_pts: If gap in incoming RTP
timestamps is more than (3 * jbuf->clock_rate) we call
rtp_jitter_buffer_reset_skew which resets pts to 0. So components down
the pipeline (playes, mixers) just skip frames/samples until pts becomes
equal to pts before gap.

In version 1.10.2 and before this checking was bypassed for packets with
"estimated dts", and gaps were handled correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=778341
2017-02-26 12:41:19 +02:00
Miguel París Díaz
3aa69ca0bb rtpsession: relate received FIRs and PLIs to source
This is needed in order to:
 - Avoid ignoring requests for different media sources.
 - Add SSRC field in the GstForceKeyUnit event.

https://bugzilla.gnome.org/show_bug.cgi?id=778013
2017-02-02 12:13:59 -05:00
Santiago Carot-Nemesio
a1e4249131 rtpstats: Keep number of nacks sent/received per source
Currently, the nack packets sent or received are kept at session level,
which makes it impossible to distinguish how many of these packages were
sent/received per ssrc when several sources are in the same session. This
patch is aligned with the https://www.w3.org/TR/webrtc-stats/#dom-rtcrtpstreamstats

https://bugzilla.gnome.org/show_bug.cgi?id=776714
2017-01-24 12:38:50 +02:00
Mathieu Duponchelle
191330cba8 rtxqueue: Expose basic statistics as properties.
Statistics about the total number of retransmission requests
and the actual number of retransmitted packets can be helpful
at application-level.

https://bugzilla.gnome.org/show_bug.cgi?id=777182
2017-01-12 19:49:30 +01:00