Commit graph

871 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
fad06c9b6f vkimagebufferpool: refactor how image usage is set
Now that driver version is expected to be equal or superior to 1.3.275 the bug
in NVIDIA and RADV regarding usage is solved, we can revert commit b7ded81f7b.

Also this patch sets the internal usage variable after all the validation are
run, thus the state don't keep an invalid usage.

Finally, the now unused supported_usage variable is dropped.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7247>
2024-07-29 17:10:15 +02:00
Víctor Manuel Jáquez Leal
bb9eb6f477 vkimagebufferpool: add encoding usage as video usage
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7247>
2024-07-29 17:10:15 +02:00
Víctor Manuel Jáquez Leal
541e2e93ca vkimagebufferpool: reset the number of profiles at set_config()
Virtual method set_config() can be called several times, and if the number of
profiles counter isn't reset the pool will reach an error state.

The purpose of number of profiles is to check the number of valid vulkan video
profiles (two in the case of transcoding use-case, for example) so it's local to
set_config() virtual method.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7247>
2024-07-29 17:10:14 +02:00
Víctor Manuel Jáquez Leal
d8e384085a vulkan: encoder and decoder runtime check for driver version 1.3.275
Which is the one checked in meson. See commit 21ee264d65

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7247>
2024-07-29 17:10:14 +02:00
Víctor Manuel Jáquez Leal
8faefccfd5 va: refactor dmabuf handle close
Moved the close loop into a function guarded for non-win32 platforms.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7254>
2024-07-29 10:34:56 +02:00
Seungha Yang
f04f6f43c3 d3d12frame: Fix frame copy method
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7243>
2024-07-27 04:18:47 +09:00
Seungha Yang
28a7adf4dd d3d12memory: Check heap flag before trying to create NT handle
CreateSharedHandle() will fail eventually if the resource was created
with non-shared heap. Instead of trying to create handle blindly,
validate resource first.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7243>
2024-07-27 04:17:03 +09:00
Seungha Yang
4a6daad517 d3d12: Suppress fence data object leak report
We don't release GstD3D12Device intentionally, thus
a GstD3D12FenceDataPool owned by a device will not be released
but that's expected leak.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7243>
2024-07-27 03:23:22 +09:00
Seungha Yang
9a8d7db5de d3d12: Fix debug category name
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7243>
2024-07-27 03:23:22 +09:00
Jan Schmidt
1ebbcc31ef va: Fix dmabuf handle leaks
Close dmabuf handles manually when they're not going to
be passed into GStreamer FD memory, to avoid fd handle
leaks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7240>
2024-07-26 10:32:48 +00:00
Seungha Yang
0b285fc1a1 cuda: Fix runtime compiler loading with old CUDA tookit
Fallback to PTX if CUBIN symbol is unavailable

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3685
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7220>
2024-07-23 19:53:09 +00:00
Víctor Manuel Jáquez Leal
2387c3c4aa vkimagebufferpool: no aliased images for video decoding
This fix regression in validation layer introduced by commit 3a2e8d2d19

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7211>
2024-07-22 16:46:53 +00:00
Víctor Manuel Jáquez Leal
423f0d5384 vkdecoder: handle barrier internally for coincide references
This is to avoid a regression in validation layer (introduced by commit
916c4e70cd) when using vulkandownload

VUID-VkImageMemoryBarrier2-srcAccessMask-03914 ..  vkCmdPipelineBarrier2():
pDependencyInfo->pImageMemoryBarriers[1].srcAccessMask (VK_ACCESS_TRANSFER_READ_BIT)
is not supported by stage mask (VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR)

since vulkandownload set DPB memories' access mask to
VK_ACCESS_TRANSFER_READ_BIT, while they are retain by the DPB queue, so when
they are used as DPB after been shown, this validation error is raised.

Must of the barrier values are set ignoring the previous state of the vulkan
images.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7211>
2024-07-22 16:46:53 +00:00
Víctor Manuel Jáquez Leal
035e0698cf vkoperation: fix documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7203>
2024-07-22 10:49:33 +02:00
Víctor Manuel Jáquez Leal
e91ffae1f0 vkimagebufferpool: reset buffer's access flags
The access flags are kept around the operations, but when the buffer is
released, the access flag should be reset to its original value, since queue
transfers can be done along the pipeline and, when reusing the buffer, the new
queue might not support the latest access flag.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7165>
2024-07-19 14:45:39 +02:00
Víctor Manuel Jáquez Leal
2990cc5f71 vulkan: add source pipeline stage to _operation_add_frame_barrier()
Instead of dragging the last destination pipeline stage as current barrier
source pipeline stage (which isn't a valid semantic) this patch adds a parameter
to gst_vulkan_operation_add_frame_barrier() to set the source pipeline stage to
define the barrier.

The previous logic brought problems particularly with queue transfers, when the
new queue doesn't support the stage set during a previous operation in a
different queue.

Now the operation API is closer to Vulkan semantics.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7165>
2024-07-19 14:45:39 +02:00
Seungha Yang
9a06330d09 d3d12converter: Update internal method names
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7193>
2024-07-18 14:17:43 +00:00
Seungha Yang
b37bfc02f5 d3d12: Remove unnecessary event handles
null event NT handle to ID3D12Fence::SetEventOnCompletion()
will block the calling CPU thread already, thus it has no point that
creating an event NT handle in order to immediate wait for fence at CPU-side.
Note that passing a valid event NT handle to the fence API might be useful
when we need to wait for the fence value later (or timeout is required),
or want to wait for multiple fences at once via WaitForMultipleObjects().
But it's not a considered use case for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7176>
2024-07-16 19:17:15 +00:00
Víctor Manuel Jáquez Leal
c7259f3a5b vulkan: remove beta extensions guard for encode operations
This is not needed anymore since encoder operations are not beta anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7179>
2024-07-16 15:08:39 +00:00
Seungha Yang
89096dde38 h264decoder: Update output frame duration when second field frame is discarded
In case of an interlaced stream, if each field picture belongs to
different GstVideoCodecFrame, updates output frame's duration
based on discarded second field picture's timestamp information.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7132>
2024-07-15 16:36:50 +00:00
Víctor Manuel Jáquez Leal
058ae85b22 vadisplay: fix minor version check
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7164>
2024-07-12 14:34:31 +00:00
Víctor Manuel Jáquez Leal
3a2e8d2d19 vkimagebufferpool: set image creation flags in needed
set ALIAS bit if the usage is for both sampled and storage.

set MUTABLE_FORMAT and EXTENDED_USAGE bits if the image is a multiplane YUV and
uses multiple memories.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6798>
2024-07-11 20:28:04 +02:00
Víctor Manuel Jáquez Leal
0f8f2d0057 vkformat: add gst_vulkan_format_get_map function
This will be used later to compare the format selected by
gst_vulkan_format_from_video_info_2(), to verify if it's multiple memory buffer
or not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6798>
2024-07-11 20:28:04 +02:00
Víctor Manuel Jáquez Leal
2d17bba6f1 vkimagebufferpool: define a default usage
Define a default usage and use it instead of repeating the same bitwise
addition.

Therefore, when usage is defined as zero, the usage is defined with the
format's supported usage and the default usage, now without the storage
bit, but with color and input attachment bits.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6798>
2024-07-11 10:52:19 +02:00
Víctor Manuel Jáquez Leal
b1eebec485 vkformat: unward G8_B8R8_2PLANE_420_UNORM
Since it exists since VK_VERSION_1_1. It should be ignored by usage flags or the
no_multiplane parameter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6798>
2024-07-11 10:52:19 +02:00
Robert Mader
abf3361de3 waylandsink: Fix surface cropping for rotated streams
The wp_viewport source rectangle is applied in surface-local coordinates
after buffer_transform and buffer_scale. Therefore we need to swap width
and height for 90/270 deg. rotations.

This fixes playback of rotated videos such as portrait videos from
mobile devices.

See also: https://wayland.app/protocols/viewporter#wp_viewport

Fixes: 0b648f9a2d ("waylandsink: Crop surfaces to their display width height")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7136>
2024-07-10 17:13:54 +00:00
Nirbheek Chauhan
8619e163bf vk-video: Fix uint64_t string format errors
With clang on macOS:

```
error: format specifies type 'long' but the argument has type 'uint64_t' (aka 'unsigned long long')
...
error: format specifies type 'unsigned long' but the argument has type 'VkImageView' (aka 'unsigned long long')
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7091>
2024-07-07 13:20:12 +00:00
Nirbheek Chauhan
156a016313 meson: Find MoltenVK with the objc++ compiler everywhere
When building for iOS in Cerbero, as of MoltenVK SDK 1.3.283, we have
to statically link to libMoltenVK since it no longer ships a dylib.
This requires linking to libc++, so we find the dep with the objc++
compiler to ensure that meson uses the right linker.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7091>
2024-07-07 13:20:12 +00:00
Nirbheek Chauhan
5ed3e045d8 meson: Fix vulkan library build on iOS
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7091>
2024-07-07 13:20:12 +00:00
Nirbheek Chauhan
5c41d387e3 meson: Use / instead of join_paths for vulkan
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7091>
2024-07-07 13:20:12 +00:00
Nirbheek Chauhan
54a6643986 meson: Fix automagic dependency checks in gstvulkan
Windowing, in particular, was getting silently disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7091>
2024-07-07 13:20:12 +00:00
jadarve
fd25409a70 doc: fix Since marker
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6793>
2024-07-03 08:40:22 +00:00
jadarve
3323245606 mpegts: Added missing function prototype
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6793>
2024-07-03 08:40:21 +00:00
jadarve
5c3f3d8f16 doc: fix docstrings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6793>
2024-07-03 08:40:21 +00:00
jadarve
14c4d62915 doc: fix single line Since comments
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6793>
2024-07-03 08:40:21 +00:00
jadarve
7f35a4f7c3 doc: fix Since marker for gst_mpegts_descriptor_from_metadata_pointer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6793>
2024-07-03 08:40:21 +00:00
jadarve
fad36407bb doc: update docstrings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6793>
2024-07-03 08:40:21 +00:00
jadarve
0a57f361ce mpegts: use GstMpegtsMetadataApplicationFormat in metadata descriptor
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6793>
2024-07-03 08:40:21 +00:00
jadarve
992a35b8f9 mpegts: added metadata pointer descriptor
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6793>
2024-07-03 08:40:21 +00:00
jadarve
669a351c78 mpegts: moved metadata descriptors to gstmpegtsdescriptor
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6793>
2024-07-03 08:40:20 +00:00
Seungha Yang
6cac053549 d3d12bufferpool: Use shared heap by default
... to make cross-api resource sharing possible

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7119>
2024-07-01 20:18:42 +00:00
Thibault Saunier
5f50b93f0a meson: Remove duplicated library definitions for gstmse and gstanalytics
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7109>
2024-06-30 15:43:27 +00:00
Seungha Yang
c2531853fc d3d12commandallocatorpool: Remove unused methods
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7108>
2024-06-29 20:47:39 +09:00
Seungha Yang
76fd732d42 qsv: Check d3d shared resource tier using D3D11 API
We can check the tier using d3d11 API. Thus, don't need to
create d3d12 device

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7099>
2024-06-26 16:25:06 +00:00
Seungha Yang
e71ffe978a d3d12converter: Make sure data upload before executing compute shader
Use read d3d12 map, so that upload can happen if needed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7093>
2024-06-24 20:49:19 +09:00
Seungha Yang
245e15eab0 d3d12: Add ARGB64_LE format support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7093>
2024-06-24 20:11:21 +09:00
Seungha Yang
8c538c8122 d3d12: Add AV12 format support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7093>
2024-06-24 20:11:13 +09:00
Seungha Yang
2703f41da6 d3d12: Add NV16, NV61, and NV24 format support
Can reuse NV12 shader for the formats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7093>
2024-06-24 20:10:50 +09:00
Seungha Yang
bb0f95a67f d3d12: Add A420, A422 and A444 format support
Adding A420/A422/A444 and its 10/12/16 bits format support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7093>
2024-06-24 20:10:50 +09:00
Seungha Yang
52bc28c93d d3d12: Add YUV 4:1:0 and 4:1:1 format support
Adding Y41B, YUV9, and YVU9 format support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7093>
2024-06-24 20:10:50 +09:00