Exercise both video orientations at 30, 50 and 60 fps

This commit is contained in:
evgeny committed 2026-10-20 00:15:42 +02:00
1 parent 3db52c755c
commit 8c826fa2e7
1 file changed
+10 -8
@@ -131,7 +131,7 @@ private slots:
QCOMPARE(caps.decode[0].profiles, uint8_t(3)); QCOMPARE(caps.decode[1].profiles, uint8_t(3));
for (const auto& limit : caps.decode) {
QCOMPARE(limit.width, uint16_t(1920)); QCOMPARE(limit.height, uint16_t(1920));
QCOMPARE(limit.pixels_per_second, uint32_t(1920 * 1080 * 30));
QCOMPARE(limit.fps, uint16_t(60)); QCOMPARE(limit.pixels_per_second, uint32_t(1920 * 1080 * 60));
}
QCOMPARE(caps.encode[0].width, uint16_t(0)); QCOMPARE(caps.encode[1].width, uint16_t(0));
const QString directory = qEnvironmentVariable("UTUN_CALL_VIDEO_REMOTE_DIR");
@@ -155,20 +155,22 @@ private slots:
}
}
void bothOrientations_data() {
QTest::addColumn<int>("codec"); QTest::addColumn<bool>("fullhd");
QTest::newRow("H264-720p") << 1 << false; QTest::newRow("H265-720p") << 2 << false;
QTest::newRow("H264-1080p") << 1 << true; QTest::newRow("H265-1080p") << 2 << true;
QTest::addColumn<int>("codec"); QTest::addColumn<bool>("fullhd"); QTest::addColumn<int>("fps");
for (int codec : {1, 2}) for (bool fullhd : {false, true}) for (int fps : {30, 50, 60})
QTest::newRow(qPrintable(QString("codec%1-%2p-%3fps").arg(codec).arg(fullhd ? 1080 : 720).arg(fps))) << codec << fullhd << fps;
}
void bothOrientations() {
QFETCH(int, codec); QFETCH(bool, fullhd);
QFETCH(int, codec); QFETCH(bool, fullhd); QFETCH(int, fps);
const char* backend = codec == 1 ? "libx264" : "libx265";
if (!avcodec_find_encoder_by_name(backend)) QSKIP("Software encoder unavailable");
auto config = configuration(codec);
const uint16_t width = fullhd ? 1920 : 1280, height = fullhd ? 1080 : 720;
config.level = codec == 1 ? (fullhd ? 40 : 31) : (fullhd ? 120 : 93);
config.fps = fps;
config.level = codec == 1 ? (fullhd ? (fps > 30 ? 42 : 40) : (fps > 30 ? 32 : 31))
: (fullhd ? (fps > 30 ? 123 : 120) : (fps > 30 ? 120 : 93));
auto receiver = CallVideoDecoder::capabilities();
call_video_caps sender{};
call_video_limit limit{width, height, 30, uint32_t(width) * height * 30, 4000000, config.profile, config.level};
call_video_limit limit{width, height, uint16_t(fps), uint32_t(width) * height * fps, 4000000, config.profile, config.level};
// Обе пробы используют production open с проверкой настоящего KEY.
for (bool portrait : {false, true}) {
config.width = portrait ? height : width; config.height = portrait ? width : height;
@@ -195,7 +197,7 @@ private slots:
call_video_frame output{}; QImage decoded;
QCOMPARE(decoder.submit(input), 1); QCOMPARE(decoder.receive(output, decoded), 1);
QCOMPARE(output.pts_us, int64_t(pts)); QCOMPARE(decoded.size(), image.size());
QCOMPARE(output.format.generation, config.generation); pts += 33333;
QCOMPARE(output.format.generation, config.generation); pts += 1000000 / fps;
}
}
}