Verify caption updates preserve continuous H264 and Opus playback

This commit is contained in:
evgeny committed 2026-10-28 00:58:59 +01:00
1 parent 5286388ada
commit 7b3fe48657
1 file changed
+15 -2
+15 -2
View File
@@ -599,7 +599,9 @@ private slots:
for (auto* label : remote->findChildren<QLabel*>()) if (label->text() == remoteName) remoteTitle = label;
QVERIFY(localTitle); QVERIFY(remoteTitle);
QPointer<QVideoWidget> preview = local->findChild<QVideoWidget*>(); QVERIFY(preview);
QVideoFrame frame(QImage(16, 16, QImage::Format_RGB32)); frame.setStartTime(123000);
QVideoFrame frame(QVideoFrameFormat(QSize(16, 16), QVideoFrameFormat::Format_BGRA8888));
QVERIFY(frame.map(QVideoFrame::WriteOnly)); memset(frame.bits(0), 0xff, frame.mappedBytes(0)); frame.unmap();
frame.setStartTime(123000);
grid.setLocalPreview(group, QVariant::fromValue(frame));
QPointer<VideoRenderWidget> video = remote->findChild<VideoRenderWidget*>(); QVERIFY(video);
auto* volume = remote->findChild<QSlider*>(); QVERIFY(volume); volume->setValue(37);
@@ -798,7 +800,18 @@ private slots:
#ifdef TEST_NULL_AUDIO
uint64_t gapsBefore = silenceGaps.load();
#endif
int beforeSteady = shown.count(); QTest::qWait(1500);
int beforeSteady = shown.count();
QPointer<VideoRenderWidget> render = window.findChild<VideoRenderWidget*>(); QVERIFY(render);
const QString renamed = QString::fromUtf8("Переименован во время эфира 🎬");
window.setSourceName(renamed);
QCOMPARE(window.windowTitle(), QString("Live stream: %1").arg(renamed));
bool renamedCaption = false;
for (auto* label : window.findChildren<QLabel*>()) renamedCaption |= label->text() == renamed && label->toolTip() == renamed;
QVERIFY(renamedCaption);
QTest::qWait(1500);
QVERIFY(render); QCOMPARE(window.findChild<VideoRenderWidget*>(), render.data());
stream_info renamedInfo{}; QCOMPARE(stream_get_info(publisher, &renamedInfo), STREAM_OK);
QCOMPARE(renamedInfo.owners, 2u); QCOMPARE(renamedInfo.descriptor.source_epoch, epoch);
QVERIFY2(shown.count() >= beforeSteady + 30, "30fps video must keep advancing with 200ms physical audio latency");
#ifdef TEST_NULL_AUDIO
QCOMPARE(silenceGaps.load(), gapsBefore);