Commit graph

1715 commits

Author SHA1 Message Date
Benjamin Gaignard
c25c4355b1 v4l2codecs: udpate videodev2.h
Update videodev2.h to be aligned with kernel version v6.10

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7684>
2024-10-19 01:39:03 +00:00
L. E. Segovia
4dcc4b6235 meson: Undefine any WINVER and _WIN32_WINNT entries before redefining them
Fixes Cerbero build with MinGW GCC 14, where specifying -DWINVER=0x0601 -DWINVER=0x0A00 is a hard -Werror.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7658>
2024-10-12 19:10:46 -03:00
L. E. Segovia
572f2d10f5 meson: amfcodec: fix build with MinGW GCC 14
>  ../sys/amfcodec/include/core/PropertyStorage.h:87:50: error: 'virtual void
>   amf::AMFPropertyStorage::RemoveObserver(amf::AMFPropertyStorageObserver*)' was hidden [-Werror=overloaded-virtual=]

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7658>
2024-10-12 19:05:23 -03:00
L. E. Segovia
4af2121189 meson: d3d12: fix build with MinGW GCC 14
Also apply the d3d11 fix since both use the same header.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7658>
2024-10-12 19:01:46 -03:00
L. E. Segovia
f8d6b3d568 meson: d3d11: fix build with MinGW GCC 14
In my tests with the new GCC 14 compiler for Cerbero, I got the
following error:

> In file included from include/directxmath/DirectXMath.h:2275,
> from ../gst-libs/gst/d3d11/gstd3d11converter.cpp:46:
> include/directxmath/DirectXMathMatrix.inl: In function 'bool
>   DirectX::XMMatrixDecompose(XMVECTOR*, XMVECTOR*, XMVECTOR*, FXMMATRIX)':
> include/directxmath/DirectXMathMatrix.inl:1161:16:
>  error: variable 'aa' set but not used [-Werror=unused-but-set-variable]

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7658>
2024-10-12 19:01:13 -03:00
Nirbheek Chauhan
80bb69ba66 vtdec: Set input formats when we get incomplete caps
In some cases, decodebin3 will send us incomplete caps (not containing
codec_data), and then a GAP event, which will force a negotiation.
This segfaults due to a null pointer deref because self->input_state
is NULL.

The only possible fix is to avoid negotiating when we get incomplete
caps (to avoid re-negotiationg immediately afterwards, which isn't
supported by some muxers), but also set as much input state as
possible so that a renegotiation triggered by a GAP event can complete
successfully.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7634>
2024-10-12 01:31:52 +00:00
Seungha Yang
7c06001705 d3d12: Shorten various names
Update names of various objects and method to be shorter, for instance
GstD3D12CommandAllocator is changed to GstD3D12CmdAlloc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7642>
2024-10-10 10:35:36 -04:00
Piotr Brzeziński
9a232f7983 vtenc: Don't call drop_frame() when flushing
Slipped through with earlier changes to use drop/release_frame() explicitly.
We should only drop when something goes wrong in the encoder, and just release otherwise.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7475>
2024-10-09 20:29:52 +00:00
Seungha Yang
d9114db5d0 nvdecoder: Add support for D3D12 output
Enable D3D12 output if device can support D3D12 interop

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7529>
2024-10-02 02:02:08 +09:00
Seungha Yang
16e94b7fc3 nvcodec: Add support CUDA to D3D12 memory copy
Adding CUDA -> D3D12 memory copy method to GstCudaD3D12Interop

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7529>
2024-10-02 02:02:08 +09:00
Mengkejiergeli Ba
5bf85229e5 msdkenc: Guard the read of thiz->initialized with the modification of this value
This is to avoid wrongly read/write thiz->initialized when multi-thread
invoking encoder init function, it is possible when user apps deploy
multi-thread to dynamically change encoder's settings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7578>
2024-09-29 01:07:39 +00:00
Sebastian Dröge
be6eba3e9e ntv2: Update to AJA NTV2 SDK 17.1.0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7568>
2024-09-27 16:43:37 +00:00
Sebastian Dröge
b7b24573ce common: Use more efficient versions of GstCapsFeatures API where possible
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
2024-09-26 19:26:18 +03:00
Sebastian Dröge
3b9f050600 common: Stop using GQuark-based GstCapsFeatures API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
2024-09-26 19:21:29 +03:00
Sebastian Dröge
6233eb0ff3 common: Stop using GQuark-based GstStructure field name API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
2024-09-26 19:21:29 +03:00
Seungha Yang
2d91521dfc d3d12: Fix resource allocation on old Windows version
D3D12_HEAP_FLAG_CREATE_NOT_ZEROED flag was introduced as of
Windows 10 May 2020 Update, and older versions don't understand
the heap flag. Checks the feature support and enables the
D3D12_HEAP_FLAG_CREATE_NOT_ZEROED only if it's supported by OS

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7573>
2024-09-26 12:48:55 +00:00
Weijian Pan
df23724b96 avfdeviceprovider: Fix caps leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6966>
2024-09-26 11:48:19 +00:00
Michael Grzeschik
4670e1c809 uvcsink: make gst_v4l2uvc_fourcc_to_bare_struct work with more raw formats
The uvcsink was limited to only transfer YUY2 and MJPEG. For the
uncompressed formats there is no technical reason not to support them.

Since gst_video_format_to_string is already supporting more fourcc than
only YUY2 we use the default path in gst_v4l2uvc_fourcc_to_bare_struct
to create structures for more formats and bail out if the returned
format is not from the uncompressed type.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6037>
2024-09-24 20:07:40 +00:00
Hugues Fruchet
5801e17160 kmsallocator: fix stride with planar formats
This fixes a regression introduced by the merge request
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3801

The extrapolated stride was computed but not used, resulting in the same
stride being applied to all planes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7566>
2024-09-24 12:57:16 -04:00
Seungha Yang
86af5a5f20 d3d12: Add colorconvert and scale elements
In addition to existing d3d12convert element which supports
color conversion and rescale at once, adding
separate color-conversion-only and scale-only elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7560>
2024-09-24 20:58:47 +09:00
Seungha Yang
cef201734c d3d12: Add d3d12mipmapping element
Adding a new element for texture conversion from single mip level
texture to mipmapping enabled RGBA texture

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7555>
2024-09-23 13:52:37 +00:00
Seungha Yang
51e1834e81 d3d12: Use D3D12_FILTER_MIN_MAG_MIP_LINEAR filter by default
... instead of D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT, since we supports
mipmap texture now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7555>
2024-09-23 13:52:37 +00:00
Seungha Yang
71d26ee4f8 d3d12swapchainsink: Add auto-resize mode
Automatically resize swapchain backbuffer to be identical to
stream resolution if user calls resize() signal with zero resolution

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7550>
2024-09-20 19:19:15 +00:00
Seungha Yang
9dee102867 d3d12swapchainsink: Add support for MSAA
Adding "msaa" property and enable MSAA if supported by device

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7550>
2024-09-20 19:19:15 +00:00
Seungha Yang
ce5321be68 d3d12videosink: Use converter config for initial MSAA setup
Avoid redundant pso creation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7550>
2024-09-20 19:19:15 +00:00
Seungha Yang
965d898deb d3d12swapchainsink: Add sampling-method property
Allow setting sampler filter method to use

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7550>
2024-09-20 19:19:15 +00:00
Seungha Yang
62caa76155 d3d12convert: Use new sampler filter update method
... instead of creating new converter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7550>
2024-09-20 19:19:15 +00:00
He Junyan
05353e69ca va: decoder: Delete all the internal locks
In fact, the va decoder is just a internal helper class and its access
is under the control of all dec elements. So far, there is no parallel
operation on it now.
At the other side, some code scan tools report race condition issues.
For example, the "context" field is just protected with lock at _open()
but is not protected at _add_param_buffer().
So we just delete all its lock usage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7547>
2024-09-20 14:36:17 +00:00
He Junyan
6bb294343b va: jpegenc: Fix a memory leak when filter sink caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7547>
2024-09-20 14:36:17 +00:00
He Junyan
dfccbd52f4 va: vpp: Use gst_caps_replace to operate the filter_caps
No need to use lock when we assign value to priv->filter_caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7547>
2024-09-20 14:36:17 +00:00
Benjamin Gaignard
0d0097b0b2 v4l2codecs: h265: Minimize memory allocation
Be smarter when allocating sink and source memory pools to reduce the
memory footprint. Use gst_v4l2_decoder_get_render_delay() to know the
need number of buffers for downstream element.

Handle errors in case of memory allocation failures.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7544>
2024-09-18 22:34:34 +00:00
Seungha Yang
5182cac9be d3d12decoder: Disable sub-allocated bitstream buffer
This sub-allocation causes decoding artifacts for some reason
on Intel platform

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7535>
2024-09-18 10:23:26 +00:00
Xavier Claessens
a791648600 aja: there is no need to take object lock
Both _sink_event() and _aggregate() vfunc are called from the source pad
streaming thread. There is thus no need to protect caps fields.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7536>
2024-09-17 15:59:47 +00:00
Seungha Yang
f5ce4d10b1 nvencoder: Add support for d3d12 memory
Use d3d12 -> cuda memory copy helper object in cuda mode encoder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7480>
2024-09-14 15:33:44 +00:00
Seungha Yang
6d28f3b2c6 nvcodec: Add a helper object for d3d12 interop
Adding new helper object for d3d12 -> cuda memory copy

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7480>
2024-09-14 15:33:44 +00:00
Seungha Yang
d5d17d804e nvencoder: Disable stream ordered allocation
Stream ordered allocation is not supported by encoder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7427>
2024-09-11 17:15:14 +00:00
Seungha Yang
f72a775d03 cudaipcsink: Disable stream ordered allocation
Legacy CUDA IPC does not support default CUDA memory pool

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7427>
2024-09-11 17:15:14 +00:00
Michael Tretter
76d753f1c5 uvcsink: set cur_caps to upstream selected caps
If the UVC gadget announces multiple formats in the descriptors the uvcsink
doesn't select the actual format but let's the UVC hosts select the format.

If the GStreamer pipeline is started before a UVC host selected the format,
upstream decides on a format until the UVC host has decided. In this case, the
current format needs to be set based on the caps from the caps event to be able
to detect if the format selection by the UVC host requires a format change on
the GStreamer pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7473>
2024-09-09 18:57:35 +00:00
Michael Tretter
f82a716009 uvcsink: skip comparison with prev_caps if they are not set
The uvcsink may be put into the READY state to start listening for UVC requests.
Therefore, the UVC host may set a streaming format before the GStreamer pipeline
is started and the uvcsink received a caps event. In this case, prev_caps will
be NULL.

If the EVENT_CAPS has not been received, skip the check if the format needs to
be changed, since the sink will be started with the format selected by the UVC
host, anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7473>
2024-09-09 18:57:35 +00:00
Seungha Yang
63dc54906b nvencoder: Prefer byte-stream format over packetized
Since old encoder implementation supported only byte-stream,
prefers byte-stream format for backward compatibility.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3787
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7457>
2024-09-06 01:10:14 +09:00
Michael Scherle
b1cda4439b va: restrict interpolation & scaling property to iHD driver
interpolation & scaling is supported for all hardware on
iHD driver. But not supported in mesa driver. see:

<https://github.com/intel/media-driver/issues/1843>
<https://gitlab.freedesktop.org/mesa/mesa/-/issues/11803>

improvment of:
<https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7301>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7443>
2024-09-05 13:11:37 +00:00
Víctor Manuel Jáquez Leal
85341d6dad vajpegenc: set interlace-mode, colorspace and sampling in output caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6022>
2024-09-05 09:56:02 +00:00
He Junyan
4550671b6f va: Implement the vajpegenc plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6022>
2024-09-05 09:56:02 +00:00
He Junyan
f7e434028d va: baseenc: Check the bitrate property before get its value
Not all the encoders have the bitrate property, such as the jpeg enc.
We need to check that property before getting its value, or the glib
will print warnings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6022>
2024-09-05 09:56:02 +00:00
Seungha Yang
9363a0af42 dwrite: Allow unlimited number of in-flight d3d12 commands
... so that it can be controlled by global direct command queue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7444>
2024-09-04 12:56:43 +00:00
Seungha Yang
d0505fba55 d3d12: Add async-depth property
Adding a property to control the number of in-flight GPU commands
(default is unlimited). Note that actual maximum number is defined
in d3d12device's direct command queue object which is 32 now,
thus total number of scheduled GPU commands cannot exceed 32.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7444>
2024-09-04 12:56:43 +00:00
Piotr Brzeziński
e9ab880e66 vtenc: Use new release_frame/drop_frame encoder API
Replaces usage of gst_video_codec_frame_unref everywhere.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7173>
2024-09-04 06:46:07 +00:00
Piotr Brzeziński
00eb9ad62e vtenc: Restart encoding session when certain errors are detected
Sometimes under certain loads, VT can error out with kVTVideoEncoderMalfunctionErr or kVTVideoEncoderNotAvailableNowErr.
These have been reported to happen more often than usual if CopyProperty/SetProperty() is used close to the encode call.
Both can be worked around by restarting the encoding session.

These errors can be returned either directly from VTCompressionSessionEncodeFrame() or later in the encoding callback.
This patch handles both scenarios the same way - a session restart is be attempted on the next encode_frame() call.

If the error is returned immediately by the encode call, it's possible that some correct frames will still be given to
the output callback, but for simplicity (+ because I wasn't able to verify this scenario) let's just discard those.

In addition, this commit also simplifies the beach/drop logic in enqueue_buffer.

Related bug reports in other projects:
http://www.openradar.me/45889262
https://github.com/aws/amazon-chime-sdk-ios/issues/170#issuecomment-741908622

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7173>
2024-09-04 06:46:07 +00:00
Tim-Philipp Müller
59d56bcb3f gst-plugins-bad: use g_sort_array() instead of deprecated g_qsort_with_data()
Fixes compiler warnings with the latest GLib versions.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4127

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7384>
2024-09-02 22:31:34 +00:00
Michael Scherle
671281d860 va: add interpolation method for scaling
For description of interpolation methods, see:
<https://intel.github.io/libva/structVAProcPipelineParameterBuffer.html#abb95e119ed7f841f71b2afbec2104784>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7301>
2024-08-20 08:36:03 +00:00