Include HEVC header tracing in bundled FFmpeg and round-trip tests
This commit is contained in:
1 parent
f7853f145c
commit
6d5a626b9b
2 files changed
+21
-3
No files matched your search
@@ -7,7 +7,7 @@ SRC_DIR="$BUILD_DIR/src"
|
||||
INSTALL_DIR="$BUILD_DIR/install"
|
||||
JOBS=$(nproc 2>/dev/null || echo 4)
|
||||
AMF_HEADERS_VERSION="${AMF_HEADERS_VERSION:-1.5.3}"
|
||||
FFMPEG_PROFILE_MARKER="$INSTALL_DIR/share/utun-chatgui-ffmpeg-minimal-v2"
|
||||
FFMPEG_PROFILE_MARKER="$INSTALL_DIR/share/utun-chatgui-ffmpeg-minimal-v3"
|
||||
|
||||
case "$(uname -s)" in
|
||||
Linux) PLATFORM=linux ;;
|
||||
@@ -243,7 +243,7 @@ CONFIGURE_ARGS=(
|
||||
--enable-libx264 --enable-libx265 --enable-libvpx --enable-libaom --enable-libvpl --enable-nvenc
|
||||
--enable-demuxer=avi --enable-demuxer=matroska --enable-demuxer=mov
|
||||
--enable-protocol=file --enable-parsers
|
||||
--enable-bsf=h264_mp4toannexb --enable-bsf=hevc_mp4toannexb
|
||||
--enable-bsf=h264_mp4toannexb --enable-bsf=hevc_mp4toannexb --enable-bsf=trace_headers
|
||||
--disable-programs --disable-doc --disable-avdevice
|
||||
--disable-avfilter --disable-postproc --disable-muxers
|
||||
--disable-ffprobe --disable-ffplay --disable-ffmpeg --disable-debug --enable-optimizations
|
||||
|
||||
@@ -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"};
|
||||
|
||||
Reference in new issue
Block a user