4#ifdef QGC_UNITTEST_BUILD
8#include <QtCore/QThread>
9#include <QtQuick/QQuickWindow>
10#include <QtQuick/QSGRendererInterface>
12#if defined(QGC_HAS_ANY_GPU_PATH)
17#ifdef QGC_UNITTEST_BUILD
27RenderBackend fromGraphicsApi(QSGRendererInterface::GraphicsApi api)
noexcept
30 case QSGRendererInterface::Unknown:
32 case QSGRendererInterface::OpenGL:
34 case QSGRendererInterface::Direct3D11:
36 case QSGRendererInterface::Direct3D12:
38 case QSGRendererInterface::Metal:
40 case QSGRendererInterface::Vulkan:
47#if defined(QGC_HAS_ANY_GPU_PATH)
48RenderBackend fromRhiImplementation(
int implementation)
noexcept
50 switch (
static_cast<QRhi::Implementation
>(implementation)) {
72#ifdef QGC_UNITTEST_BUILD
73 if (
const std::optional<SinkEnvironment> environment = sinkEnvironmentForTest()) {
74 return environment->target;
78 if (QThread::isMainThread()) {
79 s_requestedBackend.store(
static_cast<int>(fromGraphicsApi(QQuickWindow::graphicsApi())),
80 std::memory_order_relaxed);
83#if defined(QGC_HAS_ANY_GPU_PATH)
85 target.
backend = fromRhiImplementation(live);
94#if defined(Q_OS_LINUX)
127#if defined(QGC_HAS_GST_GLMEMORY_GPU_PATH) || defined(QGC_HAS_GST_DMABUF_GPU_PATH)
129 return "GLMemory/DMABuf";
131#if defined(QGC_HAS_GST_D3D11_GPU_PATH)
135#if defined(QGC_HAS_GST_D3D12_GPU_PATH)
138 return "D3D12 (d3d12convert to RGBA)";
140#if defined(QGC_HAS_GST_IOSURFACE_GPU_PATH)
142 return "IOSurface/VideoToolbox";
144#if defined(QGC_HAS_GST_DMABUF_VULKAN_IMPORT)
GstVideoSink that pushes decoded frames into a Qt QVideoSink; sole sink in qgcvideosinkbin....
RenderTarget currentRenderTarget()
const char * toString(RenderBackend backend) noexcept
RenderBackend
Graphics API Qt Quick renders the video with, which decides the GPU memory qgcqvideosink can import.
@ Unknown
No scene graph yet, and the GUI thread hasn't recorded the requested API either.
@ Null
QRhi's Null backend or the software renderer: no GPU import.
const char * zeroCopyPathName(RenderBackend backend) noexcept
DeviceSnapshot & deviceSnapshot() noexcept
Returns the global snapshot. Atomic fields make individual reads thread-safe.
bool sharesGlContext() const noexcept
bool isOpenGlOnEgl() const