tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit c068abb18e26620ffca2ebf27f591ba52d9cf6a7
parent 4979be7df0aff83c1e54f77629e6379fbd0fa622
Author: Andrew Osmond <aosmond@gmail.com>
Date:   Wed, 31 Dec 2025 20:49:53 +0000

Bug 2008102 - Make Android gtests be able to load libmozavutil and libmozavcodec for ffvpx. r=media-playback-reviewers,jolin

These libraries are not included in the parent directory above libxul on
Android because they are stored in the APK, and gtest libxul is stored
in a temporary folder separate from the APK.

Differential Revision: https://phabricator.services.mozilla.com/D277703

Diffstat:
Mdom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp b/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp @@ -92,6 +92,12 @@ bool FFVPXRuntimeLinker::Init() { #ifdef XP_WIN PathString path = GetLibraryFilePathname(LXUL_DLL, (PRFuncPtr)&FFVPXRuntimeLinker::Init); +#elif defined(ANDROID) + // On Android, libxul is either pulled from the APK or from a temporary folder + // for gtests/fuzzing. libmozavutil and libmozavcodec are always in the APK, + // so let's use libmozglue instead to find the base pathname. + PathString path = GetLibraryFilePathname( + MOZ_DLL_PREFIX "mozglue" MOZ_DLL_SUFFIX, (PRFuncPtr)&malloc); #else PathString path = GetLibraryFilePathname(XUL_DLL, (PRFuncPtr)&FFVPXRuntimeLinker::Init); @@ -104,10 +110,11 @@ bool FFVPXRuntimeLinker::Init() { return false; } +#ifndef ANDROID if (getenv("MOZ_RUN_GTEST") -#ifdef FUZZING +# ifdef FUZZING || getenv("FUZZER") -#endif +# endif ) { // The condition above is the same as in // xpcom/glue/standalone/nsXPCOMGlue.cpp. This means we can't reach here @@ -120,6 +127,7 @@ bool FFVPXRuntimeLinker::Init() { } libFile = parent; } +#endif if (NS_FAILED(libFile->SetNativeLeafName(MOZ_DLL_PREFIX "mozavutil" MOZ_DLL_SUFFIX ""_ns))) {