Commit graph

19005 commits

Author SHA1 Message Date
Sebastian Dröge
d885cc0f1a v4l2codec: Garbage collect old frames if they accumulate because of codec bugs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/778>
2020-10-19 22:04:55 +03:00
Sebastian Dröge
bcb3428ed0 v4l2codec: Pass system frame number as timestamp and use it to retrieve back frames reliably
System frame numbers are supposed to be unique and correct drivers are
passing through timestamps without modification from the output/sink to the
capture/src side.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/778>
2020-10-19 18:33:58 +03:00
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
John-Mark Bell
ba4b9971e9 vp8enc: expect bps for temporal-scalability-target-bitrate.
Consistency with target-bitrate is less surprising and with
modern libvpx additional configuration is required to make
temporal scaling work.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/728>
2020-10-16 09:25:10 +00:00
John-Mark Bell
d9cedee042 vp8enc: finish support for temporally scaled encoding
- introduce two new properties:

    * temporal-scalability-layer-flags:

      Provide fine-grained control of layer encoding to the
      outside world. The flags sequence should be a multiple of
      the periodicity and is indexed by a running count of encoded
      frames modulo the sequence length.

    * temporal-scalability-layer-sync-flags:

      Specify the pattern of inter-layer synchronisation (i.e.
      which of the frames generated by the layer encoding
      specification represent an inter-layer synchronisation).
      There must be one entry per entry in
      temporal-scalability-layer-flags.

  - apply temporal scalability settings and expose as buffer
    metadata.

    This allows the codec to allocate a given frame to the correct
    internal bitrate allocator. Additionally, all the
    non-bitstream metadata needed to payload a temporally scaled
    stream is now attached to each output buffer as a
    GstVideoVP8Meta.

  - add unit test for temporally scaled encoding.

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
Nicolas Dufresne
64e89e43aa meson: Allow overriding qt5 feature
This will allow controlling that feature from gst-build

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/729>
2020-09-18 15:52:11 -04: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
Haakon Sporsheim
23bb84c868 vpxdec: request a sync point on decoder errors
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/725>
2020-09-14 13:19:10 +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
Jérôme Laheurte
44d4eaab7c jpegdec: check buffer size before dereferencing. Fixes #541
Some cameras (Panacast) have buggy drivers/firmware which send
invalid JPEG frames, containing no data, which makes jpegdec
crash because it assumes the frame is at least 2 bytes long.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/723>
2020-09-10 09:47:35 +00: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
Havard Graff
ed01e165b5 v4l2object: plug memory-leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/718>
2020-09-10 01:29:53 +00:00
Mathieu Duponchelle
39fcc7f58f vp9enc: expose row-mt property
With recent libvpx versions, multithreading can be enabled on
a per-tile basis, instead of on a per tile-column basis.

In combination with the new tile-rows property, this allows the
encoder to make much better use of the available CPU power.

Bump minimum libvpx version to 1.7.0

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/707>
2020-09-09 18:05:31 +00:00
Mathieu Duponchelle
fe6b59d0cc vpxenc: change default for deadline to good quality
Having the deadline set to best quality causes the encoder
to be absurdly slow, most real-life users will want the good
quality tradeoff instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/707>
2020-09-09 18:05:31 +00:00
Mathieu Duponchelle
13cf3fe2a6 vp9enc: expose tile-columns and tile-rows properties
Based on patch by Stian Selnes <stian@pexip.com>.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/707>
2020-09-09 18:05:31 +00:00
Mathieu Duponchelle
e61932c358 vpxenc: add configure_encoder virtual method
For subclasses to expose format-specific properties

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/707>
2020-09-09 18:05:31 +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
John-Mark Bell
8f684913cf vp8enc: improve unit tests
- make test_encode_simple cope with libvpx built with
    CONFIG_REALTIME_ONLY. Sadly, there's no way to detect this at
    runtime beyond trying to set lag-in-frames to >0, pushing a
    buffer and catching the GST_FLOW_NOT_NEGOTIATED return.

  - fix bitrot in test_encode_simple_when_bitrate_set_to_zero.

  - port test_encode_simple to GstHarness and introduce a separate
    test for the lag-in-frames property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/708>
2020-09-08 22:59:29 +00:00