Commit graph

116746 commits

Author SHA1 Message Date
Matthew Waters
8cacf850fe gl/context/cocoa: ensure pixel format lives as long as the context
Under some circumstances, the CGLPixelFormatObj was being destroyed too
early which could lead to potential use-after-frees.

Fix by returning a reference when asked for the pixel format.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3154
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6566>
2024-04-15 15:28:44 +00:00
Qian Hu (胡骞)
c3238be321 qtdemux: fix wrong full_range offset when parsing colr box
use colr_data[18] >> 7 to get full range information, instead
of colr_data[17] >> 7

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6641>
2024-04-15 07:52:29 +00:00
Jimmy Ohn
2f40a0c0d6 pulsedeviceprovider: Add is_default_device_name function and missing lock
Add is_default_device_name function to simplify compare device type
name and fix the missing lock when accessing default_sink_name and
default_source_name.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6640>
2024-04-15 06:38:53 +00:00
Sebastian Dröge
6476fac04f rtpbin: Don't re-use a variable for a completely different purpose temporarily
During RTP-Info synchronization, clock_base was temporarily switched
from the actual clock-base to the base RTP time and then back some lines
later.

Instead directly work with the base RTP time. The comment about using a
signed variable for convenience doesn't make any sense because all
calculations done with the value are unsigned.

Similarly, rtp_clock_base was overridden with the rtp_delta when
calculating it, which was fine because it is not used anymore
afterwards. Instead, introduce a new variable `rtp_delta` to make this
calculation clearer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6639>
2024-04-15 01:27:28 +01:00
Sebastian Dröge
93f93847e8 rtpbin: Convert clock-base to extended RTP timestamp correctly
It's not in the same period as the current RTP base time but always in
the very first period. This avoids using it again at a much later time.

The code in question is only triggered with rtcp-sync=rtp-info.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6639>
2024-04-15 01:27:28 +01:00
Sebastian Dröge
d2b00b045a rtpjitterbuffer: Use an extended RTP timestamp for the clock-base
It is compared to other extended RTP timestamps all over rtpjitterbuffer
and since 4df3da3bab the initial extended RTP timestamp is not equal
anymore to the plain RTP time.

Continue passing a non-extended RTP timestamp via the `sync` signal for
backwards compatibility. It will always be a timestamp inside the first
extended timestamp period anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6639>
2024-04-15 01:27:27 +01:00
Thomas Goodwin
344ead31a6 gst-inspect: fix --atleast-version to be implicitly applied to --exists
The --atleast-version implies --exists, but the implementation in
earlier commits had the version check applied any time the --exists was
checked, and the default value of the major and minor versions were set
to the GStreamer major and minor versions.  The resulting behavior would
have gst-inspect return '1' if the plugin's version didn't match
gstreamer's even when --atleast-version was not specified in the command
line args.  The change in this patch removes that behavior and adds
tests to verify that if --exists is specified WITHOUT --atleast-version
the version check will NOT be applied.  If both arguments are specified
and the version does not match the arg-supplied version number, a new
return code of '2' is used to uniquely identify the failure.

Fixes #3246

Signed-off-by: Thomas Goodwin <thomas.goodwin@laerdal.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6415>
2024-04-14 15:07:40 +00:00
Sebastian Dröge
2b5930f6a0 wavpackparse: Use an unsigned integer for the block size calculations
It's never negative.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6564>
2024-04-08 09:34:13 +00:00
Sebastian Dröge
6953204a9c wavpackparse: Fix potential integer overflow on ID_ODD_SIZE blocks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6564>
2024-04-08 09:34:12 +00:00
Sebastian Dröge
18548cdd76 wavpackparse: Explicitly handle ID_WVX_NEW_BITSTREAM
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6564>
2024-04-08 09:34:12 +00:00
Sebastian Dröge
32e077cb67 typefind: Handle WavPack block sizes > 131072
These are valid nowadays.

Also handle ID_ODD_SIZE and ID_WVX_NEW_BITSTREAM. The parser already
handles the former but not the latter.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6564>
2024-04-08 09:34:12 +00:00
Elliot Chen
7e7f998f77 v4l2: fix error in calculating padding bottom for tile format
This is a regression while porting to arbitrary tile dimensions
introduced in !3424.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6565>
2024-04-08 02:22:36 +00:00
eri
2aef1d6ccd play: Update video_snapshot to support playbin3
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6563>
2024-04-07 23:56:39 +01:00
Alexander Slobodeniuk
21975e8d62 d3d11videosink: disconnect signals before releasing the window
It might happen that the key event arrives when the d3d11videosink
is stopping. In case of GstD3D11WindowWin32 it can raise a
navigation event even when the sink is already freed, because the
window object's refcount may reach 0 in the window thread. In
other words sometimes the GstD3D11WindowWin32 lives few ms more
then the GstD3D11VideoSink, because it's freed asynchronously.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6493>
2024-03-31 13:13:30 +01:00
Tim-Philipp Müller
37bacb49a9 tests: rtpred: fix out-of-bound writes
Don't write more data to the buffer than we allocated
space for.

Fixes #3312

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6479>
2024-03-29 00:22:57 +00:00
Nicolas Dufresne
ae8bc27fdf v4l2codecs: alphadecoder: Explicitly pass 64 bit integers as such through varargs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6470>
2024-03-28 12:11:44 +00:00
Sebastian Dröge
fcf22b3790 alphadecodebin: Explicitly pass 64 bit integers as such through varargs
Maybe fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3422

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6470>
2024-03-28 12:11:44 +00:00
Arnaud Vrac
801a6e5faa inputselector: fix possible clock leak on shutdown
Avoid leaking a GstClock object on shutdown, bail out before taking the ref when
not playing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6458>
2024-03-28 10:34:52 +00:00
Taruntej Kanakamalla
b014650cbe net/gstptpclock: fix double free of domain data during deinit
The attempt to free the domain data is happeing twice during the ptp deinit.
Once while iterating through the list domain_data and second while iterating
through the list domain_clocks, so this is crashing the application
trying to gst_ptp_deinit

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6459>
2024-03-27 15:01:55 +00:00
Tim-Philipp Müller
3abc1c8c7b Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6408>
2024-03-20 00:07:00 +01:00
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