summaryrefslogtreecommitdiff
path: root/mozilla-1619543.patch
blob: 7dc1e86e78049440abd2fc4847121d06cf42937d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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;
   }
 

bgstack15