|
|
|
|
@ -144,7 +144,14 @@ private slots:
|
|
|
|
|
capture.start(true); QTRY_VERIFY(portal->starting); |
|
|
|
|
emit portal->sessionObject->Closed({}); QTRY_COMPARE(errors.size(), 1); |
|
|
|
|
} |
|
|
|
|
void realPipeWireFrames_data() { |
|
|
|
|
QTest::addColumn<bool>("serial"); QTest::addColumn<bool>("visible"); |
|
|
|
|
QTest::newRow("serial-shown") << true << true; |
|
|
|
|
QTest::newRow("node-shown") << false << true; |
|
|
|
|
QTest::newRow("node-hidden") << false << false; |
|
|
|
|
} |
|
|
|
|
void realPipeWireFrames() { |
|
|
|
|
QFETCH(bool, serial); QFETCH(bool, visible); |
|
|
|
|
QTemporaryDir runtime; QVERIFY(runtime.isValid()); |
|
|
|
|
QFile config(runtime.filePath("capture.conf")); QVERIFY(config.open(QIODevice::WriteOnly)); |
|
|
|
|
config.write(R"( |
|
|
|
|
@ -184,9 +191,9 @@ context.objects = [
|
|
|
|
|
if (properties.value("node.name").toString() != "cursor-test") continue; |
|
|
|
|
node = object.value("id").toInt(); props["pipewire-serial"] = properties.value("object.serial").toVariant(); |
|
|
|
|
} |
|
|
|
|
QVERIFY(node); portal->streams = {{node, props}}; portal->holdStart = false; |
|
|
|
|
QVERIFY(node); if (!serial) props.clear(); portal->streams = {{node, props}}; portal->holdStart = false; |
|
|
|
|
StreamPortalCapture capture; QSignalSpy frames(&capture, &StreamPortalCapture::frameReady), errors(&capture, &StreamPortalCapture::errorOccurred); |
|
|
|
|
capture.start(true); |
|
|
|
|
capture.start(visible); |
|
|
|
|
QProcess link; link.setProcessEnvironment(environment); |
|
|
|
|
// Без менеджера сессий соединяем только тестовые video ports, сохраняя настоящий транспорт PipeWire.
|
|
|
|
|
QElapsedTimer elapsed; elapsed.start(); |
|
|
|
|
@ -201,7 +208,7 @@ context.objects = [
|
|
|
|
|
if (!QTest::qWaitFor([&] { return link.state() == QProcess::NotRunning; }, 1000)) { link.kill(); link.waitForFinished(); } |
|
|
|
|
qWarning().noquote() << "PipeWire ports:" << link.readAllStandardOutput(); |
|
|
|
|
} |
|
|
|
|
QVERIFY(errors.isEmpty()); QVERIFY(!frames.isEmpty()); QCOMPARE(portal->cursor, 2u); |
|
|
|
|
QVERIFY(errors.isEmpty()); QVERIFY(!frames.isEmpty()); QCOMPARE(portal->cursor, visible ? 2u : 1u); |
|
|
|
|
auto frame = frames.last().front().value<QVideoFrame>(); QVERIFY(frame.isValid()); QVERIFY(!frame.toImage().isNull()); |
|
|
|
|
QTRY_VERIFY(frames.size() >= 3); |
|
|
|
|
emit portal->sessionObject->Closed({}); QTRY_COMPARE(errors.size(), 1); |
|
|
|
|
|