From 37fc2884e83d733d15efcf839b40175a9cda0cd6 Mon Sep 17 00:00:00 2001 From: alireza787b Date: Fri, 31 Jul 2026 01:16:59 +0000 Subject: [PATCH] test(VideoManager): address Windows sink review --- .../VideoReceiver/GStreamer/gstqgc/gstqgcvideosinkbin.cc | 5 +++-- .../VideoManager/GStreamer/gstqgc/GStreamerGstQgcTest.cc | 9 ++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/VideoManager/VideoReceiver/GStreamer/gstqgc/gstqgcvideosinkbin.cc b/src/VideoManager/VideoReceiver/GStreamer/gstqgc/gstqgcvideosinkbin.cc index 302757d4b81..587ad789b5e 100644 --- a/src/VideoManager/VideoReceiver/GStreamer/gstqgc/gstqgcvideosinkbin.cc +++ b/src/VideoManager/VideoReceiver/GStreamer/gstqgc/gstqgcvideosinkbin.cc @@ -296,8 +296,9 @@ static gboolean wireGpuPath(GstQgcVideoSinkBin* self, GstElement* videosink, Gst } #else GstElement* glupload = nullptr; - // Keep native GPU memory direct. buildGpuCapsString() also offers system memory, which - // qgcqvideosink maps through its CPU fallback instead of uploading software-decoded frames. + // Keep advertised native GPU formats direct. Formats outside buildGpuCapsString() must + // renegotiate upstream; converting here would also upload software frames instead of + // letting qgcqvideosink use its CPU mapping fallback. if (!chain.linkChain({capsf, videosink}) || !chain.ghostSink(capsf)) { GST_ERROR_OBJECT(self, "Failed to link/ghost qgcqvideosink (GPU path)"); return FALSE; diff --git a/test/VideoManager/GStreamer/gstqgc/GStreamerGstQgcTest.cc b/test/VideoManager/GStreamer/gstqgc/GStreamerGstQgcTest.cc index fd511b37bab..aa0b6e4e281 100644 --- a/test/VideoManager/GStreamer/gstqgc/GStreamerGstQgcTest.cc +++ b/test/VideoManager/GStreamer/gstqgc/GStreamerGstQgcTest.cc @@ -732,7 +732,7 @@ void GStreamerTest::_testWindowsGpuSinkPreservesSoftwarePixels() /*captureCenterPixel*/ true); QVERIFY2(result.eos, qUtf8Printable(QStringLiteral("Software-frame pipeline: %1").arg(result.errorMessage))); - QTRY_VERIFY_WITH_TIMEOUT(result.frameCount > 0, 2000); + QVERIFY(result.frameCount > 0); QCOMPARE(result.lastPixelFormat, QVideoFrameFormat::Format_BGRA8888); QVERIFY2(result.centerPixelValid, "System-memory fallback frame could not be mapped for pixel verification"); QVERIFY2((result.centerPixel.red() > 200) && (result.centerPixel.green() < 50) && (result.centerPixel.blue() < 50), @@ -763,14 +763,13 @@ void GStreamerTest::_testWindowsGpuSinkPreservesDirectD3D11Memory() runPipelineThroughQVideoSink(videoSink, controller, "video/x-raw,format=NV12,width=320,height=240,framerate=30/1 ! d3d11upload ! " "video/x-raw(memory:D3D11Memory),format=NV12", - /*numBuffers*/ 5, /*gpuZerocopy*/ true, "pattern=red"); - if (!result.eos && (result.errorMessage.contains(QStringLiteral("D3D"), Qt::CaseInsensitive) || - result.errorMessage.contains(QStringLiteral("device"), Qt::CaseInsensitive))) { + /*numBuffers*/ 5, /*gpuZerocopy*/ true); + if (!result.eos && result.errorMessage.contains(QStringLiteral("d3d11"), Qt::CaseInsensitive)) { QSKIP(qPrintable(QStringLiteral("D3D11 device unavailable in this runner: %1").arg(result.errorMessage))); } QVERIFY2(result.eos, qUtf8Printable(QStringLiteral("D3D11 pipeline: %1").arg(result.errorMessage))); - QTRY_VERIFY_WITH_TIMEOUT(result.frameCount > 0, 2000); + QVERIFY(result.frameCount > 0); QCOMPARE(result.lastPixelFormat, QVideoFrameFormat::Format_NV12); #else QSKIP("D3D11 GPU sink path is only available in supported Windows builds");