3#include <QtCore/qglobal.h>
5#if defined(QGC_HAS_GST_D3D11_GPU_PATH) || defined(QGC_HAS_GST_D3D12_GPU_PATH)
15class GstD3DContextBridge :
public GstContextBridgeBase
19 GstObject* refDevice();
22 static gint64 readAdapterLuid(gpointer device);
27 constexpr GstD3DContextBridge(
const char* api, std::span<const char* const> contextTypes,
28 const QLoggingCategory& (*logCategory)(),
int qrhiBackend,
29 int secondQrhiBackend = -1) noexcept
30 : GstContextBridgeBase(api, contextTypes, logCategory)
31 , _qrhiBackend(qrhiBackend)
32 , _secondQrhiBackend(secondQrhiBackend)
35 ~GstD3DContextBridge() =
default;
38 virtual GstObject* createDevice() = 0;
41 virtual GstContext* makeDeviceContext(GstObject* device) = 0;
44 void logAdapterMatch(gint64 expectedLuid, gpointer gstDevice)
const;
47 bool primeLocked() final;
48 GstObject* refObject(const
char* contextType) final;
49 GstContext* buildContext(const
char* contextType, GstObject*
object) final;
50 void clearLocked() final;
53 bool snapshotBackendMatches();
55 static
void onDeviceRemoved(GObject* device, GParamSpec* property, gpointer bridge);
58 int _secondQrhiBackend;
59 GstObject* _device =
nullptr;
61 gulong _removalHandler = 0;
62 bool _warnedWrongBackend = false;