firefox/mozilla-1619543.patch
2020-05-05 14:01:50 +02:00

98 lines
4.2 KiB
Diff

diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
@@ -101,17 +101,22 @@
: LinkResult::UnknownFutureLibAVVersion;
}
-#define AV_FUNC_OPTION(func, ver) \
+#define AV_FUNC_OPTION_SILENT(func, ver) \
if ((ver)&version) { \
if (!(func = (decltype(func))PR_FindSymbol( \
((ver)&AV_FUNC_AVUTIL_MASK) ? mAVUtilLib : mAVCodecLib, \
#func))) { \
- FFMPEG_LOG("Couldn't load function " #func); \
} \
} else { \
func = (decltype(func)) nullptr; \
}
+#define AV_FUNC_OPTION(func, ver) \
+ AV_FUNC_OPTION_SILENT(func, ver) \
+ if ((ver)&version && (func) == (decltype(func)) nullptr) { \
+ FFMPEG_LOG("Couldn't load function " #func); \
+ }
+
#define AV_FUNC(func, ver) \
AV_FUNC_OPTION(func, ver) \
if ((ver)&version && !func) { \
@@ -153,30 +158,29 @@
AV_FUNC_OPTION(av_frame_get_colorspace, AV_FUNC_AVUTIL_ALL)
AV_FUNC_OPTION(av_frame_get_color_range, AV_FUNC_AVUTIL_ALL)
#ifdef MOZ_WAYLAND
- AV_FUNC_OPTION(avcodec_get_hw_config, AV_FUNC_58)
- AV_FUNC_OPTION(av_hwdevice_ctx_create, AV_FUNC_58)
- AV_FUNC_OPTION(av_buffer_ref, AV_FUNC_AVUTIL_58)
- AV_FUNC_OPTION(av_buffer_unref, AV_FUNC_AVUTIL_58)
- AV_FUNC_OPTION(av_hwframe_transfer_get_formats, AV_FUNC_58)
- AV_FUNC_OPTION(av_hwdevice_ctx_create_derived, AV_FUNC_58)
- AV_FUNC_OPTION(av_hwframe_ctx_alloc, AV_FUNC_58)
- AV_FUNC_OPTION(av_dict_set, AV_FUNC_58)
- AV_FUNC_OPTION(av_dict_free, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(avcodec_get_hw_config, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_create, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_buffer_ref, AV_FUNC_AVUTIL_58)
+ AV_FUNC_OPTION_SILENT(av_buffer_unref, AV_FUNC_AVUTIL_58)
+ AV_FUNC_OPTION_SILENT(av_hwframe_transfer_get_formats, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_create_derived, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_hwframe_ctx_alloc, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_dict_set, AV_FUNC_58)
+ AV_FUNC_OPTION_SILENT(av_dict_free, AV_FUNC_58)
#endif
#undef AV_FUNC
#undef AV_FUNC_OPTION
#ifdef MOZ_WAYLAND
-# define VA_FUNC_OPTION(func) \
+# define VA_FUNC_OPTION_SILENT(func) \
if (!(func = (decltype(func))PR_FindSymbol(mVALib, #func))) { \
- FFMPEG_LOG("Couldn't load function " #func); \
func = (decltype(func)) nullptr; \
}
// mVALib is optional and may not be present.
if (mVALib) {
- VA_FUNC_OPTION(vaExportSurfaceHandle)
- VA_FUNC_OPTION(vaSyncSurface)
+ VA_FUNC_OPTION_SILENT(vaExportSurfaceHandle)
+ VA_FUNC_OPTION_SILENT(vaSyncSurface)
}
# undef VA_FUNC_OPTION
#endif
diff --git a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp
@@ -66,6 +66,9 @@
PR_UnloadLibrary(sLibAV.mVALib);
sLibAV.mVALib = nullptr;
}
+ if (!sLibAV.mVALib) {
+ FFMPEG_LOG("VA-API support: Missing or old %s library.\n", lib);
+ }
}
#endif
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -173,7 +173,7 @@
FFMPEG_LOG("Initialising VA-API FFmpeg decoder");
if (!mLib->IsVAAPIAvailable()) {
- FFMPEG_LOG("libva library is missing");
+ FFMPEG_LOG("libva library or symbols are missing.");
return NS_ERROR_NOT_AVAILABLE;
}