Stop invalid encoder output explicitly while preserving transient backpressure retries
This commit is contained in:
1 parent
c0422a73c0
commit
322947777c
3 files changed
+15
-6
No files matched your search
@@ -127,7 +127,7 @@ private slots:
|
||||
for (auto name : {"h264_nvenc", "hevc_nvenc", "h264_amf", "hevc_amf", "h264_qsv", "hevc_qsv"})
|
||||
QTest::newRow(name) << QByteArray(name) << false << false;
|
||||
QTest::newRow("batch") << QByteArray("h264_nvenc") << true << false;
|
||||
QTest::newRow("rollback") << QByteArray("h264_nvenc") << false << true;
|
||||
QTest::newRow("broken-first-key") << QByteArray("h264_nvenc") << false << true;
|
||||
}
|
||||
void pipeline() {
|
||||
QFETCH(QByteArray, backend); QFETCH(bool, batch); QFETCH(bool, reject);
|
||||
@@ -143,7 +143,12 @@ private slots:
|
||||
if (i == 7) { request = 1; QVERIFY(encoder.requestBitrate(1, request, 300000)); }
|
||||
if (request && !completed && !failed) QTest::qWait(5);
|
||||
const uint64_t pts = 1234567 + i * 33333ull; QList<LiveEncodedFrame> output; CallVideoRateCompletion completion;
|
||||
QVERIFY2(encoder.encode(image, pts, false, output, completion), qPrintable(encoder.error()));
|
||||
if (!encoder.encode(image, pts, false, output, completion)) {
|
||||
QVERIFY2(reject, qPrintable(encoder.error()));
|
||||
QVERIFY(encoder.error().contains("did not start with KEY"));
|
||||
QCOMPARE(completion.request, request); QCOMPARE(completion.bitrate, 0u);
|
||||
QVERIFY(output.isEmpty()); failed = true; break;
|
||||
}
|
||||
if (completion.request) {
|
||||
QCOMPARE(completion.request, request); QCOMPARE(completion.bitrate, reject ? 0u : 300000u);
|
||||
completed = completion.bitrate != 0; failed = !completed;
|
||||
@@ -161,9 +166,8 @@ private slots:
|
||||
last = frame.pts;
|
||||
}
|
||||
}
|
||||
QVERIFY(shown >= 115); QCOMPARE(completed, !reject); QCOMPARE(failed, reject);
|
||||
QCOMPARE(shown + encoder.pendingFrames(), 120u);
|
||||
QCOMPARE(encoder.bitrate(), reject ? 1000000u : 300000u);
|
||||
QCOMPARE(completed, !reject); QCOMPARE(failed, reject);
|
||||
if (!reject) { QCOMPARE(shown + encoder.pendingFrames(), 120u); QCOMPARE(encoder.bitrate(), 300000u); }
|
||||
if (batch) QVERIFY(maximumBatch >= 2);
|
||||
qInfo("GPU pipeline %s shown=%u max_batch=%u rollback=%d", selected.constData(), shown, maximumBatch, failed);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user