Index: head/Mk/bsd.gecko.mk =================================================================== --- head/Mk/bsd.gecko.mk (revision 530012) +++ head/Mk/bsd.gecko.mk (revision 530013) @@ -1,397 +1,397 @@ #-*- tab-width: 4; -*- # ex:ts=4 # # Date created: 12 Nov 2005 # Whom: Michael Johnson # # $FreeBSD$ # # 4 column tabs prevent hair loss and tooth decay! # bsd.gecko.mk abstracts the selection of gecko-based backends. It allows users # and porters to support any available gecko backend without needing to build # many conditional tests. ${USE_GECKO} is the list of backends that your port # can handle, and ${GECKO} is set by bsd.gecko.mk to be the chosen backend. # Users set ${WITH_GECKO} to the list of gecko backends they want on their # system. .if defined(USE_GECKO) .if !defined(_POSTMKINCLUDED) && !defined(Gecko_Pre_Include) Gecko_Pre_Include= bsd.gecko.mk # This file contains some reusable components for mozilla ports. It's of # use primarily to apps from the mozilla project itself (such as Firefox, # Thunderbird, etc.), and probably won't be of use for gecko-based ports # like epiphany, galeon, etc. # # You need to make sure to add USE_GECKO=gecko to for your port can uses # one of these options below. # # Ports can use the following: # # USE_MOZILLA By default, it enables every system dependency # listed in '_ALL_DEPENDS'. If your port doesn't # need one of those then you can use '-' like # 'USE_MOZILLA= -png -vpx' to subtract the # dependencies. Experimental deps use '+' like # 'USE_MOZILLA= +speex +theora'. # # MOZILLA_PLIST_DIRS List of directories to descend into when installing # and creating the plist # # MOZ_OPTIONS configure arguments (added to .mozconfig). If # NOMOZCONFIG is defined, you probably want to set # CONFIGURE_ARGS+=${MOZ_OPTIONS} # # MOZ_MK_OPTIONS The make(1) arguments (added to .mozconfig). If # NOMOZCONFIG is defined, you probably want to set # MAKE_ARGS+=${MOZ_MK_OPTIONS} # # MOZ_EXPORT Environment variables for the build process (added # to .mozconfig). If NOMOZCONFIG is defined, you # probably want to set MAKE_ENV+=${MOZ_EXPORT} # # NOMOZCONFIG Don't drop a customized .mozconfig into the build # directory. Options will have to be specified in # CONFIGURE_ARGS instead # MAINTAINER?= gecko@FreeBSD.org MOZILLA?= ${PORTNAME} MOZILLA_VER?= ${PORTVERSION} MOZILLA_BIN?= ${PORTNAME}-bin MOZILLA_EXEC_NAME?=${MOZILLA} USES+= compiler:c++17-lang cpe gl gmake gnome iconv localbase perl5 pkgconfig \ python:2.7,build desktop-file-utils CPE_VENDOR?=mozilla USE_GL= gl USE_GNOME= cairo gdkpixbuf2 gtk20 gtk30 USE_PERL5= build USE_XORG= x11 xcb xcomposite xdamage xext xfixes xrender xt HAS_CONFIGURE= yes CONFIGURE_OUTSOURCE= yes LDFLAGS+= -Wl,--as-needed BUNDLE_LIBS= yes BUILD_DEPENDS+= llvm${LLVM_DEFAULT}>0:devel/llvm${LLVM_DEFAULT} \ - rust-cbindgen>=0.13.0:devel/rust-cbindgen \ - ${RUST_DEFAULT}>=1.39:lang/${RUST_DEFAULT} \ + rust-cbindgen>=0.13.1:devel/rust-cbindgen \ + ${RUST_DEFAULT}>=1.41:lang/${RUST_DEFAULT} \ ${LOCALBASE}/bin/python${PYTHON3_DEFAULT}:lang/python${PYTHON3_DEFAULT:S/.//g} \ node:www/node MOZ_EXPORT+= ${CONFIGURE_ENV} \ LLVM_CONFIG=llvm-config${LLVM_DEFAULT} \ PERL="${PERL}" \ PYTHON3="${LOCALBASE}/bin/python${PYTHON3_DEFAULT}" \ RUSTFLAGS="${RUSTFLAGS}" MOZ_OPTIONS+= --prefix="${PREFIX}" MOZ_MK_OPTIONS+=MOZ_OBJDIR="${BUILD_WRKSRC}" # Require newer Clang than what's in base system unless user opted out . if ${CC} == cc && ${CXX} == c++ && exists(/usr/lib/libc++.so) BUILD_DEPENDS+= ${LOCALBASE}/bin/clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} CPP= ${LOCALBASE}/bin/clang-cpp${LLVM_DEFAULT} CC= ${LOCALBASE}/bin/clang${LLVM_DEFAULT} CXX= ${LOCALBASE}/bin/clang++${LLVM_DEFAULT} USES:= ${USES:Ncompiler\:*} # XXX avoid warnings . endif MOZSRC?= ${WRKSRC} PLISTF?= ${WRKDIR}/plist_files MOZCONFIG?= ${WRKSRC}/.mozconfig MOZILLA_PLIST_DIRS?= bin lib share/pixmaps share/applications # Adjust -C target-cpu if -march/-mcpu is set by bsd.cpu.mk .if ${ARCH} == amd64 || ${ARCH} == i386 RUSTFLAGS+= ${CFLAGS:M-march=*:S/-march=/-C target-cpu=/} .else RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/} .endif # Standard depends _ALL_DEPENDS= av1 event ffi graphite harfbuzz icu jpeg nspr nss png pixman sqlite vpx webp .if exists(${FILESDIR}/patch-bug1559213) av1_LIB_DEPENDS= libaom.so:multimedia/aom libdav1d.so:multimedia/dav1d av1_MOZ_OPTIONS= --with-system-av1 .endif event_LIB_DEPENDS= libevent.so:devel/libevent event_MOZ_OPTIONS= --with-system-libevent ffi_LIB_DEPENDS= libffi.so:devel/libffi ffi_MOZ_OPTIONS= --enable-system-ffi .if exists(${FILESDIR}/patch-bug847568) graphite_LIB_DEPENDS= libgraphite2.so:graphics/graphite2 graphite_MOZ_OPTIONS= --with-system-graphite2 harfbuzz_LIB_DEPENDS= libharfbuzz.so:print/harfbuzz harfbuzz_MOZ_OPTIONS= --with-system-harfbuzz .endif icu_LIB_DEPENDS= libicui18n.so:devel/icu icu_MOZ_OPTIONS= --with-system-icu --with-intl-api -jpeg_BUILD_DEPENDS=yasm:devel/yasm jpeg_USES= jpeg jpeg_MOZ_OPTIONS= --with-system-jpeg=${LOCALBASE} nspr_LIB_DEPENDS= libnspr4.so:devel/nspr nspr_MOZ_OPTIONS= --with-system-nspr nss_LIB_DEPENDS= libnss3.so:security/nss nss_MOZ_OPTIONS= --with-system-nss pixman_LIB_DEPENDS= libpixman-1.so:x11/pixman pixman_MOZ_OPTIONS= --enable-system-pixman png_LIB_DEPENDS= libpng.so:graphics/png png_MOZ_OPTIONS= --with-system-png=${LOCALBASE} sqlite_LIB_DEPENDS= libsqlite3.so:databases/sqlite3 sqlite_MOZ_OPTIONS= --enable-system-sqlite -vpx_BUILD_DEPENDS= yasm:devel/yasm vpx_LIB_DEPENDS= libvpx.so:multimedia/libvpx vpx_MOZ_OPTIONS= --with-system-libvpx webp_LIB_DEPENDS= libwebp.so:graphics/webp webp_MOZ_OPTIONS= --with-system-webp .for use in ${USE_MOZILLA} ${use:S/-/_WITHOUT_/}= ${TRUE} .endfor LIB_DEPENDS+= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 .for dep in ${_ALL_DEPENDS} ${USE_MOZILLA:M+*:S/+//} .if !defined(_WITHOUT_${dep}) BUILD_DEPENDS+= ${${dep}_BUILD_DEPENDS} LIB_DEPENDS+= ${${dep}_LIB_DEPENDS} RUN_DEPENDS+= ${${dep}_RUN_DEPENDS} USES+= ${${dep}_USES} MOZ_OPTIONS+= ${${dep}_MOZ_OPTIONS} .else BUILD_DEPENDS+= ${-${dep}_BUILD_DEPENDS} .endif .endfor # Standard options MOZ_OPTIONS+= \ --enable-update-channel=${PKGNAMESUFFIX:Urelease:S/^-//} \ --disable-updater \ --with-system-zlib \ --with-system-bz2 # API keys from www/chromium # http://www.chromium.org/developers/how-tos/api-keys # Note: these are for FreeBSD use ONLY. For your own distribution, # please get your own set of keys. MOZ_EXPORT+= MOZ_GOOGLE_LOCATION_SERVICE_API_KEY=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 MOZ_EXPORT+= MOZ_GOOGLE_SAFEBROWSING_API_KEY=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 .if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS} CFLAGS+= -O3 MOZ_EXPORT+= MOZ_OPTIMIZE_FLAGS="${CFLAGS:M-O*}" MOZ_OPTIONS+= --enable-optimize .else MOZ_OPTIONS+= --disable-optimize . if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld # ld 2.17 barfs on Stylo built with -C opt-level=0 USE_BINUTILS= yes LDFLAGS+= -B${LOCALBASE}/bin . endif .endif .if ${PORT_OPTIONS:MCANBERRA} RUN_DEPENDS+= libcanberra>0:audio/libcanberra .endif .if ${PORT_OPTIONS:MDBUS} BUILD_DEPENDS+= libnotify>0:devel/libnotify LIB_DEPENDS+= libdbus-1.so:devel/dbus \ libdbus-glib-1.so:devel/dbus-glib \ libstartup-notification-1.so:x11/startup-notification MOZ_OPTIONS+= --enable-startup-notification .else MOZ_OPTIONS+= --disable-dbus .endif .if ${PORT_OPTIONS:MFFMPEG} # dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp RUN_DEPENDS+= ffmpeg>=0.8,1:multimedia/ffmpeg .endif .if ${PORT_OPTIONS:MGCONF} # XXX USE_GNOME+=gconf2:build is not supported BUILD_DEPENDS+= ${LOCALBASE}/lib/libgconf-2.so:devel/gconf2 MOZ_OPTIONS+= --enable-gconf .else MOZ_OPTIONS+= --disable-gconf .endif .if ${PORT_OPTIONS:MLIBPROXY} LIB_DEPENDS+= libproxy.so:net/libproxy MOZ_OPTIONS+= --enable-libproxy .else MOZ_OPTIONS+= --disable-libproxy .endif .if ${PORT_OPTIONS:MALSA} BUILD_DEPENDS+= ${LOCALBASE}/include/alsa/asoundlib.h:audio/alsa-lib RUN_DEPENDS+= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins RUN_DEPENDS+= alsa-lib>=1.1.1_1:audio/alsa-lib MOZ_OPTIONS+= --enable-alsa .endif .if ${PORT_OPTIONS:MJACK} BUILD_DEPENDS+= ${LOCALBASE}/include/jack/jack.h:audio/jack MOZ_OPTIONS+= --enable-jack .endif .if ${PORT_OPTIONS:MPULSEAUDIO} BUILD_DEPENDS+= ${LOCALBASE}/include/pulse/pulseaudio.h:audio/pulseaudio MOZ_OPTIONS+= --enable-pulseaudio .else MOZ_OPTIONS+= --disable-pulseaudio .endif .if ${PORT_OPTIONS:MSNDIO} BUILD_DEPENDS+= ${LOCALBASE}/include/sndio.h:audio/sndio post-patch-SNDIO-on: @${REINPLACE_CMD} -e 's|OpenBSD|${OPSYS}|g' \ -e '/DISABLE_LIBSNDIO_DLOPEN/d' \ ${MOZSRC}/media/libcubeb/src/moz.build .endif .if ${PORT_OPTIONS:MDEBUG} MOZ_OPTIONS+= --enable-debug --disable-release STRIP= # ports/184285 .else MOZ_OPTIONS+= --disable-debug --disable-debug-symbols --enable-release . if ${ARCH:Maarch64} || ${MACHINE_CPU:Msse2} MOZ_OPTIONS+= --enable-rust-simd . endif .endif .if ${PORT_OPTIONS:MPROFILE} MOZ_OPTIONS+= --enable-profiling STRIP= .else MOZ_OPTIONS+= --disable-profiling .endif .if ${PORT_OPTIONS:MTEST} USE_XORG+= xscrnsaver MOZ_OPTIONS+= --enable-tests .else MOZ_OPTIONS+= --disable-tests .endif .if !defined(STRIP) || ${STRIP} == "" MOZ_OPTIONS+= --disable-strip --disable-install-strip .else MOZ_OPTIONS+= --enable-strip --enable-install-strip .endif # _MAKE_JOBS is only available after bsd.port.post.mk, thus cannot be # used in .mozconfig. And client.mk automatically uses -jN where N # is what multiprocessing.cpu_count() returns. .if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE) MAKE_JOBS_NUMBER= 1 .endif .if defined(MAKE_JOBS_NUMBER) MOZ_MAKE_FLAGS+=-j${MAKE_JOBS_NUMBER} .endif .if defined(MOZ_MAKE_FLAGS) MOZ_MK_OPTIONS+=MOZ_MAKE_FLAGS="${MOZ_MAKE_FLAGS}" .endif .if ${ARCH} == amd64 . if ${USE_MOZILLA:M-nss} USE_BINUTILS= # intel-gcm.s CFLAGS+= -B${LOCALBASE}/bin LDFLAGS+= -B${LOCALBASE}/bin . endif .elif ${ARCH:Mpowerpc*} . if ${ARCH} == "powerpc64" MOZ_EXPORT+= UNAME_m="${ARCH}" . endif .elif ${ARCH} == "sparc64" # Work around miscompilation/mislinkage of the sCanonicalVTable hacks. MOZ_OPTIONS+= --disable-v1-string-abi .endif .else # bsd.port.post.mk post-patch: gecko-post-patch gecko-post-patch: @${RM} ${MOZCONFIG} .if !defined(NOMOZCONFIG) .for arg in ${MOZ_OPTIONS} @${ECHO_CMD} ac_add_options ${arg:Q} >> ${MOZCONFIG} .endfor .for arg in ${MOZ_MK_OPTIONS} @${ECHO_CMD} mk_add_options ${arg:Q} >> ${MOZCONFIG} .endfor .for var in ${MOZ_EXPORT} @${ECHO_CMD} export ${var:Q} >> ${MOZCONFIG} .endfor .endif # .if !defined(NOMOZCONFIG) .if ${USE_MOZILLA:M-nspr} @${ECHO_MSG} "===> Applying NSPR patches" @for i in ${.CURDIR}/../../devel/nspr/files/patch-*; do \ ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/nsprpub < $$i; \ done .endif .if ${USE_MOZILLA:M-nss} @${ECHO_MSG} "===> Applying NSS patches" @for i in ${.CURDIR}/../../security/nss/files/patch-*; do \ ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/security/nss < $$i; \ done .endif @if [ -f ${WRKSRC}/config/baseconfig.mk ] ; then \ ${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \ ${WRKSRC}/config/baseconfig.mk; \ fi @${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \ ${MOZSRC}/config/baseconfig.mk @${REINPLACE_CMD} -e 's|/usr/local/netscape|${LOCALBASE}|g ; \ s|/usr/local/lib/netscape|${LOCALBASE}/lib|g' \ ${MOZSRC}/xpcom/io/SpecialSystemDirectory.cpp @${REINPLACE_CMD} -e 's|/etc|${PREFIX}&|g' \ ${MOZSRC}/xpcom/build/nsXPCOMPrivate.h @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ -e 's|mozilla/plugins|browser_plugins|g' \ -e 's|share/mozilla/extensions|lib/xpi|g' \ ${MOZSRC}/xpcom/io/nsAppFileLocationProvider.cpp \ ${MOZSRC}/toolkit/xre/nsXREDirProvider.cpp # Disable vendor checksums like lang/rust @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${MOZSRC}/third_party/rust/*/.cargo-checksum.json pre-configure-script: # Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh post-install-script: gecko-create-plist gecko-create-plist: # Create the plist ${RM} ${PLISTF} .for dir in ${MOZILLA_PLIST_DIRS} @cd ${STAGEDIR}${PREFIX}/${dir} && ${FIND} -H -s * ! -type d | \ ${SED} -e 's|^|${dir}/|' >> ${PLISTF} .endfor ${CAT} ${PLISTF} | ${SORT} >> ${TMPPLIST} .endif .endif # HERE THERE BE TACOS -- adamw Index: head/www/firefox/Makefile =================================================================== --- head/www/firefox/Makefile (revision 530012) +++ head/www/firefox/Makefile (revision 530013) @@ -1,59 +1,60 @@ # Created by: Alan Eldridge # $FreeBSD$ PORTNAME= firefox -DISTVERSION= 74.0 -PORTREVISION= 6 +DISTVERSION= 75.0 PORTEPOCH= 1 CATEGORIES= www MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ - MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build3/source + MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source DISTFILES= ${DISTNAME}.source${EXTRACT_SUFX} MAINTAINER= gecko@FreeBSD.org COMMENT= Web browser based on the browser portion of Mozilla BUILD_DEPENDS= nspr>=4.25:devel/nspr \ - nss>=3.50:security/nss \ + nss>=3.51:security/nss \ icu>=64.1,1:devel/icu \ libevent>=2.1.8:devel/libevent \ harfbuzz>=2.6.4:print/harfbuzz \ graphite2>=1.3.13:graphics/graphite2 \ png>=1.6.35:graphics/png \ - libvpx>=1.5.0:multimedia/libvpx \ + libvpx>=1.8.2:multimedia/libvpx \ + py${PYTHON3_DEFAULT:S/.//}-sqlite3>0:databases/py-sqlite3@py${PYTHON3_DEFAULT:S/.//} \ v4l_compat>0:multimedia/v4l_compat \ autoconf-2.13:devel/autoconf213 \ nasm:devel/nasm \ + yasm:devel/yasm \ zip:archivers/zip USE_GECKO= gecko CONFLICTS_INSTALL= firefox-esr -USE_MOZILLA= -sqlite -vpx +USE_MOZILLA= -sqlite USES= tar:xz FIREFOX_ICON= ${MOZILLA}.png FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png FIREFOX_DESKTOP= ${MOZSRC}/taskcluster/docker/${MOZILLA}-snap/${MOZILLA}.desktop MOZ_OPTIONS= --enable-application=browser \ --enable-official-branding .include "${.CURDIR}/../../www/firefox/Makefile.options" post-patch: @${REINPLACE_CMD} -e 's/%u/%U/' -e '/X-MultipleArgs/d' \ -e '/^Icon/s/=.*/=${FIREFOX_ICON:R}/' \ ${FIREFOX_DESKTOP} @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/browser/app/nsBrowserApp.cpp pre-configure: (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${WRKSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13) post-install: ${INSTALL_DATA} ${FIREFOX_DESKTOP} ${STAGEDIR}${PREFIX}/share/applications/ ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps ${LN} -sf ${FIREFOX_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${FIREFOX_ICON} .include Index: head/www/firefox/distinfo =================================================================== --- head/www/firefox/distinfo (revision 530012) +++ head/www/firefox/distinfo (revision 530013) @@ -1,3 +1,3 @@ -TIMESTAMP = 1583759447 -SHA256 (firefox-74.0.source.tar.xz) = 74589c2836d7c30134636823c3caefbcaed0ea7c3abb2def9e3ddd9f86d9440a -SIZE (firefox-74.0.source.tar.xz) = 320001124 +TIMESTAMP = 1585679097 +SHA256 (firefox-75.0.source.tar.xz) = a8eefcc4dca2d90ffac24ecd307eecde912b1cf3d5dc0207b18c9f3eeaca3747 +SIZE (firefox-75.0.source.tar.xz) = 322506492 Index: head/www/firefox/files/patch-bug1594027 =================================================================== --- head/www/firefox/files/patch-bug1594027 (revision 530012) +++ head/www/firefox/files/patch-bug1594027 (nonexistent) @@ -1,33 +0,0 @@ -commit 9949bb054e7a -Author: Greg V -Date: Mon Feb 24 20:18:01 2020 +0000 - - Bug 1594027 - add more STL wrappers to fix build with libc++ 9 r=froydnj - - Differential Revision: https://phabricator.services.mozilla.com/D62847 - - --HG-- - extra : moz-landing-system : lando ---- - config/gcc-stl-wrapper.template.h | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git config/gcc-stl-wrapper.template.h config/gcc-stl-wrapper.template.h -index 41ae14024b0c0..9fe70fbaab8dc 100644 ---- config/gcc-stl-wrapper.template.h -+++ config/gcc-stl-wrapper.template.h -@@ -32,6 +32,14 @@ - # define moz_dont_include_mozalloc_for_cstdlib - #endif - -+#ifndef moz_dont_include_mozalloc_for_type_traits -+# define moz_dont_include_mozalloc_for_type_traits -+#endif -+ -+#ifndef moz_dont_include_mozalloc_for_limits -+# define moz_dont_include_mozalloc_for_limits -+#endif -+ - // Include mozalloc after the STL header and all other headers it includes - // have been preprocessed. - #if !defined(MOZ_INCLUDE_MOZALLOC_H) && \ Property changes on: head/www/firefox/files/patch-bug1594027 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/www/firefox/files/patch-bug1607052 =================================================================== --- head/www/firefox/files/patch-bug1607052 (revision 530012) +++ head/www/firefox/files/patch-bug1607052 (nonexistent) @@ -1,281 +0,0 @@ -commit 9d26727a4e85 -Author: Zibi Braniecki -Date: Fri Feb 21 00:39:18 2020 +0000 - - Bug 1607052 - Unify language identifier canonicalization in LocaleService and OSPreferences to use unic_langid, and extend GTK's RegionalPrefs reading to fallback on SystemLocales. r=jfkthame - - Differential Revision: https://phabricator.services.mozilla.com/D63393 - - --HG-- - extra : moz-landing-system : lando ---- - intl/locale/LocaleService.cpp | 53 ++------------------------- - intl/locale/LocaleService.h | 18 +++++++++ - intl/locale/OSPreferences.cpp | 18 ++------- - intl/locale/rust/unic-langid-ffi/src/lib.rs | 33 ++++++++++++++--- - intl/locale/tests/gtest/TestLocaleService.cpp | 23 ++++++++++++ - intl/locale/tests/unit/test_localeService.js | 3 +- - 6 files changed, 77 insertions(+), 71 deletions(-) - -diff --git intl/locale/LocaleService.cpp intl/locale/LocaleService.cpp -index f7e13e36ccbc7..6708c4af4b5c3 100644 ---- intl/locale/LocaleService.cpp -+++ intl/locale/LocaleService.cpp -@@ -39,51 +39,6 @@ NS_IMPL_ISUPPORTS(LocaleService, mozILocaleService, nsIObserver, - - mozilla::StaticRefPtr LocaleService::sInstance; - --/** -- * This function transforms a canonical Mozilla Language Tag, into it's -- * BCP47 compilant form. -- * -- * Example: "ja-JP-mac" -> "ja-JP-macos" -- * -- * The BCP47 form should be used for all calls to ICU/Intl APIs. -- * The canonical form is used for all internal operations. -- */ --static bool SanitizeForBCP47(nsACString& aLocale, bool strict) { -- // Currently, the only locale code we use that's not BCP47-conformant is -- // "ja-JP-mac" on OS X, and ICU canonicalizes it into a mouthfull -- // "ja-JP-x-lvariant-mac", so instead we're hardcoding a conversion -- // of it to "ja-JP-macos". -- if (aLocale.LowerCaseEqualsASCII("ja-jp-mac")) { -- aLocale.AssignLiteral("ja-JP-macos"); -- return true; -- } -- -- nsAutoCString locale(aLocale); -- locale.Trim(" "); -- -- // POSIX may bring us locales such as "en-US.UTF8", which -- // ICU converts to `en-US-u-va-posix`. Let's cut out -- // the `.UTF8`, since it doesn't matter for us. -- int32_t pos = locale.FindChar('.'); -- if (pos != -1) { -- locale.Cut(pos, locale.Length() - pos); -- } -- -- // The rest of this function will use ICU canonicalization for any other -- // tag that may come this way. -- const int32_t LANG_TAG_CAPACITY = 128; -- char langTag[LANG_TAG_CAPACITY]; -- UErrorCode err = U_ZERO_ERROR; -- // This is a fail-safe method that will set langTag to "und" if it cannot -- // match any part of the input locale code. -- int32_t len = uloc_toLanguageTag(locale.get(), langTag, LANG_TAG_CAPACITY, -- strict, &err); -- if (U_SUCCESS(err) && len > 0) { -- aLocale.Assign(langTag, len); -- } -- return U_SUCCESS(err); --} -- - /** - * This function splits an input string by `,` delimiter, sanitizes the result - * language tags and returns them to the caller. -@@ -93,7 +48,7 @@ static void SplitLocaleListStringIntoArray(nsACString& str, - if (str.Length() > 0) { - for (const nsACString& part : str.Split(',')) { - nsAutoCString locale(part); -- if (SanitizeForBCP47(locale, true)) { -+ if (LocaleService::CanonicalizeLanguageId(locale)) { - if (!aRetVal.Contains(locale)) { - aRetVal.AppendElement(locale); - } -@@ -421,7 +376,7 @@ LocaleService::GetDefaultLocale(nsACString& aRetVal) { - locale.Trim(" \t\n\r"); - // This should never be empty. - MOZ_ASSERT(!locale.IsEmpty()); -- if (SanitizeForBCP47(locale, true)) { -+ if (CanonicalizeLanguageId(locale)) { - mDefaultLocale.Assign(locale); - } - -@@ -617,7 +572,7 @@ LocaleService::SetRequestedLocales(const nsTArray& aRequested) { - - for (auto& req : aRequested) { - nsAutoCString locale(req); -- if (!SanitizeForBCP47(locale, true)) { -+ if (!CanonicalizeLanguageId(locale)) { - NS_ERROR("Invalid language tag provided to SetRequestedLocales!"); - return NS_ERROR_INVALID_ARG; - } -@@ -667,7 +622,7 @@ LocaleService::SetAvailableLocales(const nsTArray& aAvailable) { - - for (auto& avail : aAvailable) { - nsAutoCString locale(avail); -- if (!SanitizeForBCP47(locale, true)) { -+ if (!CanonicalizeLanguageId(locale)) { - NS_ERROR("Invalid language tag provided to SetAvailableLocales!"); - return NS_ERROR_INVALID_ARG; - } -diff --git intl/locale/LocaleService.h intl/locale/LocaleService.h -index 2ff428da3e3fd..5f5152c1fbb7a 100644 ---- intl/locale/LocaleService.h -+++ intl/locale/LocaleService.h -@@ -10,6 +10,7 @@ - #include "nsString.h" - #include "nsTArray.h" - #include "nsWeakReference.h" -+#include "MozLocaleBindings.h" - - #include "mozILocaleService.h" - -@@ -104,6 +105,23 @@ class LocaleService final : public mozILocaleService, - return RefPtr(GetInstance()).forget(); - } - -+ /** -+ * Canonicalize a Unicode Language Identifier string. -+ * -+ * The operation is: -+ * * Normalizing casing (`eN-Us-Windows` -> `en-US-windows`) -+ * * Switching `_` to `-` (`en_US` -> `en-US`) -+ * * Rejecting invalid identifiers (`e21-X` sets aLocale to `und` and -+ * returns false) -+ * * Normalizing Mozilla's `ja-JP-mac` to `ja-JP-macos` -+ * * Cutting off POSIX dot postfix (`en-US.utf8` -> `en-US`) -+ * -+ * This operation should be used on any external input before -+ * it gets used in internal operations. -+ */ -+ static bool CanonicalizeLanguageId(nsACString& aLocale) { -+ return ffi::unic_langid_canonicalize(&aLocale); -+ } - /** - * This method should only be called in the client mode. - * -diff --git intl/locale/OSPreferences.cpp intl/locale/OSPreferences.cpp -index 283db96e0d718..f816ca57abfea 100644 ---- intl/locale/OSPreferences.cpp -+++ intl/locale/OSPreferences.cpp -@@ -54,19 +54,7 @@ void OSPreferences::Refresh() { - * It returns true if the canonicalization was successful. - */ - bool OSPreferences::CanonicalizeLanguageTag(nsCString& aLoc) { -- char langTag[512]; -- -- UErrorCode status = U_ZERO_ERROR; -- -- int32_t langTagLen = uloc_toLanguageTag(aLoc.get(), langTag, -- sizeof(langTag) - 1, false, &status); -- -- if (U_FAILURE(status)) { -- return false; -- } -- -- aLoc.Assign(langTag, langTagLen); -- return true; -+ return LocaleService::CanonicalizeLanguageId(aLoc); - } - - /** -@@ -291,7 +279,9 @@ OSPreferences::GetRegionalPrefsLocales(nsTArray& aRetVal) { - return NS_OK; - } - -- return NS_ERROR_FAILURE; -+ // If we failed to read regional prefs locales, -+ // use system locales as last fallback. -+ return GetSystemLocales(aRetVal); - } - - static OSPreferences::DateTimeFormatStyle ToDateTimeFormatStyle( -diff --git intl/locale/rust/unic-langid-ffi/src/lib.rs intl/locale/rust/unic-langid-ffi/src/lib.rs -index 701d3679c4cec..517e08c1a64c1 100644 ---- intl/locale/rust/unic-langid-ffi/src/lib.rs -+++ intl/locale/rust/unic-langid-ffi/src/lib.rs -@@ -5,18 +5,39 @@ - use nsstring::nsACString; - use nsstring::nsCString; - use thin_vec::ThinVec; --pub use unic_langid::LanguageIdentifier; -+pub use unic_langid::{LanguageIdentifier, LanguageIdentifierError}; -+ -+fn new_langid_for_mozilla(name: &nsACString) -> Result { -+ if name.eq_ignore_ascii_case(b"ja-jp-mac") { -+ "ja-JP-macos".parse() -+ } else { -+ // Cut out any `.FOO` like `en-US.POSIX`. -+ let mut name: &[u8] = name.as_ref(); -+ if let Some(ptr) = name.iter().position(|b| b == &b'.') { -+ name = &name[..ptr]; -+ } -+ LanguageIdentifier::from_bytes(name) -+ } -+} -+ -+#[no_mangle] -+pub unsafe extern "C" fn unic_langid_canonicalize(name: &mut nsACString) -> bool { -+ let langid = new_langid_for_mozilla(name); -+ -+ let result = langid.is_ok(); -+ -+ name.assign(&langid.unwrap_or_default().to_string()); -+ -+ result -+} -+ - - #[no_mangle] - pub unsafe extern "C" fn unic_langid_new( - name: &nsACString, - ret_val: &mut bool, - ) -> *mut LanguageIdentifier { -- let langid = if name.eq_ignore_ascii_case(b"ja-jp-mac") { -- "ja-JP-macos".parse() -- } else { -- LanguageIdentifier::from_bytes(name) -- }; -+ let langid = new_langid_for_mozilla(name); - - *ret_val = langid.is_ok(); - Box::into_raw(Box::new(langid.unwrap_or_default())) -diff --git intl/locale/tests/gtest/TestLocaleService.cpp intl/locale/tests/gtest/TestLocaleService.cpp -index b13ecfd237dfa..aaac8615b09fd 100644 ---- intl/locale/tests/gtest/TestLocaleService.cpp -+++ intl/locale/tests/gtest/TestLocaleService.cpp -@@ -10,6 +10,29 @@ - - using namespace mozilla::intl; - -+TEST(Intl_Locale_LocaleService, CanonicalizeLanguageId) -+{ -+ nsCString locale("en-US.POSIX"); -+ ASSERT_TRUE(LocaleService::CanonicalizeLanguageId(locale)); -+ ASSERT_TRUE(locale.EqualsLiteral("en-US")); -+ -+ locale.AssignLiteral("en-US_POSIX"); -+ ASSERT_TRUE(LocaleService::CanonicalizeLanguageId(locale)); -+ ASSERT_TRUE(locale.EqualsLiteral("en-US-posix")); -+ -+ locale.AssignLiteral("en-US-POSIX"); -+ ASSERT_TRUE(LocaleService::CanonicalizeLanguageId(locale)); -+ ASSERT_TRUE(locale.EqualsLiteral("en-US-posix")); -+ -+ locale.AssignLiteral("C"); -+ ASSERT_FALSE(LocaleService::CanonicalizeLanguageId(locale)); -+ ASSERT_TRUE(locale.EqualsLiteral("und")); -+ -+ locale.AssignLiteral(""); -+ ASSERT_FALSE(LocaleService::CanonicalizeLanguageId(locale)); -+ ASSERT_TRUE(locale.EqualsLiteral("und")); -+} -+ - TEST(Intl_Locale_LocaleService, GetAppLocalesAsBCP47) - { - nsTArray appLocales; -diff --git intl/locale/tests/unit/test_localeService.js intl/locale/tests/unit/test_localeService.js -index 1970ae94b2607..202c2674972a8 100644 ---- intl/locale/tests/unit/test_localeService.js -+++ intl/locale/tests/unit/test_localeService.js -@@ -204,8 +204,7 @@ add_test(function test_requestedLocales_sanitize() { - Assert.equal(locales[0], "de"); - Assert.equal(locales[1], "pl"); - Assert.equal(locales[2], "de-AT"); -- Assert.equal(locales[3], "und"); -- Assert.equal(locales.length, 4); -+ Assert.equal(locales.length, 3); - - Services.prefs.clearUserPref(PREF_REQUESTED_LOCALES); - Property changes on: head/www/firefox/files/patch-bug1607052 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/www/firefox/files/patch-bug1612377 =================================================================== --- head/www/firefox/files/patch-bug1612377 (nonexistent) +++ head/www/firefox/files/patch-bug1612377 (revision 530013) @@ -0,0 +1,210 @@ +commit f30e2a9e31fa +Author: Martin Stransky +Date: Thu Mar 26 12:12:40 2020 +0000 + + Bug 1612377 [Wayland] Remove moz_container_set_accelerated(), r=jhorak + + Differential Revision: https://phabricator.services.mozilla.com/D68351 + + --HG-- + extra : moz-landing-system : lando +--- + widget/gtk/mozcontainer.cpp | 7 +------ + widget/gtk/mozcontainer.h | 2 -- + widget/gtk/nsWindow.cpp | 1 - + 3 files changed, 1 insertion(+), 9 deletions(-) + +diff --git widget/gtk/mozcontainer.cpp widget/gtk/mozcontainer.cpp +index 0c3833bc8ce3e..d438b67f9baea 100644 +--- widget/gtk/mozcontainer.cpp ++++ widget/gtk/mozcontainer.cpp +@@ -230,7 +230,6 @@ void moz_container_init(MozContainer* container) { + container->subsurface_dy = 0; + container->surface_position_needs_update = 0; + container->initial_draw_cbs.clear(); +- container->is_accelerated = false; + #endif + + LOG(("%s [%p]\n", __FUNCTION__, (void*)container)); +@@ -694,14 +693,10 @@ void moz_container_update_opaque_region(MozContainer* container, + // When GL compositor / WebRender is used, + // moz_container_get_wl_egl_window() is called only once when window + // is created or resized so update opaque region now. +- if (container->is_accelerated) { ++ if (moz_container_has_wl_egl_window(container)) { + moz_container_set_opaque_region(container); + } + } +- +-void moz_container_set_accelerated(MozContainer* container) { +- container->is_accelerated = true; +-} + #endif + + void moz_container_force_default_visual(MozContainer* container) { +diff --git widget/gtk/mozcontainer.h widget/gtk/mozcontainer.h +index 6befb992515dc..885dce5c27a1a 100644 +--- widget/gtk/mozcontainer.h ++++ widget/gtk/mozcontainer.h +@@ -87,7 +87,6 @@ struct _MozContainer { + gboolean surface_needs_clear; + gboolean ready_to_draw; + std::vector> initial_draw_cbs; +- gboolean is_accelerated; + #endif + gboolean force_default_visual; + }; +@@ -121,7 +120,6 @@ wl_surface* moz_gtk_widget_get_wl_surface(GtkWidget* aWidget); + void moz_container_update_opaque_region(MozContainer* container, + bool aSubtractCorners, + bool aFullScreen); +-void moz_container_set_accelerated(MozContainer* container); + #endif + + #endif /* __MOZ_CONTAINER_H__ */ +diff --git widget/gtk/nsWindow.cpp widget/gtk/nsWindow.cpp +index 728c1ed7d3226..dbcd8b8ae4941 100644 +--- widget/gtk/nsWindow.cpp ++++ widget/gtk/nsWindow.cpp +@@ -4138,7 +4138,6 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent, + self->mNeedsCompositorResume = true; + self->MaybeResumeCompositor(); + }); +- moz_container_set_accelerated(mContainer); + } + #endif + + +commit 4d1730dd79f9 +Author: Martin Stransky +Date: Thu Mar 26 12:12:48 2020 +0000 + + Bug 1612377 [Wayland] Update opaque region and widget scale factor when screen DPI changes, r=jhorak + + - Integrate scale factor setup to moz_container_get_wl_surface() and don't call it explicitly. + - No need to set it explicitly at nsWindow::GetWaylandSurface(). + - Update client offset when scale changes in CSD mode by UpdateClientOffsetFromCSDWindow(). + - Update scale factor/opaque region on EGL immediately. + + Differential Revision: https://phabricator.services.mozilla.com/D68352 + + --HG-- + extra : moz-landing-system : lando +--- + widget/gtk/mozcontainer.cpp | 19 ++++++++++++++++++- + widget/gtk/mozcontainer.h | 3 +-- + widget/gtk/nsWindow.cpp | 29 ++++++++++++++++++++++------- + 3 files changed, 41 insertions(+), 10 deletions(-) + +diff --git widget/gtk/mozcontainer.cpp widget/gtk/mozcontainer.cpp +index d438b67f9baea..eff25264d5678 100644 +--- widget/gtk/mozcontainer.cpp ++++ widget/gtk/mozcontainer.cpp +@@ -595,6 +595,22 @@ static void moz_container_set_opaque_region(MozContainer* container) { + container->opaque_region_needs_update = false; + } + ++static int moz_gtk_widget_get_scale_factor(MozContainer* container) { ++ static auto sGtkWidgetGetScaleFactor = ++ (gint(*)(GtkWidget*))dlsym(RTLD_DEFAULT, "gtk_widget_get_scale_factor"); ++ return sGtkWidgetGetScaleFactor ++ ? sGtkWidgetGetScaleFactor(GTK_WIDGET(container)) ++ : 1; ++} ++ ++void moz_container_set_scale_factor(MozContainer* container) { ++ if (!container->surface) { ++ return; ++ } ++ wl_surface_set_buffer_scale(container->surface, ++ moz_gtk_widget_get_scale_factor(container)); ++} ++ + struct wl_surface* moz_container_get_wl_surface(MozContainer* container) { + LOGWAYLAND(("%s [%p] surface %p ready_to_draw %d\n", __FUNCTION__, + (void*)container, (void*)container->surface, +@@ -645,6 +661,8 @@ struct wl_surface* moz_container_get_wl_surface(MozContainer* container) { + } + + moz_container_set_opaque_region(container); ++ moz_container_set_scale_factor(container); ++ + return container->surface; + } + +@@ -659,7 +677,6 @@ struct wl_egl_window* moz_container_get_wl_egl_window(MozContainer* container, + if (!surface) { + return nullptr; + } +- wl_surface_set_buffer_scale(surface, scale); + if (!container->eglwindow) { + GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); + container->eglwindow = +diff --git widget/gtk/mozcontainer.h widget/gtk/mozcontainer.h +index 885dce5c27a1a..8d40560cf634b 100644 +--- widget/gtk/mozcontainer.h ++++ widget/gtk/mozcontainer.h +@@ -112,8 +112,7 @@ void moz_container_move_resize(MozContainer* container, int dx, int dy, + int width, int height); + void moz_container_egl_window_set_size(MozContainer* container, int width, + int height); +-void moz_container_scale_changed(MozContainer* container, +- GtkAllocation* aAllocation); ++void moz_container_set_scale_factor(MozContainer* container); + void moz_container_add_initial_draw_callback( + MozContainer* container, const std::function& initial_draw_cb); + wl_surface* moz_gtk_widget_get_wl_surface(GtkWidget* aWidget); +diff --git widget/gtk/nsWindow.cpp widget/gtk/nsWindow.cpp +index dbcd8b8ae4941..be9c29a02ba32 100644 +--- widget/gtk/nsWindow.cpp ++++ widget/gtk/nsWindow.cpp +@@ -2713,7 +2713,7 @@ gboolean nsWindow::OnConfigureEvent(GtkWidget* aWidget, + OnSizeAllocate(&allocation); + } + +- // Client offset are upated by _NET_FRAME_EXTENTS on X11 when system titlebar ++ // Client offset are updated by _NET_FRAME_EXTENTS on X11 when system titlebar + // is enabled. In ither cases (Wayland or system titlebar is off on X11) + // we don't get _NET_FRAME_EXTENTS X11 property notification so we derive + // it from mContainer position. +@@ -3689,6 +3689,26 @@ void nsWindow::OnScaleChanged(GtkAllocation* aAllocation) { + // configure_event is already fired before scale-factor signal, + // but size-allocate isn't fired by changing scale + OnSizeAllocate(aAllocation); ++ ++ // Client offset are updated by _NET_FRAME_EXTENTS on X11 when system titlebar ++ // is enabled. In ither cases (Wayland or system titlebar is off on X11) ++ // we don't get _NET_FRAME_EXTENTS X11 property notification so we derive ++ // it from mContainer position. ++ if (mCSDSupportLevel == CSD_SUPPORT_CLIENT) { ++ if (!mIsX11Display || (mIsX11Display && mDrawInTitlebar)) { ++ UpdateClientOffsetFromCSDWindow(); ++ } ++ } ++ ++#ifdef MOZ_WAYLAND ++ // We need to update scale and opaque region when scale of egl window ++ // is changed. ++ if (mContainer && moz_container_has_wl_egl_window(mContainer)) { ++ moz_container_set_scale_factor(mContainer); ++ LayoutDeviceIntRegion tmpRegion; ++ UpdateOpaqueRegion(tmpRegion); ++ } ++#endif + } + + void nsWindow::DispatchDragEvent(EventMessage aMsg, +@@ -7618,12 +7638,7 @@ void nsWindow::GetCompositorWidgetInitData( + #ifdef MOZ_WAYLAND + wl_surface* nsWindow::GetWaylandSurface() { + if (mContainer) { +- struct wl_surface* surface = +- moz_container_get_wl_surface(MOZ_CONTAINER(mContainer)); +- if (surface != NULL) { +- wl_surface_set_buffer_scale(surface, GdkScaleFactor()); +- } +- return surface; ++ return moz_container_get_wl_surface(MOZ_CONTAINER(mContainer)); + } + + NS_WARNING( Property changes on: head/www/firefox/files/patch-bug1612377 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/www/firefox/files/patch-bug1619258 =================================================================== --- head/www/firefox/files/patch-bug1619258 (nonexistent) +++ head/www/firefox/files/patch-bug1619258 (revision 530013) @@ -0,0 +1,101 @@ +commit 7f9b73f61241 +Author: Martin Stransky +Date: Wed Mar 18 07:01:27 2020 +0000 + + Bug 1619258 [Wayland] Enable VA-API for all formats, r=jya + + Differential Revision: https://phabricator.services.mozilla.com/D65536 + + --HG-- + extra : moz-landing-system : lando +--- + dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp | 30 ++++++++++++++--------- + dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h | 1 + + 2 files changed, 20 insertions(+), 11 deletions(-) + +diff --git dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp +index 9a71a681eaef5..e0f7504574d6c 100644 +--- dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp ++++ dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp +@@ -42,6 +42,9 @@ typedef int VAStatus; + # define VA_STATUS_SUCCESS 0x00000000 + #endif + ++// Use some extra HW frames for potential rendering lags. ++#define EXTRA_HW_FRAMES 6 ++ + typedef mozilla::layers::Image Image; + typedef mozilla::layers::PlanarYCbCrImage PlanarYCbCrImage; + +@@ -135,10 +138,6 @@ VAAPIFrameHolder::~VAAPIFrameHolder() { + } + + AVCodec* FFmpegVideoDecoder::FindVAAPICodec() { +- if (mCodecID != AV_CODEC_ID_H264) { +- return nullptr; +- } +- + AVCodec* decoder = mLib->avcodec_find_decoder(mCodecID); + for (int i = 0;; i++) { + const AVCodecHWConfig* config = mLib->avcodec_get_hw_config(decoder, i); +@@ -172,7 +171,6 @@ bool FFmpegVideoDecoder::CreateVAAPIDeviceContext() { + + MediaResult FFmpegVideoDecoder::InitVAAPIDecoder() { + FFMPEG_LOG("Initialising VA-API FFmpeg decoder"); +- MOZ_ASSERT(mCodecID == AV_CODEC_ID_H264); + + if (!mLib->IsVAAPIAvailable()) { + FFMPEG_LOG("libva library is missing"); +@@ -282,11 +280,9 @@ RefPtr FFmpegVideoDecoder::Init() { + MediaResult rv; + + #ifdef MOZ_WAYLAND_USE_VAAPI +- if (mCodecID == AV_CODEC_ID_H264) { +- rv = InitVAAPIDecoder(); +- if (NS_SUCCEEDED(rv)) { +- return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__); +- } ++ rv = InitVAAPIDecoder(); ++ if (NS_SUCCEEDED(rv)) { ++ return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__); + } + #endif + +@@ -338,7 +334,12 @@ void FFmpegVideoDecoder::InitVAAPICodecContext() { + mCodecContext->height = mInfo.mImage.height; + mCodecContext->thread_count = 1; + mCodecContext->get_format = ChooseVAAPIPixelFormat; +- mCodecContext->extra_hw_frames = H264::ComputeMaxRefFrames(mInfo.mExtraData); ++ if (mCodecID == AV_CODEC_ID_H264) { ++ mCodecContext->extra_hw_frames = ++ H264::ComputeMaxRefFrames(mInfo.mExtraData); ++ } else { ++ mCodecContext->extra_hw_frames = EXTRA_HW_FRAMES; ++ } + } + #endif + +@@ -697,4 +698,11 @@ void FFmpegVideoDecoder::ProcessShutdown() { + FFmpegDataDecoder::ProcessShutdown(); + } + ++#ifdef MOZ_WAYLAND_USE_VAAPI ++bool FFmpegVideoDecoder::IsHardwareAccelerated( ++ nsACString& aFailureReason) const { ++ return !!mVAAPIDeviceContext; ++} ++#endif ++ + } // namespace mozilla +diff --git dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +index 6158f7bc2f6dd..670cb6203dde0 100644 +--- dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h ++++ dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +@@ -92,6 +92,7 @@ class FFmpegVideoDecoder + bool CreateVAAPIDeviceContext(); + void InitVAAPICodecContext(); + AVCodec* FindVAAPICodec(); ++ bool IsHardwareAccelerated(nsACString& aFailureReason) const override; + + MediaResult CreateImageVAAPI(int64_t aOffset, int64_t aPts, int64_t aDuration, + MediaDataDecoder::DecodedData& aResults); Property changes on: head/www/firefox/files/patch-bug1619258 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property