Commit graph

10207 commits

Author SHA1 Message Date
Nicolas Dufresne b113516241 rtpbin: Add clear-ssrc action
This action signal will delegate to clear-ssrc onto the rtpssrcdemux element
associated with the session. This allow rtpbin users to clear pads and
elements for a specific ssrc that is known to no longer be in use. This
happens when a pad is reused in rtpsrc or ristsrc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/736>
2020-10-16 16:45:56 +00:00
John-Mark Bell 3348c5ceae rtpvp8pay: payload temporally scaled bitstreams.
Co-Authored-By: Vincent Sanders <vince@pexip.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/728>
2020-10-16 09:25:10 +00:00
Stian Selnes 29d5936749 rtpvp8pay: Add picture-id-offset property
Add property to set the initial value for picture-id. RFC7741 says
that picture-id MAY be initialized to a random value, thus it's also
valid to simply set it to a fixed initial value. A fixed value is very
useful for testing.

Default behavior is not changed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/728>
2020-10-16 09:25:10 +00:00
Mikhail Fludkov 543b7e5024 rtpvp8pay: move duplicate code to separate functions
Two new functions to modify picture id:
gst_rtp_vp8_pay_picture_id_reset - picks random picture id of
appropriate bitsize
gst_rtp_vp8_pay_picture_id_increment - increments picture id taking
care of wrapping

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/728>
2020-10-16 09:25:10 +00:00
Stéphane Cerveau 0429c24637 meson: update glib minimum version to 2.56
In order to support the symbol g_enum_to_string in various
project using GStreamer ( gst-validate etc.), the glib minimum
version should be 2.56.0.

Remove compat code as glib requirement
is now > 2.56

Version used by Ubuntu 18.04 LTS

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/774>
2020-10-15 18:21:54 +02:00
Mathieu Duponchelle 5fb5abc8a8 rtpst2022-1-fecenc: fix input seqnum check
We need to cast the incremented last seqnum to guint16 for
consistent checks on wraparound

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/770>
2020-10-14 14:30:34 +02:00
Jan Alexander Steffens (heftig) a73ede42cf flvmux: Correct time types
- last_dts is in milliseconds, not nanoseconds as expected for
  GstClockTime. Make it a generic guint64.
- Use GstClockTime for the fields that actually contain nanoseconds.
  None of them should become negative.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/766>
2020-10-09 07:10:47 +00:00
Sebastian Dröge 6a84dc4146 rtpst2022-1-fecenc: Don't unconditionally use GLib 2.60 APIs
g_queue_clear_full() in this case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/768>
2020-10-09 09:31:27 +03:00
Mathieu Duponchelle ed2b5e6cfc rtpulpfec: fix potential alignment issue in xor function
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/753#note_646453
for context

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/753>
2020-10-08 22:22:18 +00:00
Mathieu Duponchelle 591af0f38a rtpmanager: implement SMPTE 2022-1 FEC encoder
+ improve integration of FEC encoders in rtpbin

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/753>
2020-10-08 22:22:18 +00:00
Mathieu Duponchelle cff42d4c26 rtpmanager: implement SMPTE 2022-1 FEC decoder
+ improve integration of FEC decoders in rtpbin

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/753>
2020-10-08 22:22:18 +00:00
Olivier Crête 7c9a5e86fe rtpfunnel: Also forward custom sticky event
This is useful to track metadata about each group of packets

Also include a unit test

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/666>
2020-10-06 20:57:49 +00:00
Thibault Saunier 6eef0967b9 isomp4: Rename GstQTMux to GstBaseQTMux to avoid breaking API
Since 52b63de19a the qtmux GType was
renamed GstQTMuxElement which breaks presets, revert that change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/755>
2020-09-30 09:18:13 -03:00
Sebastian Dröge f95dde512c rtp: Fix allocations to support source-info property
Use gst_rtp_base_payload_allocate_output_buffer() instead of
gst_rtp_buffer_new_allocate() in order to allocate RTP buffer with
correct number of CSRCs according to the meta.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/612>
2020-09-28 15:27:17 +00:00
Stian Selnes d494be9916 rtpvp8pay: Fix allocation to support source-info property
Use gst_rtp_base_payload_allocate_output_buffer() in order to allocate
RTP buffer with correct number of CSRCs according to the meta.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/314

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/612>
2020-09-28 15:27:17 +00:00
Matthew Waters 7736a21659 qtmux: output the correct limits in error messages
Having the current bytes being less than the limit was confusing!

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/732>
2020-09-28 15:37:12 +10:00
Matthew Waters e81ce6f2d7 qtmux: properly support initial caps nego failure
Scenario:
- gap event causes h264parse to push made up caps that may fail checks
  inside qtmux (e.g missing codec_data).
- the caps event has already been marked as received and is sticky on
  the sink pad
- gst_qt_mux_pad_can_renegotiate() will retrieve the failed caps event
  using gst_pad_get_current_caps() and reject the correct updated caps
  with codec_data.
- Failure!

Keep track of the configured caps ourselves instead of relying on the
sticky event on the pad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/732>
2020-09-28 15:37:12 +10:00
Matthew Waters b27dc540d0 qtmux: support non-seekable downstream mode
Write an mdat per buffer in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/732>
2020-09-28 15:37:12 +10:00
Nicolas Dufresne 345f74b09d rtpbin: Remove the rtpjitterbuffer with the stream
Since !348, the jitterbuffer was only removed with the session. This restores
the original behaviour and removes the jitterbuffer when the stream is
removed. This avoid accumulating jitterbuffer objects into the bin when a
session is reused.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/735>
2020-09-24 09:54:05 -04:00
Nicolas Dufresne ecc110ca8b rtpbin: Cleanup dead code
The rtpjitterbuffer is now part of the session elements, we no longer need
to do the ref_sink dance when signalling it. It is already owned by the bin
when signalled. Also, the code that handles generic session elements already
handle the ref_sink() calls since:

03dc22951b

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/735>
2020-09-23 15:48:24 -04:00
Matthew Waters ea61714c70 rtph26*depay: drop FU's without a corresponding start bit
If we have not received a FU with a start bit set, any subsequent FU
data is not useful at all and would result in an invalid stream.

This case is constructed from multiple requirements in
RFC 3984 Section 5.8 and RFC 7798 Section 4.4.3.  Following are excerpts
from RFC 3984 but RFC 7798 contains similar language.

The FU in a single FU case is forbidden:

   A fragmented NAL unit MUST NOT be transmitted in one FU; i.e., the
   Start bit and End bit MUST NOT both be set to one in the same FU
   header.

and dropping is possible:

   If a fragmentation unit is lost, the receiver SHOULD discard all
   following fragmentation units in transmission order corresponding to
   the same fragmented NAL unit.

The jump in seqnum case is supported by this from the specification
instead of implementing the forbidden_zero_bit mangling:

   If a fragmentation unit is lost, the receiver SHOULD discard all
   following fragmentation units in transmission order corresponding to
   the same fragmented NAL unit.

   A receiver in an endpoint or in a MANE MAY aggregate the first n-1
   fragments of a NAL unit to an (incomplete) NAL unit, even if fragment
   n of that NAL unit is not received.  In this case, the
   forbidden_zero_bit of the NAL unit MUST be set to one to indicate a
   syntax violation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/730>
2020-09-21 08:08:38 +00:00
Seungha Yang 027940a416 imagefreeze: Response caps query from srcpad
... and chain up to default query handler for unhandled query types.
Unhandled query shouldn't be returned with FALSE if there's no special needs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/731>
2020-09-21 10:28:01 +03:00
Matthew Waters e64227f585 qtmux: make documentation happy
introduce a base qtmux class that we can install documentation snippets
on instead of duplicating across alll the isomp4 elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/643>
2020-09-21 12:09:09 +10:00
Matthew Waters 52b63de19a isomp4/mux: add a fragment mode for initial moov with data
Used by some proprietary software for their fragmented files.

Adds some support for multi-stream fragmented files

Flow is as follows.
1. The first 'fragment' is written as a self-contained fragmented
   mdat+moov complete with an edit list and durations, tags, etc.
2. Subsequent fragments are written with a mdat+moof and each stream is
   interleaved as data arrives (currently ignoring the interleave-*
   properties).  data-offsets in both the traf and the trun ensure
   data is read from the correct place on demuxing.  Data/chunk offsets
   are also kept for writing out the final moov.
3. On finalisation, the initial moov is invalidated to a hoov and the
   size of the first mdat is extended to cover the entire file contents.
   Then a moov is written as regularly would in moov-at-end mode (the
   default).

This results in a file that is playable throughout while leaving a
finalised file on completion for players that do not understand
fragmented mp4.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/643>
2020-09-21 12:08:14 +10:00
Matthew Waters 97e932d500 qtdemux: increase some logging on streams and sample parsing
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/643>
2020-09-21 12:08:14 +10:00
Matthew Waters 37f0119f49 qtdemux: bail out when encountering an atom with a size of 0
A size 0 atom means the atom extends to the end of the file.  No further
valid atoms will ever follow.  Avoids a subsequent scan for an atom from
one byte earlier after encountering a size 0 atom.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/643>
2020-09-21 12:08:14 +10:00
Matthew Waters 868149ca5a qtdemux: fix subsequent moof parsing after moov with valid samples
reset the moof_offset back to its original value like is done in the
error case just before.

Fixes subsequent parsing of a moof following a moov that contains valid
samples in a non-streaming fragmented mp4.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/643>
2020-09-21 12:08:14 +10:00
Matthew Waters 2b9c465643 qtdemux: extend edit list when fragmented
When we are fragmented, the edit list may only refer to the portion of
the media that is in the moov.  Extend the edit list stop time when we
if there is only one qt segment and we are reading a fragmented file.

Fixes playback of some fragmented mp4 files generated by proprietary
programs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/643>
2020-09-21 12:08:14 +10:00
Olivier Crête c79a520946 splitmuxsrc: Implement segment query
Fixes #239

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/713>
2020-09-18 10:54:23 -04:00
Sebastian Dröge c90af726ab rtpmp4gdepay: Allow lower-case "aac-hbr" instead of correct "AAC-hbr"
Various live555 based products are using the wrong "mode" string or
seem to assume case-insensitive matching, which is wrong.

Examples for this are the Yuan SC6C0N1 mini and the Kiloview E2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/727>
2020-09-18 10:02:44 +03:00
Stefan Brüns ee3ea2a94d qtdemux: Add support for AAX encrypted audio streams
This is modelled after the DASH Common Encryption scheme, but is somewhat
simpler as more parts are fixed, i.e. just one encryption scheme.

The output caps are fixed to 'application/x-aavd'. All information
required for decryption are part of the 'adrm' atom, which is passed
on as a property. The property is attached to the buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/577>
2020-09-16 00:59:34 +00:00
Stefan Brüns 6e68873d7f qtdemux: Add 'aavd' and related fourcc codes for AAX encrypted audio
The 'aavd' box is contained in the 'stsd' sample description. The 'aavd'
box follows the layout of an 'mp4a' entry, i.e. it contains a single
standard 'esds' extension box, and the two proprietary 'adrm' and 'aabd'
extension boxes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/577>
2020-09-16 00:59:34 +00:00
Camilo Celis Guzman 5340de5c33 rtp/vrawpay: use alloc_output_buffer from base class
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/726>
2020-09-13 23:16:10 +02:00
Ricky Tang cfae2a37be rtspsrc: Fix push-backchannel-buffer parameter mismatch
When using python, signal parameter must match with function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/724>
2020-09-11 18:33:04 +08:00
Jan Alexander Steffens (heftig) 953ceba80d flvmux: Improve logging of gst_flv_mux_buffer_to_tag_internal
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/722>
2020-09-10 09:20:46 +00:00
Jan Alexander Steffens (heftig) deeb3917a5 flvmux: Move stream skipping to GstAggregatorPadClass.skip_buffer
Besides looking like the correct place to put this, it allows us to drop
the entire aggregator queue. The old implementation only dropped at most
one buffer for each call of aggregate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/722>
2020-09-10 09:20:46 +00:00
Mathieu Duponchelle 19860200ed splitmuxsink: fix sink pad release while PLAYING
- Release the split mux lock while removing the probes

- Flush the sinkpad to unblock other pads

- Turn check_completed_gop into a do while statement, when
  waking up we want to recheck whether the current GOP is
  ready for sending

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/719>
2020-09-09 19:03:12 +02:00
Sebastian Dröge 47c43b29eb gst: Update for gst_video_transfer_function_*() function renaming
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/715>
2020-09-07 12:13:18 +03:00
Jan Alexander Steffens (heftig) 2d08d16002 flvmux: Avoid crash when best pad gets flushed
The 'best' pad might receive a flush event between us picking it and us
popping the buffer. In this case, the buffer will be missing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/711>
2020-08-31 14:19:14 +00:00
Jan Alexander Steffens (heftig) 01594d19b8 flvmux: Correct breaks in gst_flv_mux_find_best_pad
The code seems to use `continue` and `break` as if both refer to the
surrounding `while` loop. But because `break` breaks out of the
`switch`, they actually have the same effect.

This may have caused the loop not to terminate when it should. E.g. when
`skip_backwards_streams` drops a buffer we should abort the aggregation
and wait for all pads to be filled again. Instead, we might have just
selected a subsequent pad as our new "best".

Replace `break` with `done = TRUE; break`, and `continue` with `break`.
Then simplify the code a bit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/710>
2020-08-31 15:14:56 +02:00
Zeid Bekli 3211c65a5e rtpL16depay: unref buffer on error
gst_rtp_L16_depay_process to unref buffer on wrong payload size or
reorder failure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/702>
2020-08-24 19:43:15 +00:00
Sebastian Dröge 85a6e95c7d rtputils: Don't call NULL GstMeta transform function
It's optional and if it does not exist then no transformation is
possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/701>
2020-08-18 10:27:52 +03:00
Julian Bouzas 91972c91aa rtp: Do not register rtpreddec and rtpredenc twice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/699>
2020-08-13 15:27:25 -04:00
Sebastian Dröge e4ce9887cd rtpmanager: Improve readability of "stats" docs by making the fields an actual list
Otherwise they end up all in the same line one after another.

Also add docs for the "avg-jitter" stats field of the jitterbuffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/698>
2020-08-13 07:24:17 +00:00
Vivia Nikolaidou c95cc6a015 flvmux: Return NEED_DATA when we drop a buffer
When we are dropping a buffer in find_best_pad (e.g. waiting for a
keyframe, or skipping backwards timestamp), return
GST_AGGREGATOR_FLOW_NEED_DATA to make sure we have enough data at the
next run. Otherwise, a stream that accidentally fell behind (e.g.
relinking race, or just waiting for a keyframe) will never get the
opportunity to catch up to the other one, because the other one will
always keep advancing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/696>
2020-08-10 20:36:51 +03:00
Vivia Nikolaidou 75f6ca8a11 flvmux: Return NEED_DATA when no best pad is found
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/696>
2020-08-10 20:20:04 +03:00
Vivia Nikolaidou 59aab55e71 flvmux: Fix possible crash on GST_ITERATOR_RESYNC
Wrong pointer type

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/696>
2020-08-10 20:18:30 +03:00
Sebastian Dröge e9a0307b94 rtph26[45]pay: Change default aggregate-mode to "none" for backwards compatibility
We didn't aggregate at all in previous versions and there are apparently
various RTP implementations that don't handle aggregation well at all.

As part of this also document that for RTSP it is recommended to keep it
set to "none" while for WebRTC it should be set to "zero-latency".

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/749

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/692>
2020-08-08 10:08:31 +03:00
Jan Alexander Steffens (heftig) 28a616f693 splitmuxsink: Make sure flushing doesn't block
* Trying to disconnect a stream from a running splitmuxsink by flushing
  it results in the FLUSH_START blocking in the stream queue's
  gst_pad_pause_task because the flush did not unblock
  complete_or_wait_on_out, so add a check for ctx->flushing there.

* Add a GST_SPLITMUX_BROADCAST_INPUT so check_completed_gop notices
  flushing changed and the incoming push is unblocked.

* Pass the FLUSH_STOP along to the muxer without waiting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/687>
2020-08-04 15:15:27 +00:00
Vivia Nikolaidou af9e66d7a5 imagefreeze: Wait until we have a clock
Otherwise it can happen that it tries to get the clock in PAUSED state
in live mode, which does not exist.

Thanks to Sebastian Dröge for helping debugging.

Fixes #775

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/691>
2020-08-04 17:28:39 +03:00