diff --git a/MozillaFirefox.changes b/MozillaFirefox.changes index a7ed0f56..aac456b1 100644 --- a/MozillaFirefox.changes +++ b/MozillaFirefox.changes @@ -1,3 +1,28 @@ +------------------------------------------------------------------- +Sun Jun 28 07:17:13 UTC 2020 - Wolfgang Rosenauer + +- Mozilla Firefox 78.0 + * startup notifications now using Gtk instead of libnotify + * PDF downloads now show an option to open the PDF directly in Firefox +- requires + * NSS >= 3.53.1 + * nodejs >= 10.21 + * Gtk+3 >= 3.14 +- removed obsolete patch + * mozilla-s390-bigendian.patch +- Add mozilla-pipewire-0-3.patch for openSUSE >= 15.2 to build + WebRTC with pipewire support to enable screen sharing under + Wayland; also add BuildRequires: pkgconfig(libpipewire-0.3) + appropriately (boo#1172903). +- adding SLE12 compatibility in spec file +- add patches for s390x + * mozilla-bmo1602730.patch (bmo#1602730) + * mozilla-bmo1626236.patch (bmo#1626236) + * mozilla-bmo998749.patch (bmo#998749) + * mozilla-s390x-skia-gradient.patch +- update create-tar.sh +- Use same _constraints for ppc64 (BE) as ppc64le to avoid oom build failure + ------------------------------------------------------------------- Wed Jun 10 07:17:15 UTC 2020 - Guillaume GARDET diff --git a/MozillaFirefox.spec b/MozillaFirefox.spec index aecc5cbe..450af97b 100644 --- a/MozillaFirefox.spec +++ b/MozillaFirefox.spec @@ -18,9 +18,16 @@ # changed with every update -%define major 77 -%define mainver %major.0.1 -%define orig_version 77.0.1 +# orig_version vs. mainver: To have beta-builds +# FF70beta3 would be released as FF69.99 +# orig_version would be the upstream tar ball +# orig_version 70.0 +# orig_suffix b3 +# major 69 +# mainver %major.99 +%define major 78 +%define mainver %major.0 +%define orig_version 78.0 %define orig_suffix %{nil} %define update_channel release %define branding 1 @@ -61,6 +68,12 @@ BuildArch: i686 %else %define crashreporter 0 %endif +%if 0%{?sle_version} > 150100 +# pipewire is too old on Leap <15.1 +%define with_pipewire0_3 1 +%else +%define with_pipewire0_3 0 +%endif Name: %{pkgname} BuildRequires: Mesa-devel @@ -71,7 +84,7 @@ BuildRequires: dejavu-fonts BuildRequires: fdupes BuildRequires: memory-constraints %if 0%{?suse_version} <= 1320 -BuildRequires: gcc7-c++ +BuildRequires: gcc9-c++ %else BuildRequires: gcc-c++ %endif @@ -80,19 +93,22 @@ BuildRequires: libXcomposite-devel BuildRequires: libcurl-devel BuildRequires: libidl-devel BuildRequires: libiw-devel -BuildRequires: libnotify-devel BuildRequires: libproxy-devel BuildRequires: makeinfo BuildRequires: mozilla-nspr-devel >= 4.25 -BuildRequires: mozilla-nss-devel >= 3.52.1 +BuildRequires: mozilla-nss-devel >= 3.53.1 BuildRequires: nasm >= 2.14 -BuildRequires: nodejs10 >= 10.19.0 +BuildRequires: nodejs10 >= 10.21.0 BuildRequires: python-devel +%if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000 +BuildRequires: python-libxml2 +BuildRequires: python36 +%else BuildRequires: python2-xml BuildRequires: python3 >= 3.5 +%endif BuildRequires: rust >= 1.41 BuildRequires: rust-cbindgen >= 0.14.1 -BuildRequires: startup-notification-devel BuildRequires: unzip BuildRequires: update-desktop-files BuildRequires: xorg-x11-libXt-devel @@ -104,16 +120,23 @@ BuildRequires: zip %if 0%{?suse_version} < 1550 BuildRequires: pkgconfig(gconf-2.0) >= 1.2.1 %endif +%if (0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000) +BuildRequires: clang6-devel +%else BuildRequires: clang-devel >= 5 +%endif BuildRequires: pkgconfig(gdk-x11-2.0) BuildRequires: pkgconfig(glib-2.0) >= 2.22 BuildRequires: pkgconfig(gobject-2.0) BuildRequires: pkgconfig(gtk+-2.0) >= 2.18.0 -BuildRequires: pkgconfig(gtk+-3.0) >= 3.4.0 +BuildRequires: pkgconfig(gtk+-3.0) >= 3.14.0 BuildRequires: pkgconfig(gtk+-unix-print-2.0) BuildRequires: pkgconfig(gtk+-unix-print-3.0) BuildRequires: pkgconfig(libffi) BuildRequires: pkgconfig(libpulse) +%if %{with_pipewire0_3} +BuildRequires: pkgconfig(libpipewire-0.3) +%endif # libavcodec is required for H.264 support but the # openSUSE version is currently not able to play H.264 # therefore the Packman version is required @@ -148,7 +171,7 @@ Source9: firefox.js Source11: firefox.1 Source12: mozilla-get-app-id Source13: spellcheck.js -Source14: https://github.com/openSUSE/firefox-scripts/raw/8a54002/create-tar.sh +Source14: https://github.com/openSUSE/firefox-scripts/raw/5e54f4a/create-tar.sh Source15: firefox-appdata.xml Source16: %{name}.changes # Set up API keys, see http://www.chromium.org/developers/how-tos/api-keys @@ -168,7 +191,6 @@ Patch6: mozilla-sandbox-fips.patch Patch7: mozilla-fix-aarch64-libopus.patch Patch8: mozilla-disable-wasm-emulate-arm-unaligned-fp-access.patch Patch9: mozilla-s390-context.patch -Patch10: mozilla-s390-bigendian.patch Patch11: mozilla-reduce-rust-debuginfo.patch Patch12: mozilla-ppc-altivec_static_inline.patch Patch13: mozilla-bmo1005535.patch @@ -181,7 +203,11 @@ Patch19: mozilla-bmo1512162.patch Patch20: mozilla-fix-top-level-asm.patch Patch21: mozilla-bmo1504834-part4.patch Patch22: mozilla-bmo849632.patch -Patch23: mozilla-bmo1634646.patch +Patch23: mozilla-pipewire-0-3.patch +Patch24: mozilla-bmo1602730.patch +Patch25: mozilla-bmo998749.patch +Patch26: mozilla-bmo1626236.patch +Patch27: mozilla-s390x-skia-gradient.patch # Firefox/browser Patch101: firefox-kde.patch Patch102: firefox-branded-icons.patch @@ -228,6 +254,8 @@ Development files for %{appname} to make packaging of addons easier. Summary: Common translations for %{appname} Group: System/Localization Provides: locale(%{name}:ar;ca;cs;da;de;el;en_GB;es_AR;es_CL;es_ES;fi;fr;hu;it;ja;ko;nb_NO;nl;pl;pt_BR;pt_PT;ru;sv_SE;zh_CN;zh_TW) +# This is there for updates from Firefox before the translations-package was split up into 2 packages +Provides: %{name}-translations Requires: %{name} = %{version} Obsoletes: %{name}-translations < %{version}-%{release} @@ -302,9 +330,6 @@ cd $RPM_BUILD_DIR/%{srcname}-%{orig_version} %patch7 -p1 %patch8 -p1 %patch9 -p1 -%ifarch s390x ppc64 -%patch10 -p1 -%endif %patch11 -p1 %patch12 -p1 %patch13 -p1 @@ -317,7 +342,13 @@ cd $RPM_BUILD_DIR/%{srcname}-%{orig_version} %patch20 -p1 %patch21 -p1 %patch22 -p1 +%if %{with_pipewire0_3} %patch23 -p1 +%endif +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch27 -p1 # Firefox %patch101 -p1 %patch102 -p1 @@ -330,15 +361,24 @@ modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")" DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\"" TIME="\"$(date -d "${modified}" "+%%R")\"" find . -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} + + +# SLE-12 provides python36, but that package does not provide a python3 binary +%if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000 +sed -i "s/python3/python36/g" configure.in +sed -i "s/python3/python36/g" mach +export PYTHON3=/usr/bin/python36 +%endif + # kdehelperversion=$(cat toolkit/xre/nsKDEUtils.cpp | grep '#define KMOZILLAHELPER_VERSION' | cut -d ' ' -f 3) if test "$kdehelperversion" != %{kde_helper_version}; then echo fix kde helper version in the .spec file exit 1 fi -source %{SOURCE4} %endif # only_print_mozconfig +source %{SOURCE4} + export CARGO_HOME=${RPM_BUILD_DIR}/%{srcname}-%{orig_version}/.cargo export MOZ_SOURCE_CHANGESET=$RELEASE_TAG export SOURCE_REPO=$RELEASE_REPO @@ -349,7 +389,7 @@ export MOZILLA_OFFICIAL=1 export BUILD_OFFICIAL=1 export MOZ_TELEMETRY_REPORTING=1 %if 0%{?suse_version} <= 1320 -export CC=gcc-7 +export CC=gcc-9 %else %if 0%{?clang_build} == 0 export CC=gcc @@ -374,8 +414,17 @@ export MOZCONFIG=$RPM_BUILD_DIR/mozconfig echo "export CC=$CC" echo "export CXX=$CXX" echo "export CFLAGS=\"$CFLAGS\"" +echo "export CXXFLAGS=\"$CXXFLAGS\"" echo "export LDFLAGS=\"$LDFLAGS\"" echo "export RUSTFLAGS=\"$RUSTFLAGS\"" +echo "export CARGO_HOME=\"$CARGO_HOME\"" +echo "export PATH=\"$PATH\"" +echo "export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"" +echo "export PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"" +echo "export MOZCONFIG=\"$MOZCONFIG\"" +echo "export MOZILLA_OFFICIAL=1" +echo "export BUILD_OFFICIAL=1" +echo "export MOZ_TELEMETRY_REPORTING=1" echo "" cat << EOF %else @@ -395,9 +444,10 @@ ac_add_options --prefix=%{_prefix} ac_add_options --libdir=%{_libdir} ac_add_options --includedir=%{_includedir} ac_add_options --enable-release +%if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000 +ac_add_options --enable-default-toolkit=cairo-gtk3 +%else ac_add_options --enable-default-toolkit=cairo-gtk3-wayland -%if 0%{?suse_version} >= 1550 -ac_add_options --disable-gconf %endif # bmo#1441155 - Disable the generation of Rust debug symbols on Linux32 %ifarch %ix86 %arm @@ -423,7 +473,6 @@ ac_add_options --disable-updater ac_add_options --disable-tests ac_add_options --enable-alsa ac_add_options --disable-debug -ac_add_options --enable-startup-notification #ac_add_options --enable-chrome-format=jar ac_add_options --enable-update-channel=%{update_channel} ac_add_options --with-mozilla-api-keyfile=%{SOURCE18} diff --git a/_constraints b/_constraints index 1a3e31c2..443eb283 100644 --- a/_constraints +++ b/_constraints @@ -44,6 +44,7 @@ + ppc64 ppc64le diff --git a/create-tar.sh b/create-tar.sh index 4d78daed..1cf654c6 100644 --- a/create-tar.sh +++ b/create-tar.sh @@ -181,10 +181,7 @@ fi BUILD_ID=$(get_build_number "$VERSION$VERSION_SUFFIX") if [ -z ${SKIP_LOCALES+x} ]; then - # TODO: Thunderbird has usually "default" as locale entry. - # There we probably need to double-check Firefox-locals - # For now, just download every time for Thunderbird - if [ "$PRODUCT" = "firefox" ] && [ "$PREV_VERSION" != "" ] && locales_unchanged "$BUILD_ID"; then + if [ "$PREV_VERSION" != "" ] && locales_unchanged "$BUILD_ID"; then printf "%-40s: Did not change. Skipping.\n" "locales" LOCALES_CHANGED=0 else diff --git a/firefox-77.0.1.source.tar.xz b/firefox-77.0.1.source.tar.xz deleted file mode 100644 index d7529721..00000000 --- a/firefox-77.0.1.source.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:54256fc5f8e9c2e8129ef84773fae31fcfdaf95da6d4d03151f3939e9f749640 -size 334037816 diff --git a/firefox-77.0.1.source.tar.xz.asc b/firefox-77.0.1.source.tar.xz.asc deleted file mode 100644 index cca4635c..00000000 --- a/firefox-77.0.1.source.tar.xz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCgAdFiEECXsxMHeuYqAvhNpN8aZmj7t9Vy4FAl7W+HkACgkQ8aZmj7t9 -Vy7Jgw//cvNlYwBSHdGaSO+zDinKwpVM1kitUQkAkyWpRt4iPwtCkbntVdFO/y39 -9Qw1LWYy2bqyUP3SVWL6l9Fk0IhpcxHmbVujZUWL6KNm1aGKhf1ZHojDpt2orPIS -WSMRJrwE2Ii/GwJF9ZB8s1hR218kv1AY9THhSVNiMDQLXc2InX/Zi7XsGw92FkM8 -fGJUnXn9k2XKfYzYqk3BaroewNyqK8+EQ9ENwSJTCWnMXa9zOJ1QFSGC9nEvY4cf -uJIuvsp/H4b/5OwWcQVuLLd1CZZKkYnmcrK6Z2FPLwb2L4GYndHV6JhX+faYl3jo -xRcAMaZMIQODhdyFw1DStq56ZQKHGW+AiMuzi30Z/iwS2XAx5fM69BeHeQbKihw6 -dScknUuZDPUHKakl0e1Xs5TnLtSrzdPta7AeUXs8XBcciucUIagb4xQLYX5ia3Xd -htwV4VbOFk6FQ68JU++E6Iw6AHQamyvZmPQRKB22nPAjt5+deGep2TNDMJqfbpnk -2iPx3B2xckAGWtgYRo6wZZ2ZKTxOe8WjmtCqT69UquhJFcgaIxDOw9Si/wtw6PwU -jrl6LsfRoun200KsxxBBMIsNYWuph0W4aZTMKK9jwSBiorhZ1AZoPtiqwHwV/aSM -1oMGBgUGfIIGCkLNCW+Kq7zfg/qHKVOblJJmZE+5niIbPpATXFU= -=2chn ------END PGP SIGNATURE----- diff --git a/firefox-78.0.source.tar.xz b/firefox-78.0.source.tar.xz new file mode 100644 index 00000000..449b091f --- /dev/null +++ b/firefox-78.0.source.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:291a593151e476e6c4b61e48a3bdd5a11896fbde6261dcad347d5b7df265a058 +size 333422136 diff --git a/firefox-78.0.source.tar.xz.asc b/firefox-78.0.source.tar.xz.asc new file mode 100644 index 00000000..11190f6b --- /dev/null +++ b/firefox-78.0.source.tar.xz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEECXsxMHeuYqAvhNpN8aZmj7t9Vy4FAl706/oACgkQ8aZmj7t9 +Vy7BQQ//e9w8ZTou1TaKhI8Wkd+NwpmqPgqpkqlfZ39/G0TACqEQQnUJh6EmYmxc +lr3U82ePOoT0pOaH1qOJpoBQUlgODqxkL/RQjrkUnY+MfWvhdQqM3X7OaqOrVYue +pwpNQ7wWCzirIgzVdHOD8CLw0aqYfJwu8Hbnu4kEadXWEck05YDcGHvpDdpfbQ3Z ++DmkgIRGUjed1PCZxrB4rwFE4VWzPhKByLGBtfSbI+49AwXXt/TRzCYC8y0sfl1+ +mzLMO7K02xfquWpXwSY+cyDHW1WM76BdTKOCqswD3lsB7MJiA+HZ+h6HfVRGK4ov +VLh2H1/0RfvjO9VUOtrSRUAevFpmRMuBHwtRNF0Zp2mjunSNeHRHIndWUPSbMp6F +Ecvm+RNAIUHOtgi+mrzq9NIVIoi4F2KYNOTJQPR/vGGbvDUmnyXm0y5wLt7pAyIv +d7LBV7BcTmCjmnWQG40QbhLpDyFF/wUoKkxXWySnPBu5V2UD2OzBnlQ+BIZyvSar +jjGNLlWcwQ9TIZUFqYa3J3JQ23BRHYh4Nr40YDuEGZCJcdAslbFSRUeII0XxVa1k +YqVHSU/C1Vsumxe/Yh5s2CppZAs+KyZ5YkRlZebBR+7mRd52fuoOSMgNbiSV5aOw +qEV4RV82Cph/uITGPzxAn3TatGRP/tGdz3b5mi+Bwmveq+9Z1Q8= +=FBW2 +-----END PGP SIGNATURE----- diff --git a/l10n-77.0.1.tar.xz b/l10n-77.0.1.tar.xz deleted file mode 100644 index f5238a18..00000000 --- a/l10n-77.0.1.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c1c0834bc57b7dd8bbefcb31abe08530cab24ff537f4c48bea7dfb8714e22b73 -size 52244764 diff --git a/l10n-78.0.tar.xz b/l10n-78.0.tar.xz new file mode 100644 index 00000000..a3dbab7e --- /dev/null +++ b/l10n-78.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2323c7ecf0b413f31b4c15164f7998e44a75637a5a40cdbfb7be8bc80622d33d +size 52194856 diff --git a/mozilla-bmo1602730.patch b/mozilla-bmo1602730.patch new file mode 100644 index 00000000..810047ff --- /dev/null +++ b/mozilla-bmo1602730.patch @@ -0,0 +1,25 @@ +# HG changeset patch +# User msirringhaus@suse.de +# Date 1582805890 -3600 +# Thu Feb 27 13:18:10 2020 +0100 +# Node ID 457cbe5705f2a3759d3da36a05c0ed66ec61ea12 +# Parent 7440f4b6bab85068ca2f84e9c48e0706d04330e8 +imported patch mozilla-bmo1602730-FF73.patch + +diff -r 7440f4b6bab8 gfx/layers/composite/CompositableHost.cpp +--- a/gfx/layers/composite/CompositableHost.cpp Thu Feb 27 13:17:56 2020 +0100 ++++ b/gfx/layers/composite/CompositableHost.cpp Wed Jun 17 15:33:32 2020 +0200 +@@ -92,9 +92,13 @@ + } + MOZ_ASSERT(source); + ++ // Setting an alpha-mask here breaks the URL-bar on big endian (s390x) ++ // if the typed URL is too long for the textbox (automatic scrolling needed) ++#if MOZ_LITTLE_ENDIAN() + RefPtr effect = + new EffectMask(source, source->GetSize(), aTransform); + aEffects.mSecondaryEffects[EffectTypes::MASK] = effect; ++#endif + return true; + } + diff --git a/mozilla-bmo1626236.patch b/mozilla-bmo1626236.patch new file mode 100644 index 00000000..9615c046 --- /dev/null +++ b/mozilla-bmo1626236.patch @@ -0,0 +1,85 @@ +# HG changeset patch +# User msirringhaus@suse.de +# Date 1582805876 -3600 +# Thu Feb 27 13:17:56 2020 +0100 +# Node ID cc3d09abea31068e57f1ab918782f9f86fc6a158 +# Parent 9cd90914846f667f18babc491a74c164ae5d6e9f +imported patch decoder_workaround.patch + +diff -r 9cd90914846f image/decoders/nsGIFDecoder2.cpp +--- a/image/decoders/nsGIFDecoder2.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsGIFDecoder2.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -422,6 +422,9 @@ + MOZ_ASSERT(mSwizzleFn); + uint8_t* data = reinterpret_cast(aColormap); + mSwizzleFn(data, data, aColors); ++#if MOZ_BIG_ENDIAN() ++ SwizzleRow(SurfaceFormat::A8R8G8B8, SurfaceFormat::B8G8R8A8)(data, data, aColors); ++#endif + } + + LexerResult nsGIFDecoder2::DoDecode(SourceBufferIterator& aIterator, +diff -r 9cd90914846f image/decoders/nsJPEGDecoder.cpp +--- a/image/decoders/nsJPEGDecoder.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsJPEGDecoder.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -263,6 +263,9 @@ + case JCS_YCbCr: + // By default, we will output directly to BGRA. If we need to apply + // special color transforms, this may change. ++#if MOZ_BIG_ENDIAN() ++ mInfo.out_color_space = MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB; ++#else + switch (SurfaceFormat::OS_RGBX) { + case SurfaceFormat::B8G8R8X8: + mInfo.out_color_space = JCS_EXT_BGRX; +@@ -277,6 +280,7 @@ + mState = JPEG_ERROR; + return Transition::TerminateFailure(); + } ++#endif + break; + case JCS_CMYK: + case JCS_YCCK: +diff -r 9cd90914846f image/decoders/nsPNGDecoder.cpp +--- a/image/decoders/nsPNGDecoder.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsPNGDecoder.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -361,7 +361,7 @@ + IResumable* aOnResume) { + MOZ_ASSERT(!HasError(), "Shouldn't call DoDecode after error!"); + +- return mLexer.Lex(aIterator, aOnResume, ++ LexerResult res = mLexer.Lex(aIterator, aOnResume, + [=](State aState, const char* aData, size_t aLength) { + switch (aState) { + case State::PNG_DATA: +@@ -371,6 +371,14 @@ + } + MOZ_CRASH("Unknown State"); + }); ++ ++#if MOZ_BIG_ENDIAN() ++ if(res.is() && res.as() == TerminalState::SUCCESS) { ++ NativeEndian::swapToLittleEndianInPlace((uint32_t*)(mImageData), mImageDataLength / 4); ++ } ++#endif ++ ++ return res; + } + + LexerTransition nsPNGDecoder::ReadPNGData( +diff -r 9cd90914846f image/decoders/nsWebPDecoder.cpp +--- a/image/decoders/nsWebPDecoder.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsWebPDecoder.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -237,7 +237,12 @@ + // WebP doesn't guarantee that the alpha generated matches the hint in the + // header, so we always need to claim the input is BGRA. If the output is + // BGRX, swizzling will mask off the alpha channel. ++#if MOZ_BIG_ENDIAN() ++ mBuffer.colorspace = MODE_ARGB; ++ SurfaceFormat inFormat = mFormat; ++#else + SurfaceFormat inFormat = SurfaceFormat::OS_RGBA; ++#endif + + SurfacePipeFlags pipeFlags = SurfacePipeFlags(); + if (mFormat == SurfaceFormat::OS_RGBA && diff --git a/mozilla-bmo1634646.patch b/mozilla-bmo1634646.patch deleted file mode 100644 index c98e41da..00000000 --- a/mozilla-bmo1634646.patch +++ /dev/null @@ -1,26 +0,0 @@ -# HG changeset patch -# User Wolfgang Rosenauer -# Parent 43820d9e289abee98a2e3cdb4314848de3bc8622 - -diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py ---- a/build/pgo/profileserver.py -+++ b/build/pgo/profileserver.py -@@ -127,17 +127,17 @@ if __name__ == '__main__': - # Bug 1553850 considers fixing this. - env["MOZ_DISABLE_CONTENT_SANDBOX"] = "1" - env["MOZ_DISABLE_RDD_SANDBOX"] = "1" - - # Ensure different pids write to different files - env["LLVM_PROFILE_FILE"] = "default_%p_random_%m.profraw" - - # Write to an output file if we're running in automation -- process_args = {} -+ process_args = {'universal_newlines': True} - if 'UPLOAD_PATH' in env: - process_args['logfile'] = os.path.join(env['UPLOAD_PATH'], 'profile-run-1.log') - - # Run Firefox a first time to initialize its profile - runner = FirefoxRunner(profile=profile, - binary=binary, - cmdargs=['data:text/html,'], - env=env, diff --git a/mozilla-bmo998749.patch b/mozilla-bmo998749.patch new file mode 100644 index 00000000..91a6168d --- /dev/null +++ b/mozilla-bmo998749.patch @@ -0,0 +1,29 @@ +# HG changeset patch +# User msirringhaus@suse.de +# Date 1583738770 -3600 +# Mon Mar 09 08:26:10 2020 +0100 +# Node ID 34676feac1a542e409e22acf5b98735f8313b1ce +# Parent 506857dace0a08d1c9685e3ac264646590b3e27f +[mq]: mozilla-bmo998749.patch + +diff -r 506857dace0a -r 34676feac1a5 gfx/2d/FilterProcessing.h +--- a/gfx/2d/FilterProcessing.h Fri Feb 28 12:31:51 2020 +0100 ++++ b/gfx/2d/FilterProcessing.h Mon Mar 09 08:26:10 2020 +0100 +@@ -13,10 +13,17 @@ + namespace mozilla { + namespace gfx { + ++#if MOZ_BIG_ENDIAN() ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_B = 3; ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_G = 2; ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_R = 1; ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_A = 0; ++#else + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_B = 0; + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_G = 1; + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_R = 2; + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_A = 3; ++#endif + + class FilterProcessing { + public: diff --git a/mozilla-kde.patch b/mozilla-kde.patch index a076caa4..4223410f 100644 --- a/mozilla-kde.patch +++ b/mozilla-kde.patch @@ -3,7 +3,7 @@ # Date 1559294891 -7200 # Fri May 31 11:28:11 2019 +0200 # Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112 -# Parent b517aa8dfa37d729db9590fe699caa38f899dfba +# Parent aa58e8c70d1448a08407c6c191ea8b76d61e8bf6 Description: Add KDE integration to Firefox (toolkit parts) Author: Wolfgang Rosenauer Author: Lubos Lunak @@ -175,7 +175,7 @@ diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloa diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm --- a/toolkit/mozapps/downloads/HelperAppDlg.jsm +++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm -@@ -1205,36 +1205,66 @@ nsUnknownContentTypeDialog.prototype = { +@@ -1203,36 +1203,66 @@ nsUnknownContentTypeDialog.prototype = { params.handlerApp && params.handlerApp.executable && params.handlerApp.executable.isFile() @@ -800,7 +800,7 @@ diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandle using mozilla::dom::RemoteHandlerApp; namespace { -@@ -294,17 +294,17 @@ mozilla::ipc::IPCResult HandlerServicePa +@@ -299,17 +299,17 @@ mozilla::ipc::IPCResult HandlerServicePa mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocolOS( const nsCString& aProtocolScheme, bool* aHandlerExists) { if (aProtocolScheme.Length() > MAX_SCHEME_LENGTH) { @@ -819,7 +819,7 @@ diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandle /* * Check if a handler exists for the provided protocol. Check the datastore -@@ -323,17 +323,17 @@ mozilla::ipc::IPCResult HandlerServicePa +@@ -328,17 +328,17 @@ mozilla::ipc::IPCResult HandlerServicePa nsCOMPtr protoSvc = do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &rv); if (NS_WARN_IF(NS_FAILED(rv))) { @@ -1214,7 +1214,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth #include "nsIFileStreams.h" #include "nsILineInputStream.h" #include "nsIFile.h" -@@ -1023,17 +1023,17 @@ nsresult nsOSHelperAppService::GetHandle +@@ -1022,17 +1022,17 @@ nsresult nsOSHelperAppService::GetHandle nsresult nsOSHelperAppService::OSProtocolHandlerExists( const char* aProtocolScheme, bool* aHandlerExists) { @@ -1233,7 +1233,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth nsCOMPtr handlerSvc = do_GetService(NS_HANDLERSERVICE_CONTRACTID, &rv); if (NS_SUCCEEDED(rv) && handlerSvc) { -@@ -1043,17 +1043,17 @@ nsresult nsOSHelperAppService::OSProtoco +@@ -1042,17 +1042,17 @@ nsresult nsOSHelperAppService::OSProtoco } return rv; @@ -1252,7 +1252,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth NS_IMETHODIMP nsOSHelperAppService::IsCurrentAppOSDefaultForProtocol( const nsACString& aScheme, bool* _retval) { -@@ -1140,17 +1140,17 @@ already_AddRefed nsOSHel +@@ -1139,17 +1139,17 @@ already_AddRefed nsOSHel nsresult rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, minorType, mime_types_description, true); @@ -1271,7 +1271,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt), majorType, minorType, mime_types_description, false); -@@ -1252,17 +1252,17 @@ already_AddRefed nsOSHel +@@ -1251,17 +1251,17 @@ already_AddRefed nsOSHel // Now look up our extensions nsAutoString extensions, mime_types_description; @@ -1293,7 +1293,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build --- a/widget/gtk/moz.build +++ b/widget/gtk/moz.build -@@ -129,16 +129,17 @@ include('/ipc/chromium/chromium-config.m +@@ -131,16 +131,17 @@ include('/ipc/chromium/chromium-config.m FINAL_LIBRARY = 'xul' @@ -1331,13 +1331,13 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp #include "nsGtkUtils.h" #include "nsIFileURL.h" #include "nsIGIOService.h" -@@ -20,16 +21,18 @@ - #include "nsArrayEnumerator.h" +@@ -22,16 +23,18 @@ #include "nsMemory.h" #include "nsEnumeratorUtils.h" #include "nsNetUtil.h" #include "nsReadableUtils.h" - #include "mozcontainer.h" + #include "MozContainer.h" + #include "gfxPlatformGtk.h" #include "nsFilePicker.h" +#include "nsKDEUtils.h" @@ -1350,7 +1350,7 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp #define MAX_PREVIEW_SOURCE_SIZE 4096 nsIFile* nsFilePicker::mPrevDisplayDirectory = nullptr; -@@ -223,17 +226,19 @@ nsFilePicker::AppendFilters(int32_t aFil +@@ -231,17 +234,19 @@ nsFilePicker::AppendFilters(int32_t aFil mAllowURLs = !!(aFilterMask & filterAllowURLs); return nsBaseFilePicker::AppendFilters(aFilterMask); } @@ -1371,7 +1371,7 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp mFilters.AppendElement(filter); mFilterNames.AppendElement(name); -@@ -333,16 +338,39 @@ nsresult nsFilePicker::Show(int16_t* aRe +@@ -341,16 +346,39 @@ nsresult nsFilePicker::Show(int16_t* aRe return NS_OK; } @@ -1411,7 +1411,7 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp GtkFileChooserAction action = GetGtkFileChooserAction(mMode); const gchar* accept_button; -@@ -562,16 +590,244 @@ void nsFilePicker::Done(void* file_choos +@@ -570,16 +598,244 @@ void nsFilePicker::Done(void* file_choos mCallback->Done(result); mCallback = nullptr; } else { @@ -1685,7 +1685,7 @@ diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp --- a/xpcom/components/ManifestParser.cpp +++ b/xpcom/components/ManifestParser.cpp -@@ -33,16 +33,17 @@ +@@ -34,16 +34,17 @@ #include "nsTextFormatter.h" #include "nsVersionComparator.h" #include "nsXPCOMCIDInternal.h" @@ -1703,7 +1703,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars int argc; bool ischrome; -@@ -393,16 +394,17 @@ void ParseManifest(NSLocationType aType, +@@ -394,16 +395,17 @@ void ParseManifest(NSLocationType aType, NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled"); NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired"); NS_NAMED_LITERAL_STRING(kApplication, "application"); @@ -1721,7 +1721,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars NS_NAMED_LITERAL_STRING(kMain, "main"); NS_NAMED_LITERAL_STRING(kContent, "content"); -@@ -448,39 +450,44 @@ void ParseManifest(NSLocationType aType, +@@ -449,39 +451,44 @@ void ParseManifest(NSLocationType aType, CopyUTF8toUTF16(s, abi); abi.Insert(char16_t('_'), 0); abi.Insert(osTarget, 0); @@ -1742,8 +1742,8 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars + desktop = NS_LITERAL_STRING("win"); # pragma warning(pop) #elif defined(MOZ_WIDGET_COCOA) - SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor(); - SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor(); + SInt32 majorVersion = nsCocoaFeatures::macOSVersionMajor(); + SInt32 minorVersion = nsCocoaFeatures::macOSVersionMinor(); nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", majorVersion, minorVersion); + desktop = NS_LITERAL_STRING("macosx"); #elif defined(MOZ_WIDGET_GTK) @@ -1766,7 +1766,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars process = kMain; } -@@ -567,25 +574,27 @@ void ParseManifest(NSLocationType aType, +@@ -568,25 +575,27 @@ void ParseManifest(NSLocationType aType, TriState stOsVersion = eUnspecified; TriState stOs = eUnspecified; TriState stABI = eUnspecified; @@ -1794,7 +1794,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars continue; } -@@ -622,17 +631,17 @@ void ParseManifest(NSLocationType aType, +@@ -623,17 +632,17 @@ void ParseManifest(NSLocationType aType, } LogMessageWithContext( @@ -1833,7 +1833,7 @@ diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build if CONFIG['MOZ_ENABLE_DBUS']: CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS'] - if CONFIG['MOZ_LAYOUT_DEBUGGER']: + include('/ipc/chromium/chromium-config.mozbuild') diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -1855,7 +1855,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp # include "prmem.h" # include "plbase64.h" -@@ -1907,62 +1908,77 @@ nsLocalFile::SetPersistentDescriptor(con +@@ -1898,62 +1899,77 @@ nsLocalFile::SetPersistentDescriptor(con NS_IMETHODIMP nsLocalFile::Reveal() { diff --git a/mozilla-pipewire-0-3.patch b/mozilla-pipewire-0-3.patch new file mode 100644 index 00000000..4b9eb848 --- /dev/null +++ b/mozilla-pipewire-0-3.patch @@ -0,0 +1,846 @@ +diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild +index 2081d0c683a4..641133bf1ea4 100644 +--- a/config/system-headers.mozbuild ++++ b/config/system-headers.mozbuild +@@ -314,6 +314,7 @@ system_headers = [ + 'Gestalt.h', + 'getopt.h', + 'gio/gio.h', ++ 'gio/gunixfdlist.h', + 'glibconfig.h', + 'glib.h', + 'glib-object.h', +@@ -607,6 +608,7 @@ system_headers = [ + 'Pgenerr.h', + 'PGenErr.h', + 'Ph.h', ++ 'pipewire/pipewire.h', + 'pixman.h', + 'pk11func.h', + 'pk11pqg.h', +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn b/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn +index ba885217b3ba..201d3b755221 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn +@@ -158,7 +158,7 @@ if (rtc_include_tests) { + if (is_linux) { + if (rtc_use_pipewire) { + pkg_config("pipewire") { +- packages = [ "libpipewire-0.2" ] ++ packages = [ "libpipewire-0.3" ] + + defines = [ "WEBRTC_USE_PIPEWIRE" ] + } +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +index 90b40431c7e4..d844aa79d591 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +@@ -194,6 +194,30 @@ if CONFIG["OS_TARGET"] == "Linux": + "/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc" + ] + ++# PipeWire specific files ++if CONFIG["OS_TARGET"] == "Linux": ++ ++ DEFINES["WEBRTC_USE_PIPEWIRE"] = "1" ++ ++ OS_LIBS += [ ++ "rt", ++ "pipewire-0.3", ++ "glib-2.0", ++ "gio-2.0", ++ "gobject-2.0" ++ ] ++ ++ CXXFLAGS += CONFIG['TK_CFLAGS'] ++ CXXFLAGS += [ "-I/usr/include/pipewire-0.3" ] ++ CXXFLAGS += [ "-I/usr/include/spa-0.2" ] ++ ++ UNIFIED_SOURCES += [ ++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", ++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc" ++ ] ++ ++ + if CONFIG["OS_TARGET"] == "NetBSD": + + DEFINES["USE_X11"] = "1" +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h +index 1eb8ead26efa..316468eed1fc 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h +@@ -141,7 +141,7 @@ class DesktopCaptureOptions { + bool disable_effects_ = true; + bool detect_updated_region_ = false; + #if defined(WEBRTC_USE_PIPEWIRE) +- bool allow_pipewire_ = false; ++ bool allow_pipewire_ = true; + #endif + }; + +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +index 379341c833de..76349f1fbd4d 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +@@ -15,8 +15,11 @@ + + #include + #include +-#include +-#include ++ ++#include ++#include ++#include ++#include + + #include + #include +@@ -36,31 +39,36 @@ const char kSessionInterfaceName[] = "org.freedesktop.portal.Session"; + const char kRequestInterfaceName[] = "org.freedesktop.portal.Request"; + const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast"; + +-// static +-void BaseCapturerPipeWire::OnStateChanged(void* data, +- pw_remote_state old_state, +- pw_remote_state state, +- const char* error_message) { +- BaseCapturerPipeWire* that = static_cast(data); +- RTC_DCHECK(that); + +- switch (state) { +- case PW_REMOTE_STATE_ERROR: +- RTC_LOG(LS_ERROR) << "PipeWire remote state error: " << error_message; +- break; +- case PW_REMOTE_STATE_CONNECTED: +- RTC_LOG(LS_INFO) << "PipeWire remote state: connected."; +- that->CreateReceivingStream(); +- break; +- case PW_REMOTE_STATE_CONNECTING: +- RTC_LOG(LS_INFO) << "PipeWire remote state: connecting."; ++// static ++void BaseCapturerPipeWire::SyncDmaBuf(int fd, uint64_t start_or_end) { ++ struct dma_buf_sync sync = { 0 }; ++ ++ sync.flags = start_or_end | DMA_BUF_SYNC_READ; ++ ++ while(true) { ++ int ret; ++ ret = ioctl (fd, DMA_BUF_IOCTL_SYNC, &sync); ++ if (ret == -1 && errno == EINTR) { ++ continue; ++ } else if (ret == -1) { ++ RTC_LOG(LS_ERROR) << "Failed to synchronize DMA buffer: " << g_strerror(errno); + break; +- case PW_REMOTE_STATE_UNCONNECTED: +- RTC_LOG(LS_INFO) << "PipeWire remote state: unconnected."; ++ } else { + break; ++ } + } + } + ++// static ++void BaseCapturerPipeWire::OnCoreError(void *data, ++ uint32_t id, ++ int seq, ++ int res, ++ const char *message) { ++ RTC_LOG(LS_ERROR) << "core error: " << message; ++} ++ + // static + void BaseCapturerPipeWire::OnStreamStateChanged(void* data, + pw_stream_state old_state, +@@ -73,76 +81,54 @@ void BaseCapturerPipeWire::OnStreamStateChanged(void* data, + case PW_STREAM_STATE_ERROR: + RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message; + break; +- case PW_STREAM_STATE_CONFIGURE: +- pw_stream_set_active(that->pw_stream_, true); +- break; +- case PW_STREAM_STATE_UNCONNECTED: +- case PW_STREAM_STATE_CONNECTING: +- case PW_STREAM_STATE_READY: + case PW_STREAM_STATE_PAUSED: + case PW_STREAM_STATE_STREAMING: ++ case PW_STREAM_STATE_UNCONNECTED: ++ case PW_STREAM_STATE_CONNECTING: + break; + } + } + + // static +-void BaseCapturerPipeWire::OnStreamFormatChanged(void* data, +- const struct spa_pod* format) { ++void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id, ++ const struct spa_pod *format) { + BaseCapturerPipeWire* that = static_cast(data); + RTC_DCHECK(that); + +- RTC_LOG(LS_INFO) << "PipeWire stream format changed."; ++ RTC_LOG(LS_INFO) << "PipeWire stream param changed."; + +- if (!format) { +- pw_stream_finish_format(that->pw_stream_, /*res=*/0, /*params=*/nullptr, +- /*n_params=*/0); ++ if (!format || id != SPA_PARAM_Format) { + return; + } + +- that->spa_video_format_ = new spa_video_info_raw(); +- spa_format_video_raw_parse(format, that->spa_video_format_, +- &that->pw_type_->format_video); ++ spa_format_video_raw_parse(format, &that->spa_video_format_); + +- auto width = that->spa_video_format_->size.width; +- auto height = that->spa_video_format_->size.height; ++ auto width = that->spa_video_format_.size.width; ++ auto height = that->spa_video_format_.size.height; + auto stride = SPA_ROUND_UP_N(width * kBytesPerPixel, 4); + auto size = height * stride; + ++ that->desktop_size_ = DesktopSize(width, height); ++ + uint8_t buffer[1024] = {}; + auto builder = spa_pod_builder{buffer, sizeof(buffer)}; + + // Setup buffers and meta header for new format. +- const struct spa_pod* params[2]; +- params[0] = reinterpret_cast(spa_pod_builder_object( +- &builder, +- // id to enumerate buffer requirements +- that->pw_core_type_->param.idBuffers, +- that->pw_core_type_->param_buffers.Buffers, +- // Size: specified as integer (i) and set to specified size +- ":", that->pw_core_type_->param_buffers.size, "i", size, +- // Stride: specified as integer (i) and set to specified stride +- ":", that->pw_core_type_->param_buffers.stride, "i", stride, +- // Buffers: specifies how many buffers we want to deal with, set as +- // integer (i) where preferred number is 8, then allowed number is defined +- // as range (r) from min and max values and it is undecided (u) to allow +- // negotiation +- ":", that->pw_core_type_->param_buffers.buffers, "iru", 8, +- SPA_POD_PROP_MIN_MAX(1, 32), +- // Align: memory alignment of the buffer, set as integer (i) to specified +- // value +- ":", that->pw_core_type_->param_buffers.align, "i", 16)); +- params[1] = reinterpret_cast(spa_pod_builder_object( +- &builder, +- // id to enumerate supported metadata +- that->pw_core_type_->param.idMeta, that->pw_core_type_->param_meta.Meta, +- // Type: specified as id or enum (I) +- ":", that->pw_core_type_->param_meta.type, "I", +- that->pw_core_type_->meta.Header, +- // Size: size of the metadata, specified as integer (i) +- ":", that->pw_core_type_->param_meta.size, "i", +- sizeof(struct spa_meta_header))); +- +- pw_stream_finish_format(that->pw_stream_, /*res=*/0, params, /*n_params=*/2); ++ const struct spa_pod* params[3]; ++ params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, ++ SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, ++ SPA_PARAM_BUFFERS_size, SPA_POD_Int(size), ++ SPA_PARAM_BUFFERS_stride, SPA_POD_Int(stride), ++ SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(8, 1, 32))); ++ params[1] = reinterpret_cast(spa_pod_builder_add_object(&builder, ++ SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, ++ SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), ++ SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)))); ++ params[2] = reinterpret_cast(spa_pod_builder_add_object(&builder, ++ SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, ++ SPA_PARAM_META_type, SPA_POD_Id (SPA_META_VideoCrop), ++ SPA_PARAM_META_size, SPA_POD_Int (sizeof(struct spa_meta_region)))); ++ pw_stream_update_params(that->pw_stream_, params, 3); + } + + // static +@@ -150,15 +136,25 @@ void BaseCapturerPipeWire::OnStreamProcess(void* data) { + BaseCapturerPipeWire* that = static_cast(data); + RTC_DCHECK(that); + +- pw_buffer* buf = nullptr; ++ struct pw_buffer *next_buffer; ++ struct pw_buffer *buffer = nullptr; ++ ++ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); ++ while (next_buffer) { ++ buffer = next_buffer; ++ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); + +- if (!(buf = pw_stream_dequeue_buffer(that->pw_stream_))) { ++ if (next_buffer) ++ pw_stream_queue_buffer (that->pw_stream_, buffer); ++ } ++ ++ if (!buffer) { + return; + } + +- that->HandleBuffer(buf); ++ that->HandleBuffer(buffer); + +- pw_stream_queue_buffer(that->pw_stream_, buf); ++ pw_stream_queue_buffer(that->pw_stream_, buffer); + } + + BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type) +@@ -169,38 +165,22 @@ BaseCapturerPipeWire::~BaseCapturerPipeWire() { + pw_thread_loop_stop(pw_main_loop_); + } + +- if (pw_type_) { +- delete pw_type_; +- } +- +- if (spa_video_format_) { +- delete spa_video_format_; +- } +- + if (pw_stream_) { + pw_stream_destroy(pw_stream_); + } + +- if (pw_remote_) { +- pw_remote_destroy(pw_remote_); ++ if (pw_core_) { ++ pw_core_disconnect(pw_core_); + } + +- if (pw_core_) { +- pw_core_destroy(pw_core_); ++ if (pw_context_) { ++ pw_context_destroy(pw_context_); + } + + if (pw_main_loop_) { + pw_thread_loop_destroy(pw_main_loop_); + } + +- if (pw_loop_) { +- pw_loop_destroy(pw_loop_); +- } +- +- if (current_frame_) { +- free(current_frame_); +- } +- + if (start_request_signal_id_) { + g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); + } +@@ -250,27 +230,35 @@ void BaseCapturerPipeWire::InitPortal() { + void BaseCapturerPipeWire::InitPipeWire() { + pw_init(/*argc=*/nullptr, /*argc=*/nullptr); + +- pw_loop_ = pw_loop_new(/*properties=*/nullptr); +- pw_main_loop_ = pw_thread_loop_new(pw_loop_, "pipewire-main-loop"); +- +- pw_core_ = pw_core_new(pw_loop_, /*properties=*/nullptr); +- pw_core_type_ = pw_core_get_type(pw_core_); +- pw_remote_ = pw_remote_new(pw_core_, nullptr, /*user_data_size=*/0); ++ pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); ++ pw_context_ = pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0); ++ if (!pw_context_) { ++ RTC_LOG(LS_ERROR) << "Failed to create PipeWire context"; ++ return; ++ } + +- InitPipeWireTypes(); ++ pw_core_ = pw_context_connect(pw_context_, nullptr, 0); ++ if (!pw_core_) { ++ RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context"; ++ return; ++ } + + // Initialize event handlers, remote end and stream-related. +- pw_remote_events_.version = PW_VERSION_REMOTE_EVENTS; +- pw_remote_events_.state_changed = &OnStateChanged; ++ pw_core_events_.version = PW_VERSION_CORE_EVENTS; ++ pw_core_events_.error = &OnCoreError; + + pw_stream_events_.version = PW_VERSION_STREAM_EVENTS; + pw_stream_events_.state_changed = &OnStreamStateChanged; +- pw_stream_events_.format_changed = &OnStreamFormatChanged; ++ pw_stream_events_.param_changed = &OnStreamParamChanged; + pw_stream_events_.process = &OnStreamProcess; + +- pw_remote_add_listener(pw_remote_, &spa_remote_listener_, &pw_remote_events_, +- this); +- pw_remote_connect_fd(pw_remote_, pw_fd_); ++ pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this); ++ ++ pw_stream_ = CreateReceivingStream(); ++ if (!pw_stream_) { ++ RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream"; ++ return; ++ } + + if (pw_thread_loop_start(pw_main_loop_) < 0) { + RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; +@@ -278,81 +266,132 @@ void BaseCapturerPipeWire::InitPipeWire() { + } + } + +-void BaseCapturerPipeWire::InitPipeWireTypes() { +- spa_type_map* map = pw_core_type_->map; +- pw_type_ = new PipeWireType(); +- +- spa_type_media_type_map(map, &pw_type_->media_type); +- spa_type_media_subtype_map(map, &pw_type_->media_subtype); +- spa_type_format_video_map(map, &pw_type_->format_video); +- spa_type_video_format_map(map, &pw_type_->video_format); +-} +- +-void BaseCapturerPipeWire::CreateReceivingStream() { ++pw_stream* BaseCapturerPipeWire::CreateReceivingStream() { + spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1}; +- spa_rectangle pwScreenBounds = +- spa_rectangle{static_cast(desktop_size_.width()), +- static_cast(desktop_size_.height())}; ++ spa_rectangle pwMaxScreenBounds = spa_rectangle{INT32_MAX, INT32_MAX}; + +- spa_fraction pwFrameRateMin = spa_fraction{0, 1}; +- spa_fraction pwFrameRateMax = spa_fraction{60, 1}; ++ auto stream = pw_stream_new(pw_core_, "webrtc-pipewire-stream", nullptr); + +- pw_properties* reuseProps = pw_properties_new("pipewire.client.reuse", "1", +- /*end of varargs*/ nullptr); +- pw_stream_ = pw_stream_new(pw_remote_, "webrtc-consume-stream", reuseProps); ++ if (!stream) { ++ RTC_LOG(LS_ERROR) << "Could not create receiving stream."; ++ return nullptr; ++ } + + uint8_t buffer[1024] = {}; +- const spa_pod* params[1]; +- spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; +- params[0] = reinterpret_cast(spa_pod_builder_object( +- &builder, +- // id to enumerate formats +- pw_core_type_->param.idEnumFormat, pw_core_type_->spa_format, "I", +- pw_type_->media_type.video, "I", pw_type_->media_subtype.raw, +- // Video format: specified as id or enum (I), preferred format is BGRx, +- // then allowed formats are enumerated (e) and the format is undecided (u) +- // to allow negotiation +- ":", pw_type_->format_video.format, "Ieu", pw_type_->video_format.BGRx, +- SPA_POD_PROP_ENUM(2, pw_type_->video_format.RGBx, +- pw_type_->video_format.BGRx), +- // Video size: specified as rectangle (R), preferred size is specified as +- // first parameter, then allowed size is defined as range (r) from min and +- // max values and the format is undecided (u) to allow negotiation +- ":", pw_type_->format_video.size, "Rru", &pwScreenBounds, 2, +- &pwMinScreenBounds, &pwScreenBounds, +- // Frame rate: specified as fraction (F) and set to minimum frame rate +- // value +- ":", pw_type_->format_video.framerate, "F", &pwFrameRateMin, +- // Max frame rate: specified as fraction (F), preferred frame rate is set +- // to maximum value, then allowed frame rate is defined as range (r) from +- // min and max values and it is undecided (u) to allow negotiation +- ":", pw_type_->format_video.max_framerate, "Fru", &pwFrameRateMax, 2, +- &pwFrameRateMin, &pwFrameRateMax)); +- +- pw_stream_add_listener(pw_stream_, &spa_stream_listener_, &pw_stream_events_, +- this); ++ const spa_pod* params[2]; ++ spa_pod_builder builder = SPA_POD_BUILDER_INIT(buffer, sizeof (buffer)); ++ ++ params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, ++ SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, ++ SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video), ++ SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), ++ SPA_FORMAT_VIDEO_format, SPA_POD_CHOICE_ENUM_Id(5, SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx, SPA_VIDEO_FORMAT_RGBA, ++ SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_BGRA), ++ SPA_FORMAT_VIDEO_size, SPA_POD_CHOICE_RANGE_Rectangle(&pwMinScreenBounds, ++ &pwMinScreenBounds, ++ &pwMaxScreenBounds), ++ 0)); ++ pw_stream_add_listener(stream, &spa_stream_listener_, &pw_stream_events_, this); ++ + pw_stream_flags flags = static_cast( +- PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE | +- PW_STREAM_FLAG_MAP_BUFFERS); +- if (pw_stream_connect(pw_stream_, PW_DIRECTION_INPUT, /*port_path=*/nullptr, +- flags, params, +- /*n_params=*/1) != 0) { ++ PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE); ++ ++ if (pw_stream_connect(stream, PW_DIRECTION_INPUT, pw_stream_node_id_, PW_STREAM_FLAG_AUTOCONNECT, params, 1) != 0) { + RTC_LOG(LS_ERROR) << "Could not connect receiving stream."; + portal_init_failed_ = true; +- return; + } ++ ++ return stream; + } + + void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { ++ struct spa_meta_region* video_crop; + spa_buffer* spaBuffer = buffer->buffer; +- void* src = nullptr; ++ uint8_t *map = nullptr; ++ uint8_t* src = nullptr; ++ uint8_t* dst = nullptr; ++ ++ if (spaBuffer->datas[0].chunk->size == 0) { ++ map = nullptr; ++ src = nullptr; ++ } else if (spaBuffer->datas[0].type == SPA_DATA_MemFd) { ++ map = static_cast(mmap( ++ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, ++ PROT_READ, MAP_PRIVATE, spaBuffer->datas[0].fd, 0)); ++ ++ if (map == MAP_FAILED) { ++ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno); ++ return; ++ } ++ ++ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t); ++ } else if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) { ++ int fd; ++ fd = spaBuffer->datas[0].fd; + +- if (!(src = spaBuffer->datas[0].data)) { ++ map = static_cast(mmap( ++ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, ++ PROT_READ, MAP_PRIVATE, fd, 0)); ++ ++ if (map == MAP_FAILED) { ++ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno); ++ return; ++ } ++ ++ SyncDmaBuf(fd, DMA_BUF_SYNC_START); ++ ++ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t); ++ } else if (spaBuffer->datas[0].type == SPA_DATA_MemPtr) { ++ map = nullptr; ++ src = static_cast(spaBuffer->datas[0].data); ++ } else { + return; + } + +- uint32_t maxSize = spaBuffer->datas[0].maxsize; +- int32_t srcStride = spaBuffer->datas[0].chunk->stride; ++ if (!src) { ++ return; ++ } ++ ++ DesktopSize prev_crop_size = DesktopSize(0, 0); ++ if (video_crop_size_initialized_) { ++ prev_crop_size = video_crop_size_; ++ } ++ ++ if ((video_crop = static_cast( ++ spa_buffer_find_meta_data(spaBuffer, SPA_META_VideoCrop, sizeof(*video_crop))))) { ++ RTC_DCHECK(video_crop->region.size.width <= desktop_size_.width() && ++ video_crop->region.size.height <= desktop_size_.height()); ++ if ((video_crop->region.size.width != desktop_size_.width() || ++ video_crop->region.size.height != desktop_size_.height()) && video_crop->region.size.width && video_crop->region.size.height) { ++ video_crop_size_ = DesktopSize(video_crop->region.size.width, video_crop->region.size.height); ++ video_crop_size_initialized_ = true; ++ } else { ++ video_crop_size_initialized_ = false; ++ } ++ } else { ++ video_crop_size_initialized_ = false; ++ } ++ ++ size_t frame_size; ++ if (video_crop_size_initialized_) { ++ frame_size = ++ video_crop_size_.width() * video_crop_size_.height() * kBytesPerPixel; ++ } else { ++ frame_size = ++ desktop_size_.width() * desktop_size_.height() * kBytesPerPixel; ++ } ++ ++ if (!current_frame_ || ++ (video_crop_size_initialized_ && !video_crop_size_.equals(prev_crop_size))) { ++ current_frame_ = std::make_unique(frame_size); ++ } ++ RTC_DCHECK(current_frame_ != nullptr); ++ ++ const int32_t dstStride = video_crop_size_initialized_ ++ ? video_crop_size_.width() * kBytesPerPixel ++ : desktop_size_.width() * kBytesPerPixel; ++ const int32_t srcStride = spaBuffer->datas[0].chunk->stride; ++ + if (srcStride != (desktop_size_.width() * kBytesPerPixel)) { + RTC_LOG(LS_ERROR) << "Got buffer with stride different from screen stride: " + << srcStride +@@ -361,21 +400,40 @@ void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { + return; + } + +- if (!current_frame_) { +- current_frame_ = static_cast(malloc(maxSize)); ++ dst = current_frame_.get(); ++ ++ // Adjust source content based on crop video position ++ if (video_crop_size_initialized_ && ++ (video_crop->region.position.y + video_crop_size_.height() <= desktop_size_.height())) { ++ for (int i = 0; i < video_crop->region.position.y; ++i) { ++ src += srcStride; ++ } ++ } ++ const int xOffset = ++ video_crop_size_initialized_ && (video_crop->region.position.x + video_crop_size_.width() <= ++ desktop_size_.width()) ++ ? video_crop->region.position.x * kBytesPerPixel ++ : 0; ++ const int height = video_crop_size_initialized_ ? video_crop_size_.height() : desktop_size_.height(); ++ for (int i = 0; i < height; ++i) { ++ // Adjust source content based on crop video position if needed ++ src += xOffset; ++ std::memcpy(dst, src, dstStride); ++ // If both sides decided to go with the RGBx format we need to convert it to ++ // BGRx to match color format expected by WebRTC. ++ if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || ++ spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { ++ ConvertRGBxToBGRx(dst, dstStride); ++ } ++ src += srcStride - xOffset; ++ dst += dstStride; + } +- RTC_DCHECK(current_frame_ != nullptr); + +- // If both sides decided to go with the RGBx format we need to convert it to +- // BGRx to match color format expected by WebRTC. +- if (spa_video_format_->format == pw_type_->video_format.RGBx) { +- uint8_t* tempFrame = static_cast(malloc(maxSize)); +- std::memcpy(tempFrame, src, maxSize); +- ConvertRGBxToBGRx(tempFrame, maxSize); +- std::memcpy(current_frame_, tempFrame, maxSize); +- free(tempFrame); +- } else { +- std::memcpy(current_frame_, src, maxSize); ++ if (map) { ++ if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) { ++ SyncDmaBuf(spaBuffer->datas[0].fd, DMA_BUF_SYNC_END); ++ } ++ munmap(map, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset); + } + } + +@@ -725,10 +783,7 @@ void BaseCapturerPipeWire::OnStartRequestResponseSignal( + g_variant_get(variant, "(u@a{sv})", &stream_id, &options); + RTC_DCHECK(options != nullptr); + +- g_variant_lookup(options, "size", "(ii)", &width, &height); +- +- that->desktop_size_.set(width, height); +- ++ that->pw_stream_node_id_ = stream_id; + g_variant_unref(options); + g_variant_unref(variant); + } +@@ -813,10 +868,15 @@ void BaseCapturerPipeWire::CaptureFrame() { + return; + } + +- std::unique_ptr result(new BasicDesktopFrame(desktop_size_)); ++ DesktopSize frame_size = desktop_size_; ++ if (video_crop_size_initialized_) { ++ frame_size = video_crop_size_; ++ } ++ ++ std::unique_ptr result(new BasicDesktopFrame(frame_size)); + result->CopyPixelsFrom( +- current_frame_, (desktop_size_.width() * kBytesPerPixel), +- DesktopRect::MakeWH(desktop_size_.width(), desktop_size_.height())); ++ current_frame_.get(), (frame_size.width() * kBytesPerPixel), ++ DesktopRect::MakeWH(frame_size.width(), frame_size.height())); + if (!result) { + callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); + return; +@@ -837,4 +897,22 @@ bool BaseCapturerPipeWire::SelectSource(SourceId id) { + return true; + } + ++// static ++std::unique_ptr ++BaseCapturerPipeWire::CreateRawScreenCapturer( ++ const DesktopCaptureOptions& options) { ++ std::unique_ptr capturer = ++ std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); ++ return std::move(capturer);} ++ ++// static ++std::unique_ptr ++BaseCapturerPipeWire::CreateRawWindowCapturer( ++ const DesktopCaptureOptions& options) { ++ ++ std::unique_ptr capturer = ++ std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); ++ return std::move(capturer); ++} ++ + } // namespace webrtc +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +index 56b101acbaa6..de54157d1a2a 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +@@ -22,17 +22,13 @@ + + namespace webrtc { + +-class PipeWireType { +- public: +- spa_type_media_type media_type; +- spa_type_media_subtype media_subtype; +- spa_type_format_video format_video; +- spa_type_video_format video_format; +-}; +- + class BaseCapturerPipeWire : public DesktopCapturer { + public: +- enum CaptureSourceType { Screen = 1, Window }; ++ enum CaptureSourceType : uint32_t { ++ kScreen = 0b01, ++ kWindow = 0b10, ++ kAny = 0b11 ++ }; + + explicit BaseCapturerPipeWire(CaptureSourceType source_type); + ~BaseCapturerPipeWire() override; +@@ -43,28 +39,32 @@ class BaseCapturerPipeWire : public DesktopCapturer { + bool GetSourceList(SourceList* sources) override; + bool SelectSource(SourceId id) override; + ++ static std::unique_ptr CreateRawScreenCapturer( ++ const DesktopCaptureOptions& options); ++ ++ static std::unique_ptr CreateRawWindowCapturer( ++ const DesktopCaptureOptions& options); ++ + private: + // PipeWire types --> ++ pw_context* pw_context_ = nullptr; + pw_core* pw_core_ = nullptr; +- pw_type* pw_core_type_ = nullptr; + pw_stream* pw_stream_ = nullptr; +- pw_remote* pw_remote_ = nullptr; +- pw_loop* pw_loop_ = nullptr; + pw_thread_loop* pw_main_loop_ = nullptr; +- PipeWireType* pw_type_ = nullptr; + ++ spa_hook spa_core_listener_ = {}; + spa_hook spa_stream_listener_ = {}; +- spa_hook spa_remote_listener_ = {}; + ++ pw_core_events pw_core_events_ = {}; + pw_stream_events pw_stream_events_ = {}; +- pw_remote_events pw_remote_events_ = {}; + +- spa_video_info_raw* spa_video_format_ = nullptr; ++ struct spa_video_info_raw spa_video_format_; + ++ guint32 pw_stream_node_id_ = 0; + gint32 pw_fd_ = -1; + + CaptureSourceType capture_source_type_ = +- BaseCapturerPipeWire::CaptureSourceType::Screen; ++ BaseCapturerPipeWire::CaptureSourceType::kAny; + + // <-- end of PipeWire types + +@@ -78,33 +78,37 @@ class BaseCapturerPipeWire : public DesktopCapturer { + guint sources_request_signal_id_ = 0; + guint start_request_signal_id_ = 0; + ++ bool video_crop_size_initialized_ = false; ++ DesktopSize video_crop_size_;; + DesktopSize desktop_size_ = {}; + DesktopCaptureOptions options_ = {}; + +- uint8_t* current_frame_ = nullptr; ++ std::unique_ptr current_frame_; + Callback* callback_ = nullptr; + + bool portal_init_failed_ = false; + + void InitPortal(); + void InitPipeWire(); +- void InitPipeWireTypes(); + +- void CreateReceivingStream(); ++ pw_stream* CreateReceivingStream(); + void HandleBuffer(pw_buffer* buffer); + + void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); + +- static void OnStateChanged(void* data, +- pw_remote_state old_state, +- pw_remote_state state, +- const char* error); ++ static void SyncDmaBuf(int fd, uint64_t start_or_end); ++ static void OnCoreError(void *data, ++ uint32_t id, ++ int seq, ++ int res, ++ const char *message); ++ static void OnStreamParamChanged(void *data, ++ uint32_t id, ++ const struct spa_pod *format); + static void OnStreamStateChanged(void* data, + pw_stream_state old_state, + pw_stream_state state, + const char* error_message); +- +- static void OnStreamFormatChanged(void* data, const struct spa_pod* format); + static void OnStreamProcess(void* data); + static void OnNewBuffer(void* data, uint32_t id); + +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc +index 26956fc67dc8..3813d697bb38 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc +@@ -15,7 +15,7 @@ + namespace webrtc { + + ScreenCapturerPipeWire::ScreenCapturerPipeWire() +- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Screen) {} ++ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kScreen) {} + ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {} + + // static +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc +index 35436475cb4d..c43a1f1a0c4e 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc +@@ -15,7 +15,7 @@ + namespace webrtc { + + WindowCapturerPipeWire::WindowCapturerPipeWire() +- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Window) {} ++ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kWindow) {} + WindowCapturerPipeWire::~WindowCapturerPipeWire() {} + + // static +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc +index cf8a9dd0e0db..d27fab8d28d9 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc +@@ -26,7 +26,7 @@ std::unique_ptr DesktopCapturer::CreateRawScreenCapturer( + const DesktopCaptureOptions& options) { + #if defined(WEBRTC_USE_PIPEWIRE) + if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { +- return ScreenCapturerPipeWire::CreateRawScreenCapturer(options); ++ return BaseCapturerPipeWire::CreateRawScreenCapturer(options); + } + #endif // defined(WEBRTC_USE_PIPEWIRE) + +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc +index 82359e50c2db..bb9724cf7cc2 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc +@@ -26,7 +26,7 @@ std::unique_ptr DesktopCapturer::CreateRawWindowCapturer( + const DesktopCaptureOptions& options) { + #if defined(WEBRTC_USE_PIPEWIRE) + if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { +- return WindowCapturerPipeWire::CreateRawWindowCapturer(options); ++ return BaseCapturerPipeWire::CreateRawWindowCapturer(options); + } + #endif // defined(WEBRTC_USE_PIPEWIRE) + diff --git a/mozilla-s390-bigendian.patch b/mozilla-s390-bigendian.patch deleted file mode 100644 index acfeaf10..00000000 --- a/mozilla-s390-bigendian.patch +++ /dev/null @@ -1,30 +0,0 @@ -# HG changeset patch -# User msirringhaus@suse.de -# Date 1558452126 -7200 -# Tue May 21 17:22:06 2019 +0200 -# Node ID a3cc550d25e3a04d906f516928cbcbe50efd585e -# Parent ae49126f2a63ba1de250ad02ffe39379295660f3 -[mq]: mozilla-s390-bigendian.patch - -diff --git a/build/autoconf/icu.m4 b/build/autoconf/icu.m4 ---- a/build/autoconf/icu.m4 -+++ b/build/autoconf/icu.m4 -@@ -63,17 +63,17 @@ if test -n "$USE_ICU"; then - if test x"$version" = x; then - AC_MSG_ERROR([cannot determine icu version number from uvernum.h header file $lineno]) - fi - MOZ_ICU_VERSION="$version" - - # TODO: the l is actually endian-dependent - # We could make this set as 'l' or 'b' for little or big, respectively, - # but we'd need to check in a big-endian version of the file. -- ICU_DATA_FILE="icudt${version}l.dat" -+ ICU_DATA_FILE="icudt${version}b.dat" - fi - - AC_SUBST(MOZ_ICU_VERSION) - AC_SUBST(JS_HAS_INTL_API) - AC_SUBST(USE_ICU) - AC_SUBST(ICU_DATA_FILE) - - if test -n "$USE_ICU"; then diff --git a/mozilla-s390x-skia-gradient.patch b/mozilla-s390x-skia-gradient.patch new file mode 100644 index 00000000..4b48f1e3 --- /dev/null +++ b/mozilla-s390x-skia-gradient.patch @@ -0,0 +1,51 @@ +# HG changeset patch +# Parent acf59ea86dd1d878b43920832093f082dcfc61c0 + +diff -r acf59ea86dd1 gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp +--- a/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp Mon Mar 09 08:26:10 2020 +0100 ++++ b/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp Fri Mar 27 13:30:28 2020 +0100 +@@ -7,7 +7,7 @@ + + #include "include/core/SkPaint.h" + #include "src/shaders/gradients/Sk4fLinearGradient.h" +- ++#include "src/core/SkEndian.h" + #include + #include + +@@ -28,6 +28,9 @@ + + while (n >= 4) { + DstTraits::store4x(c0, c1, c2, c3, dst, bias0, bias1); ++#ifdef SK_CPU_BENDIAN ++ SkEndianSwap32s(dst, 4); ++#endif + dst += 4; + + c0 = c0 + dc4; +@@ -37,12 +40,23 @@ + n -= 4; + } + if (n & 2) { +- DstTraits::store(c0, dst++, bias0); +- DstTraits::store(c1, dst++, bias1); ++ DstTraits::store(c0, dst, bias0); ++#ifdef SK_CPU_BENDIAN ++ *dst = SkEndianSwap32(*dst); ++#endif ++ ++dst; ++ DstTraits::store(c1, dst, bias1); ++#ifdef SK_CPU_BENDIAN ++ *dst = SkEndianSwap32(*dst); ++#endif ++ ++dst; + c0 = c0 + dc2; + } + if (n & 1) { + DstTraits::store(c0, dst, bias0); ++#ifdef SK_CPU_BENDIAN ++ *dst = SkEndianSwap32(*dst); ++#endif + } + } + diff --git a/tar_stamps b/tar_stamps index f5c589c0..2d461ae8 100644 --- a/tar_stamps +++ b/tar_stamps @@ -1,11 +1,11 @@ PRODUCT="firefox" CHANNEL="release" -VERSION="77.0.1" +VERSION="78.0" VERSION_SUFFIX="" -PREV_VERSION="77.0" +PREV_VERSION="78.0b8" PREV_VERSION_SUFFIX="" #SKIP_LOCALES="" # Uncomment to skip l10n and compare-locales-generation RELEASE_REPO="https://hg.mozilla.org/releases/mozilla-release" -RELEASE_TAG="b8d272601020250ac2897e113b3fc3b53b72cf4b" -RELEASE_TIMESTAMP="20200602222727" +RELEASE_TAG="52486654c09a5248ae83230ee380b1dbb7ad2ef4" +RELEASE_TIMESTAMP="20200625152958"