Commit graph

1901 commits

Author SHA1 Message Date
Doug Nazar
5867c7900a all: Annotate *_set_property() contructor only props without free
Properties that are marked constructor only aren't required to be freed
before g_value_dup_*() as they can only be called once during construction.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8978>
2025-05-13 19:15:21 -04:00
Seungha Yang
4d87ffb8f3 d3d12decoder: Workaround for NVIDIA crash on resolution change
Recent NVIDIA driver seems to crash on resolution change
if ID3D12VideoDecoder and ID3D12VideoDecodeCommandList are reused.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4415
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8968>
2025-05-12 23:40:13 +00:00
Seungha Yang
bef18d47cf nvjpegenc: Add autogpu mode element
Similar to nvautogpu{h264,h265,av1}enc, adding auto gpu select mode
element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8555>
2025-05-11 00:01:28 +00:00
Seungha Yang
7d45eca2ce nvjpegenc: Use stream-ordered alloc if requested
If user requested stream-ordered allocation, use async alloc/free
methods

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8555>
2025-05-11 00:01:28 +00:00
Alexander Slobodeniuk
d437e92049 properties: add G_PARAM_STATIC_STRINGS where missing
"Hold on, I know you need to generate the registry, but let me just
create copies of all those strings first", Framework whispered

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8915>
2025-05-10 12:09:38 +00:00
Seungha Yang
5db574fc35 d3d12: Add d3d12remap element
Adding new element to support pixel remapping operation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8887>
2025-05-02 22:10:58 +09:00
Alexander Slobodeniuk
a03c4de48f elements: use set_static_metadata when it's allowed
Those strings are nice but CPU doesn't want to copy them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8905>
2025-04-26 19:30:15 +02:00
Jochen Henneberg
67cafe5999 va: Fix H264 profile decision logic
The current logic would choose 'baseline' profiles only in case that
these profiles appear in the list first.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8882>
2025-04-24 08:43:01 +02:00
Stéphane Cerveau
e3ae573651 vaav1enc: fix mem leaks in _av1_decide_profile
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8845>
2025-04-23 10:11:16 +00:00
Stéphane Cerveau
c3f4b6bdaf vavp9enc: fix mem leaks in _vp9_decide_profile
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8845>
2025-04-23 10:11:16 +00:00
Sebastian Dröge
df662b5904 aja: Use the correct location of the AJA NTV2 SDK in the docs
Also there is no longer a proprietary version of it.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8874>
2025-04-23 09:28:16 +03:00
Jakub Adam
c8a802772c vapostproc: fix wrong video orientation after restarting the element
After READY -> NULL -> READY state change, the configured video
orientation didn't get applied on the new GstVaFilter instance.

Resettig prev_direction to default value in update_properties ensures
gst_va_filter_set_orientation() isn't inadvertently skipped.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8871>
2025-04-22 12:44:37 +02:00
Seungha Yang
420b32b953 wasapi2: Log buffer QPC position and status flags
Log all infos of IAudioCaptureClient::GetBuffer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8859>
2025-04-17 22:44:19 +00:00
Nicolas Dufresne
cb67f760f0 v4l2codecs: Add Rockchip 8bit/10bit 422 formats
This enable NV16 and NV16_10LE40 formats. These formats are
produced by notably rkvdec driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5612>
2025-04-17 15:36:06 +00:00
Andrew Yooeun Chun
1d014e6146 v4l2codecs: fix typos in the documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8829>
2025-04-12 15:02:38 +09:00
Detlev Casanova
28fdf598e4 v4l2codecs: Unref the frame before leaving on error
In h264, h265 and mpeg2, make sure that dec_submit_bitstream() doesn't leak
a frame when dec_ensure_output_buffer() fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8794>
2025-04-09 15:43:03 +00:00
Detlev Casanova
880053c52c v4l2codecs: av1,vp9: Use temporary variable for buffer
This makes the end_picture() function handle the frame in the same way
as in vp8, which also fixes a frame leak when
gst_buffer_pool_acquire_buffer() fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8794>
2025-04-09 15:43:03 +00:00
Xavier Claessens
f6115efe8d Revert "va: h266 requires libva 2.22.0"
This reverts commit 8c017c79c5.

1.22 was the correct pkg-config version. It's only the subproject
version that was wrong. Since we bumped libva.wrap to 2.22 version, h266
is now always available when using the subproject.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8800>
2025-04-09 09:01:22 -04:00
Xavier Claessens
8c017c79c5 va: h266 requires libva 2.22.0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8788>
2025-04-08 11:45:11 +00:00
Guillaume Desmottes
d2086675a4 alphadecodebin: use a multiqueue instead of a couple of queues
Fix gapless playback as queues are no longer stopped after the first
eos.

Co-authored-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Fix #4165

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8775>
2025-04-07 23:45:33 +00:00
Olivier Crête
e3c3fd10cd va: Add since markers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8774>
2025-04-04 14:06:35 -04:00
Olivier Crête
7ed5c10751 va: Remove GstVaFeature marking as a plugin API
It's part of the libgstva library and it's documented there, no need
to duplicate it as it confuses hotdoc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8774>
2025-04-04 14:06:35 -04:00
Olivier Crête
f6b3538027 va: Add doc section for vah26xlpenc and codecalpha element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8774>
2025-04-04 14:06:35 -04:00
Olivier Crête
50cebd3ba8 qsv: Add since marker to device-path property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8774>
2025-04-04 14:06:30 -04:00
Michael Grzeschik
3b345568bc uvcsink: Respond to control requests with proper error handling
The complete handling on the control interface is currently dead.
We return with EOPNOTSUPP for the caller to know that a response
to such requests is not valid. The host however may ask
control interface why these control requests were not available.

For this the UVC_VC_REQUEST_ERROR_CODE_CONTROL is used. As an overall
exception for the control interface we just always return 0x06 as
an response which is representing "not implemented".

This patch is a necessary feature to properly pass the UVC Functionality
Test of the USB3CV Compliance Software.

Fixes: 69c1746139 ('uvcgadget: Properly implement GET_INFO control responses')
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7524>
2025-04-01 15:57:20 +00:00
Piotr Brzeziński
50d2d1446f avfvideosrc: Guess reasonable framerate values for some 3rd party devices
For some third-party devices macOS sometimes reports silly framerates,
like 750003/6250 instead of 120/1. To avoid users having to exactly
pecify those values, we instead report the closest reasonable value in
caps. If it ends up being chosen, the additional logic in
setDeviceCaps() will reverse that process and pass the actual supported
value back to AVF, as most often the rounding causes us to fall just
outside the accepted threshold.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8745>
2025-04-01 14:44:50 +00:00
Sebastian Dröge
3ac5bb2d36 va: Skip codecs that report maximum width or height lower than minimum
This happens on F42 with the JPEG decoders for some reason and trying to
actually use them with any resolution simply gives a "resolution not supported"
error.

A minimum of 64 is correctly reported though and trying to create caps with an
int range of [64, 0] gives critical warnings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8736>
2025-03-30 11:00:08 +00:00
Doug Nazar
ecccd6a8cf a2dpsink: Free various props during cleanup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
2025-03-27 09:03:18 +00:00
Doug Nazar
108cd906fa aja: Free various props during cleanup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
2025-03-27 09:03:18 +00:00
Doug Nazar
5f90a4ae67 all: Annotate *_set_property() contructor only props without free
Properties that are marked constructor only aren't required to be freed
before g_value_dup_string() as they can only be called once during construction.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
2025-03-27 09:03:18 +00:00
Piotr Brzeziński
ad6c5b05e9 vtenc: Reset restart flag when creating session in set_format()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8597>
2025-03-14 10:12:38 +00:00
Piotr Brzeziński
f7fe817c87 vtenc: Avoid deadlocking when changing properties on the fly
VT supports changing properties on the fly, and old code attempted to
support that. Perhaps 10 years ago that worked, but these days
VTSessionSetProperty will always wait for the output callback to finish
before proceeding. This means that it's very prone to deadlocking, as
property setters will take the object lock, the callback thread will
take the stream lock, and the main (streaming) thread attempts to take
both, resulting in a deadlock.

New version uses something similar to other encoders (e.g. x264enc) -
changing a property when a session is already created will just flag it
to be reconfigured upon the next encode call. This is done in similar
fashion to how restarting the session upon an error works.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8597>
2025-03-14 10:12:38 +00:00
Víctor Manuel Jáquez Leal
2172b4ab9f va: remove unused headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8626>
2025-03-13 10:02:05 +00:00
Thibault Saunier
ed693c7435 video: Give better names to buffer pools
Making debugging simpler

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8617>
2025-03-12 14:49:22 +00:00
Ruben Gonzalez
7b98c739c8 vacompositor: Add missing GST_VIDEO_CROP_META_API_TYPE
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8537>
2025-03-10 16:39:00 +00:00
Carlo Caione
69c1746139 uvcgadget: Properly implement GET_INFO control responses
According to the UVC 1.5 specification, section 4.1.2, the GET_INFO request
must return a bitmap indicating supported operations for the control.
Value 0x00 indicates that neither GET nor SET operations are supported.

This patch fixes control handling in the UVC gadget implementation to properly
respond to GET_INFO requests with the correct bitmap, allowing host systems
to properly detect supported control operations (none in this case).

The pipeline I'm using to test this is:

  gst-launch-1.0 videotestsrc ! uvcsink v4l2sink::device=/dev/video0

This is the equivalent of [0] but the difference is that we are now returning
0x00 instead of 0x03.

Without this change the host in my case is unable to probe the UVC gadget at
all, automatically disconnecting the device after a few seconds.

Following is the log when the gadget is not working (without this fix):

  usb 1-1.2: new high-speed USB device number 73 using xhci_hcd
  usb 1-1.2: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 5.15
  usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  usb 1-1.2: Product: UVC Gadget
  usb 1-1.2: Manufacturer: localhost.localdomain
  usb 1-1.2: SerialNumber: 0123456789
  usb 1-1.2: Found UVC 1.10 device UVC Gadget (0525:a4a2)
  usb 1-1.2: Failed to query (GET_INFO) UVC control 2 on unit 1: -110 (exp. 1).
  usb 1-1.2: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
  uvcvideo 1-1.2:1.1: Failed to query (129) UVC probe control : -71 (exp. 34).
  uvcvideo 1-1.2:1.1: Failed to initialize the device (-71).
  cdc_subset 1-1.2:1.0: probe with driver cdc_subset failed with error -22
  cdc_subset 1-1.2:1.1: probe with driver cdc_subset failed with error -22
  usb 1-1.2: USB disconnect, device number 73

With the fix the USB device is correctly probed:

  usb 1-1.2: new high-speed USB device number 88 using xhci_hcd
  usb 1-1.2: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 5.15
  usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  usb 1-1.2: Product: UVC Gadget
  usb 1-1.2: Manufacturer: localhost.localdomain
  usb 1-1.2: SerialNumber: 0123456789
  usb 1-1.2: Found UVC 1.10 device UVC Gadget (0525:a4a2)

[0] camera/uvc-gadget@0df9d3ad

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8572>
2025-03-07 10:12:25 +01:00
Benjamin Gaignard
cb681d8d28 v4l2codecs: Fix caps leak after sorting caps
gst_v4l2_format_sort_caps() create a new caps which need to be
release to avoid leak.

Co-authored-by: Robert Mader <robert.mader@posteo.de>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8583>
2025-03-06 21:28:33 +00:00
Benjamin Gaignard
95a3c0123f v4l2codecs: Release sink allocator when deciding allocation
All decoders have the same design pattern in decide allocation
and forgot to release sink allocator before allocating a new one.
Fixing the memory leak by clearing sink allocator before creating
the new one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8583>
2025-03-06 21:28:33 +00:00
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
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
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
Alexander Slobodeniuk
1eaf9b867e avfassetsrc: fix mutex leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8479>
2025-02-14 12:55:27 +00:00
Alexander Slobodeniuk
c3fdd1ea3a avfassetsrc: fix missing GObject dispose chainup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8479>
2025-02-14 12:55:27 +00:00