|
|
|
|
@ -132,7 +132,8 @@ extern "C" void __wrap_ma_device_uninit(ma_device* device) {
|
|
|
|
|
#ifdef HAVE_FFMPEG |
|
|
|
|
static QStringList ffmpegDiagnosticMessages; |
|
|
|
|
static void captureFfmpegDiagnostic(int, const char*, const char* message) { |
|
|
|
|
if (strstr(message, "UTUN_AMF_LOG_TEST")) ffmpegDiagnosticMessages.append(QString::fromUtf8(message)); |
|
|
|
|
if (strstr(message, "UTUN_AMF_LOG_TEST") || strstr(message, "ffmpeg headers:")) |
|
|
|
|
ffmpegDiagnosticMessages.append(QString::fromUtf8(message)); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
@ -533,7 +534,24 @@ private slots:
|
|
|
|
|
void encoderRoundTrip() { |
|
|
|
|
#ifdef HAVE_FFMPEG |
|
|
|
|
QFETCH(int, codec); if (!codec) QSKIP("No supported encoder"); |
|
|
|
|
auto previousDebug = g_debug_config.category_levels[DEBUG_CATEGORY_DEBUG]; |
|
|
|
|
auto cleanup = qScopeGuard([&] { |
|
|
|
|
if (codec != STREAM_MEDIA_H265) return; |
|
|
|
|
debug_set_log_hook(nullptr); debug_set_category_level(DEBUG_CATEGORY_DEBUG, previousDebug); |
|
|
|
|
ffmpegDiagnosticMessages.clear(); |
|
|
|
|
}); |
|
|
|
|
if (codec == STREAM_MEDIA_H265) { |
|
|
|
|
ffmpegDiagnosticMessages.clear(); debug_set_log_hook(captureFfmpegDiagnostic); |
|
|
|
|
debug_set_category_level(DEBUG_CATEGORY_DEBUG, DEBUG_LEVEL_TRACE); |
|
|
|
|
} |
|
|
|
|
auto encoded = keyframe(codec); QVERIFY(!encoded.isEmpty()); |
|
|
|
|
if (codec == STREAM_MEDIA_H265) { |
|
|
|
|
QString headers = ffmpegDiagnosticMessages.join('\n'); |
|
|
|
|
QVERIFY2(headers.contains("Packet:"), qPrintable(headers)); |
|
|
|
|
QVERIFY2(headers.contains("init_qp_minus26"), qPrintable(headers)); |
|
|
|
|
QVERIFY2(headers.contains("slice_qp_delta"), qPrintable(headers)); |
|
|
|
|
QVERIFY(!headers.contains("profile_compatibility_flag")); |
|
|
|
|
} |
|
|
|
|
const uint8_t *config = nullptr, *frame = nullptr; size_t configLength = 0, frameLength = 0; |
|
|
|
|
QCOMPARE(stream_media_key_parse((const uint8_t*)encoded.constData(), encoded.size(), &config, &configLength, &frame, &frameLength), STREAM_OK); |
|
|
|
|
const char* names[] = {"", "h264", "hevc", "vp9", "av1", "vvc"}; |
|
|
|
|
|