Verify actual bitstreams through asynchronous decoder API and CPU encoder fallback

This commit is contained in:
evgeny committed 2026-10-19 19:13:00 +02:00
1 parent 5f45b38cfb
commit f9348ce36f
2 files changed
+20 -11

No files matched your search

@@ -142,9 +142,10 @@ private slots:
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,
(uint8_t)actual.level, 4000000, (uint8_t)actual.profile};
CallVideoDecoder decoder;
CallVideoDecoder decoder(CallVideoDecoder::Backend::SoftwareOnly);
for (unsigned i = 0; i < 4; ++i) { f.frame_id = i + 1; f.pts_us = 1000000 + i * 33333;
QImage image; QVERIFY2(decoder.decode(f, image), qPrintable(name)); }
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));
}
}
@@ -160,7 +161,7 @@ private slots:
QVERIFY(call_video_format_supported(&sender, &receiver, &config));
CallVideoEncoder encoder; QVERIFY2(encoder.open(config, 4000000, codec == 1 ? "libx264" : "libx265"), qPrintable(encoder.error()));
Decoder decoder; QVERIFY(decoder.open(codec));
CallVideoDecoder productionDecoder;
CallVideoDecoder productionDecoder(CallVideoDecoder::Backend::SoftwareOnly);
QImage image(config.width, config.height, QImage::Format_RGB32);
uint32_t random = 1; unsigned completions = 0;
for (int phase = 0; phase < 3; phase++) {
@@ -195,7 +196,9 @@ private slots:
call_video_frame wire{}; wire.call_id = 1; wire.frame_id = phase * 120 + frame + 1; wire.pts_us = pts;
wire.format = config; wire.size = wire.length = output.data.size(); wire.flags = output.key ? CALL_VIDEO_KEY : 0;
wire.data = reinterpret_cast<const uint8_t*>(output.data.constData());
QImage rendered; QVERIFY(productionDecoder.decode(wire, rendered)); QCOMPARE(rendered.size(), image.size());
QImage rendered; call_video_frame decodedFrame{};
QCOMPARE(productionDecoder.submit(wire), 1); QCOMPARE(productionDecoder.receive(decodedFrame, rendered), 1);
QCOMPARE(decodedFrame.pts_us, wire.pts_us); QCOMPARE(rendered.size(), image.size());
QCOMPARE(decoder.frame->width, config.width); QCOMPARE(decoder.frame->height, config.height);
QCOMPARE(decoder.frame->format, int(AV_PIX_FMT_YUV420P)); QCOMPARE(decoder.context->has_b_frames, 0);
QCOMPARE(decoder.context->profile, codec == 1 ? AV_PROFILE_H264_CONSTRAINED_BASELINE : AV_PROFILE_HEVC_MAIN);