3#include <QtCore/qglobal.h>
5#if defined(Q_OS_WIN) && (defined(QGC_HAS_GST_D3D11_GPU_PATH) || defined(QGC_HAS_GST_D3D12_GPU_PATH))
7#include <QtCore/QLoggingCategory>
8#include <QtCore/QMutex>
14namespace GstD3DContextBridgeCommon {
21 bool warnedWrongBackend =
false;
22 std::atomic<bool> loggedFirstHandoff{
false};
23 GstObject* device =
nullptr;
31 const char* contextType;
32 const QLoggingCategory& (*cat)();
34 GstObject* (*createDevice)(
const QLoggingCategory&);
35 GstContext* (*makeContext)(GstObject* device);
40bool checkSnapshotBackend(BridgeState& state,
const QLoggingCategory& cat,
int expectedBackend,
41 const char* backendName);
44void logHandoff(BridgeState& state,
const QLoggingCategory& cat,
GstElement* element,
const char* apiName);
47gint64 readAdapterLuid(gpointer device);
50void logAdapterMatch(gint64 expectedLuid, gpointer gstDevice,
const QLoggingCategory& cat,
const char* apiName);
53void registerBridge(
const QLoggingCategory& cat, GstBusSyncReply (*handler)(GstMessage*),
void (*reset)());
56bool prime(BridgeState& state,
const BridgeOps& ops);
59GstObject* currentDevice(BridgeState& state);
62GstBusSyncReply handleSyncMessage(BridgeState& state,
const BridgeOps& ops, GstMessage* message);
65bool answerContextQuery(BridgeState& state,
const BridgeOps& ops, GstQuery* query);
68void reset(BridgeState& state,
const BridgeOps& ops);
struct _GstElement GstElement