Commit graph

626 commits

Author SHA1 Message Date
George Kiagiadakis 8dd512fd9f tests/check/rtpsession: extend test_internal_sources_timeout
to verify that rtx SSRCs do not BYE after timeout

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/360

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3112>
2022-10-10 14:56:18 +00:00
Sebastian Dröge 72b6dabd32 rtpsession: Remember the corresponding media SSRC for RTX sources
This allows timing out the RTX source and sending BYE for it when the
actual media source belonging to it is timed out.

This change only applies to sending sources from this session.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3112>
2022-10-10 14:56:17 +00:00
Sebastian Dröge d5c072fadd rtpsource: Rename rtp_source_update_caps to rtp_source_update_send_caps
To make it clear that this is only used for sending RTP sources.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3112>
2022-10-10 14:56:17 +00:00
Sebastian Dröge 97a47341a7 rtpsession: Rename gst_rtp_session_sink_setcaps to gst_rtp_session_setcaps_recv_rtp
to make it clearer that this is for setting receiver caps and to make it
more consistent with gst_rtp_session_setcaps_send_rtp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3112>
2022-10-10 14:56:17 +00:00
Sebastian Dröge bacd92274d rtspsrc: Retry SETUP with non-compliant URL resolution on "Bad Request" and "Not found"
Various RTSP servers/cameras assume base and control URL to be simply
appended instead of being resolved according to the relative URL
resolution algorithm as mandated by the RTSP specification.

To work around this, try using such a non-compliant control URL if the
server didn't like the URL used in the first SETUP request.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3127>
2022-10-07 09:12:00 +00:00
Tim-Philipp Müller 99bbb1ef35 Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3115>
2022-10-04 03:57:31 +01:00
Tim-Philipp Müller 9820e58be6 Release 1.21.1 2022-10-04 01:18:20 +01:00
Tim-Philipp Müller c376d80e9b Update ChangeLogs for 1.21.1 2022-10-04 01:13:59 +01:00
Edward Hervey f2a1769236 qtdemux: Don't stop task when resetting
This is a regression that was introduced in
cca2f555d1 (yes, 9 years ago).

The only place where a demuxer streaming thread should be stopped is when the
sinkpad is deactivated from pull mode (i.e. PAUSED->READY).

Attempting to stop the task in this function would cause this to happen when a
FLUSH_STOP or STREAM_START event is received... which can cause deadlocks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3109>
2022-10-03 14:41:18 +02:00
Mathieu Duponchelle f8d8d67b8b splitmuxsrc: don't consider unlinked pads when deactivating part
If splitmuxsrc exposes multiple pads, but only one is linked, part pads
will never see an EOS event. This shouldn't prevent the part from being
eventually deactivated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3099>
2022-10-01 02:33:08 +00:00
Nirbheek Chauhan 0aa9d8ade6 rtspsrc: Fix usage of IPv6 connections in SETUP
If the SETUP request returns an IPv6 server address in the Transport
field, we would generate an incorrect URI, and multiudpsink would fail
to initialize:

```
     rtspsrc gstrtspsrc.c:9780:dump_key_value:<source>    key: 'Transport', value: 'RTP/AVP;unicast;source=fe80::dc27:25ff:fe5e:bd13:8080;client_port=62696-62697;server_port=4000-4001'
...
     rtspsrc gstrtspsrc.c:4595:gst_rtspsrc_stream_configure_udp_sinks:<source> configure RTP UDP sink for fe80::dc27:25ff:fe5e:bd13:8080:4000
...
multiudpsink gstmultiudpsink.c:1229:gst_multiudpsink_configure_client:<udpsink0> error: Invalid address family (got 23)
```

We can't look at stream->is_ipv6 because we can't rely on the server
returning the right value there. In the issue reported about this,
server reported itself as `KuP RTSP Server/0.1`, and the SDP was:

```
c=IN IP4
m=video 54608 RTP/AVP 96
a=rtpmap:96 H264/90000
```

So we need to parse the string value and figure out the family
ourselves.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1819>
2022-09-27 18:59:59 +00:00
Tim-Philipp Müller 02a8f9973b qtdemux: guard against timestamp calculation overflow in gap event loop
Could possibly cause an endless loop.

Fixes #1400.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3084>
2022-09-27 13:07:15 +00:00
Jan Schmidt 3c2c4bbe2c dashdemux2: fix mpd unit test expectations
Update unit test for some mpd cases that were reporting
timestamps including the period start time, while
dashdemux2 expects that it needs to add the period
start time itself.

Fix the tests to not expect the period start time
to be included.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3025>
2022-09-27 00:00:49 +00:00
Junsoo Park 699f2ebb45 dashdemux2: Set timestamp relative to period start
These values will be referred to as timestamp relative to period start
so need to subtract period start time from the values.

Fixes a problem with determining the start position when playing Live content
with SegmentTimeline, presentationTimeOffset and a non-0 period start time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3025>
2022-09-27 00:00:49 +00:00
Jakub Adam cccc7a12e1 vp9: check if libvpx supports high bit depth
Detect at runtime if libvpx is compiled with --enable-vp9-highbitdepth
and enable 10bit video formats in element caps accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3067>
2022-09-23 13:55:12 +02:00
Nirbheek Chauhan a0e6278dba meson: Use implicit builtin dirs in pkgconfig generation
Starting with Meson 0.62, meson automatically populates the variables
list in the pkgconfig file if you reference builtin directories in the
pkgconfig file (whether via a custom pkgconfig variable or elsewhere).
We need this, because ${prefix}/libexec is a hard-coded value which is
incorrect on, for example, Debian.

Bump requirement to 0.62, and remove version compares that retained
support for older Meson versions.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3061>
2022-09-21 21:08:11 +05:30
Seungha Yang a9144f5313 adaptivedemux2: Always wake up loop thread on unpause
Otherwise loop thread will sleep forever because
GstAdaptiveDemuxLoop.paused flag update is not signalled
when loop was marked as stopped already from other thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3057>
2022-09-21 09:26:22 +00:00
Jan Schmidt a03f3df626 adaptivedemux2: Rework input download wakeups
Change the way streams are woken up to download more data.

Instead of checking the level on tracks that are being
output as data is dequeued, calculate a 'wakeup time'
at which it should download more data, and wake up
the stream when the global output position crosses
that threshold.

For efficiency, compute the earliest wakeup time
for all streams and store it on the period, so the
output loop can quickly check only a single value
to decide if something needs waking up.

Does the same buffering as the previous method,
but ensures that as we approach the end of
one period, the next period continues incrementally
downloading data so that it is fully buffered when
the period starts.

Fixes issues with multi-period VOD content where
download of the second period resumes only after
the first period is completely drained.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3055>
2022-09-20 19:48:17 +00:00
Edward Hervey fdfa70997b hlsdemux2: Handle negative time mappings
Some servers can return playlists with "old" media playlists and different
Discont Sequence.

In those cases, the segment stream times would be negative when creating a new
time mapping. In order to properly handle such scenarios, shift the values to
stored accordingly to end up with non-negative reference stream time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3054>
2022-09-20 14:34:34 +00:00
Mart Raudsepp beece4e778 shout: fix minimum requirement to libshout >= 2.4.3
commit e64c6f0b93 added usage of the SHOUT_USAGE_UNKNOWN symbol, but this
became available in the Icecast-libshout 2.4.3 release, not 2.4.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3048>
2022-09-19 20:50:25 +03:00
Elliot Chen e76e98d109 v4l2videodec: add cap negotiation fail check in the capture configuration change
The capture configuration change may cause negotiation fail.
Need to check it to avoid enter the endless loop.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2960>
2022-09-17 21:21:22 +00:00
Thibault Saunier ebcaf35839 doc: Do not build plugins to build the doc
It is not actually necessary

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2954>
2022-09-15 20:11:46 +00:00
Tim-Philipp Müller 2ac5d687e1 tests: add a few more orc tests
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3029>
2022-09-15 12:14:56 +01:00
Edward Hervey 124f93a05d hlsdemux2: Fix crash on live playlist with single entry
If there is a single entry, we would end up computing a minimum distance of 0,
and would therefore read entries from after the segment array

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3024>
2022-09-14 15:14:08 +01:00
Zebediah Figura c4681ac428 meson: Build with -Wl,-z,nodelete to prevent unloading of dynamic libraries and plugins
GLib made the unfortunate decision to prevent libgobject from ever being
unloaded, which means that now any library which registers a static type
can't ever be unloaded either (and any library that depends on those,
ad nauseam).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/778>
2022-09-13 15:48:52 +00:00
Jan Schmidt e5e72ede26 adaptivedemux2: Always check bitrate in live
When advancing fragment in live, it's normal to return
GST_FLOW_EOS when playing at the live edge of the available
fragments. In that case, we still want to adjust bitrate
dynamically.

Fixes issue with dashdemux2 where the current bitrate of
each adaptation set is changed to the lowest one when
updating the mpd for a live stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3020>
2022-09-13 09:02:43 +00:00
Matt Crane e64a5b9a85 rtpjitterbuffer: Fix calculation of reference timestamp metadata
Add support for RTCP SRs that contain RTP timestamps later than the
current timestamps in the RTP stream packet buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3019>
2022-09-12 20:17:08 +00:00
Filip Hanes 29aec57ef6 pngenc: lower minimum width and height to 1x1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3003>
2022-09-09 09:59:56 +00:00
Edward Hervey 855dabb578 dashdemux2: Remove bogus limitation checks for duration fields
Just like for the seconds field, there are no limitations on the hours and
minutes fields. The specification for xml schema duration fields doesn't forbid
specifying durations with only (huge) minutes or hours values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2951>
2022-09-07 12:48:28 +00:00
Jan Schmidt 43209d0ee6 dashdemux2: Preserve current representation on live manifest updates
When updating a manifest during live playback, preserve the current
representation for each stream.

During update_fragment_info, if the current representation changed
because it couldn't be matched, trigger a caps change and new
header download.

This reverts commit e0e1db212f
and reapplies "dashdemux: Fix issue when manifest update sets slow start
without passing necessary header & caps changes downstream" with
changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2920>
2022-09-05 16:07:00 +00:00
Sebastian Dröge cc454f0fc3 rtpjitterbuffer: Add test for crash caused by removing timers twice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2973>
2022-09-03 09:26:24 +00:00
Sebastian Dröge 648b8f3362 rtpjitterbuffer: Make it more explicit that update_rtx_timers() takes ownership of the passed in timer
It is not valid anymore afterwards and must not be used, otherwise an
already freed pointer might be used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2973>
2022-09-03 09:26:24 +00:00
Sebastian Dröge e66f5e2423 rtpjitterbuffer: Don't shadow variable
While this didn't cause any problems in this context it is simply
confusing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2973>
2022-09-03 09:26:24 +00:00
Sebastian Dröge 0b19c457ca rtpjitterbuffer: Change RTX timer availability checks to assertions
It's impossible to end up in the corresponding code without a timer for
RTX packets because otherwise it would be an unsolicited RTX packet and
we would've already returned early.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2973>
2022-09-03 09:26:24 +00:00
Sebastian Dröge 2ca849499e rtpjitterbuffer: Only unschedule timers for late packets if they're not RTX packets and only once
Timers for RTX packets are dealt with later in update_rtx_timers(), and
timers for non-RTX packets would potentially also be unscheduled a
second time from there so avoid that.

Also don't shadow the timer variable from the outer scope but instead
make use of it directly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2973>
2022-09-03 09:26:24 +00:00
Patricia Muscalu 3c9e4f4886 rtph265: keep delta unit flag
Without this patch all buffers that pass the payloader
are marked as non-delta-unit buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2969>
2022-09-02 08:56:13 +00:00
Thibault Saunier 6a4425e46a meson: Call pkgconfig.generate in the loop where we declare plugins dependencies
Removing some copy pasted code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2970>
2022-09-01 21:17:35 +00:00
Thibault Saunier bc9c1e3956 meson: Namespace the plugins_doc_dep/libraries variables
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2970>
2022-09-01 21:17:35 +00:00
Thibault Saunier b5e90fe579 meson: Rename plugins list and make them "dependency" objects
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2970>
2022-09-01 21:17:35 +00:00
Raul Tambre e1d3612321 rtpjitterbuffer: remove lost timer for out of order packets
When receiving old packets remove the running lost timer if present.
This fixes incorrect reporting of a lost packet even if it arrived in time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2922>
2022-09-01 09:01:31 +00:00
Sebastian Dröge cbc6761199 rtpvp8depay: If configured to wait for keyframes after packet loss, also do that if incomplete frames are detected
This can happen if the data inside the packets is incomplete without the
seqnums being discontinuous because of ULPFEC being used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2947>
2022-08-31 08:58:03 +00:00
Stéphane Cerveau 6b1ffadb0c docs: disable in static build
Following gst-plugins-base, disable docs if static_build
in:
 - gstreamer
 - gst-plugins-good
 - gst-plugins-ugly
 - gst-libav
 - gstreamer-vaapi

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2529>
2022-08-30 14:46:28 +00:00
Jianhui Dai 625e74100d v4l2allocator: Fix invalid imported dmabuf fd
Fix a typo that set userptr to dmabuf fd. It leads to failure of
dmabuf-import io-mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2935>
2022-08-24 09:59:14 +00:00
Mathieu Duponchelle 8756f523d1 playback: add onvif metadata caps to raw caps
+ remove encoding from x-onvif-metadata caps output by qtdemux

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2889>
2022-08-24 12:21:18 +03:00
zhiyuan.liu ffebd52e46 isoff: Fix earliest pts field parse issue
earliest pts will be covered by first_offset field on version 0 case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2927>
2022-08-23 10:59:56 +00:00
Jan Alexander Steffens (heftig) 5ae3c9318d adaptivedemux2: Fix download helper with libsoup 3.0.x
libsoup 3.0.x dispatches using a single source attached when the session
is created, so we need to create the session with the same context that
our download thread is later using.

2.74 or 3.1 will dispatch a response using the context which sent the
request. However, for any context other than the one that created the
session, this will also create and destroy sources, so there's still
some slight performance benefit.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1384
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2913>
2022-08-18 20:16:18 +00:00
Jan Schmidt ba8f14e922 adaptivedemux2: Implement send_event() vfunc
Handle select-streams and seek events in an element
level send_event() vfunc, so they can be received
before any source pads are created.

This allows preferred streams to be selected before
segment downloading starts.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2912>
2022-08-18 15:30:05 +01:00
Jan Schmidt 4a6c2e6720 splitmuxsrc: Stop pad task before cleanup
When stopping the element, make sure the pad task
is stopped before destroying the part readers.

Closes a race where the pad task might access
a freed pointer.

Also add a guard against this sort of thing
by holding a ref to the reader in the pad loop.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2901>
2022-08-17 09:42:50 +10:00
Jan Schmidt c2fa0b50ce qtdemux: Avoid crash on reconfiguring.
When reconfiguring a stream that never created
an output pad, don't access a NULL GstPad pointer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2869>
2022-08-16 19:01:28 +00:00
Sebastian Dröge a3037eb453 qtdemux: Set parsed=true on ONVIF Timed Metadata caps
Inside MP4 the metadata must be properly parsed into frames and in
order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2897>
2022-08-16 18:11:53 +00:00
Nicolas Dufresne d126f65485 v4l2bufferpool: Fix debug trace
The tracing of the buffer pointer was done on the secondary pointer, which
does not match with other traces of the same buffer. This made the trace
confusing and less useful.

Fixes #1379

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2893>
2022-08-16 14:33:24 +00:00
Jan Schmidt f4f1819416 adaptivedemux2: Fix for period switching in live streams
When playing live, it's possible that one stream reaches
the end of the available playback window and goes to sleep
waiting for a manifest update, and the manifest update
introduces a new period. In that case, the sleeping
stream needs to wake up and go 'properly' EOS before we
can advance the input to the new period.

Accordingly, make sure that a stream's last_ret value
is not marked as EOS if it's just sleeping waiting for a live
manifest update.

Also fix the output loop to go back and re-check if it's
time to switch to the next period after dequeuing and
discarding an EOS event.

https://livesim.dashif.org/livesim/periods_20/testpic_2s/Manifest.mpd

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2895>
2022-08-16 12:39:58 +00:00
Hosang Lee 3cd79c4262 mssdemux2: Use gsturi structure to form fragment urls
Utilize gsturi to form fragment url paths.
A token query may contain the string "manifest" and this would lead
to improper url creations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2859>
2022-08-16 17:57:19 +09:00
Sebastian Dröge 8e77c8155c rtspsrc: Consider the actual control base URI also in case the connection URI contains a query string
That is, get rid of unnecessary and wrong special-casing.

This could always use gst_rtsp_url_get_request_uri_with_control() but as
we only have the control base URI as string it is easier to just call
gst_uri_join_strings().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2868>
2022-08-12 18:52:29 +00:00
Sebastian Dröge b0533d1ea0 qtdemux: Add reference timestamp meta with UTC times based on the ONVIF Export File Format CorrectStartTime box to outgoing buffers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2525>
2022-08-12 16:13:50 +00:00
Jan Schmidt 025e446470 hlsdemux2: Fix reference leak of variant stream
When switching back to the previous variant stream
in gst_hls_demux_change_playlist(), fix a couple of
paths that would leak a reference to the previous
variant.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2873>
2022-08-12 13:52:59 +00:00
Jan Schmidt 9db19a3b06 hlsdemux2: Don't leak the datetime in time map structs
Add a function to clean up GstHLSTimeMap structs
and free the ref on the optional associated GDateTime

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2873>
2022-08-12 13:52:59 +00:00
Jan Schmidt a242428532 hlsdemux2: Fix typefind leak and invalid memory access
When typefinding aggregates incoming data to a pending
typefind buffer and then succeeds in typefinding, it
leaks the aggregated buffer, and leaves the caller
accessing an unreffed buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2873>
2022-08-12 13:52:59 +00:00
Jan Schmidt a6eb725413 hlsdemux2: m3u8: Fix memory leaks on parsing
Fix memory leaks when parsing of an m3u8 file is
incomplete, with EXTINF or EXT-X-PROGRAM-DATE-TIME
directives, but no segment url.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2873>
2022-08-12 13:52:59 +00:00
Jan Schmidt 0ff317f107 hlsdemux2: m3u8: Fix memory leak
Clear the GValue holding intermediate GstStructure field
data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2873>
2022-08-12 13:52:59 +00:00
Jan Schmidt fd64e8c7ed adaptivedemux2: Fix uninitialised memory usage in debug
Fix printing uninitialised memory by clearing the
GstAdaptiveDemuxClock structure when allocating.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2873>
2022-08-12 13:52:59 +00:00
Nirbheek Chauhan d8c4ebccab rtpst2022-1-fecenc: Drain column packets on EOS
Otherwise we won't send the protection packets for the last few
packets when a stream ends.

Also send EOS on the FEC src row pad immediately, and on the FEC src
column pad after draining is complete. This makes it so that the FEC
src pads on rtpbin behave the same way as the RTCP src pads on rtpbin
when EOS is received on the send_rtp_sink pad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2863>
2022-08-12 12:59:19 +00:00
Edward Hervey 63dcee34fb qtdemux: Don't use invalid values from failed trex parsing
If parsing the fragment default values (`trex` atom) failed, don't try to
compute a bogus sample_description_id value.

Fixes #1369

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2860>
2022-08-11 08:50:34 +02:00
Piotr Brzeziński c883a9f54b videoflip: Add support for 10/12bit planar formats
Implements support for I420, I422 and Y444 in 10/12 bit LE/BE variants.
I422 is handled separately from the rest, as it needs to consider
the endianness of the current format during most transforms.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2788>
2022-08-10 10:52:27 +00:00
Haihua Hu 82025897c4 alpha: fix stride issue when out buffer has padding on right
if outbuf has padding on right, need jump to next line use stride,
otherwise downstream element will show a wrong picture when use the
same stride

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2842>
2022-08-09 13:04:11 +08:00
Jan Schmidt edf84a7119 hlsdemux2: Requeue header buffer when restarting fragment
When returning GST_ADAPTIVE_DEMUX_FLOW_RESTART_FRAGMENT
for the first segment data, we might need to requeue the
header.

This was leading to occasional prerolling stalls on
HLS live streams with renditions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2849>
2022-08-08 15:52:22 +00:00
Jan Schmidt 91e43048cf hlsdemux2: Fix buffer leak when resynching
Unref the buffer in gst_hls_demux_handle_buffer() when
returning GST_ADAPTIVE_DEMUX_FLOW_LOST_SYNC

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2849>
2022-08-08 15:52:22 +00:00
Jan Schmidt b7e662f400 adaptivedemux2: Fix a small race on shutdown
Make sure gst_adaptive_demux_loop_cancel_call()
never tries to operate on an invalidated main context. Make
sure to clear the main context pointer while holding the lock,
and to check it in gst_adaptive_demux_loop_cancel_call()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2847>
2022-08-05 23:36:49 +01:00
Jan Schmidt d60c2f46e2 adaptivedemux2-stream: Silence a compiler warning
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:49 +01:00
Jan Schmidt 1060f72f90 adaptivedemux2: Move internal FLOW_SWITCH return value.
Move the internal-only FLOW_SWITCH custom return value
to GST_FLOW_CUSTOM_SUCCESS+2 to avoid collision with
GST_ADAPTIVE_DEMUX_FLOW_LOST_SYNC

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:33 +01:00
Edward Hervey 0857f5af5f adaptivedemux2: Modify custom sync loss flow return
Make it a custom sucess and not an error

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:33 +01:00
Edward Hervey 6934362817 hlsdemux2: Always check DSN if required
We don't want to consider the candidate as being before the playlist if the DSN
don't match

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:27 +01:00
Edward Hervey 5d0b112c0c adaptivedemux2/hlsdemux2: Handle loss of sync when dowloading.
Media playlist updates and fragment downloads happen in an interleaved
fashion. When a media playlist update fails *while* a segment is being
downloaded, this means we lost synchronization.

Properly propagate and handle this

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:27 +01:00
Edward Hervey 6a9bdceb5e hlsdemux2: Fix initial playlist setup.
There is now only a single case where we setup the initial playlist to 0, which
is for the very first variant stream.

Rendition streams will have the initial playlist "synchronized" against the
variant stream media playlist.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:27 +01:00
Edward Hervey 9ca1dcd563 hlsdemux2: Handle loss of synchronization in live
Loss of synchronization happens when the updated media playlist has no
relationship to the previous ones. This could happen because of network issues,
server issues, etc...

When this happens, we take no chance and "reset" ourselves so that we can "seek
back to live" against the new updated playlists.

Since this happens at the "media playlist update" level, make sure the custom
flow return is propagated up.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:27 +01:00
Edward Hervey abe5a06421 adaptivedemux2: Handle synchronously to lost sync
We are already in the main scheduler thread, therefore we can do the "seek back
to live" directly. This also avoids other pending actions to take place.

Also handle the loss of sync when doing manifest updates.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:27 +01:00
Edward Hervey 1aab9db803 hlsdemux2: Prune time maps when possible
Add a new method to prune unused time mappings (i.e. which aren't used by any
current media playlist).

Do that when doing flushing seeks. Could be used in other places later too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:21 +01:00
Edward Hervey c20ad629c7 hlsdemux2: Allow DSN mismatches when re-syncing playlists
Some providers provide completely incompatible DSN across bitrates/renditions,
but do keep MSN consistent.

If we fail to synchronize playlist with DSN, retry without the DSN taken into
account.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
2022-08-04 14:49:12 +01:00
Jan Schmidt da65a7b0ba adaptivedemux2: Fixes for period switching in the output loop
Close some race conditions in switching to the next period,
by ensuring the tracks are completely drained first and by
not outputting EOS events to the output source pad
if there is another period pending.

Fixes Manifest_MultiPeriod_1080p.mpd some more.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2838>
2022-08-04 13:43:57 +01:00
Jan Schmidt de7e2c9b6b adaptivedemux2: stream: Set period has_next_period flag before EOS
Before sending EOS, update the period's has_next_period
flag and/or create the next period. This closes a race
where the output loop might receive the EOS event
and either push it downstream (causing premature EOS),
or receive it and try and switch to the next period
before that period is completely set up.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2838>
2022-08-04 13:43:51 +01:00
Jan Schmidt 1863082efa adaptivedemux2: period: Rename 'closed' flag to 'has_next_period'
The flag is used to tell the output loop that a
next period is present, since the output loop
can't call the gst_adaptive_demux_has_next_period()
method.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2838>
2022-08-04 13:43:36 +01:00
Jan Schmidt e89d84a178 adaptivedemux2: Recheck for a pending track on drain
When a track is completely drained and EOS, but
there's a pending track on the slot loop again
to switch to that track.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2838>
2022-08-04 13:43:31 +01:00
Jan Schmidt f33fe73bb7 adaptivedemux2: Check stream selected instead of state
When combining stream flows, ignore streams that
are not selected, instead of checking whether
the stream state has changed yet.

Fixes another issue with dashdemux2 where it fails to
change to the next period when playing content with
several video, audio and text streams, as with
Manifest_MultiPeriod_1080p.mpd when seeking to 730
just before the end of the first period.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2838>
2022-08-04 13:43:25 +01:00
Nirbheek Chauhan 5da9f62313 rtsp+rtmp: Forward warning added to tls-validation-flags to our users
With the 2.72 release, glib-networking developers have decided that
TLS certificate validation cannot be implemented correctly by them, so
they've deprecated it.

In a nutshell: a cert can have several validation errors, but there
are no guarantees that the TLS backend will return all those errors,
and things are made even more complicated by the fact that the list of
errors might refer to certs that are added for backwards-compat and
won't actually be used by the TLS library.

Our best option is to ignore the deprecation and pass the warning onto
users so they can make an appropriate security decision regarding
this.

We can't deprecate the tls-validation-flags property because it is
very useful when connecting to RTSP cameras that will never get
updates to fix certificate errors.

Relevant upstream merge requests / issues:

https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2214

https://gitlab.gnome.org/GNOME/glib-networking/-/issues/179

https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/193

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2494>
2022-07-30 11:27:12 +00:00
Mark Nauwelaerts b5707e2371 videobox: avoid dropping caps fields for passthrough caps transform
Fixes potential negotiation failure in case downstream element
is a bit picky regarding the fields in question.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2786>
2022-07-29 18:44:13 +00:00
Adrian Fiergolski 8e6872a36e videoflip: Fix caps negotiation when method is selected
The caps negotiation should respect the selected method to the test pipeline below works properly.
gst-launch-1.0 videotestsrc ! video/x-raw,width=320,height=600 ! videoflip method=clockwise ! video/x-raw,width=600,height=320 ! fakesink

Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2803>
2022-07-28 00:00:47 +00:00
fduncanh 197b72f32a v4l2object.c: add support for Apple's full-range bt709 colorspace variant
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2793>
2022-07-26 15:14:41 +00:00
Elliot Chen e0564b04c6 v4l2: fix the critical log when unreference the buffer with no data
In the trick mode, driver may queue a valid buffer follow by an
empty buffer which has no valid data to indicate EOS.For the empty
buffer whose memory is multi-plane, need to resize it before
unreference it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2731>
2022-07-25 16:44:05 +08:00
Sebastian Dröge 1728f8b72a qt: Fix another instance of Qt/GStreamer both defining GLsync differently
In file included from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/gstreamer-1.0/gst/gl/gstglfuncs.h:87,
                 from ../gst-plugins-good-1.20.3/ext/qt/qtglrenderer.cc:14:
../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/gstreamer-1.0/gst/gl/glprototypes/gstgl_compat.h:40:18: error: conflicting declaration 'typedef void* GLsync'
   40 | typedef gpointer GLsync;
      |                  ^~~~~~
In file included from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtGui/qopengl.h:127,
                 from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtQuick/qsggeometry.h:44,
                 from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtQuick/qsgnode.h:43,
                 from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtQuick/qsgrendererinterface.h:43,
                 from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtQuick/qquickwindow.h:44,
                 from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtQuick/QQuickWindow:1,
                 from ../gst-plugins-good-1.20.3/ext/qt/qtglrenderer.cc:6:
../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtGui/qopengles2ext.h:24:26: note: previous declaration as 'typedef struct __GLsync* GLsync'
   24 | typedef struct __GLsync *GLsync;
      |                          ^~~~~~

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2763>
2022-07-18 07:45:22 +00:00
Nirbheek Chauhan 41bf3f6c1b osxaudio: Fix deprecation in macOS 12.0
kAudioObjectPropertyElementMaster has been renamed to
kAudioObjectPropertyElementMain

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2761>
2022-07-16 06:16:17 +00:00
Jan Schmidt ab459f0528 splitmuxsink: Fix memory leak
Fix a leak of the buffer info struct when reaching
EOS without data on the reference input.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2751>
2022-07-12 11:22:33 +00:00
Sebastian Dröge eb0746ba97 rtpjitterbuffer: Fix calculation of RFC7273 RTP time period start
This has to be based directly on the current estimated clock time and
has to allow for negative period starts.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2655>
2022-07-11 15:33:42 +00:00
Seungha Yang b233df3537 splitmuxsink: Don't crash on EOS without buffer
Fix a case where upstream pushed EOS without buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2174>
2022-07-05 11:33:35 +00:00
Thibault Saunier 339f950e79 rtprtx: Fix copying extension headers
There was a typo leading to reading memory from the buffer we were
writing to.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2696>
2022-07-04 19:20:57 +00:00
fduncanh 735723c230 v4l2videodec: replace multiple decoder bug warnings with single one
Achieve this by dropping frames after a drain if the driver failed to so.
This works around RaspberryPi driver issue [1].

[1] https://github.com/raspberrypi/linux/issues/5059#issuecomment-

Fixes #1103

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2518>
2022-07-02 23:56:00 +00:00
Tim-Philipp Müller 90090dc13b tests: udpsink: make test work in environments without IPv6
Part-fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/939

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2659>
2022-07-02 11:57:31 +00:00
fduncanh dfeb8198e4 v4l2videodec: replace multiple decoder bug warnings by a single warning
(warning due to incorrectly dropped frames at initial caps adjustment)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2517>
2022-06-29 19:50:15 +00:00
Jan Schmidt 0af4a53bc2 adaptivedemux2: Ignore stopped stream flow state
When calculating the combined stream flow state
for a period, don't consider stopped streams.

Fixes switching to the next period in DASH streams
with multiple video/audio/subtitle streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2684>
2022-06-29 16:35:26 +01:00
Jan Schmidt a369448b0c adaptivedemux2: Clean up stream parsebins on finalize
Remove the parsebin for a stream from the overall
bin when cleaning up the stream, to avoid
keeping around old ones when moving between periods

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2676>
2022-06-29 14:33:30 +00:00
Jan Schmidt 63d3ba4dfb adaptivedemux2: Fix memory leaks and use-after-free
Fix various small memory leaks, and an invalid
access to GstEvent after giving away the ref
via gst_pad_push_event()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2676>
2022-06-29 14:33:30 +00:00
Jan Schmidt 4b7622b377 hlsdemux2: Fix potential segfault
Fix a potential segfault if we receive a ISO-FF stream
with moof before moov.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2676>
2022-06-29 14:33:30 +00:00
Jan Schmidt b2944c36ca hlsdemux2: Fix memory leaks
Clean up various memory leaks

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2676>
2022-06-29 14:33:30 +00:00
Jan Schmidt 76e0333213 hlsdemux2: Free current_segment on finalize
Avoid a memory leak by making sure to release the
current segment on exit if non-NULL

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2676>
2022-06-29 14:33:30 +00:00
Tim-Philipp Müller 9272943bc7 coding style: allow declarations after statement
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1243/
and https://gitlab.freedesktop.org/gstreamer/gstreamer-project/-/issues/78

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2683>
2022-06-29 13:40:25 +00:00
Jan Schmidt 61e4f058ef adaptivedemux2: track: Fix buffering time calc before output
Use the lowest track input time as the output
time when calculating track buffering levels
before anything has been dequeued.

Fixes multi-period DASH not advancing to the
next period in some cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2650>
2022-06-28 18:34:31 +00:00
Jan Schmidt 16a04f7697 adaptivedemux2: track: Add period number to most debug statements
Store the period number the track belongs to, and
add it in various debug statements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2650>
2022-06-28 18:34:31 +00:00
Jan Schmidt e1559d26d0 adaptivedemux2: stream: Don't take TRACKS_LOCK when sending EOS event
The stream tracks list can't change while we're
iterating it from the scheduling thread,
and the event handler immediately takes the
tracks lock, causing a deadlock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2650>
2022-06-28 18:34:31 +00:00
Edward Hervey e9f8c7d33a hlsdemux2: Improve media playlist updates
* When dealing with rendition streams, we attempt to synchronize the media
  playlist against the variant stream. This helps with speeding up the correct
  initial fragment search and avoids issues when streams at activated at a much
  later time.
* Also add checks for variant stream existence before attempting to use them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:24 +00:00
Edward Hervey 0a658840da hlsdemux2: Only seek on selected streams
When handling seeks, there is no need to seek on unselected streams. If they
later get activated they will be properly seek onto

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:24 +00:00
Edward Hervey 787dbfd4e4 tests: check: Update hlsdemux2 tests for playlist changes
We no longer do auto-magic fallbacks when synchronizing a disconnected
playlist. It is handled at a higher level.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:24 +00:00
Edward Hervey 34a7710762 hlsdemux2: Fix debug return statement
Due to latest commits res could have been NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:24 +00:00
Edward Hervey 82bd65e711 hlsdemux2: No longer re-add segments from before the playlist
When updating playlists, there is a possibility that the playlists don't
perfectly align, but the last entry of the previous playlist is *just* before
the first entry of the new playlist.

In those cases, we still can transfer the timing information from one playlist
to another, but we do not want to return that segment as being the matching one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Edward Hervey b9effe04e3 hlsdemux2: Use variant stream as support for synchronizing playlists
When matching playlists, there is a possibility that rendition streams will not
have been updated in time (for example because that stream started later, or
playback was paused). This would cause several playback failures and seeking
failures.

In order to still fall back on our feet, attempt to synchronize that rendition
playlist against the current variant playlist. This will attempt to match the
stream time using SN/DNS/PDT/...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Edward Hervey 87ab729551 hlsdemux2: Detect synchronization loss
If we have been updating too slowly and have gone out of the current live
window, inform the baseclass accordingly.

This is different from the case where we have been updating quicker than what
the server provides.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Edward Hervey 9cdadf6d08 hlsdemux2: More improvement/fixes to position tracking
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Edward Hervey d88d7d5b55 adaptivedemux2: Handle loss of synchronization
Add a new custom GstFlowReturn so that subclasses can notify that they have lost
live synchronization.

When that happens, do a flushing seek back to the live position

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Edward Hervey 37b17ba0eb adaptivedemux2: Fix SNAP seek handling
* Since only flushing seeks are allowed, the "current" position is always the
  global output position (and not "some" stream current position).

* In terms of figuring out to which stream to "snap" to, we can send it to any
  selected stream. Removes the requirement of this function to a specific output
  pad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Edward Hervey 5271603852 hlsdemux2: Fix position tracking
Remove the "pending advance" hack and instead rely on the base stream current
position to track our position (instead of a potentially NULL "current
segment").

Also ensure the media playlists are always refreshed with valid stream time,
even if there is no current segment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Edward Hervey 8fd2dcd266 hlsdemux2: Add a new method to synchronize two media playlist
This allows transfering the stream time of the playlist to an updated
variant/rendition.

This allows updating that information without having a "current segment"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Edward Hervey 4eac7f0e06 adaptivedemux2: Initialize and use stream start/current position
The stream start and current position would be properly set when seeking or
activating a stream after playback started. But it would never be properly
initialized.

Set it to NONE initially to indicate to subclasses that no position has been
tracked yet. This will allow them to detect initial stream usage.

Futhermore, once the initial streams setup is done, make sure that it is set to
a valid initial value:
* The minimum stream time in live
* Or else the period start

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>
2022-06-28 17:59:23 +00:00
Nicolas Dufresne 7c40fcb66e v4l2videodec: Fix activation of internal pool
If the driver does not support VIDIOC_CREATE_BUFS ioctl, the pool
configuration may get changed, which requires a validation. This would
fail to activate a pool in a case it shouldn't normally fail unless we
are out of memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2456>
2022-06-28 16:19:53 +00:00
Tim-Philipp Müller afc94046ba dv, opusparse: fix duplicate symbols in static build
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1262

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2670>
2022-06-28 01:29:06 +01:00
Tim-Philipp Müller c895cdbec8 tests: skip unit tests for dependency-less elements that have been disabled
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1136

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2660>
2022-06-27 07:05:00 +00:00
Tim-Philipp Müller 0e551871c4 examples: don't try and build jack examples if jack was disabled
Fixes meson build ERROR: Unknown variable "libjack_dep".

Fixes #1301

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2656>
2022-06-24 16:00:37 +00:00
Marc Leeman db5a4b490d rtpsession: properly initialise favor-new property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2625>
2022-06-17 13:05:18 +00:00
Edward Hervey 74f25cca31 hlsdemux2: Look for mpegts synchronization point further
Some mpeg-ts streams have extra data at the beginning. While it's not ideal, we
should be able to cope with it.

Therefore increase the initial search window for at least 4 consecutive
synchronization points to 1kB.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2626>
2022-06-17 12:30:09 +00:00
Sebastian Dröge cf887f1b8e matroskademux: Avoid integer-overflow resulting in heap corruption in WavPack header handling code
blocksize + WAVPACK4_HEADER_SIZE might overflow gsize, which then
results in allocating a very small buffer. Into that buffer blocksize
data is memcpy'd later which then causes out of bound writes and can
potentially lead to anything from crashes to remote code execution.

Thanks to Adam Doupe for analyzing and reporting the issue.

CVE: CVE-2022-1920

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

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2612>
2022-06-15 18:35:12 +00:00
Sebastian Dröge 14d306da6d qtdemux: Fix integer overflows in zlib 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 200MB 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 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: tbd

https://gstreamer.freedesktop.org/security/sa-2022-0003.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 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
Piotr Brzeziński 0a2c490723 adaptivedemux2: Prevent duplicate symbols on static builds
Uses prelude header files with #defines to rename DASH and MSS
symbols duplicated in their old standalone versions.
Also redefines soup-related functions when building it for
adaptivedemux2 to prevent symbol conflicts there.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2534>
2022-06-15 01:13:16 +00:00
Jan Schmidt 6e48a3ec28 adaptivedemux2: Improve reverse playback buffering.
In reverse playback, store the lowest running time in each GOP
as the input_time for buffering purposes. That means we end up
storing at least a complete GOP before declaring buffering
100%

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2510>
2022-06-14 13:06:49 +01:00
Jan Schmidt a4a805312d adaptivedemux2: reverse playback running times
Account for running time moving non-monotonically in
reverse playback by tracking the highest running time
seen at each point.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2510>
2022-06-14 13:06:49 +01: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
Ignacio Casal Quinteiro 408f37c1d9 osxaudio: remove usage of goto
It is easier to follow the code without the goto now

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2251>
2022-06-08 06:28:17 +00:00
Ignacio Casal Quinteiro caa5972abd osxaudio: support hidden devices
macOS features hidden devices. These are devices that will
not be shown in the macOS UIs and that cannot be retrieved
without having the specific UID of the hidden device. There
are cases when you might want to have a hidden device, for example
when having a virtual speaker that forwards the data to a virtual
hidden input device from which you can then grab the audio.
The blackhole project supports these hidden devices and
this patch provides a way that if the device id is a hidden
device it will use it instead of check the hardware list of devices
to understand if the device is valid.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2251>
2022-06-08 06:28:17 +00:00
Ignacio Casal Quinteiro 243f8e8882 osx: fix indent
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2251>
2022-06-08 06:28:17 +00:00
Ignacio Casal Quinteiro 57fed3c911 osxaudio: iterate device only if needed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2251>
2022-06-08 06:28:17 +00:00
Ignacio Casal Quinteiro a4a4d295a1 osxaudio: reduce scope of default device id variable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2251>
2022-06-08 06:28:17 +00:00
Bastien Nocera e37c462f87 gtk: Fix double-free when OpenGL can't be initialised
gtk_gl_area_get_error() doesn't return a copy of the error, but just the
error. If initialising OpenGL fails, then GtkGstGLWidget will consume
the error, and cause GTK to try and display freed memory.

==50914== Invalid read of size 8
==50914==    at 0x4C4CB8A: gtk_gl_area_draw_error_screen (gtkglarea.c:663)
==50914==    by 0x4C4CB8A: gtk_gl_area_draw (gtkglarea.c:687)
==50914==    by 0x4E061CA: gtk_widget_draw_internal (gtkwidget.c:7084)
==50914==    by 0x4BAEFB1: gtk_container_propagate_draw (gtkcontainer.c:3854)
==50914==    by 0x4D4B6BF: gtk_stack_render (gtkstack.c:2207)
==50914==    by 0x4BB4B03: gtk_css_custom_gadget_draw (gtkcsscustomgadget.c:159)
==50914==    by 0x4BBA4C4: gtk_css_gadget_draw (gtkcssgadget.c:885)
==50914==    by 0x4D4D780: gtk_stack_draw (gtkstack.c:2119)
==50914==    by 0x4E061CA: gtk_widget_draw_internal (gtkwidget.c:7084)
==50914==    by 0x4BAEFB1: gtk_container_propagate_draw (gtkcontainer.c:3854)
==50914==    by 0x4BAF0C3: gtk_container_draw (gtkcontainer.c:3674)
==50914==    by 0x4E061CA: gtk_widget_draw_internal (gtkwidget.c:7084)
==50914==    by 0x4BAEFB1: gtk_container_propagate_draw (gtkcontainer.c:3854)
==50914==  Address 0x187a0818 is 8 bytes inside a block of size 16 free'd
==50914==    at 0x48480E4: free (vg_replace_malloc.c:872)
==50914==    by 0x49A5B8C: g_free (gmem.c:218)
==50914==    by 0x49C1013: g_slice_free1 (gslice.c:1183)
==50914==    by 0x4990DE4: g_error_free (gerror.c:870)
==50914==    by 0x4990FE9: g_clear_error (gerror.c:1052)
==50914==    by 0x1A489780: _get_gl_context (gtkgstglwidget.c:540)
==50914==    by 0x1A4863CB: gst_gtk_invoke_func (gstgtkutils.c:39)
==50914==    by 0x49A3834: g_main_context_invoke_full (gmain.c:6137)
==50914==    by 0x1A486450: gst_gtk_invoke_on_main (gstgtkutils.c:59)
==50914==    by 0x1A48A29E: gtk_gst_gl_widget_init_winsys (gtkgstglwidget.c:632)
==50914==    by 0x1A4887E7: gst_gtk_gl_sink_start (gstgtkglsink.c:267)
==50914==    by 0x6579810: gst_base_sink_change_state (gstbasesink.c:5662)
==50914==  Block was alloc'd at
==50914==    at 0x484586F: malloc (vg_replace_malloc.c:381)
==50914==    by 0x49A9278: g_malloc (gmem.c:125)
==50914==    by 0x49C1BA5: g_slice_alloc (gslice.c:1072)
==50914==    by 0x49C3BCC: g_slice_alloc0 (gslice.c:1098)
==50914==    by 0x499096B: g_error_allocate (gerror.c:708)
==50914==    by 0x4990AF1: UnknownInlinedFun (gerror.c:722)
==50914==    by 0x4990AF1: g_error_copy (gerror.c:892)
==50914==    by 0x4C4B9F9: gtk_gl_area_set_error (gtkglarea.c:1036)
==50914==    by 0x4C4BAF7: gtk_gl_area_real_create_context (gtkglarea.c:346)
==50914==    by 0x4B21B28: _gtk_marshal_OBJECT__VOIDv (gtkmarshalers.c:2730)
==50914==    by 0x4920B78: UnknownInlinedFun (gclosure.c:893)
==50914==    by 0x4920B78: g_signal_emit_valist (gsignal.c:3406)
==50914==    by 0x4920CB2: g_signal_emit (gsignal.c:3553)
==50914==    by 0x4C4B927: gtk_gl_area_realize (gtkglarea.c:308)

Reproduced by running:
MESA_GL_VERSION_OVERRIDE=2.7 totem

See https://gitlab.gnome.org/GNOME/totem/-/issues/522

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2565>
2022-06-07 17:36:26 +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
Stéphane Cerveau c3bb04f779 soup: fix soup debug category
Use soup debug category in souploader
for soup plugin element load.

Inititalize properly soup utils category.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2535>
2022-06-02 12:55:13 +00:00
Seungha Yang 238ce301b6 hlsdemux2: Adjust debug log level
HLS manifest might not be represented by a single common caps
when different codecs are mixed in a playlist, but it
does not seem to be a critical issue we need to warn.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2516>
2022-06-01 14:32:55 +00:00
Stéphane Cerveau 6b55f97529 adaptivedemux2: fix plugin/element init
In case of per features registration such as the
customizable gstreamer-full library, each
element should check that the soup library can be loaded to
facilitate the element registration.

Initialize the debug categories properly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2348>
2022-05-30 13:13:48 +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
Nirbheek Chauhan a6db1a4c81 jack: Always use jack_free as specified by the docs
Fixes a crash on Windows due to a CRT mismatch. The JACK installation
still uses MSVCRT, and we the Universal CRT for both MinGW and MSVC.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2497>
2022-05-28 11:34:23 +00:00
Nirbheek Chauhan 4865f36344 jack: Add support for detecting libjack on Windows
No source code changes were necessary to get the plugin working on
Windows with MSVC.

Run QJackCtl and audiotestsrc ! jackaudiosink just works.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2497>
2022-05-28 11:34:23 +00:00
Hou Qi 7f2fb3b783 v4l2: Reset transfer in gst_v4l2_object_acquire_format()
get_colorspace() checks input caps transfer when mapping V4L2_XFER_FUNC_709
back to V4L2_COLORSPACE_BT2020 and GST_VIDEO_TRANSFER_BT2020_12. After
receiving source change event, decoder will G_FMT and S_FMT again. So need
to reset transfer when acquiring format to avoid using the old transfer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2475>
2022-05-26 17:09:28 +00: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
Stéphane Cerveau 39b13fcdbd soup: Fix plugin/element init
In case of per features registration such as the
customizable gstreamer-full library, each
element should check that the soup library can be loaded to
facilitate the element registration.

Initialize the debug category properly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2349>
2022-05-25 09:33:56 +02:00
Eli Schwartz 79c3bbc2ed meson: use better zlib dependency fallback
zlib is required, and if it isn't found it is checked several ways and
then forced via subproject(). This code was added in commit
b93e37592a, to account for systems where
zlib doesn't have pkg-config files installed.

But Meson already does dependency fallback, and also, since 0.54.0, does
the in-between checks for find_library('z') and has_header('zlib.h') via
the "system" type dependency. Simplify dependency lookup by marking it
as required, which also makes sure that the console log doesn't
confusingly list "not found".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2484>
2022-05-24 19:39:29 +00:00
Nicolas Dufresne 6d6ebbbb36 v4l2videodec: Fix missing handling of resolution-change
The pool process function may poll and get the resolution-change event
whenever it is not possible to share our buffers. This typically happen
when downstream does not support GstVideoMeta.

Not handling this would cause the decoder thread to exit silently and the
pipeline to stall.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2457>
2022-05-24 18:02:12 +00:00
Nicolas Dufresne 4e441417b8 v4l2videodec: Downgrade to info resolution-change trace
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2457>
2022-05-24 18:02:12 +00:00
Tim-Philipp Müller e64c6f0b93 shout2: fix compiler warnings and bump req to libshout >= 2.4.2
Fix compiler warnings with latest libshout version (2.4.6).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2473>
2022-05-23 20:23:38 +01:00
László Károlyi fedb48c68f shout2send: Adding send-title-info and user-agent options
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2420>
2022-05-23 16:01:48 +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
Hou Qi 85b53bb65d v4l2: set default resolution if caps has no such information
Output may attemp to set the width and height to zero values if
caps has no such information, which will cause capture get invalid
dimensions. Then decoder reports negotiation failure.

So need to set default resolution if caps has no such information.
Real values can be set again until source change event is signaled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2400>
2022-05-20 12:23:40 +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
Guillaume Desmottes aa3b6a11e0 vpxenc: enforce strictly increasing pts
From vpx_codec_encode() documentation:
  "The presentation time stamp (PTS) MUST be strictly increasing."

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2405>
2022-05-12 13:00:53 +02:00
Guillaume Desmottes 10b837ae5e vpxenc: conver input pts to running time
The input pts needs to be strictly increasing, see vpx_codec_encode() doc, so convert it to
running time as we don't want to reset the encoder for each segment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2405>
2022-05-12 13:00:53 +02:00
Guillaume Desmottes 1e829696e8 vpxenc: fix crash if encoder produces unmatching ts
If for some reason the encoder produces frames with a pts higher than
the input one, we were dropping all the video encoder frames and ended
up crashing when trying to access the pts of a NULL pointer returned by
gst_video_encoder_get_oldest_frame().

I hit this scenario by feeding a decreasing timestamp to vp8enc which
seem to confuse the encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2405>
2022-05-12 13:00:53 +02:00
Nicolas Dufresne 522f19e013 v4l2videoenc: Setup crop rectangle if needed
Hantro H1 and Rockchip VEPU2 drivers will pad the width/height to a
multiple of 16. In order to obtain the right JPEG size, the image needs
to be cropped using the S_SELECTION API. This support is added as best
effort since older drivers may emulate this by looking at the capture
queue width/height.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2329>
2022-05-07 11:35:14 +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
Edward Hervey 7c9eb0335f mssdemux2: Don't expose/use streams we can't handle yet
Avoids issues further down

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2319>
2022-04-28 10:45:37 +00:00
Edward Hervey 2ec79418df mssdemux2: Ensure stream/track uniqueness
If there is more than one track of the same type (say audio), we would end up
creating several stream/types with the same name.

Instead use the MSS stream name property to make them unique

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2319>
2022-04-28 10:45:37 +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
Camilo Celis Guzman 5eadde319c rtphdrextsdes: fixup test trying to g_free a local variable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2235>
2022-04-22 08:41:59 +00:00
Edward Hervey 964ee0299d hls/m3u8: Fix starting segment for live playlist
RFC 8216 6.3.3 "Playing the Media Playlist File" : states that for live media
playlists "the client SHOULD NOT choose a segment that starts less than three
target durations from the end of the Playlist file"

This is an off-by-one error. Since we are looking for the "index" of the
segment, we need to subtract 1 from the searched position.

Ex: For a playlist with 12 entries, we want to start playback on the 9th segment
... which is at index 8.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2259>
2022-04-22 08:06:27 +00:00
Edward Hervey 8f2d347559 hls: Relax webvtt checks
If no hour field is present (which is allowed), the remaining data can be less
than 15 character.

Fix time translation failures if the hour field wasn't present

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2248>
2022-04-20 17:47:00 +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