QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GstD3D11VideoBuffer.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_D3D11_GPU_PATH)
6
7#include <array>
8
9#include "GstHwVideoBuffer.h"
10
11class QRhi;
12struct ID3D11Texture2D;
13
16class GstD3D11VideoBuffer final : public GstHwVideoBuffer
17{
18public:
19 GstD3D11VideoBuffer(GstSample* sample, const GstVideoInfo& videoInfo, const QVideoFrameFormat& format);
20 ~GstD3D11VideoBuffer() override;
21
22 QVideoFrameTexturesUPtr mapTextures(QRhi& rhi, QVideoFrameTexturesUPtr& oldTextures) override;
23 bool validatePlaneHandles() const override;
24
25 const char* storageTag() const override { return "D3D11"; }
26
28 static void resetCachedState() noexcept;
29
30private:
32 void resolvePlaneResources();
33
34 std::array<ID3D11Texture2D*, GstHw::kMaxPlanes> _textures{};
35 int _resolvedCount = 0;
36 bool _resolved = false;
37};
38
39#endif // Q_OS_WIN && QGC_HAS_GST_D3D11_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.