Use verified Android encoder levels and expose negotiated frame rate

This commit is contained in:
evgeny committed 2026-10-20 00:21:21 +02:00
1 parent 3037c5fa87
commit 521dce5528
3 files changed
+12 -6

No files matched your search

@@ -2,6 +2,7 @@
* один decoder на весь поток, непрерывные capture PTS и измеренный bitrate. */
#include <QtTest>
#include <QScopeGuard>
#include <QRegularExpression>
#include <clocale>
#include "../src/call_video_encoder.h"
#include "../src/call_video_decoder.h"
@@ -144,10 +145,12 @@ private slots:
QVERIFY(!call_video_inspect_key(codec, reinterpret_cast<const uint8_t*>(bytes.constData()), bytes.size(), &actual));
call_video_frame f{}; f.call_id = 1; f.flags = CALL_VIDEO_KEY; f.size = f.length = bytes.size();
f.data = reinterpret_cast<const uint8_t*>(bytes.constData());
f.format = {1, (uint16_t)actual.width, (uint16_t)actual.height, 30, 0, (uint8_t)codec,
const auto rate = QRegularExpression(QStringLiteral("-fps(30|50|60)-")).match(name);
const unsigned fps = rate.hasMatch() ? rate.captured(1).toUInt() : 30;
f.format = {1, (uint16_t)actual.width, (uint16_t)actual.height, (uint16_t)fps, 0, (uint8_t)codec,
(uint8_t)actual.level, 4000000, (uint8_t)actual.profile};
CallVideoDecoder decoder(CallVideoDecoder::Backend::SoftwareOnly);
for (unsigned i = 0; i < 4; ++i) { f.frame_id = i + 1; f.pts_us = 1000000 + i * 33333;
for (unsigned i = 0; i < 8; ++i) { f.frame_id = i + 1; f.pts_us = 1000000 + i * 1000000ll / fps;
QImage image; call_video_frame output{};
QCOMPARE(decoder.submit(f), 1); QCOMPARE(decoder.receive(output, image), 1); QCOMPARE(output.pts_us, f.pts_us); }
DEBUG_INFO(DEBUG_CATEGORY_CALL, "hardware stream decoded file=%s", qPrintable(name));