Commit graph

4349 commits

Author SHA1 Message Date
Benjamin Gaignard
0d1cc08176 v4l2codecs: allocator: Fix buffers leak when using remove buffers
When removing buffers from v4l2 queue do not forget to release
the memory on gstreamer side.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8583>
2025-03-06 21:28:33 +00:00
Seungha Yang
dba3bdd0cf h264ccextractor,h265ccextractor: Do not resend caps per output buffer
Send caps event only when it's required

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4281
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8596>
2025-03-06 16:24:44 +00:00
Pablo García
af148bb746 curl: replace #if with #ifdef (part 2)
Continuation of 47d1262402c81a9054e618052deeff7414b4f75d, that is not enough.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8595>
2025-03-06 13:44:33 +00:00
Stéphane Cerveau
93364189d0 vulkan/operation: fix timeline semaphore extension detection
As for synchronization2, the timeline semaphore has been
been promoted in 1.2 and does not have to be enabled explicitely.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:21 +00:00
Matthew Waters
b9bbcf9202 vulkan/operation: fix synchronization2 extension detection
The synchronization2 extension is a core part of Vulkan 1.3.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:21 +00:00
Matthew Waters
e23bc6ed77 vulkan/device: only enable relevant extensions
Extensions can have a minimum set of dependencies (e.g. API version) and may
also be promoted to core in a later version.  Don't explicitly enable extensions
that fail to meet their requirements or that have been promoted to the core API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:21 +00:00
Matthew Waters
e7b8ac099f vulkan/operation: retrieve function pointers directly from the device
The instance API version supported may not be of the same version supported by
the device. It is possible that the function that is returned may be non-0
but not functional due to the requested API version of the instance limiting the
availability of calling the returned function.

Can be reproduced by running a pipeline with GST_VULKAN_INSTANCE_API_VERSION=1.1

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:21 +00:00
Matthew Waters
7452589ff8 vulkan/instance: allow the requested api version to be larger than the supported
Since Vulkan 1.1, the requested API version is the maximum API version that the
application is expecting to use. It is also possible for individual devices
(backed by potentially different drivers) may support a higher or lower API
version than the instance.  Both cases (higher and lower) should be supported
and as such, it is not an error to request an API version that is larger than
the instance supported API version.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:21 +00:00
Matthew Waters
156b05d52b vulkan: plugin: add debug for why an instance fails to open
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:20 +00:00
Matthew Waters
4692a45dea vkformat: fix format_from_video_info_2 to actually runtime check versions and extensions
If the vulkan plugin was compiled against a newer version than the supported
vulkan runtime instance or device, then it was possible for format retrieval to
fail.  Failure was due to unconditionally using newer extensions and features
without runtime checking them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:20 +00:00
Matthew Waters
51dda24a88 vulkan: fix device related API version checks
The API version exposed by a particular device can be completely different from
what is exported by the parent instance.  Since Vulkan 1.1 it is also possible
to use newer device API than supported by the instance API version (with the
appropriate version checks).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:20 +00:00
Matthew Waters
72860a20bf vulkan/physicaldevice: add methods for retrieving and checking against an API version
Most version checks should actually be done against the device API version and
not the instance API version.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:20 +00:00
Pablo García
3e8fbc1203 curl: replace #if with #ifdef
Using #if instead of #ifdef was causing some issues when cross-compiling, like:

        ../ext/curl/gstcurlsmtpsink.c:54:5: error: "HAVE_SYS_SOCKET_H" is not
        defined, evaluates to 0 [-Werror=undef]
        54 | #if HAVE_SYS_SOCKET_H

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8589>
2025-03-05 15:13:43 +01:00
Pablo García
4640650ff5 curl: remove unnecesary reference to unistd.h
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8589>
2025-03-05 15:13:35 +01:00
Christopher Degawa
6bdfaa4606 svtav1enc: update to use SVT-AV1 3.0.0 API changes
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8539>
2025-03-05 13:18:26 +00:00
Branko Subasic
f37b820060 voamrwbenc: Do not install anything unless dependency found
If the dependency for the plugin is not found then nothing should be
installed, neither the element nor documentation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8586>
2025-03-05 10:48:40 +00:00
Carlos Bentzen
ee6618d9ba h266parse: clear cache values with memset
Fixes a stack overflow on Windows/MSVC.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8588>
2025-03-05 10:02:38 +00:00
Nirbheek Chauhan
e2e6daf362 meson: Replace disabler dependencies with not-found dependencies
If a plugin gets disabled due to a `disabler()` dependency, the plugin
docs build itself will get disabled because `all_plugins_paths` will
become a disabler.

This was actually happening with opencv on systems that don't have
opencv available, and could happen with libsoup too if the build files
change in the future.

Let's avoid wasting hours of debugging for people. A not-found
dependency has the same effect.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8582>
2025-03-04 17:38:30 +00:00
Stéphane Cerveau
a42bcf7865 tests: add dashsink unit test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7916>
2025-03-03 12:19:09 +01:00
Stéphane Cerveau
1492b282dc dashsink: use gst_dash_sink_reset
To be able to use the properties properly,
the element should be reset by gst_dash_sink_reset
during the state change from READY_PAUSED and PAUSED_READY.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7916>
2025-03-03 12:19:09 +01:00
Stéphane Cerveau
c9dd3fbc8f dashsink: send element message on event
On new mpd update and new segment written, send
an element message to signal the event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7916>
2025-03-03 12:19:09 +01:00
Stéphane Cerveau
a7a3a80344 dashsink: cleanup the teardown process
The stream was keeping a reference to the sink, preventing
it to be removed properly by the pipleline bin.
Clean up and simplify the code to get the stream from the pad.
Add more mutex protection against add/remove requested pad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7916>
2025-03-03 12:19:09 +01:00
Denis Yuji Shimizu
51a3ef55c9 analytics: objectdetectionoverlay: improve event handling
This change ensures that the `GST_EVENT_EOS`,
`GST_EVENT_FLUSH_START` and `GST_EVENT_FLUSH_STOP`
events are forwarded to the sink downstream.
The logging message for `GST_EVENT_FLUSH_START`
has also been fixed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8576>
2025-03-01 10:47:33 +00:00
Dongyun Seo
e778791b90 pitch: fix build error
fix build error due to sound integer sample caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8570>
2025-02-28 13:49:11 +00:00
Elliot Chen
4b44169f05 gstplay: support disabling the selected track at startup
In some cases, need to disable some type tracks at startup before
receiving the stream collection message. And fix printing error log
in this case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8568>
2025-02-28 18:10:18 +09:00
Robert Mader
970bfc335e waylandsink/demo: Use playbin3 instead of playbin
Video looping currently does not work reliably with the later
and playbin3 is generally considered the better choice.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8561>
2025-02-27 23:32:29 +00:00
Olivier Crête
0e9d6f7e42 avtpsrc: Use GSocket to have cancellable wait
Otherwise it would block forever when there is no sender.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8550>
2025-02-27 21:37:51 +00:00
Roberto Viola
2e8b542145 dashsink: fix period duration in dynamic MPD
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8531>
2025-02-25 12:33:39 +00:00
Qian Hu (胡骞)
a99694cca8 wayland: leverage unified object destruction for wl_callback
This patch refactors gst_wl_display_callback_destroy() to use the
recently introduced gst_wl_display_object_destroy() helper. Previously,
the function manually handled wl_callback destruction with explicit
lock/unlock calls and direct invocation of wl_callback_destroy().
Switching to gst_wl_display_object_destroy() unifies the destruction
process across similar objects, reducing code duplication and potential
errors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8242>
2025-02-24 18:10:50 +00:00
Qian Hu (胡骞)
6d17596777 wayland: fix crash issue during stop flow
when received xdg config event fron wayland server,
gst_wl_display_thread_run will call handle_xdg_surface_configure
which protected by priv->sync_mutex.

and in handle_xdg_surface_configure, configure_mutex also is locked

but if waylandsink set state from paused to ready, that will dispose
wlwindow, which will try to clear configure_mutex, and try to destroy
xdg_surface,
that do not proteced by anything.

so, problem is:
1) if clear configure_mutex(with locked state), clear lock will abort
2) after xdg_surface destroy, handle_xdg_surface_config may still call
   ack_configure, that will lead wayland server go wrong

so, this patch updates gst_wl_window_finalize to use the new
destruction function for xdg_toplevel and xdg_surface, ensuring all
destruction operations are properly synchronized.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8242>
2025-02-24 18:10:50 +00:00
Qian Hu (胡骞)
308540c2fe wayland: add synchronized object destruction function
Introduces a new generic destruction function
gst_wl_display_object_destroy that ensures all
destruction operations are protected by
sync_mutex.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8242>
2025-02-24 18:10:50 +00:00
Tim-Philipp Müller
644a005ecb Back to development after 1.25.90 2025-02-23 23:52:57 +00:00
Tim-Philipp Müller
94a3e912ab Release 1.25.90 2025-02-23 23:44:10 +00:00
Tim-Philipp Müller
2f0a0a837c gst-plugins-bad: update translations 2025-02-23 23:44:02 +00:00
Seungha Yang
184ac2d930 nvcodec: Register all elements if CUDA kernel is precompiled
GstCudaConverter dependent element can work if CUDA kernel is
precompiled even if runtime compiler library is not found

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8536>
2025-02-22 07:09:03 +00:00
Seungha Yang
ae8eef82a6 nvjpegenc: Add support for kernel precompile
Port to CUDA precompile/cache

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8536>
2025-02-22 07:09:03 +00:00
Seungha Yang
697cfe38ef cudaconverter: Add support for kernel precompile and cache
Port to precompile/cache approach

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8536>
2025-02-22 07:09:03 +00:00
Seungha Yang
9a8f3a65a3 nvcodec: Add support for CUDA kernel precompile
Enable build time CUDA kernel compile if nvcc is detected.
Precompile is disabled by default and controlled by
"nvcodec-cuda-precompile" build option.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8536>
2025-02-22 07:09:03 +00:00
Nicolas Dufresne
33aafc4a91 v4l2codecs: Sort formats to avoid quality lost
When the driver prefered format is not picked by downstream, the
decoders needs to select another format from the list. The selection
was currently unsorted, resulting in 10bit data often being stripped
to 8bit.

To solve this, reorder the formats in an HW preference order. This order
deviates slightly from the preferred order in libgstvideo. This is to
prefer bandwidth saving over better CPU alignment. As an example NV15 is
prefered over P010. We also prefer tiled over linear.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8522>
2025-02-21 19:11:47 +00:00
Nicolas Dufresne
5e48b89686 kmssink: Add NV12_10LE40 / NV15 support
This is needed until kmssink is ported to use libgstvideo mapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8525>
2025-02-21 16:37:55 +00:00
Seungha Yang
5c974980ef closedcaption: Add h264/h265 ccinserter docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8496>
2025-02-21 15:00:02 +00:00
Seungha Yang
89c0dc80e5 closedcaption: Add h265ccinserter element
Adding new element for inserting closed caption SEI to H.265 stream

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8496>
2025-02-21 15:00:01 +00:00
Seungha Yang
6a711ede04 closedcaption: Add h264ccinserter element
Adding new element for inserting closed caption SEI to H.264 stream

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8496>
2025-02-21 15:00:01 +00:00
Seungha Yang
55b2dcc121 h264picture: Export private method symbols
That method will be used by plugin

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8496>
2025-02-21 15:00:01 +00:00
Seungha Yang
bb4d21001f examples: Add example for nvenc extern-cuda-bufferpool property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8516>
2025-02-21 10:10:53 +00:00
Seungha Yang
d17e8707c9 nvencoder: Add extern-cuda-bufferpool property
Add new property to support application allocated GstCudaMemory.

CUDA memory alloc/free is a global device synchronization point
as if launching CUDA kernel on default CUDA stream. To avoid the global
synchronization, we added stream-ordered allocation support
which allocates CUDA memory asynchronously.
However, NVENC does not allow registering the stream-ordered
allocated memory. Thus encoder was allocating normal CUDA
memory in case that input CUDA memory is stream-ordered type.

In this commit, newly introduced property will allow application
to provide encoder with GstCudaBufferPool. Application can
preallocate sufficient amount of CUDA memory in advance
to avoid global device synchronization while pipeline is running.

For now, this pool is used only if input CUDA memory is allocated
via stream-ordered-allocation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8516>
2025-02-21 10:10:53 +00:00
Seungha Yang
700e31d146 cudaconverter: Use stream ordered allocation if requested
... to avoid global device synchronization

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8516>
2025-02-21 10:10:52 +00:00
Seungha Yang
6ef54dd883 cudaconverter: Remove unnecessary CUDA memory allocation
We can pass struct to kernel by value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8516>
2025-02-21 10:10:52 +00:00
Matthew Waters
9f7fe58054 vkupload: don't require that input memory count matches output memory count
It can very easily not. e.g.

videotestsrc ! video/x-raw,format=NV12 ! identity drop-allocation=true ! \
    vulkanupload ! vulkancolorconvert ! vulkansink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8530>
2025-02-21 17:22:15 +11:00
Seungha Yang
9baff8e4e0 closedcaption: Add h265ccextractor element
This element will collect closed caption meta from H.265 stream
and output caption buffers in display order

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8500>
2025-02-19 11:10:30 +00:00