3#include <QtCore/qglobal.h>
5#if defined(QGC_HAS_GST_DMABUF_VULKAN_IMPORT)
12#include <vulkan/vulkan.h>
14#include <QtCore/QSize>
15#include <QtMultimedia/QVideoFrameFormat>
24namespace GstDmaBufVulkan {
28void requestDeviceExtensions();
33void probeDevice(QRhi& rhi);
37void* importDevice() noexcept;
42bool canImport(const GstQtDmaBufImport::PlaneFourccs& planeFourccs, quint64 modifier);
45std::vector<quint64> importableModifiers(quint32 planeFourcc);
50QVideoFrameTexturesUPtr importTextures(GstHwVideoBuffer& source, QRhi& rhi, QVideoFrameTexturesUPtr& old,
51 std::span<const GstQtDmaBufImport::Plane> planes,
52 QVideoFrameFormat::PixelFormat pixelFormat, QSize frameSize, GstBuffer* buffer,
56void resetCachedState() noexcept;
61class GstVulkanOwnedFrameTextures final : public GstHwFrameTexturesBase
64 GstVulkanOwnedFrameTextures(QRhi* rhi, QSize size, QVideoFrameFormat::PixelFormat pixelFormat,
65 std::span<const VkImage> images)
69 wrapPlanes(rhi, size, pixelFormat, images, VK_IMAGE_LAYOUT_GENERAL);
72 ~GstVulkanOwnedFrameTextures()
override
75 for (
auto& texture : _textures) {
84 void adoptVulkanResources(std::function<
void()> release)
noexcept { _release = std::move(release); }
87 std::function<void()> _release;