QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GstD3DContextBridgeCommon.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) || defined(QGC_HAS_GST_D3D12_GPU_PATH))
6
7#include <QtCore/QLoggingCategory>
8#include <QtCore/QMutex>
9
10#include <atomic>
11
12#include <gst/gst.h>
13
14class QRhi;
15
25namespace GstD3DContextBridgeCommon {
26
28struct BridgeState {
29 QMutex mutex;
30 bool primed = false;
31 bool warnedWrongBackend = false;
32 std::atomic<bool> loggedFirstHandoff{false};
33};
34
39QRhi *checkRhiBackend(BridgeState &state,
40 const QLoggingCategory &cat,
41 int expectedBackend,
42 const char *backendName);
43
47GstElement *matchNeedContext(GstMessage *message, const char *expectedContextType);
48
51void logHandoff(BridgeState &state,
52 const QLoggingCategory &cat,
53 GstElement *element,
54 const char *apiName);
55
59gint64 readAdapterLuid(gpointer device);
60
63void logAdapterMatch(QRhi *rhi, gint64 expectedLuid, gpointer gstDevice,
64 const QLoggingCategory &cat, const char *apiName);
65
66} // namespace GstD3DContextBridgeCommon
67
68#endif // Q_OS_WIN && (QGC_HAS_GST_D3D11_GPU_PATH || QGC_HAS_GST_D3D12_GPU_PATH)
struct _GstElement GstElement