Commit graph

3423 commits

Author SHA1 Message Date
Seungha Yang
20852ba028 d3d12videosink: Disconnect window signal handler on dispose as intended
Fixing typo

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7012>
2024-06-10 23:33:26 +09:00
Seungha Yang
20db3369d3 d3d12videosink: Add error-on-closed property
Adding a property to control error reporting behavior when output
window is closed in playing or paused state. This can be useful
for apps where an app wants to close window even if it's playing
a stream, and the closed window is expected.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6939>
2024-06-09 16:48:41 +00:00
Stéphane Cerveau
fe737fc274 vulkan: fix macos build
The VulkanSDK can be downloaded from LunarG website and can
be installed properly in /usr/local following:

https://vulkan.lunarg.com/doc/view/latest/mac/getting_started.html

Fixes partly #2372

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6669>
2024-06-07 03:16:26 +00:00
Matthew Waters
b6d03432b4 vulkan/fullscreenquad: add check for unset video info
So we don't crash when set_info() is not called.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7000>
2024-06-07 01:44:32 +00:00
Matthew Waters
e925f22f33 vulkan/fullscreenquad: allow setting NULL input/output buffer to unset
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7000>
2024-06-07 01:44:32 +00:00
Seungha Yang
afb62e98c7 cuda: Enable x86 NVMM support again
It was broken since memory copy helper function was moved to gst-libs.
Also, adding "cuda-nvmm" and "cuda-nvmm-include-path" build options
to en/disable NVMM support in gstcuda library

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6978>
2024-06-06 12:16:50 +00:00
Seungha Yang
6fb0c7b928 examples: cuda: Add CUDA memory synchronization example
Add an example code for external CUDA context sharing and
gst_cuda_memory_sync()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6864>
2024-06-06 11:27:26 +00:00
Stéphane Cerveau
a17957a7c8 vulkan: remove remaining GST_VULKAN_HAVE_VIDEO_ENCODERS
Some define use have been forgotten in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6992

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7001>
2024-06-06 10:32:51 +00:00
Sebastian Dröge
400c379c3d mxf: Use GDateTime instead of gmtime()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6872>
2024-06-06 08:33:51 +00:00
Stéphane Cerveau
df33ae2da6 gst-plugins-bad: tests: rename vkvideoencode tests
Rename vulkan encode tests to be able to use the namespace
libs_vkvideoencode*.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6992>
2024-06-05 17:50:27 +00:00
Stéphane Cerveau
21ee264d65 vulkan: remove GST_VULKAN_HAVE_VIDEO_ENCODERS
Use 2.3.275 as first supported SDK version

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6992>
2024-06-05 17:50:27 +00:00
Stéphane Cerveau
b9633cb766 vkqueue: remove useless decoder include
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6992>
2024-06-05 17:50:26 +00:00
Thibault Saunier
11f96ce4dd autoconvert: Fix race condition when creating sub elements
There was a case where the element would get destroyed while being
added to the hash table of elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6989>
2024-06-05 12:53:45 +00:00
Sebastian Dröge
cfb59df83e dtlssrtpenc: Don't crash if no pad name is provided when requesting a new pad
It is mandatory to provide a valid pad name for dtlssrtpenc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6984>
2024-06-05 07:30:36 +00:00
Matthew Waters
013026b06a vulkan/videofilter: add getters for queue/device/instance
Allows bindings to not pke at structs for this information.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6987>
2024-06-03 00:06:18 +10:00
Matthew Waters
a7a70ca7b6 vulkan/fullscreenquad: add get_queue()
Allows bindings to not poke at the instance struct.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6987>
2024-06-03 00:06:18 +10:00
Matthew Waters
5e182c911c vulkan/fullscreenquad: mark set_info GstVideoInfo as const
It's not modified by the function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6987>
2024-06-03 00:06:18 +10:00
Matthew Waters
5b471311c5 vulkan: also support glslang as a shader compiler
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6980>
2024-06-01 12:41:49 +00:00
Matthew Waters
346df4cb3f vulkan: support not having glslc available for building vulkan plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6980>
2024-06-01 12:41:49 +00:00
Stéphane Cerveau
7bbf5fd801 vkutils: do not forget to clear context in case of error
The context is leaking in case of a failing instance open.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6975>
2024-05-31 14:44:09 +00:00
Stéphane Cerveau
c3f3fd7351 vkerror: free the error string after usage
g_set_error already used the var string, can clear it now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6975>
2024-05-31 14:44:09 +00:00
Seungha Yang
e9cefde479 d3d12memory: Fix staging buffer alignment
Not all GPUs can support arbitrary offset of
D3D12_PLACED_SUBRESOURCE_FOOTPRINT when copying GPU memory between
texture and buffer. Instead of calculating size/offset per plane,
calculate the entire size and offsets at once.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6967>
2024-05-30 10:40:44 +00:00
Nirbheek Chauhan
907aca399f msdk: Fix libdrm dependency detection and usage
drm_fourcc.h should be picked up via the pkgconfig include, not the
system includedir directly.

Also consolidate the libdrm usage in va and msdk.

All this allows it to be picked up consistently (via the subproject,
for example).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Nirbheek Chauhan
e3f086c648 meson: Don't use fallback: kwarg for libva deps
This will cause a fallback even when the `va` option is `auto`, not
giving the user a chance to provide the dependency via the system, and
likely building this feature unnecessarily.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Nirbheek Chauhan
deaa0aef79 va: Fix libdrm include
The libdrm/ prefix should not be used, it will be provided by the
pkgconfig file. Also HAVE_LIBDRM is necessary.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Víctor Manuel Jáquez Leal
236d6714ec msdkcaps: fix ill-format string
This patch fixes this critical warning when registering MSDK:

_dma_fmt_to_dma_drm_fmts: assertion 'fmt != GST_VIDEO_FORMAT_UNKNOWN' failed

It was because the HEVC string with possible output formats has an extra space
that could not be parsed correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6853>
2024-05-29 13:08:55 +00:00
Seungha Yang
96cf3d7063 d3d12encoder: Do not print error log for not-supported feature
gst_d3d12_result() will print message with ERROR level if failed.
Use FAILED/SUCCEEDED macros instead, since not-supported feature
is not a critical error

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6955>
2024-05-29 10:45:13 +00:00
Seungha Yang
ec11bb8253 d3d12memory: Allow null allocator in alloc()
Update code as documented

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6940>
2024-05-29 09:45:26 +00:00
Nicolas Dufresne
79312357a6 av1parse: Properly transfer TU timestamp
When transforming from unknown alignment to frame or obu, the TU timestamp
was not properly transferred. Fix this by saving the TU DTS as the first
DTS seen within the the TU data, and the PTS as the last PTS seen in that
TU data. Finally, reset the TU timestamp after each TU have completed.

Fixes #1496

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6895>
2024-05-28 23:59:36 +00:00
Nicolas Dufresne
5b1bc0f19f av1parse: Only place a marker on the last frame of a TU
Markers are meant to indicate the buffer that ends a frame, which imply
something can be displayed. The dependent decode only frames should not
have markers. This should also fix last subframe detection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6895>
2024-05-28 23:59:36 +00:00
Seungha Yang
a4dfca3ae4 webview2: Add user-data-folder property
Adding a propery to specify location of WebView2's user data folder
location.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6921>
2024-05-28 16:56:09 +00:00
Seungha Yang
c1b1c849f2 d3d12: Add support for Device Removed Extended Data (DRED)
Enable DRED if "d3d12dred > GST_LEVEL_ERROR", and print
DRED debug information on device removed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6718>
2024-05-28 15:09:21 +00:00
Piotr Brzeziński
4612a6795a vtenc: Enable HEVC with alpha encoding
Adds a separate vtenc_h265a element (with a _hw variant as usual) for the HEVCWithAlpha codec type.
Decided to go with a separate element to not break existing uses of the normal HEVC encoder.
The preserve_alpha property is still only used for ProRes, no need for it here because we explicitly say we want alpha
when using the new element.

For now, the HEVCWithAlpha has an issue where it does not throttle the amount of input frames queued internally.
I added a quick workaround where encode_frame() will block until enqueue_frame() callback notifies it that some space
has been freed up in the internal queue. The limit was set to 5, which should be enough I guess? Hopefully this is not
too prone to race conditions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6664>
2024-05-28 10:53:25 +00:00
Piotr Brzeziński
2aa1f465e2 vtenc: Add missing vtenc_h265 docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6664>
2024-05-28 10:53:25 +00:00
Elliot Chen
7b547e044c autovideoconvert: should not forward the allocation query if no element is selected
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6927>
2024-05-27 22:46:31 +00:00
Philippe Normand
299a000917 webrtcbin: Allow session level setup attribute in SDP
An SDP answer can declare its setup attribute at the session level or at the
media level. Until this patch we were validating only the latter case and an
assert was raised in the former case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6930>
2024-05-27 14:21:15 +00:00
Víctor Manuel Jáquez Leal
ecf852d529 vulkanh264dec: code style fix
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6901>
2024-05-24 17:40:04 +00:00
Víctor Manuel Jáquez Leal
4a88137b2f vulkanh265dec: fix reference set
`StdVideoDecodeH265PictureInfo.flags.IsReference` refers to section 3.132 ITU-T
H.265 specification:

reference picture: A picture that is a short-term reference picture or a
long-term reference picture.

`GstH265Picture.ref` doesn't reflect this, but we need to query the NAL type of
the processed slice.

This patch fixes the validation layer error
`VUID-vkCmdBeginVideoCodingKHR-slotIndex-07239` while using the NVIDIA driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6901>
2024-05-24 17:40:04 +00:00
Seungha Yang
84aecab150 d3d12videosink: Add overlay signal to support d3d12/d3d11/d2d overlay
Conceptually identical to the present signal of d3d11videosink.
This signal will be emitted with current render target
(i.e., swapchain backbuffer) and command queue. Signal handler
can record GPU commands for an overlay image or to blend
an image to the render target.

In addition to d3d12 resources, videosink will send
d3d11 and d2d resources depending on "overlay-mode"
property, so that signal handler can render by using
preferred/required DirectX API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6838>
2024-05-24 15:55:17 +00:00
Seungha Yang
4d779d7de8 d3d12videosink: Use device's main direct queue
The idea of using separate command queue per videosink was that
swapchain is bound to a command queue and we need to flush the
command queue when window size is changed. But the separate
queue does not seem to improve performance a lot.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6838>
2024-05-24 15:55:17 +00:00
Sebastian Dröge
c051982c0f dtlsconnection: Fix overflow in timeout calculation on systems with 32 bit time_t
If a timeout of more than 4295s was scheduled, the calculation would
overflow and a too short timeout would be used instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6870>
2024-05-24 11:43:19 +00:00
He Junyan
ea0dce26e0 kmssink: Do not close the DRM prime handle twice
The prime_fds for multi planes may be the same. For example, on Intel's
platform, the NV12 surface may have the same FD for the plane0 and the
plane1. Then, the DRM_IOCTL_GEM_CLOSE will close the same handle twice
and get an "Invalid argument 22" error the second time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6914>
2024-05-23 15:45:24 -04:00
Víctor Manuel Jáquez Leal
e913b4870a vkformat: try UNORM format first and decouple them from colorimetry
From the spec (chapter 34, v1.3.283):

````
UNORM: the components are unsigned normalized values in the range [0, 1]

SRGB: the R, G and B components are unsigned normalized value that represent
      values using sRGB nonlinear encoding, while the A component (if one
      exists) is a regular unsigned normalized value
```

The difference is the storage encoding, the first one is aimed for image
transfers, while the second is for shaders, mostly in the swapchain stage in the
pipeline, and it's done automatically if needed [1].

As far as I have checked, other frameworks (FFmpeg, GTK+), when import or export
images from/to Vulkan, use exclusively UNORM formats, while SRGB formats are
ignored.

My conclusion is that Vulkan formats are related on how bits are stored in
memory rather their transfer functions (colorimetry).

This patch does two interrelated changes:

1. It swaps certain color format maps to try first, in both
gst_vulkan_format_from_video_info() and gst_vulkan_format_from_video_info_2(),
the UNORM formats, when comparing its usage, and later check for SRGB.

2. It removes the code that check for colorimetry in
gst_vulkan_format_from_video_info_2(), since it not storage related.

1. https://community.khronos.org/t/noob-difference-between-unorm-and-srgb/106132/7

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6797>
2024-05-23 17:41:30 +00:00
Seungha Yang
417e784463 Revert "tests/d3d11: add concurrency test for gstd3d11device"
This reverts commit 8e0046a738.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6904>
2024-05-23 15:16:02 +00:00
Seungha Yang
f47a198977 Revert "d3d11device: protect device_lock vs device_new"
This reverts commit 926d5366b9.

AcquireSRWLockExclusive seems to be acquiring lock in exclusive mode
when the same lock is combined with write lock access.
Reverting the commit because of this is unexpected behavior
and unavoidable OS bug.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6904>
2024-05-23 15:16:02 +00:00
Daniel Stone
2f2279abf4 wayland: Use wl_display_create_queue_with_name
Wayland 1.23 and above allow us to attach names to an event queue, which
are printed out when debugging. Do this to make the logs easier to read.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6900>
2024-05-23 13:38:01 +00:00
Seungha Yang
e813ea8367 cudamemory: Fix offset of subsampled planar formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6903>
2024-05-23 11:47:16 +00:00
Sebastian Dröge
fece9235a2 av1enc: Add timebase property to allow configuring a specific timebase
This mirrors the same property in vp8enc / vp9enc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6891>
2024-05-23 09:15:34 +00:00
Sebastian Dröge
fbc968d06c av1enc: Use 1/90000 as timebase and don't use the framerate at all
This mirrors the behaviour in vp8enc / vp9enc and is generally more
useful than using any framerate from the caps as it provides some degree
of accuracy if the stream doesn't have timestamps perfectly according to
the framerate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6891>
2024-05-23 09:15:34 +00:00
Sebastian Dröge
f82a512387 av1enc: Fix last timestamp tracking so it actually works
This behaves exactly the same as in vp8enc / vp9enc now.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6891>
2024-05-23 09:15:34 +00:00