diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /dom/media/platforms/ffmpeg/ffvpx | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/platforms/ffmpeg/ffvpx')
-rw-r--r-- | dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp | 48 | ||||
-rw-r--r-- | dom/media/platforms/ffmpeg/ffvpx/moz.build | 2 |
2 files changed, 27 insertions, 23 deletions
diff --git a/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp b/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp index dfc8244f1d..c0a6e01f98 100644 --- a/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp +++ b/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp @@ -7,14 +7,10 @@ #include "FFVPXRuntimeLinker.h" #include "FFmpegLibWrapper.h" #include "FFmpegLog.h" -#include "BinaryPath.h" #include "mozilla/FileUtils.h" #include "nsLocalFile.h" -#include "prmem.h" +#include "nsXPCOMPrivate.h" #include "prlink.h" -#ifdef XP_WIN -# include <windows.h> -#endif namespace mozilla { @@ -84,29 +80,37 @@ bool FFVPXRuntimeLinker::Init() { sFFVPXLib.LinkVAAPILibs(); #endif - nsCOMPtr<nsIFile> libFile; - if (NS_FAILED(mozilla::BinaryPath::GetFile(getter_AddRefs(libFile)))) { +#ifdef XP_WIN + PathString path = + GetLibraryFilePathname(LXUL_DLL, (PRFuncPtr)&FFVPXRuntimeLinker::Init); +#else + PathString path = + GetLibraryFilePathname(XUL_DLL, (PRFuncPtr)&FFVPXRuntimeLinker::Init); +#endif + if (path.IsEmpty()) { + return false; + } + nsCOMPtr<nsIFile> libFile = new nsLocalFile(path); + if (libFile->NativePath().IsEmpty()) { return false; } -#ifdef XP_DARWIN - if (!XRE_IsParentProcess() && - (XRE_GetChildProcBinPathType(XRE_GetProcessType()) == - BinPathType::PluginContainer)) { - // On macOS, PluginContainer processes have their binary in a - // plugin-container.app/Content/MacOS/ directory. - nsCOMPtr<nsIFile> parentDir1, parentDir2; - if (NS_FAILED(libFile->GetParent(getter_AddRefs(parentDir1)))) { - return false; - } - if (NS_FAILED(parentDir1->GetParent(getter_AddRefs(parentDir2)))) { - return false; - } - if (NS_FAILED(parentDir2->GetParent(getter_AddRefs(libFile)))) { + if (getenv("MOZ_RUN_GTEST") +#ifdef FUZZING + || getenv("FUZZER") +#endif + ) { + // The condition above is the same as in + // xpcom/glue/standalone/nsXPCOMGlue.cpp. This means we can't reach here + // without the gtest libxul being loaded. In turn, that means the path to + // libxul leads to a subdirectory of where the libmozav* libraries are, so + // we get the parent. + nsCOMPtr<nsIFile> parent; + if (NS_FAILED(libFile->GetParent(getter_AddRefs(parent)))) { return false; } + libFile = parent; } -#endif if (NS_FAILED(libFile->SetNativeLeafName(MOZ_DLL_PREFIX "mozavutil" MOZ_DLL_SUFFIX ""_ns))) { diff --git a/dom/media/platforms/ffmpeg/ffvpx/moz.build b/dom/media/platforms/ffmpeg/ffvpx/moz.build index bc72b6d1a7..a9236b25eb 100644 --- a/dom/media/platforms/ffmpeg/ffvpx/moz.build +++ b/dom/media/platforms/ffmpeg/ffvpx/moz.build @@ -25,7 +25,7 @@ SOURCES += [ ] LOCAL_INCLUDES += [ "..", - "../ffmpeg60/include", + "../ffmpeg61/include", "/media/mozva", ] |