3#ifdef QGC_UNITTEST_BUILD
8#include <QtCore/QByteArray>
9#include <QtCore/QtEnvironmentVariables>
13#ifdef QGC_UNITTEST_BUILD
23#if defined(QGC_GST_BIN_HAS_GLUPLOAD) && defined(QGC_GST_BIN_HAS_DIRECT_DMABUF)
24 const QByteArray choice = value.trimmed().toByteArray().toLower();
25 if (choice ==
"dmabuf") {
28 if (choice ==
"glupload") {
31 if (!choice.isEmpty()) {
32 qCWarning(GstQgcGpuBinLog) <<
"Unknown QGC_GST_GPU_BIN value" << choice
33 <<
"(expected glupload or dmabuf); using the default glupload bin";
38#if defined(QGC_GST_BIN_HAS_GLUPLOAD)
40#elif defined(QGC_GST_BIN_HAS_DIRECT_DMABUF)
50#ifdef QGC_UNITTEST_BUILD
51 if (
const std::optional<SinkEnvironment> environment = sinkEnvironmentForTest()) {
52 return environment->gpuBin;
57 qCDebug(GstQgcGpuBinLog).nospace() <<
"GPU bin preference: " <<
gpuBinName(parsed.
mode) <<
" ("
66#if defined(QGC_HAS_GST_D3D12_GPU_PATH)
72 switch (preference.mode) {
74 suited = target.sharesGlContext();
77 suited = target.isOpenGlOnEgl();
94 return "direct DMABuf";
96 return "d3d12convert";
100 return "passthrough";
105 const auto is = [](
const char* text, std::string_view expected) {
return text && (expected == text); };
109 return is(factoryName,
"d3d11upload") || is(factoryName,
"d3d11download");
#define QGC_LOGGING_CATEGORY(name, categoryStr)
GstVideoSink that pushes decoded frames into a Qt QVideoSink; sole sink in qgcvideosinkbin....
const char * gpuBinName(GpuBinMode mode) noexcept
GpuBinPreference parseGpuBinPreference(QByteArrayView value)
bool converterSuitsRenderTarget(const char *pluginName, const char *factoryName, const RenderTarget &target) noexcept
@ GlUpload
glupload → glcolorconvert → GLMemory 2D; gst-gl imports LINEAR and vendor-tiled DMABuf.
@ Passthrough
Every compiled native memory straight into qgcqvideosink (Windows, Apple, ...).
GpuBinPreference gpuBinPreference()
parseGpuBinPreference() of QGC_GST_GPU_BIN, read and logged on the first call.
GpuBinMode selectGpuBin(GpuBinPreference preference, const RenderTarget &target) noexcept
The GPU bin asked for, before the render target is known.
bool explicitChoice
Chosen through QGC_GST_GPU_BIN: used even under a render target it doesn't suit.