122543 Commits

Author SHA1 Message Date
Seungha Yang
e3d0a8d83e d3d12screencapturesrc: Fix OS handle leaks/random crash in WGC mode
Multiple DispatcherQueues per thread seems to be causing OS handle leak
and random crashes were observed. Instead of creating
thread/DispatcherQueue per GstD3D12GraphicsCapture object,
reuse only single thread and DispatcherQueue

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4351
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9153>
2025-06-25 14:30:56 +00:00
Doug Nazar
c15a898742 vkvideoencodeh26x: ensure we call teardown() for each test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9062>
2025-06-25 10:43:51 +00:00
Doug Nazar
35bceff695 gstrtspsrc: Don't emit error during close if server is EOF
During a graceful close we try to notify the server that we're
finished. There is no reason to consider it an error if the
server has already closed the connection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9278>
2025-06-25 00:00:57 -04:00
Seungha Yang
67031a508c hip: Add plugin docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 01:17:27 +09:00
Seungha Yang
1d6ae8791d hip: Add hipcompositor element
Feature-wise it's the same as cudacompositor

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Seungha Yang
2b0f4705a5 hip: Load memset symbols
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Seungha Yang
be3d7b6f13 hipmemorycopy: Add support for GL interop
Enable memory copy between HIP and GL

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Seungha Yang
baa9bc9d95 hip: Add GstHipGraphicsResource object
hipGraphicsResource_t wrapper object for graphics api interop

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Seungha Yang
04fb36b2f9 hip: Load GL interop related symbols
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Seungha Yang
ecaab82f11 hip: Pass GPU arch to kernel compile option args
Pass current GPU arch to compile option instead of relying on auto
detection

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Seungha Yang
fc8f7c349b hip: Add support for NVIDIA kernel precompile
... with "hip-nvidia-precompile" and "hip-nvcc-arch" build options

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Seungha Yang
eb925e4212 hip: Add support for AMD kerenl precompile
Adding "hip-amd-precompile" build option. If enabled, AMD kernels
will be precompiled at build time. Also "hip-hipcc-arch" build option
(corresponding to --offload-arch hipcc option) is added
so that user can specify target GPU arch instead of auto-detection by hipcc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Seungha Yang
d26755f4d4 hip: Add support for memory copy between GstCuda and GstHip
Handle CUDA <-> HIP memory copy in hipupload and hipdownload elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Seungha Yang
7254e812ac hip: Add support for NVIDIA
Adding HIP <-> CUDA translation layer like the HIP SDK does
but uses dlopen() for CUDA as well

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Seungha Yang
24b93f2c41 hip: Remove build-time SDK dependency
Use dlopen at runtime

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Seungha Yang
0f9ce9de90 hip: Add AMD HIP plugin
Adding hipupload, hipdownload, and hipconvert family elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8923>
2025-06-25 00:15:55 +09:00
Sebastian Dröge
79677043dd ci: Update ABI tag
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9245>
2025-06-24 08:00:14 +00:00
Sebastian Dröge
4bd4c4d4f7 buffer: Add optional info structure to GstReferenceTimestampMeta
This allows carrying additional per-timestamp information if needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9245>
2025-06-24 08:00:14 +00:00
Sebastian Dröge
f40726597e pad: Only remove TAG events on STREAM_START if the stream-id actually changes
Missing part from 88a36b53c5064d186acb317b0b72633ef5d886e3

See also https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4097

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9268>
2025-06-23 13:11:18 +00:00
Doug Nazar
a8e3dc337b analyticsoverlay: Fix memory leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9266>
2025-06-23 12:29:06 +00:00
Doug Nazar
e8fda4b6b7 dashsink: test: Minor cleanups
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9266>
2025-06-23 12:29:06 +00:00
Doug Nazar
794cae4b03 dashsink: Fix memory leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9266>
2025-06-23 12:29:06 +00:00
Doug Nazar
805d532280 splitmuxsink: Only send closed message once per open fragment
We send a closed message on EOS. It's possible to receive multiple EOS
messages before opening the next fragment (from an element change state
for example).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9266>
2025-06-23 12:29:06 +00:00
Qian Hu (胡骞)
bbae7dba0a imagefreeze: fix not negotiate error when stop
when the chain is called between reset and pad deactive in base
change state, a "not negotiation" error is produced.
so, we add a judge for flushing and reset

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8916>
2025-06-23 10:28:06 +00:00
Matthew Waters
f7ad5cb570 decklink/clock: remove clock_offset
It is completely unused and only ever initialized to 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9267>
2025-06-23 08:25:57 +00:00
Matthew Waters
cae2b38614 decklink: calculate internal using values closer to the current clock times
In a previous version of the clock time conversion code, scheduled playback used
to be started (from 0) when transitioning to PLAYING and stopped when
transitioning PLAYING->PAUSED. This worked fine when converting running times
using the internal clock.  However, now the decklink clock will produce values
that are monotonically increasing and do not reset to 0 at the same moments as
running time anymore. This means that the clock adjustments could attempt to
convert a small running time based on a large clock time e.g. after pausing
for many hours. As the adjustment code is a simple linear interpolation based on
the current clock times (large) using the provided value (small), the small
differences in the rate could result in very large differences in the
output time.

Fix by instead using both internal and external clock times based on the values
that gst_clock_get_calibration() will return. By doing so, small changes in the
rate calculations between the internal and external clock times will not result
in potentially large differences in the output internal time from
gst_clock_unadjust_with_calibration().

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9267>
2025-06-23 08:25:57 +00:00
Nirbheek Chauhan
d432dbd106 docs: Document that unnecessary rebases make reviewing harder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9255>
2025-06-20 13:36:35 +00:00
Thibault Saunier
e799d79025 playsink: Fix race condition in stream synchronizer pad cleanup during state changes
Prevent race condition where gst_play_sink_do_reconfigure() could be called
from a pad probe while stream synchronizer pads are being released during
GST_STATE_CHANGE_PAUSED_TO_READY transition.

The race occurred when:
1. State change starts releasing stream synchronizer pads
2. Pads are unblocked earlier in the state change, allowing events to flow
3. A streaming thread triggers sinkpad_blocked_cb -> gst_play_sink_do_reconfigure
4. Reconfiguration tries to use already-released pad pointers
5. New pad creation fails with assertion in gst_pad_iterate_internal_links

The fix adds GST_PLAY_SINK_LOCK around the pad cleanup to ensure atomic
cleanup and prevent concurrent access during state transitions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9233>
2025-06-20 11:53:50 +00:00
Víctor Manuel Jáquez Leal
743c425f64 vulkanupload: refactor frame copy in a single function
Avoiding code duplication

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9222>
2025-06-20 11:08:17 +00:00
Víctor Manuel Jáquez Leal
bcf97b088f vulkanupload: use gst_video_frame_copy() for VulkanBuffer
There's no need of a custom copy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9222>
2025-06-20 11:08:17 +00:00
Doug Nazar
c0a86ebb30 adaptivedemux2: Fix race for expected error in test
After gst-validate-1.0 notices the first expected error on the bus, it will
queue the completion of that action while the pipeline is still processing the
error and getting to the basesrc for the second error.

Mark the second error as 'sometimes=true', as it's not critical to the test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9118>
2025-06-20 00:27:57 +00:00
Doug Nazar
49a81965fc validate: Ignore error msgs when executing next action
When processing an expected error msg, the test for if the next action
was a message would trigger and we'd never execute the next action
causing a timeout.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9118>
2025-06-20 00:27:57 +00:00
Doug Nazar
1fb195e08e validate: Fix memory leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9118>
2025-06-20 00:27:57 +00:00
Doug Nazar
198498d3d2 validate: Pass correct argument size to va_arg function
sizeof(int) != sizeof (GType) and can cause an invalid access.
Also one function call was missing the terminator altogether.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9118>
2025-06-20 00:27:57 +00:00
Doug Nazar
0f32647aae validate: Fix a memory leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9118>
2025-06-20 00:27:57 +00:00
Doug Nazar
83be566ca7 validate: Reset mutex to NUL to allow re-init
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9118>
2025-06-20 00:27:57 +00:00
Doug Nazar
76fc1d0acf validate: tests: use fixtures to init/deinit and fix leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9118>
2025-06-20 00:27:57 +00:00
Doug Nazar
79321deb27 validate: cleanup several items on shutdown
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9118>
2025-06-20 00:27:57 +00:00
Doug Nazar
b0885d2fc3 validate: Fix various memory leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9118>
2025-06-20 00:27:57 +00:00
Doug Nazar
2f5ecdc911 validate: ensure we shutdown execute_actions source
Actions are no longer always called directly from the main loop
so we can't depend on G_SOURCE_REMOVE to remove it. It's also
possible while returning up the call chain after running stop
to try to re-add it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9118>
2025-06-20 00:27:57 +00:00
Doug Nazar
86795f6414 baseparse: test: Fix race on test start
It's possible that the sink pad is still flushing when the first buffer
is processed causing the test to timeout when we activate the sink after
starting the pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9256>
2025-06-19 16:26:30 +00:00
Loïc Le Page
f47b0c0293 GstAudioAggregator: fix structure unref in peek_next_sample
The GstStructure attached to the audio sample in peek_next_sample() was
freed prematurely before usage as gst_sample_new() is taking full
ownership on it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9248>
2025-06-19 15:25:11 +00:00
Pratik Pachange
1f5dbbbd0b v4l2object: Add support for colorimetry bt2100-pq and 1:4:5:3
Colorimetry bt2100-pq is a variant of colorspace V4L2_COLORSPACE_BT2020
where the transfer function is SMPTE 2084 which is used by HDR content.

Colorimetry 1:4:5:3 is a full-range variant of colorspace
V4L2_COLORSPACE_470_SYSTEM_BG

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9166>
2025-06-19 14:29:54 +00:00
Edward Hervey
bc0324f862 tsdemux: Allow access unit parsing failures
* Refactor the various Access Unit extraction calls into a single function
* Allow the access unit parsing to fail, but emit a warning

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9246>
2025-06-19 13:03:16 +00:00
Nirbheek Chauhan
a8d9bfdcf2 amc: Overhaul hw-accelerated video codecs detection
Android 10 (API 29) added support for isHardwareAccelerated() to
MediaCodecInfo to detect whether a particular MediaCodec is backed by
hardware or not. We can now use that to ensure that the video hw-codec
is PRIMARY+1 on Android, since using a software codec for video is
simply not feasible most of the time.

If we're not able to detect isHardwareAccelerated(), perhaps because
the Android API version is too old, we try to use the codec name as
a fallback.

Also rank PRIMARY+1 the c2.android c2.exynos and c2.amlogic audio
codecs alongside OMX.google, because they are known-good.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9225>
2025-06-19 11:36:40 +00:00
Nirbheek Chauhan
fb04ef5be3 amc: Log under GST_FIXME for audio encoders
We don't support audio encoders yet, so log that correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9225>
2025-06-19 11:36:40 +00:00
Nirbheek Chauhan
966d8ec279 amc: Improve codec registration logging
Most of the messages can be printed with INFO threshold since they are
only printed on plugin registration.

Fix printing of codec caps, since GST_PTR_FORMAT truncates the output
in almost every case that I saw.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9225>
2025-06-19 11:36:40 +00:00
Nirbheek Chauhan
b8c9884674 amc: Print error messages when registering plugins
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9225>
2025-06-19 11:36:40 +00:00
Alicia Boya García
371100c743 tracers: Fix deadlock in latency tracer
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4317

This patch fixes a regression in
a35bf1e3847351703542869755b6b9e536b9d2fd.

The new calls to tracers in the affected change were being done while
holding the pad object lock, which wasn't the case in the old ones,
leading to the latency tracer deadlocking in gst_object_get_parent().

The dependency on the pad lock for those calls was accidental. This
patch removes it by temporarily unlocking during the affected calls,
not unlike how it's done when calling a probe callback or the
send_event() function of the downstream element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8925>
2025-06-19 09:12:14 +00:00
Jakub Adam
ddd6a708cb dashdemux2: Fix seeking in a stream with gaps
When there are gaps between segments in the DASH manifest (e.g. it's a
recording of a live stream during which the camera was turned on and off
a couple times), seeking to a timestamp that belongs into a gap leads to
repeat_index calculation yielding a nonsensical negative number (because
ts < segment->start).

In such event set the playback to continue at the first repetition of
the segment that follows after the gap.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8620>
2025-06-19 07:26:49 +00:00