Commit graph

228 commits

Author SHA1 Message Date
Sebastian Dröge ad6012159a matroskademux: Fix integer overflows in zlib/bz2/etc decompression code
Various variables were of smaller types than needed and there were no
checks for any overflows when doing additions on the sizes. This is all
checked now.

In addition the size of the decompressed data is limited to 120MB now as
any larger sizes are likely pathological and we can avoid out of memory
situations in many cases like this.

Also fix a bug where the available output size on the next iteration in
the zlib/bz2 decompression code was provided too large and could
potentially lead to out of bound writes.

Thanks to Adam Doupe for analyzing and reporting the issue.

CVE: CVE-2022-1922, CVE-2022-1923, CVE-2022-1924, CVE-2022-1925

https://gstreamer.freedesktop.org/security/sa-2022-0002.html

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1225

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2610>
2022-06-15 17:50:55 +00:00
Sebastian Dröge f503caad67 avidemux: Fix integer overflow resulting in heap corruption in DIB buffer inversion code
Check that width*bpp/8 doesn't overflow a guint and also that
height*stride fits into the provided buffer without overflowing.

Thanks to Adam Doupe for analyzing and reporting the issue.

CVE: CVE-2022-1921

See https://gstreamer.freedesktop.org/security/sa-2022-0001.html

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1224

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2608>
2022-06-15 16:40:48 +00:00
Adam Doupe be11a6e26b smpte: Fix integer overflow with possible heap corruption in GstMask creation.
Check that width*height*sizeof(guint32) doesn't overflow when
allocated user_data for mask, potential for heap overwrite when
inverting.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1231

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2603>
2022-06-15 14:53:50 +00:00
Tim-Philipp Müller 9d9e59622f Bump GLib requirement to >= 2.62
Can't require 2.64 yet because of
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/323

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2568>
2022-06-10 06:01:41 +00:00
Marc Leeman 8bdf7e8ad8 fix trivial distination -> destination
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2573>
2022-06-08 14:40:09 +02:00
Sebastian Dröge 47aab6c832 flvdemux: Make use of the streams API if used in a streams-aware bin
This allows adding audio/video streams after 6s.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2559>
2022-06-07 10:52:46 +00:00
Jan Alexander Steffens (heftig) 637406cdb1 aacparse: Avoid mismatch between src_caps and output_header_type
If our downstream caps didn't intersect, we attempted to convert between
raw and ADTS stream formats, if possible. If the caps still did not
intersect, we then used the modified `src_caps` but left the
`output_header_type` unmodified.

This caused a mismatch between caps and actual stream format.

Avoid this by first copying the `src_caps` to `convcaps` for the
additional intersection tests, replacing `src_caps` if we succeed.

While we're here, clean up the code a bit and remove the `codec_data`
field from outgoing ADTS caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2550>
2022-06-06 15:09:09 +00:00
Sebastian Dröge e5f9bb973f flvdemux: Actually make use of the debug category
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2552>
2022-06-06 14:36:41 +00:00
Jan Schmidt a8f18aef18 rtpptdemux: Don't GST_FLOW_ERROR when ignoring invalid packets
https://bugzilla.gnome.org/show_bug.cgi?id=741398 changed
rtpptdemux in 2014 to not post a GST_ELEMENT_ERROR on the
bus when dropping an invalid (non-RTP) packet, but still
returned GST_FLOW_ERROR upstream - so the pipeline still
stops, but now without a useful bus error.

Return GST_FLOW_OK instead, so the pipeline keeps
running. Some old telephony equipment can send invalid
packets before the real RTP traffic starts.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2520>
2022-05-29 20:27:38 +10:00
Piotrek Brzeziński 5490189b9b cutter: Include running/stream-time in messages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2490>
2022-05-25 12:27:10 +00:00
Sebastian Dröge 7273024ae5 qtdemux: Add support for ONVIF XML Timed MetaData
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2453>
2022-05-20 13:01:44 +00:00
Sebastian Dröge 365a9af9c5 qtdemux: Add parsing/dumping of nmhd / metx boxes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2453>
2022-05-20 13:01:44 +00:00
Sebastian Dröge 04f6258863 qtdemux: Parse styp box for informational purposes
And include some more details in the debug logs for the ftyp box too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2453>
2022-05-20 13:01:44 +00:00
Jan Schmidt 7322a6d004 splitmuxsrc: Re-queue sticky events after probing.
When processing the first event after probing the
file and being activated, requeue sticky events
as there's no requirement that demuxers send tag
and other events again after a seek - that's
why they're sticky.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2432>
2022-05-17 11:55:40 +00:00
Jan Alexander Steffens (heftig) d0fdfa76ae deinterlace: Clean up error handling in chain and _push_history
- Consistently unref the chained buffer at the end of the chain
  function, if we're not handing it off to `gst_pad_push`. This avoids a
  few buffer leaks in the error paths in `_chain` and `_push_history`.
- When mapping the video frame fails, return a flow error instead of
  crashing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2428>
2022-05-17 10:56:23 +00:00
Jan Alexander Steffens (heftig) 718d31fe63 splitmuxsink: When flushing, exit handle_mq_input quickly
If we just break the loop, we might run into the `gop != NULL` assert
that follows it. Rather, exit immediately with flushing flow.

Also use this flushing mechanism when we release a pad. This avoids
having an extra flag.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1030>
2022-05-17 09:24:10 +00:00
Jan Alexander Steffens (heftig) fd27ee1537 splitmuxsink: Avoid deadlock on release, harder
Unlock after broadcasting and wait for the pad to be free before
relocking the muxer, giving the input probe a chance to react to our
broadcast.

Improves the fix from
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/838.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1030>
2022-05-17 09:24:10 +00:00
Shingo Kitagawa 92c0a462ae wavparse: fix typo in debug message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2425>
2022-05-16 19:31:18 +09:00
Thibault Saunier 1cb4c050d0 rtpbin: Avoid holding lock GST_RTP_BIN_LOCK when emitting pad-added
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2411>
2022-05-13 06:25:03 +00:00
Sebastian Dröge 1223324246 qtdemux: Don't use tfdt for parsing subsequent trun boxes
The timestamp in the tfdt refers to the first trun box and if there are
multiple trun boxes then the distance between the first timestamps will
grow.

At some point this distance reaches a threshold and triggers the
resetting of the first sample's timestamp of this trun box to be reset
to the tfdt.

This threshold is implemented for files where there is a jump in the
timeline between fragments and where this can be detected via a jump
between the end timestamp of the previous fragment and the tfdt of the
next. This behaviour is preserved.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2409>
2022-05-13 04:19:36 +00:00
Sebastian Dröge d2c6f21fc1 mp4mux: Disable aggregator's default negotiation
mp4mux can't negotiate caps with upstream/downstream and always outputs
specific caps based on the input streams. This will always happen before
it produces the first buffers.

By having the default aggregator negotiation enabled the same caps
would be pushed twice in the beginning, and again every time a
reconfigure event is received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2372>
2022-05-05 17:41:58 +00:00
Sebastian Dröge 841cba4182 flvmux: Disable aggregator's default negotiation
flvmux can't negotiate caps with upstream/downstream and always outputs
specific caps based on the input streams. This will always happen before
it produces the first buffers.

By having the default aggregator negotiation enabled the same caps
would be pushed twice in the beginning, and again every time a
reconfigure event is received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2372>
2022-05-05 17:41:58 +00:00
Matthew Waters f4f342aa78 wavparse: ensure that any pending segment is sent before an EOS event is sent
Specifically fixes seqnum handling when an aggregator-based element
(audiomixer et al) is downstream and a seek is performed that
immediately causes an EOS from wavparse.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2356>
2022-05-04 08:00:02 +00:00
Sebastian Dröge 7466444b63 rtpjitterbuffer: Free CNAME/SSRC mappings on finalize and PAUSED->READY
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2336>
2022-04-29 23:33:47 +03:00
Sebastian Dröge 2c405da921 rtpmanager: Refactor RTCP packet loops to fix control flow
Mixing C loops with switch statements is a bad idea as break has a
different meaning in both. Breaking inside the switch statements wrongly
caused further loop iterations.

Instead use goto to get out of the loop and continue to do another loop
iteration, and never ever use break except for the end of a case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2336>
2022-04-29 23:13:15 +03:00
Seungha Yang 6619f1611f rtpjitterbuffer: Initialize variables
Avoid use of uninitialized variable
Fixing MSVC warning
gstrtpjitterbuffer.c(4733) : warning C4700: uninitialized local variable 'have_sdes' used

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2315>
2022-04-28 12:37:13 +00:00
dongil.park 5b11e6a3d0 wavparse: Unset DISCONT buffer flag for divided into multiple buffers in push mode
In push mode (streaming), if the received chunk buffer size from _chain is bigger
than output buffer size, the flags of the divided-buffers are propagated to the
DISCONT flag from first received chunk buffer. This unexpected buffers contained DISCONT
flags are abnormally transformed when changing the sampling rate by audioresample element.
So unset unnecessary DISCONT flag before pad_push().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2305>
2022-04-27 14:29:10 +00:00
Sebastian Dröge 9d5179ad3f rtpjitterbuffer: add the reference timestamp meta in more situations
Previously, we only added it when actually performing synchronization
based on the NTP time.

The information can be useful downstream in other situations too, and
we can compute a NTP time as soon as we get a sender report with the
relevant information.

Co-authored-by: Mathieu Duponchelle <mathieu@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2252>
2022-04-27 12:35:21 +00:00
Sebastian Dröge ed425e2785 rtpgstpay: Don't push packets before the first input buffer is received
It's not possible to create a valid RTP timestamp for them, which would
cause a potentially very big RTP timestamp discontinuity between those
first packets (created from initial events) and the packet based on the
first input buffer.

As a side-effect, also simplify the packet aggregation code a bit and
work with only a single level of buffer lists.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1157

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2250>
2022-04-27 11:55:17 +00:00
Havard Graff 390ec99f1b rtptwcc: don't map the buffer twice
...and use the pt extracted rather than the one from RTPPacketInfo
when logging.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2271>
2022-04-26 10:27:25 +00:00
Thibault Saunier d673a90aea rtpsession: Emit "notify::stats" when we update stats from RR or SR
Sensibily optimizing caching the pspecs and using them directly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2266>
2022-04-26 08:49:42 +00:00
Mathieu Duponchelle 3391a7d499 rtpredenc: quieten warning about ignoring header extensions
Turn it into a FIXME, and only log once

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2279>
2022-04-23 01:04:54 +00:00
Havard Graff b7b71e6974 rtprtxsend: mark RTX buffers with GST_RTP_BUFFER_FLAG_RETRANSMISSION
It is useful for elements downstream from rtxsend to know if the RTP
buffer they are dealing with is an RTX buffer or not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2272>
2022-04-22 19:27:45 +00:00
Tristan Matthews 27dea62304 mp4mux: fix spelling
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2241>
2022-04-22 14:07:57 +00:00
Jonas Bonn 2f6ad787b2 multiudpsink: allow binding to IPv6 address
When the sink is configured to create sockets with an explicit bind
address, then the created socket gets set to the udp_socket field
irregardless of whether the bind address indicated that the socket
family should be IPv4 or IPv6.  When binding to an IPv6 address, this
results in the following error:

gstmultiudpsink.c:1285:gst_multiudpsink_configure_client:<rtcpsink>
error: Invalid address family (got 10)

This patch adds a check of the address family being bound to and sets
the created socket to used_socket or used_socket_v6, accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1551>
2022-04-22 10:43:13 +00:00
Sebastian Dröge 02115a5efc rtpmanager: Move some duplicated constant and helper function to a single place
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132>
2022-04-20 14:40:25 +00:00
Sebastian Dröge c7e12974ba rtpbin/rtpjitterbuffer: Don't parse RTCP SRs twice unless needed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132>
2022-04-20 14:40:25 +00:00
Sebastian Dröge 82169aa140 rtpjitterbuffer: Add property to throttle handling of RTCP SR / NTP-64 syncing
This proxies the "rtcp-sync-interval" property of rtpbin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132>
2022-04-20 14:40:25 +00:00
Sebastian Dröge ce38614e1a rtpsession: Handle RTCP-SR-REQ (RFC6051) RTCP feedback message
This causes an RTCP SR to be sent at the earliest possible time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132>
2022-04-20 14:40:25 +00:00
Sebastian Dröge 0c819d2f31 rtpbin/rtpjitterbuffer: Allow syncing to an SR without CNAME if the CNAME is already known
The RTCP SR packet might be without SDES in case of a reduced-size RTCP
packet. For syncing purposes the CNAME is needed but it might be known
already from an earlier RTCP packet or out of band, via the SDP for
example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132>
2022-04-20 14:40:25 +00:00
Sebastian Dröge cbaac3cdba rtpbin/jitterbuffer: Use inband 64-bit NTP timestamps according to RFC6051 for faster synchronization
When signalled via the caps that the header extension is used, it will
be read and used in the same way as the RTP/NTP time mapping from RTCP
SRs.

If the CNAME of the stream's SSRC is provided out of band via e.g. the
SDP then this allows streams to be synchronized immediately on the first
packet instead of having to wait for the first RTCP SR to arrive.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132>
2022-04-20 14:40:25 +00:00
Sebastian Dröge 7c796b3c05 rtpsession: Only add send latency to the running time if it is actually known
Otherwise we can't know the running time yet if rtcp-sync-send-time is
set, and have to wait until the latency is known later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132>
2022-04-20 14:40:25 +00:00
Sebastian Dröge 7ffc830959 rtpsession: Update 64-bit NTP header extensions with the actual NTP time in senders
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132>
2022-04-20 14:40:25 +00:00
Sebastian Dröge 8980c35efe rtpmanager: Add header extension implementation for the 64-bit RFC6051 NTP header extension
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132>
2022-04-20 14:40:25 +00:00
Xavier Claessens b99ecc78ca Replace gst-i18n-*.h with gi18n-lib.h
GLib guarantees libintl is always present, using proxy-libintl as
last resort. There is no need to mock gettex API any more.

This fix static build on Windows because G_INTL_STATIC_COMPILATION must
be defined before including libintl.h, and glib does it for us as part
as including glib.h.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2028>
2022-04-19 18:01:06 +00:00
Havard Graff 71891e5647 qtdemux: fix leak of channel_mapping
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2179>
2022-04-14 19:41:36 +09:00
Robert Rosengren e4a6521ac7 rtpbin: Fix division by zero when using ts-offset-smoothing-factor
avg_ts_offset may cause division by zero when calculating potential
overflow protection. This fix will avoid the division.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2151>
2022-04-11 15:29:49 +02:00
Tristan Matthews 86f0f8b67f rtpopusdepay: assume 2 channels if sprop-stereo is missing
Fixes #1064

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2125>
2022-04-08 13:11:25 +00:00
Sebastian Dröge 0813efc821 rtpstats: Remove non-existing twcc field docs from RTPPacketInfo and add missing field docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2121>
2022-04-06 10:15:13 +03:00
Sebastian Dröge 46d7763879 rtpsession: Remove unused twcc fields from the struct
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2121>
2022-04-06 10:15:13 +03:00
Xavier Claessens b004464ac6 Remove glib and gobject dependencies everywhere
They are part of gst_dep already and we have to make sure to always have
gst_dep. The order in dependencies matters, because it is also the order
in which Meson will set -I args. We want gstreamer's config.h to take
precedence over glib's private config.h when it's a subproject.

While at it, remove useless fallback args for gmodule/gio dependencies,
only gstreamer core needs it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2031>
2022-04-01 16:32:17 +00:00
Thibault Saunier b358897a3b navigation: Rename parse_state to parse_modifier_state
`parse_state` sounds a bit weird and `parse_modifier_state` is clearer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2087>
2022-04-01 06:38:43 +00:00
Matthew Waters 8cdbfec5ed deinterlace: silence unused-but-set werror from imported code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2042>
2022-03-28 03:00:58 +00:00
Thibault Saunier 2db3ddaa9d navigationtest: Add some support for modifiers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2010>
2022-03-25 15:16:03 +00:00
Matthew Waters c1a3f958e7 rtpptdemux: fix leak of caps when ignoring a pt
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2025>
2022-03-25 05:44:36 +00:00
Vivienne Watermeier 97bc8f193f navigationtest: Display touchscreen events, log all events
Represents touchscreen events as a trail of black squares, one for each
reported position. Additionally, this adds the `display-mouse` and
`display-touch` properties to toggle visibility of mouse/touchscreen
events, since touchscreens often emulate mouse events, as well as
logging for all received navigation events.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1633>
2022-03-23 13:14:52 +00:00
Vivienne Watermeier 6c2f6c3bd4 all: Use new navigation interface and API
Use and implement the new navigation interface in all relevant sink elements,
and use API functions everywhere instead of directy accessing the event structure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1633>
2022-03-23 13:14:52 +00:00
Stéphane Cerveau 1170ab3c29 wavparse: handle query in any parse state
In order to create the stream_id, we need to
pass the query to the default query handler.

If the parse state is different from GST_WAVPARSE_DATA
the query should be passed to the default query
handler.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1987>
2022-03-22 16:25:35 +00:00
Jan Alexander Steffens (heftig) 074f7c2e4e flvmux: Clean up aggregate's control flow
This unifies exits to go through a single out label. It mostly
simplifies how EOS is handled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1035>
2022-03-22 15:28:57 +00:00
Matthew Waters 206021e4d4 rtpmanager/rtx: implement initial support for reading/writing rid extensions
Two RTP Header extensions are very relevant for rtprtxsend/receive.
1. "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id": will always be removed
2. "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id": will be written
    instead of the "rtp-stream-id" header extension.

Currently it's only a simple replacement of one header extension for
another however a future change would only add the relevant extension
based on some heuristics (like, video frames only on one of the rtp key
frame buffers, or only until the rtx ssrc has been validated by the peer)
in order to reduce the required bandwidth.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1759>
2022-03-21 03:18:18 +00:00
Matthew Waters 1e55e2d654 rtpmanager: add support for RFC8852 (rid) RTP header extensions
Both for regular RID and for adding on a repaired (RTX) etc stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1759>
2022-03-21 03:18:18 +00:00
Matthew Waters ecd9cce3b1 rtpmanager: add support for writing RFC8843 (BUNDLE mid) RTP header extension
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1759>
2022-03-21 03:18:18 +00:00
Sebastian Dröge 3de245ed17 videocrop: Add support for v210
Like UYVY and similar formats this is rounding down to the start of the
previous macro-pixel to not mix up the different components.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1988>
2022-03-19 01:25:07 +00:00
Sebastian Dröge 49ec82b209 videocrop: Use GST_ROUND_DOWN_2 instead of re-defining a local version
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1988>
2022-03-19 01:25:07 +00:00
Sebastian Dröge cd86181d54 videocrop: Rename PACKED_COMPLEX to PACKED_YVYU
It's not handling any kind of complex packed format, only formats that
are like YVYU.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1988>
2022-03-19 01:25:07 +00:00
Sangchul Lee 7691c6776a rtpjitterbuffer: Fix invalid memory access in rtp_jitter_buffer_pop()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1973>
2022-03-17 12:46:14 +00:00
Tim-Philipp Müller 7895bf38ad rtspsrc: proxy new "add-reference-timestamp-meta" property from rtpjitterbuffer
When syncing to an RFC7273 clock this will add the original
reconstructed reference clock timestamp to buffers in form
of a GstReferenceTimestampMeta.

This is useful when we want to process or analyse data based
on the original timestamps untainted by any local adjustments,
for example reconstruct AES67 audio streams with sample accuracy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1964>
2022-03-16 09:52:58 +00:00
Tim-Philipp Müller c29d741c0e rtpbin: proxy new "add-reference-timestamp-meta" property from rtpjitterbuffer
When syncing to an RFC7273 clock this will add the original
reconstructed reference clock timestamp to buffers in form
of a GstReferenceTimestampMeta.

This is useful when we want to process or analyse data based
on the original timestamps untainted by any local adjustments,
for example reconstruct AES67 audio streams with sample accuracy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1964>
2022-03-16 09:52:58 +00:00
Tim-Philipp Müller c88bfc0b3e rtpjitterbuffer: add "add-reference-timestamp-meta" property
When syncing to an RFC7273 clock this will add the original
reconstructed reference clock timestamp to buffers in form
of a GstReferenceTimestampMeta.

This is useful when we want to process or analyse data based
on the original timestamps untainted by any local adjustments,
for example reconstruct AES67 audio streams with sample accuracy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1964>
2022-03-16 09:52:58 +00:00
Sebastian Dröge 5ca39060f4 rtpjitterbuffer: Improve accuracy of RFC7273 clock time calculations
Previously the result of the calculations included inaccuracies caused
by the NTP clock estimation, which caused the timestamps to jitter
+/- 1/clockrate.

By reorganizing the calculations it is possible to get rid of this
inaccuracy and calculate deterministic and exact packet timestamps based
on the actual NTP clock as long as the estimation is not off by more
than 2**31 clockrate units.

The only remaining inaccuracy that is introduced now is caused by the
conversion from the NTP clock to the pipeline clock.

Also split up debug output, demote many messages to the trace debug
level and output more intermediate results.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1955>
2022-03-15 23:33:37 +00:00
Nirbheek Chauhan 8c2ef0f025 twcc: Add some logging to debug TWCC feedback
This should allow people to debug when TWCC feedback is not enabled
because they haven't set the extmap in the caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1952>
2022-03-15 22:32:07 +00:00
Nirbheek Chauhan a6bb63dcd7 twcc: Note that packet-loss-pct can count reordering as loss
This is difficult to encounter in ordinary networks, but is
encountered when using tc-netem to add random delays to packets, and
also when your UDP stream is bonded over multiple links with varying
characteristics.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1952>
2022-03-15 22:32:07 +00:00
Havard Graff e5bd9839c4 rtprtxsend: don't require clock-rate in caps
For multiplexing, the rtpstreams you are multiplexing might not use
the same clock-rate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1881>
2022-03-15 19:05:00 +00:00
Havard Graff 4d31641302 rtprtxsend: don't start the task unless we are doing rtx
The rtxsend element can do pass-through when not enabled (no pt-map set)
and in those cases there is no point in starting an additional task
that does absolutely nothing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1880>
2022-03-15 12:03:27 +00:00
Havard Graff 6f57199958 rtprtxreceive: add ssrc-map property
Mirroring the rtxsend, this allows the application to "pre-map" the
retransmission-ssrcs to the "real" ssrc, if this information is known.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1878>
2022-03-14 09:14:10 +00:00
Carlos Rafael Giani 671c89c392 mpg123: Add gapless playback support
Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1028>
2022-03-14 10:32:15 +02:00
Carlos Rafael Giani 0431a0845c mpegaudioparse: Support gapless playback
Gapless playback is handled by adjusting buffer timestamps & durations
and by adding GstAudioClippingMeta.

Support for "Frankenstein" streams (= poorly stitched together streams)
is also added, so that gapless playback support doesn't prevent those
from being properly played.

Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1028>
2022-03-14 10:32:15 +02:00
Jan Alexander Steffens (heftig) 2db283499e deinterlace: scalerbob: Reduce latency to 0
We only need the current field, just like `linear`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1926>
2022-03-12 22:48:39 +00:00
Vivia Nikolaidou 8c648384f2 yadif: Fix CHECK macro for YUY2 format
Used to make comb artifacts for videotestsrc pattern=ball for YUY2
format only (not AYUV).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1938>
2022-03-12 17:18:47 +00:00
Sangchul Lee 67df5815a9 rtpvp8depay: Fix crash when making 'GstRTPPacketLost' custom event
This patch fixes a seg.fault in gst_structure_new() with warnings as below.

GLib-GObject-WARNING **:
 ../gobject/gtype.c:4330: type id '0' is invalid
GLib-GObject-WARNING **:
 can't peek value table for type '<invalid>' which is not currently referenced

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1918>
2022-03-10 19:37:49 +00:00
Tomasz Andrzejak e74435008f rtpbin: allow FEC elements with Always pads
This patch enable picking up FEC decoder or enocder that have
static repair packets pad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1860>
2022-03-10 08:33:27 +00:00
Edward Hervey 568b918971 qtdemux: Propagate stick events downstream when creating pads
If upstream provided a stream collection event before any pads were created,
make sure it's propagated downstream when pads are created.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1891>
2022-03-09 16:09:31 +00:00
Havard Graff a2c25ccd09 rtprtxsend: if no rtx is present, don't expose a rtx-ssrc in caps
The point here is that rtpsession will create a new rtpsource when
the field "rtx-ssrc" is present, and when not doing rtx, that means
a random ssrc will create a new rtpsource that will be included in RTCP
messages for the current session.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1882>
2022-03-09 15:30:37 +00:00
Havard Graff 2a8fa45ba8 rtprtxsend: don't process or warn if no map is set
This makes it more gentle when doing "pass-through"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1879>
2022-03-09 12:01:22 +05:30
Mikhail Fludkov 815d279f2e rtprtxreceive: fix crash when RTX payload has zero length
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1875>
2022-03-08 09:07:41 +00:00
Havard Graff 86c7231dae rtprtxreceive: allow passthrough and non-rtp buffers
To avoid mapping rtp buffers when RTX is not in use, and to not
do a full error on receiving a non-rtp buffer, since you have no control
of what a rouge sender might send you.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1874>
2022-03-07 23:43:49 +00:00
Havard Graff a475c93346 rtprtx: don't access type-system per buffer
When doing only a single stream of audio/video this hardly matters,
but when doing many at the same time, the fact that you have to get
a hold of the glib global type-system lock every time you process a buffer,
means that there is a limit to how many streams you can process in
parallel.

Luckily the fix is very simple, by doing a cast rather than a full
type-check.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1873>
2022-03-07 22:01:03 +00:00
Hou Qi b11084f729 flvmux: Add protection when unref GstFlvMuxPad
This is to avoid gst_object_unref: assertion 'object != NULL' failed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1843>
2022-03-07 13:03:16 +00:00
Nicolas Dufresne 0f15580853 matroska: Fix AV1 alignment to TU
Matroska stores AV1 in temporal unit, so that all OBU sharing the same
timestamp are put together. This was previously just assumed, which isn't
safe now that we have more alignments.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1837>
2022-03-04 21:58:15 +00:00
Nicolas Dufresne f6c070fbff isomp4: Fix AV1 default alignment
ISOMP4 store TU (temporal units) worth of AV1. Expose this in the
caps to reduce overhead in the parser, and in the muxer to avoid
storing frames split in the wrong way.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1837>
2022-03-04 21:58:15 +00:00
Tristan Matthews 9d0d001d19 matroskamux: allow width+height caps changes for VP8/9
For VP8 and VP9, width+height changes are signalled inband.

Refs https://github.com/Kurento/bugtracker/issues/535 and
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1047/diffs?commit

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1657>
2022-03-04 14:17:20 -05:00
Tristan Matthews c6ba57eb8e matroskamux: allow width + height changes for avc3|hev1
For avc3 and hev1, the intent was to allow more flexibility for caps changes
(see https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1047/diffs?commit_id=9bd8d608d5bae27ec5ff09e733f76ca32b17420c)
however width and resolution were previously omitted.

avc3 and hev1 specifically support changing stream-parameters on the fly, whereas avc1/hvc1 disallow in-band SPS.

This commit allows for changes to width and height for these which is in line with matroskamux's behaviour prior to 1.14.0.

Practically speaking, one use case where this is commonly seen is when capturing a WebRTC stream, as the browser will adapt the resolution live.

Suggested-by: Mathieu Duponchelle "<mathieu@centricular.com>"
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1657>
2022-03-04 14:17:20 -05:00
Jan Alexander Steffens (heftig) ce503d0645 deinterlace: Prevent race between _set_method and latency query
It's possible that the method is being manipulated while downstream
queries our latency, leading to crashes.

Prevent that from happening.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1854>
2022-03-04 16:14:46 +00:00
Sebastian Dröge 9f798776e5 matroska-mux: Handle pixel-aspect-ratio caps field correctly when checking caps equality
Not having this field is equivalent with it being 1/1 so consider
it like that. The generic caps functions are not aware of these
semantics and would consider the caps different, causing a negotiation
failure when caps are changing from caps with to caps without or the
other way around.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1826>
2022-03-02 10:27:47 +00:00
Sebastian Dröge 1b851ae23f matroska-mux: Handle multiview-mode/flags caps fields correctly when checking caps equality
Not having these fields is equivalent with them being mono/0 so consider
them like that. The generic caps functions are not aware of these
semantics and would consider the caps different, causing a negotiation
failure when caps are changing from caps with to caps without or the
other way around.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1826>
2022-03-02 10:27:47 +00:00
Jan Schmidt cebf769725 matroska-mux: If a stream has a TITLE tag, use it for the name.
If a title tag is pushed to a pad, store it as the Track name.
This means that players will use it as the human readable
description of the track, instead of something generic like 'Video'
or 'Subtitle'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1798>
2022-03-01 13:17:40 +00:00
Jan Schmidt 7efdc9c7f5 matroskademux: Don't parse Tracks element twice
If the tracks element was parsed from the SeekEntry, don't
parse it a second time and recreate tracks, as this
loses any tags that were read using the seek table.

If a genuinely new Tracks element is found, do read that
as it is needed for MSE support.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1798>
2022-03-01 13:17:40 +00:00
Vivia Nikolaidou b699feefee yadif.asm: Fix improper usage of LOAD macro
LOAD macro relies in m7 being zero for interleaving purposes. Using LOAD
on the m7 register makes it interleave with its new content instead of
with 0.

The effect of this bug was bobbing on some static lines that appeared
over fast-moving content.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1816>
2022-03-01 07:22:10 +00:00
Vivia Nikolaidou d499342f0d yadif.asm: Typo fixes in comments
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1816>
2022-03-01 07:22:10 +00:00
Vivia Nikolaidou 087ca88213 yadif: Fix bug in C implementation of CHECK
It was different compared to the corresponding part in both ffmpeg and
the asm implementation. Fixing this makes videotestsrc pattern=spokes
not jump at all when not using the asm optimisations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1816>
2022-03-01 07:22:10 +00:00