|
|
|
|
@ -88,7 +88,7 @@ class StreamPublishTest : public QObject {
|
|
|
|
|
bool record(uint64_t id, StreamRecordKind kind, StreamRecord& out) { |
|
|
|
|
QElapsedTimer elapsed; elapsed.start(); |
|
|
|
|
while (elapsed.elapsed() < 2500) { |
|
|
|
|
if (gui_stream_pull(id, out, 0, 60000000, 60000000) && out.kind == kind) return true; |
|
|
|
|
if (gui_stream_pull(id, out, 0, true, 60000000) && out.kind == kind) return true; |
|
|
|
|
QTest::qWait(1); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
@ -246,7 +246,7 @@ private slots:
|
|
|
|
|
auto* decoder = opus_codec_decoder_create(48000, 2); QVERIFY(decoder); |
|
|
|
|
QElapsedTimer elapsed; elapsed.start(); |
|
|
|
|
while (elapsed.elapsed() < 1800) { |
|
|
|
|
if (gui_stream_pull(202, out, 0, 60000000, 60000000)) { |
|
|
|
|
if (gui_stream_pull(202, out, 0, true, 60000000)) { |
|
|
|
|
if (out.kind == StreamRecordKind::Video) { video++; latest = out.pts; } |
|
|
|
|
if (out.kind == StreamRecordKind::Audio) { |
|
|
|
|
audio++; int16_t pcm[1920]; QCOMPARE(opus_codec_decode(decoder, (const uint8_t*)out.data.constData(), out.data.size(), pcm, 960), 960); |
|
|
|
|
@ -261,7 +261,7 @@ private slots:
|
|
|
|
|
if (engine.codecs().contains(STREAM_MEDIA_VP9)) next.video.codec = STREAM_MEDIA_VP9; |
|
|
|
|
QVERIFY(engine.reconfigure(next)); bool revised = false; |
|
|
|
|
elapsed.restart(); while (!revised && elapsed.elapsed() < 5000) { |
|
|
|
|
if (gui_stream_pull(202, out, 0, 60000000, 60000000) && out.kind == StreamRecordKind::Video && out.format.revision >= 2) revised = true; |
|
|
|
|
if (gui_stream_pull(202, out, 0, true, 60000000) && out.kind == StreamRecordKind::Video && out.format.revision >= 2) revised = true; |
|
|
|
|
QTest::qWait(1); |
|
|
|
|
} |
|
|
|
|
QVERIFY(revised); QCOMPARE(out.format.rotation, (uint16_t)90); QCOMPARE(out.format.video_codec, (uint8_t)next.video.codec); |
|
|
|
|
@ -274,7 +274,7 @@ private slots:
|
|
|
|
|
QTRY_COMPARE(errors.size(), 1); errors.clear(); |
|
|
|
|
bool restored = false; |
|
|
|
|
elapsed.restart(); while (!restored && elapsed.elapsed() < 5000) { |
|
|
|
|
if (gui_stream_pull(202, out, 0, 60000000, 60000000) && out.kind == StreamRecordKind::Video && out.format.revision >= 3) restored = true; |
|
|
|
|
if (gui_stream_pull(202, out, 0, true, 60000000) && out.kind == StreamRecordKind::Video && out.format.revision >= 3) restored = true; |
|
|
|
|
QTest::qWait(1); |
|
|
|
|
} |
|
|
|
|
QVERIFY(restored); |
|
|
|
|
@ -282,7 +282,7 @@ private slots:
|
|
|
|
|
next.source = {StreamVideoSource::Window, pattern.windowTitle(), {}, QVariant::fromValue(QCapturableWindow(pattern.windowHandle()))}; |
|
|
|
|
QVERIFY(engine.reconfigure(next)); bool window = false; |
|
|
|
|
elapsed.restart(); while (!window && elapsed.elapsed() < 5000) { |
|
|
|
|
if (gui_stream_pull(202, out, 0, 60000000, 60000000) && out.kind == StreamRecordKind::Video && out.format.revision >= 4) window = true; |
|
|
|
|
if (gui_stream_pull(202, out, 0, true, 60000000) && out.kind == StreamRecordKind::Video && out.format.revision >= 4) window = true; |
|
|
|
|
QTest::qWait(1); |
|
|
|
|
} |
|
|
|
|
QVERIFY(window); |
|
|
|
|
|