QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GstD3D12VideoBuffer.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/qglobal.h>
4
5#if defined(Q_OS_WIN) && defined(QGC_HAS_GST_D3D12_GPU_PATH)
6
7#include <array>
8
9#include "GstHwVideoBuffer.h"
10
11class QRhi;
12struct ID3D12Resource;
13
17class GstD3D12VideoBuffer final : public GstHwVideoBuffer
18{
19public:
20 GstD3D12VideoBuffer(GstSample* sample, const GstVideoInfo& videoInfo, const QVideoFrameFormat& format);
21 ~GstD3D12VideoBuffer() override;
22
23 QVideoFrameTexturesUPtr mapTextures(QRhi& rhi, QVideoFrameTexturesUPtr& oldTextures) override;
24 bool validatePlaneHandles() const override;
25
26 const char* storageTag() const override { return "D3D12"; }
27
29 static void resetCachedState() noexcept;
30
31private:
34 void resolvePlaneResources();
35
36 std::array<ID3D12Resource*, GstHw::kMaxPlanes> _resources{};
37 int _resolvedCount = 0;
38 bool _resolved = false;
39};
40
41#endif // Q_OS_WIN && QGC_HAS_GST_D3D12_GPU_PATH
Common base for GStreamer-backed QHwVideoBuffer subclasses.
virtual const char * storageTag() const
Human-readable GPU path identifier (e.g. "DMABuf"); string literal, safe from any thread.
virtual bool validatePlaneHandles() const
Streaming-thread sanity check on per-plane handles; failure routes to CPU memcpy.