Commit graph

9775 commits

Author SHA1 Message Date
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
Mathieu Duponchelle 74e3eb1f1d rtpgstpay: Set DELTA_UNIT flag when appropriate
When used in combination with a rtponviftimestamp element
downstream, forwarding this flag ensures it gets correctly
serialized in the ONVIF header extension.
2019-04-04 19:08:23 +02: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 f7c8317668 rtp: fix indentation after G_DEFINE_TYPE
A missing colon after G_DEFINE_TYPE declaration was confusing gst-indent
and causing problem in the pre-commit hook.

Add the missing colon and fix the following function declaration to
follow the normal GStreamer style.
2019-04-03 16:37:34 +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 915a9c99bb rtpstorage: Limit the queue size
Limit to the queue size in case there is no arrival time or in case there is
a huge flood of packets.
2019-03-29 22:51:54 +00: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
Olivier Crête 8bf074f21e rtpreddec: Add some more debug prints 2019-03-27 18:54:27 -04:00
Olivier Crête c840328664 rtpstorage: Issue warning if request by size if 0
If the size is 0, then nothing will ever be in the storage, if a request is
received, it generally implies a misconfigured pipeline.
2019-03-26 19:41:06 -04:00
Olivier Crête 7a317ff732 rtpstorage: Add more debug messages 2019-03-26 19:41:06 -04:00
Olivier Crête 785219a317 rtpstorage: Make debug category available to sub objects 2019-03-26 19:41:06 -04:00
Olivier Crête 9b0a373eac rtpstorage: Add debug funcptr to chain function 2019-03-26 18:08:57 -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
Seungha Yang 63bb1e3a4d qtdemux: Don't pass zero to denominator for framerate
Need to respect return of gst_video_guess_framerate() to ensure
non-zero denominator.

This patch is to fix below error with an abnormal (but has valid frame) file.
(gst-play-1.0:17940): GStreamer-CRITICAL **: passed '0' as denominator for `GstFraction'
2019-03-19 12:35:08 +09:00
Charlie Turner 39d32b2394 qtdemux: Find mp4a esds atoms in protected streams sample description tables.
This problem was found in Test. 2 of the YouTube 2018 EME
tests[1]. The code was accidentally not finding an mp4a's esds atom in
the sample description table when the stream was encrypted. It assumed
that if the stream is protected, then only an enca atom will be found
here. What happens with YouTube is they often provide protected
content with a few seconds of clear content, and then switch to the
encrypted stream.

The failure case here was an incorrect codec_data field being sent
into aacparse. The advertisement of stereo audio @ 44.1kHz for the
mp4a (unprotected) stream was incorrect. As usual, the esds contained
the real values here which were mono at 22050 Hz.

Here's what the MP4 tree looks like for these types of files,
demonstrating why the code was making a wrong assumption (or maybe
YouTube is being unusual),

[ftyp] size=8+16
...
[moov] size=8+1571
...
  [trak] size=8+559
...
          [stsd] size=12+234
            entry-count = 2
            [enca] size=8+147
              channel_count = 2
              sample_size = 16
              sample_rate = 44100
              [esds] size=12+27
                ...
            ...
            [mp4a] size=8+67
              channel_count = 2
              sample_size = 16
              sample_rate = 44100
              [esds] size=12+27
                ...

In addition to fixing this, the checks for esds atoms in mp4a and mp4v
have been made symmetrical. While I haven't seen a test case for video
with the same problem, it seemed better to make the same checks. This
also fixes a crash reported from another user[2], they also noted the
asymmetry with mp4v and mp4a.

[1] https://yt-dash-mse-test.commondatastorage.googleapis.com/unit-tests/2018.html?test_type=encryptedmedia-test
[2] https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/398
2019-03-15 12:41:33 +00:00
Andreas Frisch 3160713abf flvmux: Fix scale of time values in warning message 2019-03-15 09:55:32 +00:00
Sebastian Dröge a676c17259 rtspsrc: Don't remove udpsrc/sink from rtspsrc if they were not added to it
This can happen in various error cases that could happen between the
creation of the element in question and the adding to the rtspsrc.

It causes an ugly critical warning right now but is otherwise harmless.
2019-03-15 08:21:11 +00:00
Antonio Ospite 8c26e33f20 imagefreeze: add a num-buffers property
The imagefreeze element can be handy for benchmarking downstream
elements because it re-uses the same buffer memory and introduces less
overhead compared to always creating new frames with videotestsrc.

However it's not possible to make imagefreeze send EOS when using
gst-launch-1.0.

Add a num-buffers property to make it look more like a source in the
above scenario.
2019-03-14 09:12:28 +01:00
Guillaume Desmottes fcd568dd56 matroskamux: add support for new color primaries 2019-03-12 16:52:45 +01:00
Antonio Ospite 2dfe228740 docs: fix typos s/recieve/receive/ 2019-03-07 12:41:40 +01: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
Mathieu Duponchelle 0da8f111e6 rtpulpfdecdec: only put recovered packet back into storage if not recovered from there 2019-03-06 19:40:10 +00:00
Mathieu Duponchelle f9b49aef09 rtpulpfecdec: fix buffer leak when packet is recovered from storage
Exposed by rtpulpfecdec_recovered_from_storage test.
2019-03-06 19:40:10 +00:00
Tim-Philipp Müller c79cf179cc rtph264depay: fix caps leak
Exposed by rtp_h264depay_bytestream() unit test.
2019-03-06 18:21:20 +00:00
Tim-Philipp Müller 899d0c4b3b matroskademux: fix AV1 caps when there's no codec_data
There is no "byte-stream" format for AV1 in Matroska, this
was probably cargo-culted from H.264. codec_data / CodecPrivate
is now mandatory for AV1 in Matroska[*], but there are sample
files out there which don't have it (e.g. some Elecard ones).

[*] https://github.com/Matroska-Org/matroska-specification/blob/master/codec/av1.md#codecprivate-1
2019-03-01 17:37:55 +00: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
Jan Schmidt 098f936be8 wavparse: Declare support for RF64
RF64 encode support was added to wavenc quite some time
ago, but not declared in wavparse. It seems wavparse can
decode it though, so add it to the sink pad.

The RF64 support was added in
https://bugzilla.gnome.org/show_bug.cgi?id=735627
2019-02-24 14:29:27 +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
Ilya Smelykh 6db7bb1539 flvmux: Use 8kHz sample rate for alaw/mulaw audio 2019-02-08 20:33:55 +00:00
Ilya Smelykh b9c4c8bca5 flvdemux: set sample rate to 8KHz for G.711 audio 2019-02-08 20:33:55 +00:00
Vivia Nikolaidou 92272b5e5c qtmux: Only write timecode trak for video
Recent changes in ccextractor were attaching timecode meta to the closed
caption track. We shouldn't write timecode information for the closed
caption trak.
2019-02-08 14:13:46 +02:00
Edward Hervey f5f1de54d2 qtdemux: Remove trailing '\n' in debug 2019-02-05 11:01:21 +01:00