Commit graph

1299 commits

Author SHA1 Message Date
Thibault Saunier 232e3682ea Mark some properties as DOC_SHOW_DEFAULT 2019-05-13 10:24:40 -04:00
Thibault Saunier 0a6a62aa76 docs: Port all docstring to gtk-doc markdown 2019-05-13 10:24:40 -04:00
Nicolas Dufresne a6e7f258ac rtpsource: Add more information to probation warning 2019-05-02 14:44:58 -04: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
Danny Smith 037d70c01b rtpbin: Free storage when freeing session 2019-04-29 10:57:38 +02:00
Nicolas Dufresne ec06268ed8 rtpsession: Allow overriding NACK packet creation
This introduce a new signal on RTSession, on-sending-nacks is emited
right before the list of seqnums to be nacked are processed and
transformed into FB Nack. This allow implementing custom nacks
handling through another mechanism with APP feedback.
2019-04-05 18:36:36 -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 6bb53e75fb rtpsession: Send as many nack seqnum as possible
In order to do that, we now split the nacks registration from the actual
FB nack packet construction. We then try and add as many FB Nacks as
possible into the active packets and leave the remaining seqnums in the
RTPSource. In order to avoid sending outdated NACK later on, we save the
seqnum calculated deadline and cleanup the outdated seqnums before the
next RTCP send.

Fixes #583
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
Nicolas Dufresne 6b50d142f3 rtpsession: Fix early rtcp time comparision
If the current time is equal to the early rtcp time deadline, there is
no need to schedule a timer. This ensure that immediate feedback is
really immediate and simplify implementing unit tests with the test
clock, which stops perfectly on the timeout time.

This fix has been extracted from Pexip feature patch called
  "rtpsession: Allow instant transmission of RTCP packets"
2019-04-05 14:53:09 +00:00
Antonio Ospite 435f67debf docs: fix typo s/abonormally/abnormally/ 2019-04-03 16:42:26 +02:00
Antonio Ospite d6939c4031 docs: fix typo s/incomming/incoming/ 2019-04-03 16:38:56 +02:00
Antonio Ospite 114de8cc96 rtpsession: fix comment to refer to buffers instead of groups
One comments in gst_rtp_session_chain_send_rtp_common() is referring to
groups in a buffer list, however this concept of "group" comes from
GStreamer 0.10 and does not exist anymore in GStreamer 1.0, so update the
comment to refer to buffers instead.
2019-04-02 13:03:56 +02:00
Antonio Ospite e98b0ca8da rtpsource: add comment to explain why probation queue is not always cleared 2019-04-02 13:03:56 +02:00
Antonio Ospite 0fae88b5fd rtpsource: fix stats about received packets
The update_receiver_stats() function is called also when sending packets
in rtp_source_send_rtp(), and sending packets may happen using a buffer
list rather than individual buffers.

So update the stats using the actual number of packets sent.

NOTE: this is fine for the receive path too (rtp_process_send_rtp)
because the receive path does not support buffer lists and
pinfo->packets would always be equal to 1 in this case.
2019-04-02 09:26:03 +02:00
Olivier Crête 0ecc52c2ee rtpbin: Request the FEC decoder even if ignore-pt is set 2019-03-28 16:24:17 -04:00
Olivier Crête c2dd263562 rtpbin: Factor out the code that exposes the src pad 2019-03-28 16:24:12 -04:00
Nicolas Dufresne 79fd0af152 gstrtpsession: Remove set but not use running-time 2019-03-22 20:01:52 +00:00
Olivier Crête 7ecbd7271d rtpmanager: Register chain functions to debug 2019-03-22 16:44:41 +00:00
Nicolas Dufresne 2ff7519d73 rtpbin: Allow reusing the sender AUX bin
This is needed for the case you don't know in advance all the sessions
you will be using, but would like to place all the related AUX element
in the same GstBin. As per current implementation, each time an sender
AUX bin is requested and returned, RTPBin will walk the src pads and
create sessions for these pads.

In the current implementation, if a src pad already have a sessions, it
returns an error and stops. As a side effect, if an AUX bin is reused in
a following AUX bin request, it can only work if the pads are created on
the last request.

This change simply relax the restriction in order to keep walking, and
just ensure that all newly created pads have a sessions.
2019-03-21 21:10:43 +00:00
George Kiagiadakis d5ce10240a gstrtpsession: improve stats about rtx requests 2019-03-21 13:40:31 -04:00
George Kiagiadakis db647ee55b rtprtxsend: Improve looging of not found RTX packet
When an RTX packet is not found, display a message that say if the
packet have not arrived yet or if it was already removed from the RTX
packet queue.
2019-03-21 13:19:52 -04:00
Nicolas Dufresne 0aff8a7d30 rtpsession: Remove unused rtp_session_create_source 2019-03-21 13:19:52 -04:00
Antonio Ospite 30db93e3a4 rtpsource: fix documentation of rtp_source_send_rtp parameters
In commit 28e5f9098 (rtpbin: use PacketInfo for the sender, 2013-09-13)
the rtp_source_send_rtp signature changed but the documentation was not
adjusted to match the new one.

Update the documentation to match the function signature.
2019-03-07 12:41:40 +01:00
Antonio Ospite 38285e5bcf rtpsession: fix typo in a comment, s/SESSION_LOCK/RTP_SESSION_LOCK/
Fix a typo in a comment, mainly to avoid confusing autocompletion in
text editors.
2019-03-07 12:41:40 +01:00
Antonio Ospite 43e4226844 rtpsession: fix typos and update parameters names in comments
Some functions now accept a generic 'gpointer data' parameter because
they can work either on a single buffer or a buffer list.

However the comments were still referring to the old 'GstBuffer *buffer'
parameter, so update the comments to match the actual functions
signature.
2019-03-07 12:41:40 +01:00
Antonio Ospite b2b60c4d8f rtpstats: fix some fields names in the RTPSourceStats documentation
Fix documentation of RTPSourceStats to use the actual fields names.
2019-03-07 10:36:11 +01:00
Marc Leeman 8737e29a49 rtpsource: small spell correct 2019-02-27 16:14:22 +01:00
Nicolas Dufresne e72ef633a6 rtpsession: Fix EOS forwarding
So far we assumed that if all sources are bye, this meant we needed to
send an EOS on the RTCP sink. The problem is that this case may happens
if we only had one internal source and it detected a collision.

So now we limit the EOS forwarding to when there is a send_rtp_sink pad
and that this pad has received EOS. We don'tcheck the recv_rtp_sink
since the code does not wait for the bye to be send before sending EOS
to the RTCP src pad.
2019-02-25 17:06:50 +00:00
Nicolas Dufresne 06c340edd4 rtp: Add property to disable RTCP reports per internal rtpsource
This is useful when implementing custom retransmission mechanism like
RIST to prevent RTCP from being produces for the retransmitted SSRC.
This would also be used in general for various purpose when customizing
an RTP base pipeline.
2019-02-13 15:07:39 -05:00
Olivier Crête b88a3abf46 rtpsession: Emit on-new-sender-ssrc for RTX ssrc also 2019-02-13 15:07:39 -05:00
Olivier Crête bf00ee46de rtpjitterbuffer: Limit size to 2^15 packets
If it goes over 2^15 packets, it will think it has rolled over
and start dropping all packets. So make sure the seqnum distance is not too big.

But let's not limit it to a number that is too small to avoid emptying it
needlessly if there is a spurious huge sequence number, let's allow at
least 10k packets in any case.
2019-02-11 23:41:14 +00:00
Olivier Crête 086bad4643 rtpjitterbuffer: There is no automatic reorder threshold 2019-02-11 11:33:36 -05:00
Mathieu Duponchelle a6d681ad09 rtpjitterbuffer: use the correct segment seqnum 2019-02-04 13:14:37 +00:00
Mathieu Duponchelle 5e92f7d208 rtpsession: use the correct segment seqnum 2019-02-04 13:14:37 +00:00
Mathieu Duponchelle f52e16ceb8 Revert "rtpbin: receive bundle support"
This reverts commit dcd3ce9751.

This functionality was implemented for gstopenwebrtc, but it
turned out this was not actually needed for webrtc bundling
support, as shown in webrtcbin. It also doesn't correspond
to any standards.

This is an API break, but nothing should actually depend on
this, at least not for its initial purpose.

Changes in rtpbin.c were reverted manually, to preserve some
refactoring that had occurred in the original commit.

Fixes #537
2018-12-20 13:25:10 +00:00
Olivier Crête d857522237 rtpjitterbuffer: Run all timers immediately on EOS
When the EOS event is received, run all timers immediately and avoid
pushing the EOS downstream before this has been run. This ensures that
the lost packet statistics are accurate.
2018-12-14 12:10:16 +00:00
Nicolas Dufresne 3de2c28fc1 rtpjitterbuffer: Stop waiting after EOS
After EOS is received, it is pointless to wait for further events,
specially waiting on timers. This patches fixes two cases where we could
wait instead of returning GST_FLOW_EOS and trigger a spin of the loop
function when EOS is queued, regardless if this EOS is the queue head or
not.
2018-12-14 12:10:16 +00:00
Miguel Paris 48a4fd4e50 rtpsession: properly handle rtcp_feedback_retention_window
- Consider GST_CLOCK_TIME_NONE as not to be used.
- Complete "rtcp-feedback-retention-window" property getter/setter
  implementation.
2018-11-30 10:55:26 +00:00
Miguel Paris 458741e4b2 rtpsource: properly prune RTCP packets out of feedback_retention_window
Closes #522
2018-11-30 10:55:26 +00:00
Miguel Paris 53f03d4cc1 rtpsource: properly compare buffer PTSs 2018-11-30 10:55:26 +00:00
Miguel Paris 57829c3352 rtpsource: retain_rtcp_packet: warning if invalid running_time 2018-11-30 10:55:26 +00:00
Miguel Paris 36f55b03e8 rtpsession: properly set the running_time for rtcp packet info 2018-11-30 10:55:26 +00:00
Nicolas Dufresne d637567ab3 rtpssrcdemux: Rename confusingly name lock macros
This is an extra internal recurisve lock use to avoid having to take
both sink pad streams lock all the time. This patch renamed it
INTERLNAL_STREAM_LOCK/UNLOCK() to avoid confusion with possible upstream
GST_PAD API.
2018-11-29 15:34:47 -05:00
Nicolas Dufresne 40daf6322d rtpssrcdemux: Hold on internal stream lock while pushing sticky
This reverts "6f3734c305 rtpssrcdemux: Only forward stick events while
holding the sinkpad stream lock" and actually hold on the internal
stream lock. This prevents in some needed case having a second
streaming thread poping in and messing up event ordering.
2018-11-29 15:33:57 -05: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
Nicolas Dufresne 21378d83c2 rtpssrcdemux: Forward serialized events to all pads
While forwarding serialized event, we use gst_pad_forward() function.
In the forward callback (GstPadForwardFunction) we always return
TRUE. Returning true there will stop the dispatching procedure. As a
side effect, only one events is receiving the events. This breaks
when sending EOS from the applicaiton, it also breaks the latency
tracer.
2018-11-24 13:01:25 +00:00
Linus Svensson 8fc8b7ee33 rtpsession: Implement reset
Reset RTPSession when rtpsession changes state from PAUSED to READY.
Without this change, a stored last_rtptime in RTPSource could interfere
with RTP timestamp generation in RTCP Sender Report.

Fixes #510
2018-11-13 12:30:35 +00:00
Mathieu Duponchelle fd560bcb27 rtpfunnel: Stop using G_DECLARE_FINAL_TYPE
Fixes #516
2018-11-13 00:37:11 +01:00
Sebastian Dröge 87202cc03d rtpbin: Sink jitterbuffer/storage before passing as parameters to signals
Otherwise signal handlers from bindings will take ownership of them as
they are still floating, and we won't own a reference inside rtpbin
anymore.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/515
2018-11-07 09:11:16 +00:00