Commit graph

116676 commits

Author SHA1 Message Date
Tim-Philipp Müller e49b86e82e Release 1.22.11 2024-03-19 22:01:08 +01:00
Mark Nauwelaerts 682c749ac1 dvdspu: avoid null dereference
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6390>
2024-03-18 20:37:12 +00:00
Matthew Waters a81772f9f5 vulkan/wayland: use xdg_wm_base when available
wl_shell is deprecated and has been removed from some compositors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6396>
2024-03-18 17:44:50 +01:00
Matthew Waters 7d7ad5682b vulkan/wayland: provide a dummy registry global_remove function
Even if we don't care about any global objects being removed, wayland
will still error if globals are removed without a corresponding listener
set up for them.  e.g. wl_output hotplugging

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6396>
2024-03-18 17:44:34 +01:00
Matthew Waters 1eb5217fd1 vulkan/wayland: rename debug category to mention wayland instead of XCB
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6396>
2024-03-18 17:44:26 +01:00
Haihua Hu 6a71f0e99d v4l2src: fix cannot reuse current caps when fixate caps in negotiation
when regotiation happens, v4l2src will check if it can reuse current caps,
but we need check if current caps is subset of all query caps from downstream
instead of check it with query caps one by one.

Assuming that the current caps is not the subset of first caps from query caps,
it will go to try fmt. when try fmt success, v4l2src will make pending_set_fmt
to TRUE and going to reset.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6393>
2024-03-18 15:30:01 +01:00
Seungha Yang 35b2a1e14b asio: Fix {input,output}-channels property handling
Fixing regression introduced by the commit 06dc931b52

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6371>
2024-03-14 13:26:54 +00:00
Sebastian Dröge 861af55188 ptp: Initialize expected DELAY_REQ seqnum to an invalid value
This allows distinguishing pending syncs that didn't have a DELAY_REQ
sent from ones that did but used a seqnum of 0, like the very first one.

Specifically, if the first one or more syncs are still pending and we
send the first DELAY_REQ for a later pending sync, then the DELAY_RESP
would've been wrongly associated to the very first pending sync because
of the seqnum.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6368>
2024-03-14 04:14:47 +00:00
Seungha Yang 6e9249b078 d3d11device: Fix adapter LUID comparison in wrapped device mode
Fix integer type mismatching

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3382
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6367>
2024-03-14 03:23:32 +00:00
Alexander Slobodeniuk f04ea0c1be rtspsrc: remove 'deprecated' flag from the 'push-backchannel-sample' signal
It seems that it was added by accident when copying from push-backchannel-buffer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6366>
2024-03-14 00:36:07 +00:00
Sebastian Dröge eaffd61da6 mpg123audiodec: Correctly handle the case of clipping all decoded samples
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3365

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6360>
2024-03-13 17:13:51 +00:00
Tim-Philipp Müller f04f86f3ee Revert "audiobasesink: Don't wait on gap events"
This reverts commit 8e923a8e2d.

This caused regressions, see #3303.

Without this commit, osxaudiosrc ! osxaudiosink won't work
right, but since that hasn't really been a huge problem
for years it's probably best to revert this until a proper
solution can be figured out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6356>
2024-03-13 12:49:41 +00:00
Mikhail Rudenko 50033d03d3 rtsp-stream: clear sockets when leaving bin
Since commit 4d86f994, when setting an RTSP media both shared and
reusable, streaming cannot be restarted after the first time all the
clients disconnect. That happens because the sockets (unlike
addresses) of GstRTSPStream are not cleared in
gst_rtsp_stream_leave_bin, and on restart sockets and addresses are
not allocated in gst_rtsp_stream_allocate_udp_sockets, and then the
check in create_sender_part fails. Fix this by clearing sockets in
gst_rtsp_stream_leave_bin.

Fixes gstreamer/gst-rtsp-server#113

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6347>
2024-03-13 11:19:56 +00:00
Piotr Brzeziński 66283e8865 audiovisualizer: Don't wrap temporary memory in buffers
Avoids potentially ending up with the buffermemory pointing to already-freed or reused addresses.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6349>
2024-03-13 07:19:39 +00:00
Piotr Brzeziński f2ad031eff audioencoder: Avoid wrapping temporarily mapped memory with a GstBuffer and passing that to subclass
Memory from gst_adapter_map() could live shorter than the GstMemory that the GstBuffer wraps around it, which in lucky
cases 'just' caused a re-use of the same memory for multiple (potentially still in use!) input buffers, but could easily
end up pointing to an already-freed memory.

Manifested when an AudioToolbox encoder kept getting silence inserted in seemingly random circumstances, turned out
to be the memory being re-used by GStreamer at the same time that the AT API was processing it...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6349>
2024-03-13 07:19:39 +00:00
Nirbheek Chauhan fa387a3eb7 gsturi: Sort by feature name to break a feature rank tie
This matches autoplug in other places such as decodebin, otherwise we
will pick "randomly" based on the order in which plugins are
registered, which is mostly dependent on the order in which readdir()
returns items.

So let's make it predictable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6348>
2024-03-13 06:29:01 +00:00
Nirbheek Chauhan acd40e7852 rtspsrc: Don't invoke close when stopping if we've started cleanup
When we're doing a state change from PLAYING to NULL, first we invoke
gst_rtspsrc_loop_send_cmd_and_wait (..., CMD_CLOSE, ...) during
PAUSED_TO_READY which will schedule a TEARDOWN to happen async on the
task thread.

The task thread will call gst_rtspsrc_close(), which will send the
TEARDOWN and once it's complete, it will call gst_rtspsrc_cleanup()
without taking any locks, which frees src->streams.

At the same time however, the state change in the app thread will
progress further and in READY_TO_NULL it will call gst_rtspsrc_stop()
which calls gst_rtspsrc_close() a second time, which accesses
src->streams (without a lock again), which leads to simultaneous
access of src->streams, and a segfault.

So the state change and the cleanup are racing, but they almost always
complete sequentially. Either the cleanup sets src->streams to NULL or
_stop() completes first. Very rarely, _stop() can start while
src->streams is being freed in a for loop. That causes the segfault.

This is unlocked access is unfixable with more locking, it just leads
to deadlocks. This pattern has been observed in rtspsrc a lot: state
changes and cleanup in the element are unfixably racy, and that
foundational issue is being addressed separately via a rewrite.

The bandage fix here is to prevent gst_rtspsrc_stop() from accessing
src->streams after it has already been freed by setting src->state to
INVALID.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6346>
2024-03-12 19:22:47 +00:00
Seungha Yang 3bc068473b wasapi2: Fix task memory leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6218>
2024-03-08 22:11:31 +00:00
Seungha Yang b793c3e03b wasapi: Fix alloc/free function mismatch
... and fix leak in wasapi device provider

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3326
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6218>
2024-03-08 22:11:31 +00:00
Seungha Yang 229d9cb4e1 asiosink: Fix channel selection
Fixing copy paste mistake

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3321
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6217>
2024-03-08 21:01:25 +00:00
Guillaume Desmottes e62888c07f uridecodebin3: fix deadlock when switching input item
There was a race between urisourcebin src pad handlers.
One was starting the next item before the other was blocked.

See
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3297#note_2288799
for details.

Fix #3297

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6214>
2024-03-08 19:49:05 +00:00
Jan Schmidt dea8b1cb37 identity: Don't refuse seeks unless single-segment=true
identity only needs to configure the internal seek segment if it's
aggregating upstream segments into 1. If it's not, don't break
other seek behaviour by refusing (for example) instant-rate change
seeks.

Fixes: #3363
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6307>
2024-03-08 18:41:52 +00:00
Mathieu Duponchelle 6f21f90747 onvif: tests: check for T flag on all packets
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6294>
2024-03-07 19:58:09 +00:00
Mathieu Duponchelle 8830b03ec1 rtpgstpay: flush on EOS
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6294>
2024-03-07 19:58:09 +00:00
Mathieu Duponchelle 64bbeb106c rtponviftimestamp: make sure to set E and T bits on last buffer of lists
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6294>
2024-03-07 19:58:09 +00:00
Sebastian Dröge 01469a7de5 rtpgstpay: Delay pushing of event packets until the next buffer
And also re-timestamp them with the current buffer's PTS.

Not doing so keeps the timestamps of event packets as
GST_CLOCK_TIME_NONE or the timestamp of the previous buffer, both of
which are bogus.

Making sure that (especially) the first packet has a valid timestamp
allows putting e.g. the NTP timestamp RTP header extension on it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6294>
2024-03-07 19:58:09 +00:00
Elizabeth Figura a1d1c74be1 qtdemux: Do not set channel-mask to zero
Leave it uninitialized, so that the downstream decoder will initialize it appropriately. Setting it to zero is wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6288>
2024-03-07 13:34:54 +00:00
Jan Schmidt 375d16a9fa rtspsrc: Parse Speed/Scale before Range in responses
Parse the speed and scale in the server's response
*before* the range, so that the range start/stop
are swapped (or not swapped) correctly based
on the server's actual chosen values. Otherwise,
the old rate from the segment is used - what the
last seek asked for, but not necessarily what
the server chooses.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6287>
2024-03-07 12:03:04 +00:00
Jan Schmidt 6a07ced605 rtspsrc: Handle queries and events with no manager
When doing direct output with no session manager, we still
want to respond to queries and events from downstream, so
install the handlers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6287>
2024-03-07 12:03:04 +00:00
Jan Schmidt 7ad4055557 rtspsrc: return NO_PREROLL on PLAYING->PAUSED too
When transitioning back to PAUSED and rtspsrc is live, return
NO_PREROLL so the pipeline knows to skip preroll here too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6287>
2024-03-07 12:03:04 +00:00
Jan Schmidt ab6c205a8e rtponviftimestamp: Use gst_segment_to_stream_time_full()
In the situation where playback starts from a keyframe before
the target playback segment, then the first buffers will be
outside the configured segment and gst_segment_to_stream_time()
will return GST_CLOCK_TIME_NONE unconditionally.

If drop-out-of-segment is false, the RTP buffers will not be
dropped, but will be sent witout ONVIF extension timestamps
and given GST_CLOCK_TIME_NONE timestamps on the receiver.

Instead, use gst_segment_to_stream_time_full() to extrapolate
stream time outside the segment so that such buffers still
get assigned their correct timestamps on the receiver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6287>
2024-03-07 12:03:04 +00:00
Jan Schmidt df34adae9e gstsegment: Don't use g_return_val_if_fail()
Don't use g_return_val_if_fail() to catch the
open-ended segment or empty segment cases in
gst_segment_to_running_time_full()

g_return_val_if_fail() is for programmer errors,
and can be compiled out with a flag.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6279>
2024-03-07 01:35:09 +00:00
Jan Schmidt 1190761f7e dvbsubenc: Fix bottom field size calculation
Don't accidentally include the stuffing byte (if present)
into the bottom field size. It should only be included in the
total segment length.

Fixes problems with FFmpeg not rendering the subtitles
with a stuffing byte, giving a "Invalid object location!" error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6281>
2024-03-07 00:29:12 +00:00
Piotr Brzeziński adfefceea5 macos: Fix glimagesink not respecting preferred size
Cocoa version of glwindow only checks the preferred size upon window creation. glimagesink sets the size right before
calling gst_gl_window_show(), which might be way after the window is created in some cases. If the size was set too
late, glimagesink on macOS would remain 320x240 unless manually resized.

This change makes sure to resize the existing window when _show() is called.

Curiously, this has always been an issue, but went from manifesting every once in a while to being almost completely
broken once old event loop workarounds were removed and gst_macos_main() was introduced.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6280>
2024-03-06 17:58:46 +00:00
Tim-Philipp Müller dea9cfb5ee rtspsrc: Consider 503 Service Not Available when handling broken control urls
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6272>
2024-03-06 11:13:57 +00:00
Nirbheek Chauhan 6a18121fdc soup: Re-add soup-lookup-dep option
It's still useful on Linux since it ensures that the tests are going
to be built, since they use the same dep lookup as the plugin now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6198>
2024-03-04 14:58:26 +00:00
Arnaud Vrac 0db7773d5b adaptivedemux2: fix build with recent meson
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6198>
2024-03-04 14:58:26 +00:00
Nirbheek Chauhan 2b121be8f0 soup: Link to libsoup in all cases on non-Linux
We have unsolvable issues on macOS because of this, and the feature
was added specifically for issues that occur on Linux distros since
they ship both libsoup 2.4 and 3.0.

Everyone else should just pick one and use it, since you cannot mix
the two in a single process anyway.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6198>
2024-03-04 14:58:26 +00:00
Nirbheek Chauhan 2abbc2e0d9 good/tests: Don't enable soup tests if soup is disabled
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3268

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6198>
2024-03-04 14:58:26 +00:00
Olivier Crête 4f777ab6ae soup: Avoid using GUri before GLib 2.66
Let's use gpointer for now

Fixes: #3169
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6198>
2024-03-04 14:58:26 +00:00
Olivier Crête b4003f4449 adaptivedemux2: Parse cookies in downloadhelper
We need to parse any cookie headers, otherwise we end up
sending back attributes likes "Secure" and "httponly" which break
some servers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6198>
2024-03-04 14:58:26 +00:00
Edward Hervey 30738b09c1 plugins: Fix wrong enum usage
gcc 13 now detects conflicting enum usages. Fix the various cases where it was wrong

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6234>
2024-02-28 01:18:22 +00:00
Seungha Yang 0640147cee jpegdec: Fix progressive/interlaced detection
If input height and parsed one are identical, do not consider it as interlaced

Fixing below pipeline:
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420,width=640,height=10 \
  ! jpegenc ! jpegparse ! jpegdec ! videoconvert ! autovideosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6229>
2024-02-27 23:58:15 +00:00
Seungha Yang 42c07de96c jpegdec: Remove trailing white space
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6229>
2024-02-27 23:58:15 +00:00
Nirbheek Chauhan 1e384e5414 rtspsrc: Increase rank to PRIMARY for autoplug purposes
This affects autoplug by gst_element_make_from_uri() in, for example,
uridecodebin. The element should've already been PRIMARY rank, but it
was NONE because gst_element_make_from_uri() doesn't ignore NONE rank
elements when searching for element factories, unlike decodebin.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/502

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6231>
2024-02-27 17:23:43 +00:00
Alexander Slobodeniuk 00102b6c16 d3d11window_win32: fix crash on RC unprepare() vs window_proc()
Unprepare method posts WM_GST_D3D11_DESTROY_INTERNAL_WINDOW
command to the window queue, and from that moment considers
internal_hwnd to be released, and so it sets it to null.
The problem is that it's possible that right at that moment
the window thread might be already processing some other
command, or just another command might be already in the queue.
On practice we met a crash when WM_PAINT got processed in between
(unprepare already finished and WM_GST_D3D11_DESTROY_INTERNAL_WINDOW
was not handled yet)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6230>
2024-02-27 15:41:41 +00:00
Seungha Yang 7ff7ced388 wasapi2: Respect ringbuffer buffer/latency time
Decide buffer size based on configured buffer/latency time
if low-latency is disabled, so that ringbuffer can buffer more
than minimum required size.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2870
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6215>
2024-02-24 12:46:31 +00:00
Jan Schmidt fb8131b7da rtspsrc: Reset combined flows after a seek before restarting
After a flushing seek, rtspsrc doesn't reset the last_ret value for
streams, so might immediately shut down again when it resumes pushing
buffers to pads due to a cached `GST_FLOW_FLUSHING` result

Prevent a stored flushing value from immediately stopping
playback again by resetting pad flows before (re)starting
playback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6216>
2024-02-24 11:20:51 +00:00
Víctor Manuel Jáquez Leal edd2b3c6ee vabasedec: disable derived images for i965 driver
Since it has a very poor performance at reading derived images, which is the
most common use case for decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6204>
2024-02-23 12:23:09 +01:00
Víctor Manuel Jáquez Leal 6a42ed20ec vaallocator: remove runtime mapping selection
The original idea was to select the type of mapping (either using derive images
or downloading the image) in runtime, under the assumption that both methods
shared the same memory layout (offsets and strides), because a single
GstVideoMeta is assigned by the buffer pool at allocation time. Nonetheless, in
recent hardware this assumption is invalid, raising memory access errors.

This patch removes completely the mapping type selection at runtime, using the
method selected when the allocator is configured, synced with the bufferpool
allocation.

This problem was fixed originally for iHD driver only. But now it makes sense to
remove all of it.

Original-patch-by: Mengkejiergeli Ba <mengkejiergeli.ba@intel.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6204>
2024-02-23 12:23:09 +01:00