RHEL 9.0.0 Alpha bootstrap

The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/firefox#c8daf71be4963daab37d810024e0a6e7f04cf2dd
This commit is contained in:
Petr Šabata 2020-10-15 00:23:49 +02:00
parent 1c95a8e427
commit 268ae0028c
69 changed files with 11640 additions and 0 deletions

424
.gitignore vendored
View File

@ -0,0 +1,424 @@
firefox-langpacks-3.6.4-20100622.tar.bz2
firefox-3.6.4.source.tar.bz2
/firefox-3.6.9.source.tar.bz2
/firefox-langpacks-3.6.9-20100906.tar.bz2
/firefox-3.6.11.source.tar.bz2
/firefox-langpacks-3.6.11-20101019.tar.bz2
/firefox-3.6.12.source.tar.bz2
/firefox-langpacks-3.6.12-20101027.tar.bz2
/firefox-3.6.13.source.tar.bz2
/firefox-langpacks-3.6.13-20101210.tar.bz2
/firefox-3.6.14.source.tar.bz2
/firefox-langpacks-3.6.14-20110301.tar.bz2
/firefox-3.6.15.source.tar.bz2
/firefox-langpacks-3.6.15-20110307.tar.bz2
/firefox-3.6.16.source.tar.bz2
/firefox-langpacks-3.6.16-20110322.tar.xz
/firefox-langpacks-3.6.17-20110428.tar.xz
/firefox-3.6.17.source.tar.bz2
/firefox-3.6.18.source.tar.bz2
/firefox-langpacks-3.6.18-20110621.tar.xz
/firefox-3.6.22.source.tar.bz2
/firefox-langpacks-3.6.22-20110906.tar.xz
/firefox-langpacks-3.6.20-20110816.tar.xz
/firefox-3.6.20.source.tar.bz2
/firefox-7.0.source.tar.bz2
/firefox-langpacks-7.0-20110927.tar.xz
/firefox-7.0.1.source.tar.bz2
/firefox-langpacks-7.0.1-20110930.tar.xz
/firefox-8.0.source.tar.bz2
/firefox-langpacks-8.0-20111108.tar.xz
/firefox-9.0b5.source.tar.bz2
/firefox-langpacks-9.0b5-20111215.tar.xz
/firefox-9.0.source.tar.bz2
/firefox-langpacks-9.0-20111220.tar.xz
/firefox-9.0.1.source.tar.bz2
/firefox-langpacks-9.0.1-20111223.tar.xz
/firefox-10.0.source.tar.bz2
/firefox-langpacks-10.0-20120131.tar.xz
/firefox-10.0.1.source.tar.bz2
/firefox-langpacks-10.0.1-20120209.tar.xz
/firefox-11.0.source.tar.bz2
/firefox-langpacks-11.0-20120313.tar.xz
/firefox-12.0.source.tar.bz2
/firefox-langpacks-12.0-20120424.tar.xz
/firefox-13.0.source.tar.bz2
/firefox-langpacks-13.0-20120604.tar.xz
/firefox-13.0.1.source.tar.bz2
/firefox-langpacks-13.0.1-20120616.tar.xz
/firefox-14.0.1.source.tar.bz2
/firefox-langpacks-14.0.1-20120716.tar.xz
/firefox-15.0.source.tar.bz2
/firefox-langpacks-15.0-20120827.tar.xz
/firefox-15.0.1.source.tar.bz2
/firefox-langpacks-15.0.1-20120911.tar.xz
/firefox-16.0.source.tar.bz2
/firefox-langpacks-16.0-20121008.tar.xz
/firefox-16.0.1.source.tar.bz2
/firefox-langpacks-16.0.1-20121011.tar.xz
/firefox-16.0.2.source.tar.bz2
/firefox-langpacks-16.0.2-20121026.tar.xz
/firefox-langpacks-17.0-20121119.tar.xz
/firefox-17.0.source.tar.bz2
/firefox-17.0.1.source.tar.bz2
/firefox-langpacks-17.0.1-20121129.tar.xz
/firefox-langpacks-18.0-20130109.tar.xz
/firefox-18.0.source.tar.bz2
/firefox-18.0.1.source.tar.bz2
/firefox-langpacks-18.0.1-20130125.tar.xz
/firefox-18.0.2.source.tar.bz2
/firefox-langpacks-18.0.2-20130206.tar.xz
/firefox-19.0.source.tar.bz2
/firefox-langpacks-19.0-20130219.tar.xz
/firefox-19.0.2.source.tar.bz2
/firefox-langpacks-19.0.2-20130311.tar.xz
/firefox-langpacks-20.0-20130401.tar.xz
/firefox-20.0.source.tar.bz2
/firefox-21.0.source.tar.bz2
/firefox-langpacks-21.0-20130514.tar.xz
/firefox-22.0.source.tar.bz2
/firefox-langpacks-22.0-20130621.tar.xz
/firefox-23.0.source.tar.bz2
/firefox-langpacks-23.0-20130731.tar.xz
/firefox-langpacks-23.0-20130805.tar.xz
/firefox-23.0.1.source.tar.bz2
/firefox-langpacks-23.0.1-20130819.tar.xz
/firefox-langpacks-24.0-20130913.tar.xz
/firefox-24.0.source.tar.bz2
/firefox-25.0.source.tar.bz2
/firefox-langpacks-25.0-20131024.tar.xz
/firefox-langpacks-25.0-20131030.tar.xz
/firefox-26.0.source.tar.bz2
/firefox-langpacks-26.0-20131209.tar.xz
/firefox-27.0.source.tar.bz2
/firefox-langpacks-27.0-20140203.tar.xz
/firefox-27.0.1.source.tar.bz2
/firefox-langpacks-27.0.1-20140224.tar.xz
/firefox-28.0.source.tar.bz2
/firefox-langpacks-28.0-20140318.tar.xz
/firefox-29.0.source.tar.bz2
/firefox-langpacks-29.0-20140422.tar.xz
/firefox-29.0.1.source.tar.bz2
/firefox-langpacks-29.0.1-20140514.tar.xz
/firefox-30.0.source.tar.bz2
/firefox-langpacks-30.0-20140604.tar.xz
/firefox-31.0.source.tar.bz2
/firefox-langpacks-31.0-20140717.tar.xz
/firefox-32.0.source.tar.bz2
/firefox-langpacks-32.0-20140826.tar.xz
/firefox-32.0.1.source.tar.bz2
/firefox-langpacks-32.0.1-20140915.tar.xz
/firefox-32.0.2.source.tar.bz2
/firefox-langpacks-32.0.2-20140918.tar.xz
/firefox-langpacks-33.0-20141014.tar.xz
/firefox-33.0.source.tar.bz2
/firefox-33.1.source.tar.bz2
/firefox-langpacks-33.1-20141111.tar.xz
/firefox-34.0.source.tar.bz2
/firefox-langpacks-34.0-20141201.tar.xz
/firefox-35.0.source.tar.bz2
/firefox-langpacks-35.0-20150106.tar.xz
/firefox-langpacks-35.0-20150109.tar.xz
/firefox-35.0.1.source.tar.bz2
/firefox-langpacks-35.0.1-20150123.tar.xz
/firefox-36.0.source.tar.bz2
/firefox-langpacks-36.0-20150220.tar.xz
/firefox-36.0.1.source.tar.bz2
/firefox-langpacks-36.0.1-20150309.tar.xz
/firefox-36.0.3.source.tar.bz2
/firefox-langpacks-36.0.3-20150320.tar.xz
/firefox-36.0.4.source.tar.bz2
/firefox-langpacks-36.0.4-20150321.tar.xz
/firefox-langpacks-37.0-20150327.tar.xz
/firefox-37.0.source.tar.bz2
/firefox-langpacks-37.0.1-20150407.tar.xz
/firefox-37.0.1.source.tar.bz2
/firefox-37.0.2.source.tar.bz2
/firefox-langpacks-37.0.2-20150416.tar.xz
/firefox-38.0.source.tar.bz2
/firefox-langpacks-38.0-20150505.tar.bz2
/firefox-langpacks-38.0-20150505.tar.xz
/firefox-langpacks-38.0-20150511.tar.xz
/firefox-38.0.1.source.tar.bz2
/firefox-langpacks-38.0.1-20150518.tar.xz
/firefox-38.0.5.source.tar.bz2
/firefox-langpacks-38.0.5-20150603.tar.xz
/firefox-39.0.source.tar.bz2
/firefox-langpacks-39.0-20150623.tar.xz
/firefox-langpacks-39.0-20150625.tar.xz
/firefox-langpacks-39.0-20150630.tar.xz
/firefox-langpacks-39.0-20150702.tar.xz
/firefox-39.0.3.source.tar.bz2
/firefox-langpacks-39.0.3-20150806.tar.xz
/firefox-40.0.source.tar.bz2
/firefox-langpacks-40.0-20150807.tar.xz
/firefox-langpacks-40.0-20150811.tar.xz
/firefox-40.0.3.source.tar.bz2
/firefox-langpacks-40.0.3-20150827.tar.xz
/firefox-41.0.source.tar.xz
/firefox-langpacks-41.0-20150915.tar.xz
/firefox-langpacks-41.0-20150917.tar.xz
/firefox-langpacks-41.0-20150918.tar.xz
/firefox-langpacks-41.0.1-20150929.tar.xz
/firefox-41.0.1.source.tar.xz
/firefox-langpacks-41.0.1-20150930.tar.xz
/firefox-41.0.2.source.tar.xz
/firefox-langpacks-41.0.2-20151015.tar.xz
/firefox-42.0.source.tar.xz
/firefox-langpacks-42.0-20151029.tar.xz
/firefox-langpacks-42.0-20151030.tar.xz
/firefox-43.0.source.tar.xz
/firefox-langpacks-43.0-20151210.tar.xz
/firefox-43.0.3.source.tar.xz
/firefox-langpacks-43.0.3-20151229.tar.xz
/firefox-43.0.4.source.tar.xz
/firefox-langpacks-43.0.4-20160114.tar.xz
/firefox-44.0.source.tar.xz
/firefox-langpacks-44.0-20160121.tar.xz
/firefox-langpacks-44.0-20160125.tar.xz
/firefox-44.0.1.source.tar.xz
/firefox-langpacks-44.0.1-20160205.tar.xz
/firefox-langpacks-44.0.1-20160208.tar.xz
/firefox-44.0.2.source.tar.xz
/firefox-langpacks-44.0.2-20160210.tar.xz
/firefox-langpacks-44.0.2-20160211.tar.xz
/firefox-45.0.source.tar.xz
/firefox-langpacks-45.0-20160302.tar.xz
/firefox-langpacks-45.0-20160304.tar.xz
/firefox-langpacks-45.0.1-20160316.tar.xz
/firefox-45.0.1.source.tar.xz
/firefox-45.0.2.source.tar.xz
/firefox-langpacks-45.0.2-20160411.tar.xz
/firefox-46.0.source.tar.xz
/firefox-langpacks-46.0-20160425.tar.xz
/firefox-46.0.1.source.tar.xz
/firefox-langpacks-46.0.1-20160503.tar.xz
/firefox-47.0.source.tar.xz
/firefox-langpacks-47.0-20160601.tar.xz
/firefox-langpacks-47.0-20160603.tar.xz
/firefox-langpacks-47.0-20160606.tar.xz
/firefox-47.0.1.source.tar.xz
/firefox-langpacks-47.0.1-20160711.tar.xz
/firefox-langpacks-48.0-20160726.tar.xz
/firefox-48.0.source.tar.xz
/firefox-langpacks-48.0-20160727.tar.xz
/firefox-langpacks-48.0.1-20160819.tar.xz
/firefox-48.0.1.source.tar.xz
/firefox-49.0.source.tar.xz
/firefox-langpacks-49.0-20160906.tar.xz
/firefox-langpacks-49.0-20160908.tar.xz
/firefox-langpacks-49.0-20160919.tar.xz
/firefox-49.0.2.source.tar.xz
/firefox-langpacks-49.0.2-20161031.tar.xz
/firefox-50.0.source.tar.xz
/firefox-langpacks-50.0-20161110.tar.xz
/firefox-50.0.1.source.tar.xz
/firefox-langpacks-50.0.1-20161128.tar.xz
/firefox-50.0.2.source.tar.xz
/firefox-langpacks-50.0.2-20161130.tar.xz
/firefox-50.1.0.source.tar.xz
/firefox-langpacks-50.1.0-20161213.tar.xz
/firefox-51.0.source.tar.xz
/firefox-langpacks-51.0-20170118.tar.xz
/firefox-langpacks-51.0-20170119.tar.xz
/firefox-51.0.1.source.tar.xz
/firefox-langpacks-51.0.1-20170125.tar.xz
/firefox-langpacks-51.0.1-20170126.tar.xz
/firefox-52.0.source.tar.xz
/firefox-langpacks-52.0-20170303.tar.xz
/firefox-52.0.2.source.tar.xz
/firefox-langpacks-52.0.2-20170329.tar.xz
/firefox-53.0.2.source.tar.xz
/firefox-langpacks-53.0.2-20170505.tar.xz
/firefox-53.0.3.source.tar.xz
/firefox-langpacks-53.0.3-20170526.tar.xz
/firefox-54.0.source.tar.xz
/firefox-langpacks-54.0-20170608.tar.xz
/firefox-langpacks-54.0-20170613.tar.xz
/firefox-54.0.1.source.tar.xz
/firefox-langpacks-54.0.1-20170725.tar.xz
/firefox-55.0.source.tar.xz
/firefox-langpacks-55.0-20170802.tar.xz
/firefox-langpacks-55.0-20170807.tar.xz
/firefox-55.0.1.source.tar.xz
/firefox-langpacks-55.0.1-20170814.tar.xz
/firefox-55.0.2.source.tar.xz
/firefox-langpacks-55.0.2-20170818.tar.xz
/firefox-55.0.3.source.tar.xz
/firefox-langpacks-55.0.3-20170901.tar.xz
/firefox-56.0.source.tar.xz
/firefox-langpacks-56.0-20170925.tar.xz
/firefox-langpacks-56.0-20170927.tar.xz
/firefox-57.0b5.source.tar.xz
/firefox-langpacks-57.0b5-20171005.tar.xz
/firefox-57.0b6.source.tar.xz
/firefox-langpacks-57.0b6-20171009.tar.xz
/firefox-57.0b7.source.tar.xz
/firefox-langpacks-57.0b7-20171011.tar.xz
/firefox-57.0b8.source.tar.xz
/firefox-langpacks-57.0b8-20171016.tar.xz
/firefox-57.0b9.source.tar.xz
/firefox-langpacks-57.0b9-20171019.tar.xz
/firefox-57.0b11.source.tar.xz
/firefox-langpacks-57.0b11-20171024.tar.xz
/firefox-57.0b12.source.tar.xz
/firefox-langpacks-57.0b12-20171030.tar.xz
/firefox-57.0b14.source.tar.xz
/firefox-langpacks-57.0b14-20171106.tar.xz
/firefox-57.0.source.tar.xz
/firefox-langpacks-57.0-20171109.tar.xz
/firefox-langpacks-57.0-20171113.tar.xz
/firefox-57.0.1.source.tar.xz
/firefox-langpacks-57.0.1-20171130.tar.xz
/firefox-57.0.3.source.tar.xz
/firefox-langpacks-57.0.3-20180102.tar.xz
/firefox-57.0.4.source.tar.xz
/firefox-langpacks-57.0.4-20180104.tar.xz
/firefox-58.0.source.tar.xz
/firefox-langpacks-58.0-20180123.tar.xz
/firefox-58.0.1.source.tar.xz
/firefox-langpacks-58.0.1-20180130.tar.xz
/2f6a4d2cf42c9d59626061d45c043817cb220814.tar.bz2
/firefox-langpacks-59.0-20180306.tar.xz
/c61f5f5ead48c78a80c80db5c489bdc7cfaf8175.tar.bz2
/firefox-langpacks-59.0-20180312.tar.xz
/firefox-langpacks-59.0.1-20180317.tar.xz
/3db9e3d52b17563efca181ccbb50deb8660c59ae.tar.bz2
/239e434d6d2b8e1e2b697c3416d1e96d48fe98e5.tar.bz2
/firefox-langpacks-59.0.2-20180327.tar.xz
/firefox-60.0b13.source.tar.xz
/firefox-langpacks-60.0b13-20180418.tar.xz
/firefox-60.0b15.source.tar.xz
/firefox-langpacks-60.0b15-20180426.tar.xz
/firefox-60.0b16.source.tar.xz
/firefox-langpacks-60.0b16-20180427.tar.xz
/firefox-60.0.source.tar.xz
/firefox-langpacks-60.0-20180502.tar.xz
/firefox-langpacks-60.0-20180507.tar.xz
/firefox-60.0.1.source.tar.xz
/firefox-langpacks-60.0.1-20180523.tar.xz
/firefox-60.0.2.source.tar.xz
/firefox-langpacks-60.0.2-20180611.tar.xz
/firefox-61.0.source.tar.xz
/firefox-langpacks-61.0-20180619.tar.xz
/firefox-langpacks-61.0-20180622.tar.xz
/firefox-61.0.1.source.tar.xz
/firefox-langpacks-61.0.1-20180710.tar.xz
/firefox-langpacks-61.0.2-20180809.tar.xz
/firefox-61.0.2.source.tar.xz
/firefox-langpacks-62.0-20180828.tar.xz
/firefox-62.0.source.tar.xz
/firefox-62.0.2.source.tar.xz
/firefox-langpacks-62.0.2-20180924.tar.xz
/firefox-62.0.3.source.tar.xz
/firefox-langpacks-62.0.3-20181002.tar.xz
/firefox-63.0.source.tar.xz
/firefox-langpacks-63.0-20181018.tar.xz
/cbindgen-vendor.tar.xz
/firefox-langpacks-63.0.1-20181101.tar.xz
/firefox-63.0.1.source.tar.xz
/firefox-63.0.3.source.tar.xz
/firefox-langpacks-63.0.3-20181115.tar.xz
/firefox-64.0.source.tar.xz
/firefox-langpacks-64.0-20181204.tar.xz
/firefox-64.0.2.source.tar.xz
/firefox-langpacks-64.0.2-20190110.tar.xz
/firefox-65.0.source.tar.xz
/firefox-langpacks-65.0-20190128.tar.xz
/firefox-65.0.1.source.tar.xz
/firefox-langpacks-65.0.1-20190215.tar.xz
/firefox-65.0.2.source.tar.xz
/firefox-langpacks-65.0.2-20190301.tar.xz
/firefox-66.0.source.tar.xz
/firefox-langpacks-66.0-20190312.tar.xz
/firefox-langpacks-66.0-20190315.tar.xz
/firefox-66.0.1.source.tar.xz
/firefox-langpacks-66.0.1-20190322.tar.xz
/firefox-66.0.2.source.tar.xz
/firefox-langpacks-66.0.2-20190401.tar.xz
/firefox-langpacks-66.0.3-20190410.tar.xz
/firefox-66.0.3.source.tar.xz
/firefox-langpacks-66.0.4-20190505.tar.xz
/firefox-66.0.4.source.tar.xz
/firefox-66.0.5.source.tar.xz
/firefox-langpacks-66.0.5-20190508.tar.xz
/firefox-67.0.source.tar.xz
/firefox-langpacks-67.0-20190515.tar.xz
/firefox-langpacks-67.0-20190517.tar.xz
/firefox-67.0.2.source.tar.xz
/firefox-langpacks-67.0.2-20190611.tar.xz
/firefox-langpacks-67.0.3-20190618.tar.xz
/firefox-67.0.3.source.tar.xz
/firefox-67.0.4.source.tar.xz
/firefox-langpacks-67.0.4-20190620.tar.xz
/firefox-68.0.source.tar.xz
/firefox-langpacks-68.0-20190702.tar.xz
/firefox-langpacks-68.0-20190708.tar.xz
/firefox-68.0.1.source.tar.xz
/firefox-langpacks-68.0.1-20190722.tar.xz
/firefox-68.0.2.source.tar.xz
/firefox-langpacks-68.0.2-20190814.tar.xz
/firefox-69.0.source.tar.xz
/firefox-langpacks-69.0-20190829.tar.xz
/firefox-69.0.1.source.tar.xz
/firefox-langpacks-69.0.1-20190918.tar.xz
/firefox-langpacks-69.0.2-20191003.tar.xz
/firefox-69.0.2.source.tar.xz
/firefox-69.0.3.source.tar.xz
/firefox-langpacks-69.0.3-20191010.tar.xz
/firefox-70.0.source.tar.xz
/firefox-langpacks-70.0-20191018.tar.xz
/firefox-70.0.1.source.tar.xz
/firefox-langpacks-70.0.1-20191101.tar.xz
/firefox-71.0b12.source.tar.xz
/firefox-71.0.source.tar.xz
/firefox-langpacks-71.0-20191126.tar.xz
/firefox-langpacks-71.0-20191202.tar.xz
/firefox-72.0.source.tar.xz
/firefox-langpacks-72.0-20200103.tar.xz
/firefox-langpacks-72.0-20200106.tar.xz
/firefox-72.0.1.source.tar.xz
/firefox-langpacks-72.0.1-20200108.tar.xz
/firefox-72.0.2.source.tar.xz
/firefox-langpacks-72.0.2-20200120.tar.xz
/firefox-73.0.source.tar.xz
/firefox-langpacks-73.0-20200211.tar.xz
/firefox-73.0.1.source.tar.xz
/firefox-langpacks-73.0.1-20200220.tar.xz
/firefox-74.0.source.tar.xz
/firefox-langpacks-74.0-20200303.tar.xz
/firefox-langpacks-74.0-20200309.tar.xz
/firefox-langpacks-74.0-20200310.tar.xz
/firefox-74.0.1.source.tar.xz
/firefox-langpacks-74.0.1-20200404.tar.xz
/firefox-75.0.source.tar.xz
/firefox-langpacks-75.0-20200406.tar.xz
/firefox-76.0.source.tar.xz
/firefox-langpacks-76.0-20200502.tar.xz
/firefox-76.0.1.source.tar.xz
/firefox-langpacks-76.0.1-20200508.tar.xz
/firefox-77.0.source.tar.xz
/firefox-langpacks-77.0-20200529.tar.xz
/firefox-langpacks-77.0-20200602.tar.xz
/firefox-77.0.1.source.tar.xz
/firefox-langpacks-77.0.1-20200603.tar.xz
/firefox-78.0.source.tar.xz
/firefox-langpacks-78.0-20200629.tar.xz
/firefox-78.0.1.source.tar.xz
/firefox-langpacks-78.0.1-20200701.tar.xz
/firefox-78.0.2.source.tar.xz
/firefox-langpacks-78.0.2-20200709.tar.xz
/firefox-79.0.source.tar.xz
/firefox-langpacks-79.0-20200727.tar.xz
/firefox-80.0.source.tar.xz
/firefox-langpacks-80.0-20200818.tar.xz
/firefox-langpacks-80.0-20200820.tar.xz
/firefox-80.0.1.source.tar.xz
/firefox-langpacks-80.0.1-20200901.tar.xz
/firefox-81.0.source.tar.xz
/firefox-langpacks-81.0-20200915.tar.xz
/firefox-langpacks-81.0-20200921.tar.xz
/firefox-81.0.1.source.tar.xz
/firefox-langpacks-81.0.1-20200930.tar.xz
/firefox-81.0.2.source.tar.xz
/firefox-langpacks-81.0.2-20201012.tar.xz

45
build-aarch64-skia.patch Normal file
View File

@ -0,0 +1,45 @@
diff -up firefox-72.0/gfx/skia/skia/include/private/SkHalf.h.aarch64-skia firefox-72.0/gfx/skia/skia/include/private/SkHalf.h
--- firefox-72.0/gfx/skia/skia/include/private/SkHalf.h.aarch64-skia 2020-01-02 22:33:02.000000000 +0100
+++ firefox-72.0/gfx/skia/skia/include/private/SkHalf.h 2020-01-03 09:00:37.537296105 +0100
@@ -40,7 +40,7 @@ static inline Sk4h SkFloatToHalf_finite_
static inline Sk4f SkHalfToFloat_finite_ftz(uint64_t rgba) {
Sk4h hs = Sk4h::Load(&rgba);
-#if !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64)
+#if 0 // !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64)
float32x4_t fs;
asm ("fcvtl %[fs].4s, %[hs].4h \n" // vcvt_f32_f16(...)
: [fs] "=w" (fs) // =w: write-only NEON register
@@ -62,7 +62,7 @@ static inline Sk4f SkHalfToFloat_finite_
}
static inline Sk4h SkFloatToHalf_finite_ftz(const Sk4f& fs) {
-#if !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64)
+#if 0 // !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64)
float32x4_t vec = fs.fVec;
asm ("fcvtn %[vec].4h, %[vec].4s \n" // vcvt_f16_f32(vec)
: [vec] "+w" (vec)); // +w: read-write NEON register
diff -up firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h
--- firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia 2020-01-03 09:00:37.538296107 +0100
+++ firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h 2020-01-03 10:11:41.259219508 +0100
@@ -1087,7 +1087,7 @@ SI F from_half(U16 h) {
}
SI U16 to_half(F f) {
-#if defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \
+#if 0 //defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \
&& !defined(SK_BUILD_FOR_GOOGLE3) // Temporary workaround for some Google3 builds.
return vcvt_f16_f32(f);
diff -up firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h.aarch64-skia firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h
--- firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h.aarch64-skia 2020-01-03 09:00:37.538296107 +0100
+++ firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h 2020-01-03 10:11:53.513250979 +0100
@@ -183,8 +183,6 @@ SI F F_from_Half(U16 half) {
SI U16 Half_from_F(F f) {
#if defined(USING_NEON_FP16)
return bit_pun<U16>(f);
-#elif defined(USING_NEON_F16C)
- return (U16)vcvt_f16_f32(f);
#elif defined(USING_AVX512F)
return (U16)_mm512_cvtps_ph((__m512 )f, _MM_FROUND_CUR_DIRECTION );
#elif defined(USING_AVX_F16C)

12
build-arm-libaom.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up firefox-73.0/media/libaom/moz.build.old firefox-73.0/media/libaom/moz.build
--- firefox-73.0/media/libaom/moz.build.old 2020-02-07 23:13:28.000000000 +0200
+++ firefox-73.0/media/libaom/moz.build 2020-02-17 10:30:08.509805092 +0200
@@ -55,7 +55,7 @@ elif CONFIG['CPU_ARCH'] == 'arm':
for f in SOURCES:
if f.endswith('neon.c'):
- SOURCES[f].flags += CONFIG['VPX_ASFLAGS']
+ SOURCES[f].flags += CONFIG['NEON_FLAGS']
if CONFIG['OS_TARGET'] == 'Android':
# For cpu-features.h

12
build-arm-libopus.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up firefox-66.0/media/libopus/silk/arm/arm_silk_map.c.old firefox-66.0/media/libopus/silk/arm/arm_silk_map.c
--- firefox-66.0/media/libopus/silk/arm/arm_silk_map.c.old 2019-03-12 21:07:35.356677522 +0100
+++ firefox-66.0/media/libopus/silk/arm/arm_silk_map.c 2019-03-12 21:07:42.937693394 +0100
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
# include "config.h"
#endif
-#include "main_FIX.h"
+#include "fixed/main_FIX.h"
#include "NSQ.h"
#include "SigProc_FIX.h"

21
build-arm-wasm.patch Normal file
View File

@ -0,0 +1,21 @@
diff -up firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp.old firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp
--- firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp.old 2020-01-17 23:34:41.000000000 +0200
+++ firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp 2020-02-02 08:07:54.670341986 +0200
@@ -249,7 +249,16 @@ using mozilla::DebugOnly;
#endif
#ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS
-# include <sys/user.h>
+struct user_vfp {
+ unsigned long long fpregs[32];
+ unsigned long fpscr;
+};
+
+struct user_vfp_exc {
+ unsigned long fpexc;
+ unsigned long fpinst;
+ unsigned long fpinst2;
+};
#endif
#if defined(ANDROID)

View File

@ -0,0 +1,13 @@
diff -up firefox-55.0.3/js/src/jit/ExecutableAllocator.h.wasm firefox-55.0.3/js/src/jit/ExecutableAllocator.h
--- firefox-55.0.3/js/src/jit/ExecutableAllocator.h.wasm 2017-09-05 11:32:12.235909468 +0200
+++ firefox-55.0.3/js/src/jit/ExecutableAllocator.h 2017-09-05 11:32:46.157916575 +0200
@@ -219,7 +219,7 @@ class ExecutableAllocator
static void poisonCode(JSRuntime* rt, JitPoisonRangeVector& ranges);
-#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) || defined(JS_SIMULATOR_ARM64)
+#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) || defined(JS_SIMULATOR_ARM64) || defined(JS_CODEGEN_NONE)
static void cacheFlush(void*, size_t)
{
}
diff -up firefox-55.0.3/js/src/jit-test/tests/wasm/bench/wasm_box2d.wasm firefox-55.0.3/js/src/jit-test/tests/wasm/bench/wasm_box2d

4946
build-cubeb-pulse-arm.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
diff -up firefox-65.0/toolkit/moz.configure.disable-elfhack firefox-65.0/toolkit/moz.configure
--- firefox-65.0/toolkit/moz.configure.disable-elfhack 2019-01-28 14:16:48.530345132 +0100
+++ firefox-65.0/toolkit/moz.configure 2019-01-28 14:18:03.231029682 +0100
@@ -1036,7 +1036,7 @@ with only_when('--enable-compile-environ
help='{Enable|Disable} elf hacks')
set_config('USE_ELF_HACK',
- depends_if('--enable-elf-hack')(lambda _: True))
+ depends_if('--enable-elf-hack')(lambda _: False))
@depends(check_build_environment)

51
build-ppc-jit.patch Normal file
View File

@ -0,0 +1,51 @@
diff -up firefox-55.0/js/src/jit/MIR.h.old firefox-55.0/js/src/jit/MIR.h
--- firefox-55.0/js/src/jit/MIR.h.old 2017-08-08 14:04:44.528460099 +0200
+++ firefox-55.0/js/src/jit/MIR.h 2017-08-08 14:05:11.045364831 +0200
@@ -12434,7 +12434,7 @@ class MNearbyInt
TRIVIAL_NEW_WRAPPERS
static bool HasAssemblerSupport(RoundingMode mode) {
- return Assembler::HasRoundInstruction(mode);
+ return false;
}
RoundingMode roundingMode() const { return roundingMode_; }
diff -up firefox-55.0/js/src/jit/ExecutableAllocator.h.old firefox-55.0/js/src/jit/ExecutableAllocator.h
--- firefox-55.0/js/src/jit/ExecutableAllocator.h.old 2017-08-09 09:24:18.784983505 +0200
+++ firefox-55.0/js/src/jit/ExecutableAllocator.h 2017-08-09 09:28:01.471100075 +0200
@@ -307,6 +307,10 @@ class ExecutableAllocator
{
sync_instruction_memory((caddr_t)code, size);
}
+#else
+ static void cacheFlush(void*, size_t)
+ {
+ }
#endif
private:
diff -up firefox-55.0/js/src/wasm/WasmBuiltins.cpp.old firefox-55.0/js/src/wasm/WasmBuiltins.cpp
--- firefox-55.0/js/src/wasm/WasmBuiltins.cpp.old 2017-08-09 12:50:46.877450765 +0200
+++ firefox-55.0/js/src/wasm/WasmBuiltins.cpp 2017-08-09 12:50:59.725406974 +0200
@@ -881,7 +881,6 @@ wasm::EnsureBuiltinThunksInitialized()
MOZ_ASSERT(!masm.numSymbolicAccesses());
#endif
- ExecutableAllocator::cacheFlush(thunks->codeBase, thunks->codeSize);
if (!ExecutableAllocator::makeExecutable(thunks->codeBase, thunks->codeSize))
return false;
diff -up firefox-55.0/js/src/wasm/WasmCode.cpp.old firefox-55.0/js/src/wasm/WasmCode.cpp
--- firefox-55.0/js/src/wasm/WasmCode.cpp.old 2017-08-09 12:50:37.205483731 +0200
+++ firefox-55.0/js/src/wasm/WasmCode.cpp 2017-08-09 12:51:10.365370708 +0200
@@ -287,8 +287,6 @@ CodeSegment::initialize(Tier tier,
if (!StaticallyLink(*this, linkData))
return false;
- ExecutableAllocator::cacheFlush(bytes_.get(), RoundupCodeLength(codeLength));
-
// Reprotect the whole region to avoid having separate RW and RX mappings.
if (!ExecutableAllocator::makeExecutable(bytes_.get(), RoundupCodeLength(codeLength)))
return false;
diff -up firefox-55.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old firefox-55.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium
diff -up firefox-55.0/media/webrtc/trunk/Makefile.old firefox-55.0/media/webrtc/trunk/Makefile

25
build-rust-ppc64le.patch Normal file
View File

@ -0,0 +1,25 @@
diff -up firefox-55.0/build/moz.configure/rust.configure.rust-ppc64le firefox-55.0/build/moz.configure/rust.configure
--- firefox-55.0/build/moz.configure/rust.configure.rust-ppc64le 2017-07-31 18:20:49.000000000 +0200
+++ firefox-55.0/build/moz.configure/rust.configure 2017-08-02 10:19:03.254220003 +0200
@@ -151,6 +151,9 @@ def rust_triple_alias(host_or_target):
('sparc64', 'Linux'): 'sparc64-unknown-linux-gnu',
('x86', 'Linux'): 'i686-unknown-linux-gnu',
('x86_64', 'Linux'): 'x86_64-unknown-linux-gnu',
+ ('ppc64le', 'Linux'): 'powerpc64le-unknown-linux-gnu',
+ ('ppc64', 'Linux'): 'powerpc64-unknown-linux-gnu',
+ ('s390x', 'Linux'): 's390x-unknown-linux-gnu',
# OS X
('x86', 'OSX'): 'i686-apple-darwin',
('x86_64', 'OSX'): 'x86_64-apple-darwin',
@@ -174,8 +177,10 @@ def rust_triple_alias(host_or_target):
('sparc64', 'SunOS'): 'sparcv9-sun-solaris',
}.get((host_or_target.cpu, os_or_kernel), None)
+ if (rustc_target == 'powerpc64-unknown-linux-gnu' and host_or_target.endianness == 'little'):
+ rustc_target = 'powerpc64le-unknown-linux-gnu'
if rustc_target is None:
- die("Don't know how to translate {} for rustc".format(host_or_target.alias))
+ die("Don't know how to translate {} for rustc, cpu: {}, os: {}".format(target.alias, target.cpu, os_or_kernel))
# Check to see whether our rustc has a reasonably functional stdlib
# for our chosen target.

View File

@ -0,0 +1,39 @@
diff -up firefox-81.0/toolkit/modules/GMPInstallManager.jsm.old firefox-81.0/toolkit/modules/GMPInstallManager.jsm
--- firefox-81.0/toolkit/modules/GMPInstallManager.jsm.old 2020-09-25 10:39:04.769458703 +0200
+++ firefox-81.0/toolkit/modules/GMPInstallManager.jsm 2020-09-25 10:39:22.038504747 +0200
@@ -54,10 +54,6 @@ function getScopedLogger(prefix) {
const LOCAL_GMP_SOURCES = [
{
- id: "gmp-gmpopenh264",
- src: "chrome://global/content/gmp-sources/openh264.json",
- },
- {
id: "gmp-widevinecdm",
src: "chrome://global/content/gmp-sources/widevinecdm.json",
},
diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -108,7 +108,6 @@ toolkit.jar:
#ifdef XP_MACOSX
content/global/macWindowMenu.js
#endif
- content/global/gmp-sources/openh264.json (gmp-sources/openh264.json)
content/global/gmp-sources/widevinecdm.json (gmp-sources/widevinecdm.json)
# Third party files
diff --git a/toolkit/modules/GMPInstallManager.jsm b/toolkit/modules/GMPInstallManager.jsm
--- a/toolkit/modules/GMPInstallManager.jsm
+++ b/toolkit/modules/GMPInstallManager.jsm
@@ -238,6 +234,9 @@ GMPInstallManager.prototype = {
* downloaderr, verifyerr or previouserrorencountered
*/
installAddon(gmpAddon) {
+ if (gmpAddon.isOpenH264) {
+ return Promise.reject({ type: "disabled" });
+ }
if (this._deferred) {
let log = getScopedLogger("GMPInstallManager.installAddon");
log.error("previous error encountered");

9
distribution.ini Normal file
View File

@ -0,0 +1,9 @@
[Global]
id=fedora
version=1.0
about=Mozilla Firefox for Fedora
[Preferences]
app.distributor=fedora
app.distributor.channel=fedora
app.partner.fedora=fedora

23
fedora-build.patch Normal file
View File

@ -0,0 +1,23 @@
diff -up firefox-54.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old firefox-54.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium
diff -up firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp.old firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp
--- firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp.old 2017-06-08 14:59:08.786996664 +0200
+++ firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp 2017-06-08 14:59:22.642946570 +0200
@@ -211,7 +211,6 @@
'-Wno-parentheses',
'-Wno-strict-prototypes',
'-Wmissing-prototypes',
- '-Wno-format',
],
'defines' : [
'LINUX',
diff -up firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp.build firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp
--- firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp.build 2017-06-08 15:08:03.627063097 +0200
+++ firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp 2017-06-08 15:08:15.657019606 +0200
@@ -206,7 +206,6 @@
'-Wno-parentheses',
'-Wno-strict-prototypes',
'-Wmissing-prototypes',
- '-Wno-format',
],
'defines' : [
'LINUX',

View File

@ -0,0 +1,9 @@
diff -up firefox-73.0/build/unix/run-mozilla.sh.old firefox-73.0/build/unix/run-mozilla.sh
--- firefox-73.0/build/unix/run-mozilla.sh.old 2020-02-12 09:58:00.150895904 +0100
+++ firefox-73.0/build/unix/run-mozilla.sh 2020-02-12 09:58:06.505860696 +0100
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/sh
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -0,0 +1,29 @@
diff -up firefox-81.0/dom/media/platforms/PDMFactory.cpp.firefox-disable-ffvpx-with-vapi firefox-81.0/dom/media/platforms/PDMFactory.cpp
--- firefox-81.0/dom/media/platforms/PDMFactory.cpp.firefox-disable-ffvpx-with-vapi 2020-09-17 02:32:43.000000000 +0200
+++ firefox-81.0/dom/media/platforms/PDMFactory.cpp 2020-09-21 10:30:29.393903183 +0200
@@ -371,12 +371,6 @@ void PDMFactory::CreatePDMs() {
StartupPDM(m);
}
#endif
-#ifdef MOZ_FFVPX
- if (StaticPrefs::media_ffvpx_enabled()) {
- m = FFVPXRuntimeLinker::CreateDecoderModule();
- StartupPDM(m);
- }
-#endif
#ifdef MOZ_FFMPEG
if (StaticPrefs::media_ffmpeg_enabled()) {
m = FFmpegRuntimeLinker::CreateDecoderModule();
@@ -385,6 +379,12 @@ void PDMFactory::CreatePDMs() {
mFFmpegFailedToLoad = false;
}
#endif
+#ifdef MOZ_FFVPX
+ if (StaticPrefs::media_ffvpx_enabled()) {
+ m = FFVPXRuntimeLinker::CreateDecoderModule();
+ StartupPDM(m);
+ }
+#endif
#ifdef MOZ_WIDGET_ANDROID
if (StaticPrefs::media_android_media_codec_enabled()) {
m = new AndroidDecoderModule();

View File

@ -0,0 +1,13 @@
diff -up firefox-55.0/browser/app/profile/firefox.js.addons firefox-55.0/browser/app/profile/firefox.js
--- firefox-55.0/browser/app/profile/firefox.js.addons 2017-08-02 10:58:30.566363833 +0200
+++ firefox-55.0/browser/app/profile/firefox.js 2017-08-02 10:59:15.377216959 +0200
@@ -65,7 +65,8 @@ pref("extensions.systemAddon.update.url"
// Disable add-ons that are not installed by the user in all scopes by default.
// See the SCOPE constants in AddonManager.jsm for values to use here.
-pref("extensions.autoDisableScopes", 15);
+pref("extensions.autoDisableScopes", 0);
+pref("extensions.showMismatchUI", false);
// Scopes to scan for changes at startup.
pref("extensions.startupScanScopes", 0);

19
firefox-fedora-ua.patch Normal file
View File

@ -0,0 +1,19 @@
diff -up firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp.fedora-ua firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp
--- firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp.fedora-ua 2019-01-28 14:28:35.806375063 +0100
+++ firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp 2019-01-28 14:30:25.886917219 +0100
@@ -873,6 +873,7 @@ void nsHttpHandler::BuildUserAgent() {
mUserAgent.SetCapacity(mLegacyAppName.Length() + mLegacyAppVersion.Length() +
#ifndef UA_SPARE_PLATFORM
mPlatform.Length() +
+ mPlatform.Length() + 8 +
#endif
mOscpu.Length() + mMisc.Length() + mProduct.Length() +
mProductSub.Length() + mAppName.Length() +
@@ -891,6 +892,7 @@ void nsHttpHandler::BuildUserAgent() {
if (!mPlatform.IsEmpty()) {
mUserAgent += mPlatform;
mUserAgent.AppendLiteral("; ");
+ mUserAgent.AppendLiteral("Fedora; ");
}
#endif
if (!mCompatDevice.IsEmpty()) {

38
firefox-gcc-build.patch Normal file
View File

@ -0,0 +1,38 @@
--- firefox-80.0.1/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2020-08-31 10:04:19.000000000 -0400
+++ firefox-80.0.1/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2020-09-12 07:24:35.298931628 -0400
@@ -1962,7 +1962,7 @@ struct kernel_statfs {
LSS_ENTRYPOINT \
"pop %%ebx" \
args \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res)
#undef _syscall0
#define _syscall0(type,name) \
@@ -2019,7 +2019,7 @@ struct kernel_statfs {
: "i" (__NR_##name), "ri" ((long)(arg1)), \
"c" ((long)(arg2)), "d" ((long)(arg3)), \
"S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res); \
}
#undef _syscall6
@@ -2041,7 +2041,7 @@ struct kernel_statfs {
: "i" (__NR_##name), "0" ((long)(&__s)), \
"c" ((long)(arg2)), "d" ((long)(arg3)), \
"S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res); \
}
LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
@@ -2127,7 +2127,7 @@ struct kernel_statfs {
: "0"(-EINVAL), "i"(__NR_clone),
"m"(fn), "m"(child_stack), "m"(flags), "m"(arg),
"m"(parent_tidptr), "m"(newtls), "m"(child_tidptr)
- : "esp", "memory", "ecx", "edx", "esi", "edi");
+ : "memory", "ecx", "edx", "esi", "edi");
LSS_RETURN(int, __res);
}

View File

@ -0,0 +1,12 @@
diff -up firefox-75.0/intl/locale/LocaleService.cpp.locale-debug firefox-75.0/intl/locale/LocaleService.cpp
--- firefox-75.0/intl/locale/LocaleService.cpp.locale-debug 2020-04-06 22:42:20.196799809 +0200
+++ firefox-75.0/intl/locale/LocaleService.cpp 2020-04-06 22:43:02.522530317 +0200
@@ -372,8 +372,6 @@ LocaleService::GetDefaultLocale(nsACStri
// just use our hard-coded default below.
GetGREFileContents("update.locale", &locale);
locale.Trim(" \t\n\r");
- // This should never be empty.
- MOZ_ASSERT(!locale.IsEmpty());
if (CanonicalizeLanguageId(locale)) {
mDefaultLocale.Assign(locale);
}

24
firefox-mozconfig Normal file
View File

@ -0,0 +1,24 @@
. $topsrcdir/browser/config/mozconfig
ac_add_options --with-system-zlib
ac_add_options --disable-strip
#ac_add_options --enable-libnotify
ac_add_options --enable-necko-wifi
ac_add_options --disable-updater
ac_add_options --enable-chrome-format=omni
ac_add_options --enable-pulseaudio
ac_add_options --enable-av1
ac_add_options --without-system-icu
ac_add_options --enable-release
ac_add_options --update-channel=release
# Workaround for mozbz#1341234
ac_add_options BINDGEN_CFLAGS="$(pkg-config nspr pixman-1 --cflags)"
ac_add_options --allow-addon-sideload
ac_add_options --with-system-fdk-aac
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir

12
firefox-nss-version.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up firefox-78.0/toolkit/moz.configure.nss-version firefox-78.0/toolkit/moz.configure
--- firefox-78.0/toolkit/moz.configure.nss-version 2020-06-30 08:47:09.657501414 +0200
+++ firefox-78.0/toolkit/moz.configure 2020-06-30 08:47:12.652510169 +0200
@@ -2089,7 +2089,7 @@ option('--with-system-nss', help='Use sy
imply_option('--with-system-nspr', True, when='--with-system-nss')
-nss_pkg = pkg_check_modules('NSS', 'nss >= 3.53.1', when='--with-system-nss', config=False)
+nss_pkg = pkg_check_modules('NSS', 'nss >= 3.53.0', when='--with-system-nss', config=False)
set_config('MOZ_SYSTEM_NSS', True, when='--with-system-nss')

526
firefox-pipewire-0-2.patch Normal file
View File

@ -0,0 +1,526 @@
diff -up firefox-79.0/config/system-headers.mozbuild.firefox-pipewire-0-2 firefox-79.0/config/system-headers.mozbuild
--- firefox-79.0/config/system-headers.mozbuild.firefox-pipewire-0-2 2020-07-21 00:49:36.000000000 +0200
+++ firefox-79.0/config/system-headers.mozbuild 2020-07-29 11:03:51.455284187 +0200
@@ -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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire-0-2 2020-07-29 11:03:51.455284187 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2020-07-29 11:04:40.898017241 +0200
@@ -231,6 +231,27 @@ if CONFIG["OS_TARGET"] == "OpenBSD":
"/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.2",
+ "glib-2.0",
+ "gio-2.0",
+ "gobject-2.0"
+ ]
+
+ CXXFLAGS += CONFIG['TK_CFLAGS']
+
+ 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"] == "WINNT":
DEFINES["CERT_CHAIN_PARA_HAS_EXTRA_FIELDS"] = True
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire-0-2 2020-07-20 22:54:16.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h 2020-07-29 11:03:51.456284181 +0200
@@ -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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.firefox-pipewire-0-2 2020-07-20 22:54:27.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2020-07-29 11:03:51.618283306 +0200
@@ -18,6 +18,11 @@
#include <spa/param/video/raw-utils.h>
#include <spa/support/type-map.h>
+#include <linux/dma-buf.h>
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+#include <sys/syscall.h>
+
#include <memory>
#include <utility>
@@ -36,6 +41,27 @@ const char kSessionInterfaceName[] = "or
const char kRequestInterfaceName[] = "org.freedesktop.portal.Request";
const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast";
+
+// 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;
+ } else {
+ break;
+ }
+ }
+}
+
// static
void BaseCapturerPipeWire::OnStateChanged(void* data,
pw_remote_state old_state,
@@ -108,11 +134,13 @@ void BaseCapturerPipeWire::OnStreamForma
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];
+ const struct spa_pod* params[3];
params[0] = reinterpret_cast<spa_pod*>(spa_pod_builder_object(
&builder,
// id to enumerate buffer requirements
@@ -141,8 +169,14 @@ void BaseCapturerPipeWire::OnStreamForma
// 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);
+ params[2] = reinterpret_cast<spa_pod*>(
+ spa_pod_builder_object(&builder, that->pw_core_type_->param.idMeta,
+ that->pw_core_type_->param_meta.Meta, ":",
+ that->pw_core_type_->param_meta.type, "I",
+ that->pw_core_type_->meta.VideoCrop, ":",
+ that->pw_core_type_->param_meta.size, "i",
+ sizeof(struct spa_meta_video_crop)));
+ pw_stream_finish_format(that->pw_stream_, /*res=*/0, params, /*n_params=*/3);
}
// static
@@ -150,15 +184,25 @@ void BaseCapturerPipeWire::OnStreamProce
BaseCapturerPipeWire* that = static_cast<BaseCapturerPipeWire*>(data);
RTC_DCHECK(that);
- pw_buffer* buf = nullptr;
+ struct pw_buffer *next_buffer;
+ struct pw_buffer *buffer = nullptr;
- if (!(buf = pw_stream_dequeue_buffer(that->pw_stream_))) {
+ 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 (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)
@@ -197,10 +241,6 @@ BaseCapturerPipeWire::~BaseCapturerPipeW
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_);
}
@@ -290,12 +330,7 @@ void BaseCapturerPipeWire::InitPipeWireT
void BaseCapturerPipeWire::CreateReceivingStream() {
spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1};
- spa_rectangle pwScreenBounds =
- spa_rectangle{static_cast<uint32_t>(desktop_size_.width()),
- static_cast<uint32_t>(desktop_size_.height())};
-
- spa_fraction pwFrameRateMin = spa_fraction{0, 1};
- spa_fraction pwFrameRateMax = spa_fraction{60, 1};
+ spa_rectangle pwMaxScreenBounds = spa_rectangle{INT32_MAX, INT32_MAX};
pw_properties* reuseProps = pw_properties_new("pipewire.client.reuse", "1",
/*end of varargs*/ nullptr);
@@ -313,27 +348,19 @@ void BaseCapturerPipeWire::CreateReceivi
// 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),
+ SPA_POD_PROP_ENUM(
+ 4, pw_type_->video_format.RGBx, pw_type_->video_format.BGRx,
+ pw_type_->video_format.RGBA, pw_type_->video_format.BGRA),
// 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_type_->format_video.size, "Rru", &pwMinScreenBounds,
+ SPA_POD_PROP_MIN_MAX(&pwMinScreenBounds, &pwMaxScreenBounds)));
pw_stream_add_listener(pw_stream_, &spa_stream_listener_, &pw_stream_events_,
this);
pw_stream_flags flags = static_cast<pw_stream_flags>(
- PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE |
- PW_STREAM_FLAG_MAP_BUFFERS);
+ PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE);
if (pw_stream_connect(pw_stream_, PW_DIRECTION_INPUT, /*port_path=*/nullptr,
flags, params,
/*n_params=*/1) != 0) {
@@ -344,15 +371,81 @@ void BaseCapturerPipeWire::CreateReceivi
}
void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) {
+ struct spa_meta_video_crop* 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 == pw_core_type_->data.MemFd) {
+ map = static_cast<uint8_t*>(mmap(
+ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset,
+ PROT_READ, MAP_PRIVATE, spaBuffer->datas[0].fd, 0));
+ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t);
+ } else if (spaBuffer->datas[0].type == pw_core_type_->data.DmaBuf) {
+ int fd;
+ fd = spaBuffer->datas[0].fd;
+
+ map = static_cast<uint8_t*>(mmap(
+ nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset,
+ PROT_READ, MAP_PRIVATE, fd, 0));
+ SyncDmaBuf(fd, DMA_BUF_SYNC_START);
+
+ src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t);
+ } else if (spaBuffer->datas[0].type == pw_core_type_->data.MemPtr) {
+ map = nullptr;
+ src = static_cast<uint8_t*>(spaBuffer->datas[0].data);
+ } else {
+ return;
+ }
- if (!(src = spaBuffer->datas[0].data)) {
+ if (!src) {
return;
}
- uint32_t maxSize = spaBuffer->datas[0].maxsize;
- int32_t srcStride = spaBuffer->datas[0].chunk->stride;
+ DesktopSize prev_crop_size = DesktopSize(0, 0);
+ if (video_crop_size_initialized_) {
+ prev_crop_size = video_crop_size_;
+ }
+
+ if ((video_crop = static_cast<struct spa_meta_video_crop*>(
+ spa_buffer_find_meta(spaBuffer, pw_core_type_->meta.VideoCrop)))) {
+ RTC_DCHECK(video_crop->width <= desktop_size_.width() &&
+ video_crop->height <= desktop_size_.height());
+ if ((video_crop->width != desktop_size_.width() ||
+ video_crop->height != desktop_size_.height()) && video_crop->width && video_crop->height) {
+ video_crop_size_ = DesktopSize(video_crop->width, video_crop->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<uint8_t[]>(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 +454,39 @@ void BaseCapturerPipeWire::HandleBuffer(
return;
}
- if (!current_frame_) {
- current_frame_ = static_cast<uint8_t*>(malloc(maxSize));
+ dst = current_frame_.get();
+
+ // Adjust source content based on crop video position
+ if (video_crop_size_initialized_ &&
+ (video_crop->y + video_crop_size_.height() <= desktop_size_.height())) {
+ for (int i = 0; i < video_crop->y; ++i) {
+ src += srcStride;
+ }
+ }
+ const int xOffset =
+ video_crop_size_initialized_ && (video_crop->x + video_crop_size_.width() <=
+ desktop_size_.width())
+ ? video_crop->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 == pw_type_->video_format.RGBx) {
+ 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<uint8_t*>(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 == pw_core_type_->data.DmaBuf) {
+ SyncDmaBuf(spaBuffer->datas[0].fd, DMA_BUF_SYNC_END);
+ }
+ munmap(map, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset);
}
}
@@ -725,10 +836,6 @@ void BaseCapturerPipeWire::OnStartReques
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);
-
g_variant_unref(options);
g_variant_unref(variant);
}
@@ -813,10 +920,15 @@ void BaseCapturerPipeWire::CaptureFrame(
return;
}
- std::unique_ptr<DesktopFrame> result(new BasicDesktopFrame(desktop_size_));
+ DesktopSize frame_size = desktop_size_;
+ if (video_crop_size_initialized_) {
+ frame_size = video_crop_size_;
+ }
+
+ std::unique_ptr<DesktopFrame> 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 +949,22 @@ bool BaseCapturerPipeWire::SelectSource(
return true;
}
+// static
+std::unique_ptr<DesktopCapturer>
+BaseCapturerPipeWire::CreateRawScreenCapturer(
+ const DesktopCaptureOptions& options) {
+ std::unique_ptr<BaseCapturerPipeWire> capturer =
+ std::make_unique<BaseCapturerPipeWire>(BaseCapturerPipeWire::CaptureSourceType::kAny);
+ return std::move(capturer);}
+
+// static
+std::unique_ptr<DesktopCapturer>
+BaseCapturerPipeWire::CreateRawWindowCapturer(
+ const DesktopCaptureOptions& options) {
+
+ std::unique_ptr<BaseCapturerPipeWire> capturer =
+ std::make_unique<BaseCapturerPipeWire>(BaseCapturerPipeWire::CaptureSourceType::kAny);
+ return std::move(capturer);
+}
+
} // namespace webrtc
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.firefox-pipewire-0-2 2020-07-20 22:54:40.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h 2020-07-29 11:03:51.619283301 +0200
@@ -32,7 +32,11 @@ class PipeWireType {
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,6 +47,12 @@ class BaseCapturerPipeWire : public Desk
bool GetSourceList(SourceList* sources) override;
bool SelectSource(SourceId id) override;
+ static std::unique_ptr<DesktopCapturer> CreateRawScreenCapturer(
+ const DesktopCaptureOptions& options);
+
+ static std::unique_ptr<DesktopCapturer> CreateRawWindowCapturer(
+ const DesktopCaptureOptions& options);
+
private:
// PipeWire types -->
pw_core* pw_core_ = nullptr;
@@ -64,7 +74,7 @@ class BaseCapturerPipeWire : public Desk
gint32 pw_fd_ = -1;
CaptureSourceType capture_source_type_ =
- BaseCapturerPipeWire::CaptureSourceType::Screen;
+ BaseCapturerPipeWire::CaptureSourceType::kAny;
// <-- end of PipeWire types
@@ -78,10 +88,12 @@ class BaseCapturerPipeWire : public Desk
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<uint8_t[]> current_frame_;
Callback* callback_ = nullptr;
bool portal_init_failed_ = false;
@@ -95,6 +107,7 @@ class BaseCapturerPipeWire : public Desk
void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size);
+ static void SyncDmaBuf(int fd, uint64_t start_or_end);
static void OnStateChanged(void* data,
pw_remote_state old_state,
pw_remote_state state,
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.firefox-pipewire-0-2 2020-07-20 22:53:57.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc 2020-07-29 11:03:51.619283301 +0200
@@ -15,7 +15,7 @@
namespace webrtc {
ScreenCapturerPipeWire::ScreenCapturerPipeWire()
- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Screen) {}
+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kScreen) {}
ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {}
// static
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.firefox-pipewire-0-2 2020-07-20 22:54:18.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc 2020-07-29 11:03:51.619283301 +0200
@@ -15,7 +15,7 @@
namespace webrtc {
WindowCapturerPipeWire::WindowCapturerPipeWire()
- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Window) {}
+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kWindow) {}
WindowCapturerPipeWire::~WindowCapturerPipeWire() {}
// static
diff -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire-0-2 2020-07-20 22:54:40.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc 2020-07-29 11:03:51.620283296 +0200
@@ -26,7 +26,7 @@ std::unique_ptr<DesktopCapturer> Desktop
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 -up firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire-0-2 firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc
--- firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire-0-2 2020-07-20 22:53:32.000000000 +0200
+++ firefox-79.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc 2020-07-29 11:03:51.620283296 +0200
@@ -26,7 +26,7 @@ std::unique_ptr<DesktopCapturer> Desktop
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)

834
firefox-pipewire-0-3.patch Normal file
View File

@ -0,0 +1,834 @@
diff -up firefox-81.0/config/system-headers.mozbuild.firefox-pipewire-0-3 firefox-81.0/config/system-headers.mozbuild
--- firefox-81.0/config/system-headers.mozbuild.firefox-pipewire-0-3 2020-09-15 03:48:26.000000000 +0200
+++ firefox-81.0/config/system-headers.mozbuild 2020-09-15 14:40:00.721481417 +0200
@@ -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 -up firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn.firefox-pipewire-0-3 firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn
--- firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn.firefox-pipewire-0-3 2020-09-15 03:48:32.000000000 +0200
+++ firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn 2020-09-15 14:40:00.721481417 +0200
@@ -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 -up firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire-0-3 firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
--- firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire-0-3 2020-09-15 14:40:00.722481420 +0200
+++ firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2020-09-15 14:48:47.454733146 +0200
@@ -193,6 +193,28 @@ 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 -up firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire-0-3 firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h
--- firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire-0-3 2020-09-15 03:48:32.000000000 +0200
+++ firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h 2020-09-15 14:40:00.722481420 +0200
@@ -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 -up firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.firefox-pipewire-0-3 firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
--- firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.firefox-pipewire-0-3 2020-09-15 03:48:32.000000000 +0200
+++ firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2020-09-15 14:40:00.722481420 +0200
@@ -15,8 +15,11 @@
#include <spa/param/format-utils.h>
#include <spa/param/props.h>
-#include <spa/param/video/raw-utils.h>
-#include <spa/support/type-map.h>
+
+#include <linux/dma-buf.h>
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+#include <sys/syscall.h>
#include <memory>
#include <utility>
@@ -36,32 +39,37 @@ const char kSessionInterfaceName[] = "or
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<BaseCapturerPipeWire*>(data);
- RTC_DCHECK(that);
+void BaseCapturerPipeWire::SyncDmaBuf(int fd, uint64_t start_or_end) {
+ struct dma_buf_sync sync = { 0 };
- 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.";
+ 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,
pw_stream_state state,
@@ -73,76 +81,54 @@ void BaseCapturerPipeWire::OnStreamState
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<BaseCapturerPipeWire*>(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*>(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*>(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 *>(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 *>(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 *>(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::OnStreamProce
BaseCapturerPipeWire* that = static_cast<BaseCapturerPipeWire*>(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 (next_buffer)
+ pw_stream_queue_buffer (that->pw_stream_, buffer);
+ }
- if (!(buf = pw_stream_dequeue_buffer(that->pw_stream_))) {
+ 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::~BaseCapturerPipeW
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();
+pw_stream* BaseCapturerPipeWire::CreateReceivingStream() {
+ spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1};
+ spa_rectangle pwMaxScreenBounds = spa_rectangle{INT32_MAX, INT32_MAX};
- 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);
-}
+ auto stream = pw_stream_new(pw_core_, "webrtc-pipewire-stream", nullptr);
-void BaseCapturerPipeWire::CreateReceivingStream() {
- spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1};
- spa_rectangle pwScreenBounds =
- spa_rectangle{static_cast<uint32_t>(desktop_size_.width()),
- static_cast<uint32_t>(desktop_size_.height())};
-
- spa_fraction pwFrameRateMin = spa_fraction{0, 1};
- spa_fraction pwFrameRateMax = spa_fraction{60, 1};
-
- 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*>(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));
+ const spa_pod* params[2];
+ spa_pod_builder builder = SPA_POD_BUILDER_INIT(buffer, sizeof (buffer));
+
+ params[0] = reinterpret_cast<spa_pod *>(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_add_listener(pw_stream_, &spa_stream_listener_, &pw_stream_events_,
- this);
pw_stream_flags flags = static_cast<pw_stream_flags>(
- 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<uint8_t*>(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;
+
+ map = static_cast<uint8_t*>(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;
+ }
- if (!(src = spaBuffer->datas[0].data)) {
+ 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<uint8_t*>(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<struct spa_meta_region*>(
+ 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<uint8_t[]>(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(
return;
}
- if (!current_frame_) {
- current_frame_ = static_cast<uint8_t*>(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<uint8_t*>(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::OnStartReques
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<DesktopFrame> result(new BasicDesktopFrame(desktop_size_));
+ DesktopSize frame_size = desktop_size_;
+ if (video_crop_size_initialized_) {
+ frame_size = video_crop_size_;
+ }
+
+ std::unique_ptr<DesktopFrame> 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(
return true;
}
+// static
+std::unique_ptr<DesktopCapturer>
+BaseCapturerPipeWire::CreateRawScreenCapturer(
+ const DesktopCaptureOptions& options) {
+ std::unique_ptr<BaseCapturerPipeWire> capturer =
+ std::make_unique<BaseCapturerPipeWire>(BaseCapturerPipeWire::CaptureSourceType::kAny);
+ return std::move(capturer);}
+
+// static
+std::unique_ptr<DesktopCapturer>
+BaseCapturerPipeWire::CreateRawWindowCapturer(
+ const DesktopCaptureOptions& options) {
+
+ std::unique_ptr<BaseCapturerPipeWire> capturer =
+ std::make_unique<BaseCapturerPipeWire>(BaseCapturerPipeWire::CaptureSourceType::kAny);
+ return std::move(capturer);
+}
+
} // namespace webrtc
diff -up firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.firefox-pipewire-0-3 firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
--- firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.firefox-pipewire-0-3 2020-09-15 03:48:32.000000000 +0200
+++ firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h 2020-09-15 14:40:00.722481420 +0200
@@ -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 Desk
bool GetSourceList(SourceList* sources) override;
bool SelectSource(SourceId id) override;
+ static std::unique_ptr<DesktopCapturer> CreateRawScreenCapturer(
+ const DesktopCaptureOptions& options);
+
+ static std::unique_ptr<DesktopCapturer> 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 Desk
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<uint8_t[]> 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 -up firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.firefox-pipewire-0-3 firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc
--- firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.firefox-pipewire-0-3 2020-09-15 03:48:32.000000000 +0200
+++ firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc 2020-09-15 14:40:00.722481420 +0200
@@ -15,7 +15,7 @@
namespace webrtc {
ScreenCapturerPipeWire::ScreenCapturerPipeWire()
- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Screen) {}
+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kScreen) {}
ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {}
// static
diff -up firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.firefox-pipewire-0-3 firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc
--- firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.firefox-pipewire-0-3 2020-09-15 03:48:32.000000000 +0200
+++ firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc 2020-09-15 14:40:00.722481420 +0200
@@ -15,7 +15,7 @@
namespace webrtc {
WindowCapturerPipeWire::WindowCapturerPipeWire()
- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Window) {}
+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kWindow) {}
WindowCapturerPipeWire::~WindowCapturerPipeWire() {}
// static
diff -up firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire-0-3 firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc
--- firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire-0-3 2020-09-15 03:48:32.000000000 +0200
+++ firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc 2020-09-15 14:40:00.722481420 +0200
@@ -26,7 +26,7 @@ std::unique_ptr<DesktopCapturer> Desktop
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 -up firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire-0-3 firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc
--- firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire-0-3 2020-09-15 03:48:32.000000000 +0200
+++ firefox-81.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc 2020-09-15 14:40:00.722481420 +0200
@@ -26,7 +26,7 @@ std::unique_ptr<DesktopCapturer> Desktop
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)

View File

@ -0,0 +1,37 @@
pref("app.update.auto", false);
pref("app.update.enabled", false);
pref("app.update.autoInstallEnabled", false);
pref("general.smoothScroll", true);
pref("intl.locale.matchOS", true);
pref("intl.locale.requested", "");
pref("toolkit.storage.synchronous", 0);
pref("toolkit.networkmanager.disable", false);
pref("offline.autoDetect", true);
pref("browser.backspace_action", 2);
pref("browser.display.use_system_colors", true);
pref("browser.download.folderList", 1);
pref("browser.link.open_external", 3);
pref("browser.shell.checkDefaultBrowser", false);
pref("network.manage-offline-status", true);
pref("extensions.shownSelectionUI", true);
pref("ui.SpellCheckerUnderlineStyle", 1);
pref("startup.homepage_override_url", "");
pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://start.fedoraproject.org/");
pref("browser.newtabpage.pinned", '[{"url":"https://start.fedoraproject.org/","title":"Fedora Project - Start Page"}]');
pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%");
pref("media.gmp-gmpopenh264.provider.enabled",false);
pref("media.gmp-gmpopenh264.autoupdate",false);
pref("media.gmp-gmpopenh264.enabled",false);
pref("media.gmp.decoder.enabled", true);
pref("plugins.notifyMissingFlash", false);
/* See https://bugzilla.redhat.com/show_bug.cgi?id=1226489 */
pref("browser.display.use_system_colors", false);
pref("layers.use-image-offscreen-surfaces", false);
/* Allow sending credetials to all https:// sites */
pref("network.negotiate-auth.trusted-uris", "https://");
pref("spellchecker.dictionary_path","/usr/share/myspell");
/* Disable DoH by default */
pref("network.trr.mode", 5);
/* Enable per-user policy dir, see mozbz#1583466 */
pref("browser.policies.perUserDir", true);
pref("browser.gnome-search-provider.enabled",true);

View File

@ -0,0 +1,5 @@
[Shell Search Provider]
DesktopId=firefox.desktop
BusName=org.mozilla.Firefox.SearchProvider
ObjectPath=/org/mozilla/Firefox/SearchProvider
Version=2

64
firefox-symbolic.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -0,0 +1,12 @@
diff -up firefox-76.0.1/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp.old firefox-76.0.1/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- firefox-76.0.1/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp.old 2020-05-13 14:28:26.556800474 +0200
+++ firefox-76.0.1/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp 2020-05-13 14:28:31.562768959 +0200
@@ -43,7 +43,7 @@ typedef int VAStatus;
#endif
// Use some extra HW frames for potential rendering lags.
-#define EXTRA_HW_FRAMES 6
+#define EXTRA_HW_FRAMES 20
typedef mozilla::layers::Image Image;
typedef mozilla::layers::PlanarYCbCrImage PlanarYCbCrImage;

235
firefox-wayland.desktop Normal file
View File

@ -0,0 +1,235 @@
[Desktop Entry]
Version=1.0
Name=Firefox on Wayland
GenericName=Web Browser
Comment=Browse the Web
Exec=firefox-wayland --name firefox-wayland %u
Icon=firefox
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Categories=Network;WebBrowser;
Keywords=web;browser;internet;
Actions=new-window;new-private-window;profile-manager-window;
[Desktop Action new-window]
Name=Open a New Window
Name[ach]=Dirica manyen
Name[af]=Nuwe venster
Name[an]=Nueva finestra
Name[ar]=نافذة جديدة
Name[as]=
Name[ast]=Ventana nueva
Name[az]=Yeni Pəncərə
Name[be]=Новае акно
Name[bg]=Нов прозорец
Name[bn_BD]= (N)
Name[bn_IN]=
Name[br]=Prenestr nevez
Name[brx]= '(N)
Name[bs]=Novi prozor
Name[ca]=Finestra nova
Name[cak]=K'ak'a' tzuwäch
Name[cs]=Nové okno
Name[cy]=Ffenestr Newydd
Name[da]=Nyt vindue
Name[de]=Neues Fenster
Name[dsb]=Nowe wokno
Name[el]=Νέο παράθυρο
Name[en_GB]=New Window
Name[en_US]=New Window
Name[en_ZA]=New Window
Name[eo]=Nova fenestro
Name[es_AR]=Nueva ventana
Name[es_CL]=Nueva ventana
Name[es_ES]=Nueva ventana
Name[es_MX]=Nueva ventana
Name[et]=Uus aken
Name[eu]=Leiho berria
Name[fa]=پنجره جدید
Name[ff]=Henorde Hesere
Name[fi]=Uusi ikkuna
Name[fr]=Nouvelle fenêtre
Name[fy_NL]=Nij finster
Name[ga_IE]=Fuinneog Nua
Name[gd]=Uinneag ùr
Name[gl]=Nova xanela
Name[gn]=Ovetã pyahu
Name[gu_IN]= િ
Name[he]=חלון חדש
Name[hi_IN]= ि
Name[hr]=Novi prozor
Name[hsb]=Nowe wokno
Name[hu]=Új ablak
Name[hy_AM]=Նոր Պատուհան
Name[id]=Jendela Baru
Name[is]=Nýr gluggi
Name[it]=Nuova finestra
Name[ja]=
Name[ja_JP-mac]=
Name[ka]=
Name[kk]=Жаңа терезе
Name[km]=
Name[kn]= ಿಿ
Name[ko]=
Name[kok]=
Name[ks]=نئئ وِنڈو
Name[lij]=Neuvo barcon
Name[lo]=
Name[lt]=Naujas langas
Name[ltg]=Jauns lūgs
Name[lv]=Jauns logs
Name[mai]= ि
Name[mk]=Нов прозорец
Name[ml]=ി
Name[mr]=
Name[ms]=Tetingkap Baru
Name[my]=
Name[nb_NO]=Nytt vindu
Name[ne_NP]=
Name[nl]=Nieuw venster
Name[nn_NO]=Nytt vindauge
Name[or]= ି
Name[pa_IN]= ਿ
Name[pl]=Nowe okno
Name[pt_BR]=Nova janela
Name[pt_PT]=Nova janela
Name[rm]=Nova fanestra
Name[ro]=Fereastră nouă
Name[ru]=Новое окно
Name[sat]= ि (N)
Name[si]=
Name[sk]=Nové okno
Name[sl]=Novo okno
Name[son]=Zanfun taaga
Name[sq]=Dritare e Re
Name[sr]=Нови прозор
Name[sv_SE]=Nytt fönster
Name[ta]=ி
Name[te]= ి
Name[th]=
Name[tr]=Yeni pencere
Name[tsz]=Eraatarakua jimpani
Name[uk]=Нове вікно
Name[ur]=نیا دریچہ
Name[uz]=Yangi oyna
Name[vi]=Ca s mi
Name[wo]=Palanteer bu bees
Name[xh]=Ifestile entsha
Name[zh_CN]=
Name[zh_TW]=
Exec=firefox-wayland --name firefox-wayland --new-window %u
[Desktop Action new-private-window]
Name=Open a New Private Window
Name[ach]=Dirica manyen me mung
Name[af]=Nuwe privaatvenster
Name[an]=Nueva finestra privada
Name[ar]=نافذة خاصة جديدة
Name[as]= ি
Name[ast]=Ventana privada nueva
Name[az]=Yeni Məxfi Pəncərə
Name[be]=Новае акно адасаблення
Name[bg]=Нов прозорец за поверително сърфиране
Name[bn_BD]= ি
Name[bn_IN]= ি
Name[br]=Prenestr merdeiñ prevez nevez
Name[brx]= '
Name[bs]=Novi privatni prozor
Name[ca]=Finestra privada nova
Name[cak]=K'ak'a' ichinan tzuwäch
Name[cs]=Nové anonymní okno
Name[cy]=Ffenestr Breifat Newydd
Name[da]=Nyt privat vindue
Name[de]=Neues privates Fenster
Name[dsb]=Nowe priwatne wokno
Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης
Name[en_GB]=New Private Window
Name[en_US]=New Private Window
Name[en_ZA]=New Private Window
Name[eo]=Nova privata fenestro
Name[es_AR]=Nueva ventana privada
Name[es_CL]=Nueva ventana privada
Name[es_ES]=Nueva ventana privada
Name[es_MX]=Nueva ventana privada
Name[et]=Uus privaatne aken
Name[eu]=Leiho pribatu berria
Name[fa]=پنجره ناشناس جدید
Name[ff]=Henorde Suturo Hesere
Name[fi]=Uusi yksityinen ikkuna
Name[fr]=Nouvelle fenêtre de navigation privée
Name[fy_NL]=Nij priveefinster
Name[ga_IE]=Fuinneog Nua Phríobháideach
Name[gd]=Uinneag phrìobhaideach ùr
Name[gl]=Nova xanela privada
Name[gn]=Ovetã ñemi pyahu
Name[gu_IN]= િ
Name[he]=חלון פרטי חדש
Name[hi_IN]= ि ि
Name[hr]=Novi privatni prozor
Name[hsb]=Nowe priwatne wokno
Name[hu]=Új privát ablak
Name[hy_AM]=Սկսել Գաղտնի դիտարկում
Name[id]=Jendela Mode Pribadi Baru
Name[is]=Nýr huliðsgluggi
Name[it]=Nuova finestra anonima
Name[ja]=
Name[ja_JP-mac]=
Name[ka]=
Name[kk]=Жаңа жекелік терезе
Name[km]=
Name[kn]= ಿ ಿಿ
Name[ko]=
Name[kok]= ि
Name[ks]=نْو پرایوٹ وینڈو&amp;
Name[lij]=Neuvo barcon privou
Name[lo]=
Name[lt]=Naujas privataus naršymo langas
Name[ltg]=Jauns privatais lūgs
Name[lv]=Jauns privātais logs
Name[mai]= ि ि (W)
Name[mk]=Нов приватен прозорец
Name[ml]=ി
Name[mr]= ि
Name[ms]=Tetingkap Persendirian Baharu
Name[my]=New Private Window
Name[nb_NO]=Nytt privat vindu
Name[ne_NP]= ि
Name[nl]=Nieuw privévenster
Name[nn_NO]=Nytt privat vindauge
Name[or]= ି ି
Name[pa_IN]= ਿ
Name[pl]=Nowe okno prywatne
Name[pt_BR]=Nova janela privativa
Name[pt_PT]=Nova janela privada
Name[rm]=Nova fanestra privata
Name[ro]=Fereastră privată nouă
Name[ru]=Новое приватное окно
Name[sat]= ि ि (W )
Name[si]= (W)
Name[sk]=Nové okno v režime Súkromné prehliadanie
Name[sl]=Novo zasebno okno
Name[son]=Sutura zanfun taaga
Name[sq]=Dritare e Re Private
Name[sr]=Нови приватан прозор
Name[sv_SE]=Nytt privat fönster
Name[ta]=ி ி
Name[te]= ి ి
Name[th]=
Name[tr]=Yeni gizli pencere
Name[tsz]=Juchiiti eraatarakua jimpani
Name[uk]=Приватне вікно
Name[ur]=نیا نجی دریچہ
Name[uz]=Yangi maxfiy oyna
Name[vi]=Ca s riêng tư mi
Name[wo]=Panlanteeru biir bu bees
Name[xh]=Ifestile yangasese entsha
Name[zh_CN]=
Name[zh_TW]=
Exec=firefox-wayland --private-window --name firefox-wayland %u
[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Name[cs]=Správa profilů
Exec=firefox-wayland --name firefox-wayland --ProfileManager

7
firefox-wayland.sh.in Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/bash
#
# Run Firefox under Wayland
#
export MOZ_ENABLE_WAYLAND=1
exec /__PREFIX__/bin/firefox "$@"

235
firefox-x11.desktop Normal file
View File

@ -0,0 +1,235 @@
[Desktop Entry]
Version=1.0
Name=Firefox on X11
GenericName=Web Browser
Comment=Browse the Web
Exec=firefox-x11 --name firefox-x11 %u
Icon=firefox
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Categories=Network;WebBrowser;
Keywords=web;browser;internet;
Actions=new-window;new-private-window;profile-manager-window;
[Desktop Action new-window]
Name=Open a New Window
Name[ach]=Dirica manyen
Name[af]=Nuwe venster
Name[an]=Nueva finestra
Name[ar]=نافذة جديدة
Name[as]=
Name[ast]=Ventana nueva
Name[az]=Yeni Pəncərə
Name[be]=Новае акно
Name[bg]=Нов прозорец
Name[bn_BD]= (N)
Name[bn_IN]=
Name[br]=Prenestr nevez
Name[brx]= '(N)
Name[bs]=Novi prozor
Name[ca]=Finestra nova
Name[cak]=K'ak'a' tzuwäch
Name[cs]=Nové okno
Name[cy]=Ffenestr Newydd
Name[da]=Nyt vindue
Name[de]=Neues Fenster
Name[dsb]=Nowe wokno
Name[el]=Νέο παράθυρο
Name[en_GB]=New Window
Name[en_US]=New Window
Name[en_ZA]=New Window
Name[eo]=Nova fenestro
Name[es_AR]=Nueva ventana
Name[es_CL]=Nueva ventana
Name[es_ES]=Nueva ventana
Name[es_MX]=Nueva ventana
Name[et]=Uus aken
Name[eu]=Leiho berria
Name[fa]=پنجره جدید
Name[ff]=Henorde Hesere
Name[fi]=Uusi ikkuna
Name[fr]=Nouvelle fenêtre
Name[fy_NL]=Nij finster
Name[ga_IE]=Fuinneog Nua
Name[gd]=Uinneag ùr
Name[gl]=Nova xanela
Name[gn]=Ovetã pyahu
Name[gu_IN]= િ
Name[he]=חלון חדש
Name[hi_IN]= ि
Name[hr]=Novi prozor
Name[hsb]=Nowe wokno
Name[hu]=Új ablak
Name[hy_AM]=Նոր Պատուհան
Name[id]=Jendela Baru
Name[is]=Nýr gluggi
Name[it]=Nuova finestra
Name[ja]=
Name[ja_JP-mac]=
Name[ka]=
Name[kk]=Жаңа терезе
Name[km]=
Name[kn]= ಿಿ
Name[ko]=
Name[kok]=
Name[ks]=نئئ وِنڈو
Name[lij]=Neuvo barcon
Name[lo]=
Name[lt]=Naujas langas
Name[ltg]=Jauns lūgs
Name[lv]=Jauns logs
Name[mai]= ि
Name[mk]=Нов прозорец
Name[ml]=ി
Name[mr]=
Name[ms]=Tetingkap Baru
Name[my]=
Name[nb_NO]=Nytt vindu
Name[ne_NP]=
Name[nl]=Nieuw venster
Name[nn_NO]=Nytt vindauge
Name[or]= ି
Name[pa_IN]= ਿ
Name[pl]=Nowe okno
Name[pt_BR]=Nova janela
Name[pt_PT]=Nova janela
Name[rm]=Nova fanestra
Name[ro]=Fereastră nouă
Name[ru]=Новое окно
Name[sat]= ि (N)
Name[si]=
Name[sk]=Nové okno
Name[sl]=Novo okno
Name[son]=Zanfun taaga
Name[sq]=Dritare e Re
Name[sr]=Нови прозор
Name[sv_SE]=Nytt fönster
Name[ta]=ி
Name[te]= ి
Name[th]=
Name[tr]=Yeni pencere
Name[tsz]=Eraatarakua jimpani
Name[uk]=Нове вікно
Name[ur]=نیا دریچہ
Name[uz]=Yangi oyna
Name[vi]=Ca s mi
Name[wo]=Palanteer bu bees
Name[xh]=Ifestile entsha
Name[zh_CN]=
Name[zh_TW]=
Exec=firefox-x11 --name firefox-x11 --new-window %u
[Desktop Action new-private-window]
Name=Open a New Private Window
Name[ach]=Dirica manyen me mung
Name[af]=Nuwe privaatvenster
Name[an]=Nueva finestra privada
Name[ar]=نافذة خاصة جديدة
Name[as]= ি
Name[ast]=Ventana privada nueva
Name[az]=Yeni Məxfi Pəncərə
Name[be]=Новае акно адасаблення
Name[bg]=Нов прозорец за поверително сърфиране
Name[bn_BD]= ি
Name[bn_IN]= ি
Name[br]=Prenestr merdeiñ prevez nevez
Name[brx]= '
Name[bs]=Novi privatni prozor
Name[ca]=Finestra privada nova
Name[cak]=K'ak'a' ichinan tzuwäch
Name[cs]=Nové anonymní okno
Name[cy]=Ffenestr Breifat Newydd
Name[da]=Nyt privat vindue
Name[de]=Neues privates Fenster
Name[dsb]=Nowe priwatne wokno
Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης
Name[en_GB]=New Private Window
Name[en_US]=New Private Window
Name[en_ZA]=New Private Window
Name[eo]=Nova privata fenestro
Name[es_AR]=Nueva ventana privada
Name[es_CL]=Nueva ventana privada
Name[es_ES]=Nueva ventana privada
Name[es_MX]=Nueva ventana privada
Name[et]=Uus privaatne aken
Name[eu]=Leiho pribatu berria
Name[fa]=پنجره ناشناس جدید
Name[ff]=Henorde Suturo Hesere
Name[fi]=Uusi yksityinen ikkuna
Name[fr]=Nouvelle fenêtre de navigation privée
Name[fy_NL]=Nij priveefinster
Name[ga_IE]=Fuinneog Nua Phríobháideach
Name[gd]=Uinneag phrìobhaideach ùr
Name[gl]=Nova xanela privada
Name[gn]=Ovetã ñemi pyahu
Name[gu_IN]= િ
Name[he]=חלון פרטי חדש
Name[hi_IN]= ि ि
Name[hr]=Novi privatni prozor
Name[hsb]=Nowe priwatne wokno
Name[hu]=Új privát ablak
Name[hy_AM]=Սկսել Գաղտնի դիտարկում
Name[id]=Jendela Mode Pribadi Baru
Name[is]=Nýr huliðsgluggi
Name[it]=Nuova finestra anonima
Name[ja]=
Name[ja_JP-mac]=
Name[ka]=
Name[kk]=Жаңа жекелік терезе
Name[km]=
Name[kn]= ಿ ಿಿ
Name[ko]=
Name[kok]= ि
Name[ks]=نْو پرایوٹ وینڈو&amp;
Name[lij]=Neuvo barcon privou
Name[lo]=
Name[lt]=Naujas privataus naršymo langas
Name[ltg]=Jauns privatais lūgs
Name[lv]=Jauns privātais logs
Name[mai]= ि ि (W)
Name[mk]=Нов приватен прозорец
Name[ml]=ി
Name[mr]= ि
Name[ms]=Tetingkap Persendirian Baharu
Name[my]=New Private Window
Name[nb_NO]=Nytt privat vindu
Name[ne_NP]= ि
Name[nl]=Nieuw privévenster
Name[nn_NO]=Nytt privat vindauge
Name[or]= ି ି
Name[pa_IN]= ਿ
Name[pl]=Nowe okno prywatne
Name[pt_BR]=Nova janela privativa
Name[pt_PT]=Nova janela privada
Name[rm]=Nova fanestra privata
Name[ro]=Fereastră privată nouă
Name[ru]=Новое приватное окно
Name[sat]= ि ि (W )
Name[si]= (W)
Name[sk]=Nové okno v režime Súkromné prehliadanie
Name[sl]=Novo zasebno okno
Name[son]=Sutura zanfun taaga
Name[sq]=Dritare e Re Private
Name[sr]=Нови приватан прозор
Name[sv_SE]=Nytt privat fönster
Name[ta]=ி ி
Name[te]= ి ి
Name[th]=
Name[tr]=Yeni gizli pencere
Name[tsz]=Juchiiti eraatarakua jimpani
Name[uk]=Приватне вікно
Name[ur]=نیا نجی دریچہ
Name[uz]=Yangi maxfiy oyna
Name[vi]=Ca s riêng tư mi
Name[wo]=Panlanteeru biir bu bees
Name[xh]=Ifestile yangasese entsha
Name[zh_CN]=
Name[zh_TW]=
Exec=firefox-x11 --private-window --name firefox-x11 %u
[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Name[cs]=Správa profilů
Exec=firefox-x11 --name firefox-x11 --ProfileManager

7
firefox-x11.sh.in Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/bash
#
# Run Firefox on X11 backend
#
export MOZ_DISABLE_WAYLAND=1
exec /__PREFIX__/bin/firefox "$@"

141
firefox.1 Normal file
View File

@ -0,0 +1,141 @@
.TH FIREFOX 1 "November 30, 2017" firefox "Linux User's Manual"
.SH NAME
firefox \- a Web browser for X11 derived from the Mozilla browser
.SH SYNOPSIS
.B firefox
[\fIOPTIONS\fR ...] [\fIURL\fR]
.B firefox-bin
[\fIOPTIONS\fR] [\fIURL\fR]
.SH DESCRIPTION
\fBMozilla Firefox\fR is an open-source web browser, designed for
standards compliance, performance and portability.
.SH USAGE
\fBfirefox\fR is a simple shell script that will set up the
environment for the actual executable, \fBfirefox-bin\fR.
.SH OPTIONS
A summary of the options supported by \fBfirefox\fR is included below.
.SS "X11 options"
.TP
.BI \-\-display= DISPLAY
X display to use
.TP
.B \--sync
Make X calls synchronous
.TP
.B \-\-g-fatal-warnings
Make all warnings fatal
.SS "Firefox options"
.TP
.B \-h, \-help
Show summary of options.
.TP
.B \-v, \-version
Print Firefox version.
.TP
\fB\-P\fR \fIprofile\fR
Start with \fIprofile\fR.
.TP
\fB\-\-profile\fR \fIpath\fR
Start with profile at \fIpath\fR.
.TP
\fB\-\-migration\fR
Start with migration wizard.
.TP
.B \-\-ProfileManager
Start with ProfileManager.
.TP
\fB\-\-no\-remote\fR
Do not accept or send remote commands; implies \fB--new-instance\fR.
.TP
\fB\-\-new\-instance\fR
Open new instance, not a new window in running instance.
.TP
\fB\-\-UILocale\fR \fIlocale\fR
Start with \fIlocale\fR resources as UI Locale.
.TP
\fB\-\-safe\-mode\fR
Disables extensions and themes for this session.
.TP
\fB\-\-headless\fR
Run without a GUI.
.TP
\fB\-\-marionette\fR
Enable remote control server.
.TP
\fB\-\-browser\fR
Open a browser window.
.TP
\fB\-\-new-window\fR \fIurl\fR
Open \fIurl\fR in a new window.
.TP
\fB\-\-new-tab\fR \fIurl\fR
Open \fIurl\fR in a new tab.
.TP
\fB\-\-private-window\fR \fIurl\fR
Open \fIurl\fR in a new private window.
.TP
\fB\-\-preferences\fR
Open Preferences dialog.
.TP
\fB\-\-screenshot\fR [\fIpath\fR]
Save screenshot to \fIpath\fR or in working directory.
.TP
\fB\-\-window-size\fR \fIwidth\fR[,\fIheight\fR]
Width and optionally height of screenshot.
.TP
\fB\-\-search\fR \fIterm\fR
Search \fIterm\fR with your default search engine.
.TP
\fB\-\-jsconsole\fR
Open the Browser Console.
.TP
\fB\-\-jsdebugger\fR
Open the Browser Toolbox.
.TP
\fB\-\-wait-for-jsdebugger\fR
Spin event loop until JS debugger connects. Enables debugging (some) application startup code paths. Only has an effect when \fI--jsdebugger\fR is also supplied.
.TP
\fB\-\-devtools\fR
Open DevTools on initial load.
.TP
\fB\-\-start-debugger-server\fR [ws:][\fIport\fR|\fIpath\fR]
Start the debugger server on a TCP port or Unix domain socket path. Defaults to TCP port 6000. Use WebSocket protocol if ws: prefix is specified.
.TP
\fB\-\-recording\fR \fIfile\fR
Record drawing for a given URL.
.TP
\fB\-\-recording-output\fR \fIfile\fR
Specify destination file for a drawing recording.
.TP
\fB\-\-setDefaultBrowser\fR
Set this app as the default browser.
.SH FILES
\fI/usr/bin/firefox\fR - shell script wrapping
\fBfirefox\fR
.br
\fI/usr/lib64/firefox/firefox-bin\fR - \fBfirefox\fR
executable
.SH VERSION
57.0
.SH BUGS
To report a bug, please visit \fIhttp://bugzilla.mozilla.org/\fR
.SH AUTHORS
.TP
.B The Mozilla Organization
.I http://www.mozilla.org/about.html
.TP
.B Tobias Girstmair
.I https://gir.st/

59
firefox.appdata.xml.in Normal file
View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2019 Firefox contributors -->
<component type="desktop">
<id>firefox.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<name>Firefox</name>
<summary>Web Browser</summary>
<summary xml:lang="ca">Navegador web</summary>
<summary xml:lang="cs">Webový prohlížeč</summary>
<summary xml:lang="es">Navegador web</summary>
<summary xml:lang="fa">مرورگر اینترنتی</summary>
<summary xml:lang="fi">WWW-selain</summary>
<summary xml:lang="fr">Navigateur Web</summary>
<summary xml:lang="hu">Webböngésző</summary>
<summary xml:lang="it">Browser Web</summary>
<summary xml:lang="ja">ウェブ・ブラウザ</summary>
<summary xml:lang="ko">웹 브라우저</summary>
<summary xml:lang="nb">Nettleser</summary>
<summary xml:lang="nl">Webbrowser</summary>
<summary xml:lang="nn">Nettlesar</summary>
<summary xml:lang="no">Nettleser</summary>
<summary xml:lang="pl">Przeglądarka WWW</summary>
<summary xml:lang="pt">Navegador Web</summary>
<summary xml:lang="pt_BR">Navegador Web</summary>
<summary xml:lang="sk">Internetový prehliadač</summary>
<summary xml:lang="sv">Webbläsare</summary>
<description>
<p>
Bringing together all kinds of awesomeness to make browsing better for you.
Get to your favorite sites quickly even if you dont remember the URLs.
Type your term into the location bar (aka the Awesome Bar) and the autocomplete
function will include possible matches from your browsing history, bookmarked
sites and open tabs.
</p>
</description>
<url type="homepage">https://www.mozilla.org</url>
<update_contact>stransky@redhat.com</update_contact>
<kudos>
<kudo>ModernToolkit</kudo>
<kudo>SearchProvider</kudo>
</kudos>
<project_group>Mozilla</project_group>
<project_license>GPL-3.0+</project_license>
<developer_name>Mozilla Corporation</developer_name>
<url type="bugtracker">https://bugzilla.mozilla.org/</url>
<url type="help">https://support.mozilla.org/</url>
<translation type="gettext">firefox</translation>
<provides>
<id>firefox.desktop</id>
</provides>
<screenshots>
<screenshot type="default">https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/a.png</screenshot>
<screenshot>https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/b.png</screenshot>
<screenshot>https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/c.png</screenshot>
</screenshots>
<releases>
<release version="__VERSION__"/>
</releases>
</component>

274
firefox.desktop Normal file
View File

@ -0,0 +1,274 @@
[Desktop Entry]
Version=1.0
Name=Firefox
GenericName=Web Browser
GenericName[ca]=Navegador web
GenericName[cs]=Webový prohlížeč
GenericName[es]=Navegador web
GenericName[fa]=مرورگر اینترنتی
GenericName[fi]=WWW-selain
GenericName[fr]=Navigateur Web
GenericName[hu]=Webböngésző
GenericName[it]=Browser Web
GenericName[ja]=
GenericName[ko]=
GenericName[nb]=Nettleser
GenericName[nl]=Webbrowser
GenericName[nn]=Nettlesar
GenericName[no]=Nettleser
GenericName[pl]=Przeglądarka WWW
GenericName[pt]=Navegador Web
GenericName[pt_BR]=Navegador Web
GenericName[sk]=Internetový prehliadač
GenericName[sv]=Webbläsare
Comment=Browse the Web
Comment[ca]=Navegueu per el web
Comment[cs]=Prohlížení stránek World Wide Webu
Comment[de]=Im Internet surfen
Comment[es]=Navegue por la web
Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید
Comment[fi]=Selaa Internetin WWW-sivuja
Comment[fr]=Navigue sur Internet
Comment[hu]=A világháló böngészése
Comment[it]=Esplora il web
Comment[ja]=
Comment[ko]=
Comment[nb]=Surf på nettet
Comment[nl]=Verken het internet
Comment[nn]=Surf på nettet
Comment[no]=Surf på nettet
Comment[pl]=Przeglądanie stron WWW
Comment[pt]=Navegue na Internet
Comment[pt_BR]=Navegue na Internet
Comment[sk]=Prehliadanie internetu
Comment[sv]=Surfa på webben
Exec=firefox %u
Icon=firefox
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Categories=Network;WebBrowser;
Keywords=web;browser;internet;
Actions=new-window;new-private-window;profile-manager-window;
[Desktop Action new-window]
Name=Open a New Window
Name[ach]=Dirica manyen
Name[af]=Nuwe venster
Name[an]=Nueva finestra
Name[ar]=نافذة جديدة
Name[as]=
Name[ast]=Ventana nueva
Name[az]=Yeni Pəncərə
Name[be]=Новае акно
Name[bg]=Нов прозорец
Name[bn_BD]= (N)
Name[bn_IN]=
Name[br]=Prenestr nevez
Name[brx]= '(N)
Name[bs]=Novi prozor
Name[ca]=Finestra nova
Name[cak]=K'ak'a' tzuwäch
Name[cs]=Nové okno
Name[cy]=Ffenestr Newydd
Name[da]=Nyt vindue
Name[de]=Neues Fenster
Name[dsb]=Nowe wokno
Name[el]=Νέο παράθυρο
Name[en_GB]=New Window
Name[en_US]=New Window
Name[en_ZA]=New Window
Name[eo]=Nova fenestro
Name[es_AR]=Nueva ventana
Name[es_CL]=Nueva ventana
Name[es_ES]=Nueva ventana
Name[es_MX]=Nueva ventana
Name[et]=Uus aken
Name[eu]=Leiho berria
Name[fa]=پنجره جدید
Name[ff]=Henorde Hesere
Name[fi]=Uusi ikkuna
Name[fr]=Nouvelle fenêtre
Name[fy_NL]=Nij finster
Name[ga_IE]=Fuinneog Nua
Name[gd]=Uinneag ùr
Name[gl]=Nova xanela
Name[gn]=Ovetã pyahu
Name[gu_IN]= િ
Name[he]=חלון חדש
Name[hi_IN]= ि
Name[hr]=Novi prozor
Name[hsb]=Nowe wokno
Name[hu]=Új ablak
Name[hy_AM]=Նոր Պատուհան
Name[id]=Jendela Baru
Name[is]=Nýr gluggi
Name[it]=Nuova finestra
Name[ja]=
Name[ja_JP-mac]=
Name[ka]=
Name[kk]=Жаңа терезе
Name[km]=
Name[kn]= ಿಿ
Name[ko]=
Name[kok]=
Name[ks]=نئئ وِنڈو
Name[lij]=Neuvo barcon
Name[lo]=
Name[lt]=Naujas langas
Name[ltg]=Jauns lūgs
Name[lv]=Jauns logs
Name[mai]= ि
Name[mk]=Нов прозорец
Name[ml]=ി
Name[mr]=
Name[ms]=Tetingkap Baru
Name[my]=
Name[nb_NO]=Nytt vindu
Name[ne_NP]=
Name[nl]=Nieuw venster
Name[nn_NO]=Nytt vindauge
Name[or]= ି
Name[pa_IN]= ਿ
Name[pl]=Nowe okno
Name[pt_BR]=Nova janela
Name[pt_PT]=Nova janela
Name[rm]=Nova fanestra
Name[ro]=Fereastră nouă
Name[ru]=Новое окно
Name[sat]= ि (N)
Name[si]=
Name[sk]=Nové okno
Name[sl]=Novo okno
Name[son]=Zanfun taaga
Name[sq]=Dritare e Re
Name[sr]=Нови прозор
Name[sv_SE]=Nytt fönster
Name[ta]=ி
Name[te]= ి
Name[th]=
Name[tr]=Yeni pencere
Name[tsz]=Eraatarakua jimpani
Name[uk]=Нове вікно
Name[ur]=نیا دریچہ
Name[uz]=Yangi oyna
Name[vi]=Ca s mi
Name[wo]=Palanteer bu bees
Name[xh]=Ifestile entsha
Name[zh_CN]=
Name[zh_TW]=
Exec=firefox --new-window %u
[Desktop Action new-private-window]
Name=Open a New Private Window
Name[ach]=Dirica manyen me mung
Name[af]=Nuwe privaatvenster
Name[an]=Nueva finestra privada
Name[ar]=نافذة خاصة جديدة
Name[as]= ি
Name[ast]=Ventana privada nueva
Name[az]=Yeni Məxfi Pəncərə
Name[be]=Новае акно адасаблення
Name[bg]=Нов прозорец за поверително сърфиране
Name[bn_BD]= ি
Name[bn_IN]= ি
Name[br]=Prenestr merdeiñ prevez nevez
Name[brx]= '
Name[bs]=Novi privatni prozor
Name[ca]=Finestra privada nova
Name[cak]=K'ak'a' ichinan tzuwäch
Name[cs]=Nové anonymní okno
Name[cy]=Ffenestr Breifat Newydd
Name[da]=Nyt privat vindue
Name[de]=Neues privates Fenster
Name[dsb]=Nowe priwatne wokno
Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης
Name[en_GB]=New Private Window
Name[en_US]=New Private Window
Name[en_ZA]=New Private Window
Name[eo]=Nova privata fenestro
Name[es_AR]=Nueva ventana privada
Name[es_CL]=Nueva ventana privada
Name[es_ES]=Nueva ventana privada
Name[es_MX]=Nueva ventana privada
Name[et]=Uus privaatne aken
Name[eu]=Leiho pribatu berria
Name[fa]=پنجره ناشناس جدید
Name[ff]=Henorde Suturo Hesere
Name[fi]=Uusi yksityinen ikkuna
Name[fr]=Nouvelle fenêtre de navigation privée
Name[fy_NL]=Nij priveefinster
Name[ga_IE]=Fuinneog Nua Phríobháideach
Name[gd]=Uinneag phrìobhaideach ùr
Name[gl]=Nova xanela privada
Name[gn]=Ovetã ñemi pyahu
Name[gu_IN]= િ
Name[he]=חלון פרטי חדש
Name[hi_IN]= ि ि
Name[hr]=Novi privatni prozor
Name[hsb]=Nowe priwatne wokno
Name[hu]=Új privát ablak
Name[hy_AM]=Սկսել Գաղտնի դիտարկում
Name[id]=Jendela Mode Pribadi Baru
Name[is]=Nýr huliðsgluggi
Name[it]=Nuova finestra anonima
Name[ja]=
Name[ja_JP-mac]=
Name[ka]=
Name[kk]=Жаңа жекелік терезе
Name[km]=
Name[kn]= ಿ ಿಿ
Name[ko]=
Name[kok]= ि
Name[ks]=نْو پرایوٹ وینڈو&amp;
Name[lij]=Neuvo barcon privou
Name[lo]=
Name[lt]=Naujas privataus naršymo langas
Name[ltg]=Jauns privatais lūgs
Name[lv]=Jauns privātais logs
Name[mai]= ि ि (W)
Name[mk]=Нов приватен прозорец
Name[ml]=ി
Name[mr]= ि
Name[ms]=Tetingkap Persendirian Baharu
Name[my]=New Private Window
Name[nb_NO]=Nytt privat vindu
Name[ne_NP]= ि
Name[nl]=Nieuw privévenster
Name[nn_NO]=Nytt privat vindauge
Name[or]= ି ି
Name[pa_IN]= ਿ
Name[pl]=Nowe okno prywatne
Name[pt_BR]=Nova janela privativa
Name[pt_PT]=Nova janela privada
Name[rm]=Nova fanestra privata
Name[ro]=Fereastră privată nouă
Name[ru]=Новое приватное окно
Name[sat]= ि ि (W )
Name[si]= (W)
Name[sk]=Nové okno v režime Súkromné prehliadanie
Name[sl]=Novo zasebno okno
Name[son]=Sutura zanfun taaga
Name[sq]=Dritare e Re Private
Name[sr]=Нови приватан прозор
Name[sv_SE]=Nytt privat fönster
Name[ta]=ி ி
Name[te]= ి ి
Name[th]=
Name[tr]=Yeni gizli pencere
Name[tsz]=Juchiiti eraatarakua jimpani
Name[uk]=Приватне вікно
Name[ur]=نیا نجی دریچہ
Name[uz]=Yangi maxfiy oyna
Name[vi]=Ca s riêng tư mi
Name[wo]=Panlanteeru biir bu bees
Name[xh]=Ifestile yangasese entsha
Name[zh_CN]=
Name[zh_TW]=
Exec=firefox --private-window %u
[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Name[cs]=Správa profilů
Exec=firefox --ProfileManager

279
firefox.sh.in Normal file
View File

@ -0,0 +1,279 @@
#!/usr/bin/bash
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
##
## Usage:
##
## $ firefox
##
## This script is meant to run a mozilla program from the mozilla
## rpm installation.
##
## The script will setup all the environment voodoo needed to make
## mozilla work.
cmdname=`basename $0`
##
## Variables
##
MOZ_ARCH=$(uname -m)
case $MOZ_ARCH in
x86_64 | s390x | sparc64)
MOZ_LIB_DIR="/__PREFIX__/lib64"
SECONDARY_LIB_DIR="/__PREFIX__/lib"
;;
* )
MOZ_LIB_DIR="/__PREFIX__/lib"
SECONDARY_LIB_DIR="/__PREFIX__/lib64"
;;
esac
MOZ_FIREFOX_FILE="firefox"
if [ ! -r $MOZ_LIB_DIR/firefox/$MOZ_FIREFOX_FILE ]; then
if [ ! -r $SECONDARY_LIB_DIR/firefox/$MOZ_FIREFOX_FILE ]; then
echo "Error: $MOZ_LIB_DIR/firefox/$MOZ_FIREFOX_FILE not found"
if [ -d $SECONDARY_LIB_DIR ]; then
echo " $SECONDARY_LIB_DIR/firefox/$MOZ_FIREFOX_FILE not found"
fi
exit 1
fi
MOZ_LIB_DIR="$SECONDARY_LIB_DIR"
fi
MOZ_DIST_BIN="$MOZ_LIB_DIR/firefox"
MOZ_LANGPACKS_DIR="$MOZ_DIST_BIN/langpacks"
MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
MOZ_PROGRAM="$MOZ_DIST_BIN/$MOZ_FIREFOX_FILE"
MOZ_LAUNCHER="$MOZ_DIST_BIN/run-mozilla.sh"
##
## Enable Wayland backend?
##
if __DEFAULT_WAYLAND__ && ! [ $MOZ_DISABLE_WAYLAND ]; then
if [ "$XDG_CURRENT_DESKTOP" == "GNOME" ]; then
export MOZ_ENABLE_WAYLAND=1
fi
fi
##
## Use D-Bus remote exclusively when there's Wayland display.
##
if [ "$WAYLAND_DISPLAY" ]; then
export MOZ_DBUS_REMOTE=1
fi
##
## Set MOZ_GRE_CONF
##
MOZ_GRE_CONF=/etc/gre.d/gre.conf
if [ "$MOZ_LIB_DIR" == "/__PREFIX__/lib64" ]; then
MOZ_GRE_CONF=/etc/gre.d/gre64.conf
fi
export MOZ_GRE_CONF
##
## Set MOZILLA_FIVE_HOME
##
MOZILLA_FIVE_HOME="$MOZ_DIST_BIN"
export MOZILLA_FIVE_HOME
##
## Make sure that we set the plugin path
##
MOZ_PLUGIN_DIR="plugins"
if [ "$MOZ_PLUGIN_PATH" ]
then
MOZ_PLUGIN_PATH=$MOZ_PLUGIN_PATH:$MOZ_LIB_DIR/mozilla/$MOZ_PLUGIN_DIR:$MOZ_DIST_BIN/$MOZ_PLUGIN_DIR
else
MOZ_PLUGIN_PATH=$MOZ_LIB_DIR/mozilla/$MOZ_PLUGIN_DIR:$MOZ_DIST_BIN/$MOZ_PLUGIN_DIR
fi
export MOZ_PLUGIN_PATH
##
## Set MOZ_APP_LAUNCHER for gnome-session
##
export MOZ_APP_LAUNCHER="/__PREFIX__/bin/firefox"
##
## Set FONTCONFIG_PATH for Xft/fontconfig
##
FONTCONFIG_PATH="/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft"
export FONTCONFIG_PATH
##
## In order to better support certain scripts (such as Indic and some CJK
## scripts), Fedora builds its Firefox, with permission from the Mozilla
## Corporation, with the Pango system as its text renderer. This change
## may negatively impact performance on some pages. To disable the use of
## Pango, set MOZ_DISABLE_PANGO=1 in your environment before launching
## Firefox.
##
#
# MOZ_DISABLE_PANGO=1
# export MOZ_DISABLE_PANGO
#
##
## Disable the GNOME crash dialog, Moz has it's own
##
GNOME_DISABLE_CRASH_DIALOG=1
export GNOME_DISABLE_CRASH_DIALOG
##
## Disable the SLICE allocator (rhbz#1014858)
##
export G_SLICE=always-malloc
##
## Enable Xinput2 (mozbz#1207973)
##
export MOZ_USE_XINPUT2=1
# OK, here's where all the real work gets done
##
## To disable the use of Firefox localization, set MOZ_DISABLE_LANGPACKS=1
## in your environment before launching Firefox.
##
#
# MOZ_DISABLE_LANGPACKS=1
# export MOZ_DISABLE_LANGPACKS
#
##
## Automatically installed langpacks are tracked by .fedora-langpack-install
## config file.
##
FEDORA_LANGPACK_CONFIG="$MOZ_EXTENSIONS_PROFILE_DIR/.fedora-langpack-install"
# MOZ_DISABLE_LANGPACKS disables language packs completely
MOZILLA_DOWN=0
if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then
if [ -x $MOZ_DIST_BIN/$MOZ_FIREFOX_FILE ]; then
# Is firefox running?
/__PREFIX__/bin/pidof $MOZ_PROGRAM > /dev/null 2>&1
MOZILLA_DOWN=$?
fi
fi
# When Firefox is not running, restore SELinux labels for profile files
# (rhbz#1731371)
if [ $MOZILLA_DOWN -ne 0 ]; then
if [ `getenforce` != "Disabled" ]; then
restorecon -vr ~/.mozilla/firefox/* &
fi
fi
# Modify language pack configuration only when firefox is not running
# and language packs are not disabled
if [ $MOZILLA_DOWN -ne 0 ]; then
# Clear already installed langpacks
mkdir -p $MOZ_EXTENSIONS_PROFILE_DIR
if [ -f $FEDORA_LANGPACK_CONFIG ]; then
rm `cat $FEDORA_LANGPACK_CONFIG` > /dev/null 2>&1
rm $FEDORA_LANGPACK_CONFIG > /dev/null 2>&1
# remove all empty langpacks dirs while they block installation of langpacks
rmdir $MOZ_EXTENSIONS_PROFILE_DIR/langpack* > /dev/null 2>&1
fi
# Get locale from system
CURRENT_LOCALE=$LC_ALL
CURRENT_LOCALE=${CURRENT_LOCALE:-$LC_MESSAGES}
CURRENT_LOCALE=${CURRENT_LOCALE:-$LANG}
# Try with a local variant first, then without a local variant
SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g" | sed "s|\..*||g"`
MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g" | sed "s|\..*||g"`
function create_langpack_link() {
local language=$*
local langpack=langpack-${language}@firefox.mozilla.org.xpi
if [ -f $MOZ_LANGPACKS_DIR/$langpack ]; then
rm -rf $MOZ_EXTENSIONS_PROFILE_DIR/$langpack
# If the target file is a symlink (the fallback langpack),
# install the original file instead of the fallback one
if [ -h $MOZ_LANGPACKS_DIR/$langpack ]; then
langpack=`readlink $MOZ_LANGPACKS_DIR/$langpack`
fi
ln -s $MOZ_LANGPACKS_DIR/$langpack \
$MOZ_EXTENSIONS_PROFILE_DIR/$langpack
echo $MOZ_EXTENSIONS_PROFILE_DIR/$langpack > $FEDORA_LANGPACK_CONFIG
return 0
fi
return 1
}
create_langpack_link $MOZLOCALE || create_langpack_link $SHORTMOZLOCALE || true
fi
# BEAST fix (rhbz#1005611)
NSS_SSL_CBC_RANDOM_IV=${NSS_SSL_CBC_RANDOM_IV-1}
export NSS_SSL_CBC_RANDOM_IV
# Prepare command line arguments
script_args=""
pass_arg_count=0
while [ $# -gt $pass_arg_count ]
do
case "$1" in
-g | --debug)
script_args="$script_args -g"
debugging=1
shift
;;
-d | --debugger)
if [ $# -gt 1 ]; then
script_args="$script_args -d $2"
shift 2
else
shift
fi
;;
*)
# Move the unrecognized argument to the end of the list.
arg="$1"
shift
set -- "$@" "$arg"
pass_arg_count=`expr $pass_arg_count + 1`
;;
esac
done
# Flatpak specific environment variables
%FLATPAK_ENV_VARS%
# Don't throw "old profile" dialog box.
export MOZ_ALLOW_DOWNGRADE=1
# Run the browser
debugging=0
if [ $debugging = 1 ]
then
echo $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@"
fi
exec $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@"

1319
firefox.spec Normal file

File diff suppressed because it is too large Load Diff

32
gen_cbindgen-vendor.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
set -x
# Dummy Cargo.toml file with cbindgen dependency
cat > Cargo.toml <<EOL
[package]
name = "dummy"
version = "0.0.1"
description = """
This is a dummy package which contains dependency on cbindgen
to be used with 'cargo vendor' commmand.
"""
[dependencies]
cbindgen = "0.14.1"
[[bin]]
name = "dummy"
path = "dummy.rs"
doc = false
EOL
cargo install cargo-vendor
cargo vendor
cd vendor
tar -cJf ../cbindgen-vendor.tar.xz *
cd ..
rm -f Cargo.toml
rm -rf vendor

1
google-api-key Normal file
View File

@ -0,0 +1 @@
AIzaSyBPGXa4AYD4FC3HJK7LnIKxm4fDusVuuco

1
google-loc-api-key Normal file
View File

@ -0,0 +1 @@
AIzaSyB2h2OuRcUgy5N-5hsZqiPW6sH3n_rptiQ

99
mozilla-1170092.patch Normal file
View File

@ -0,0 +1,99 @@
diff -up firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp
--- firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2020-04-03 21:34:41.000000000 +0200
+++ firefox-75.0/extensions/pref/autoconfig/src/nsReadConfig.cpp 2020-04-06 22:40:02.760674871 +0200
@@ -244,8 +244,20 @@ nsresult nsReadConfig::openAndEvaluateJS
if (NS_FAILED(rv)) return rv;
rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile);
- if (NS_FAILED(rv)) return rv;
+ if (NS_FAILED(rv)) {
+ // Look for cfg file in /etc/<application>/pref
+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR,
+ getter_AddRefs(jsFile));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ rv = jsFile->AppendNative(nsLiteralCString("pref"));
+ NS_ENSURE_SUCCESS(rv, rv);
+ rv = jsFile->AppendNative(nsDependentCString(aFileName));
+ NS_ENSURE_SUCCESS(rv, rv);
+ rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile);
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
} else {
nsAutoCString location("resource://gre/defaults/autoconfig/");
location += aFileName;
diff -up firefox-75.0/modules/libpref/Preferences.cpp.1170092 firefox-75.0/modules/libpref/Preferences.cpp
--- firefox-75.0/modules/libpref/Preferences.cpp.1170092 2020-04-06 22:40:02.761674865 +0200
+++ firefox-75.0/modules/libpref/Preferences.cpp 2020-04-06 22:40:57.675325227 +0200
@@ -4468,6 +4468,9 @@ nsresult Preferences::InitInitialObjects
//
// Thus, in the omni.jar case, we always load app-specific default
// preferences from omni.jar, whether or not `$app == $gre`.
+ //
+ // At very end load configuration from system config location:
+ // - /etc/firefox/pref/*.js
nsresult rv = NS_ERROR_FAILURE;
UniquePtr<nsZipFind> find;
diff -up firefox-75.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-75.0/toolkit/xre/nsXREDirProvider.cpp
--- firefox-75.0/toolkit/xre/nsXREDirProvider.cpp.1170092 2020-04-03 21:35:39.000000000 +0200
+++ firefox-75.0/toolkit/xre/nsXREDirProvider.cpp 2020-04-06 22:40:02.761674865 +0200
@@ -60,6 +60,7 @@
#endif
#ifdef XP_UNIX
# include <ctype.h>
+# include "nsIXULAppInfo.h"
#endif
#ifdef XP_IOS
# include "UIKitDirProvider.h"
@@ -533,6 +534,21 @@ nsXREDirProvider::GetFile(const char* aP
}
}
}
+
+#if defined(XP_UNIX)
+ if (!strcmp(aProperty, NS_APP_PREFS_SYSTEM_CONFIG_DIR)) {
+ nsCString sysConfigDir = nsLiteralCString("/etc/");
+ nsCOMPtr<nsIXULAppInfo> appInfo = do_GetService("@mozilla.org/xre/app-info;1");
+ if (!appInfo)
+ return NS_ERROR_NOT_AVAILABLE;
+ nsCString appName;
+ appInfo->GetName(appName);
+ ToLowerCase(appName);
+ sysConfigDir.Append(appName);
+ return NS_NewNativeLocalFile(sysConfigDir, false, aFile);
+ }
+#endif
+
if (NS_FAILED(rv) || !file) return NS_ERROR_FAILURE;
if (ensureFilePermissions) {
@@ -845,6 +861,16 @@ nsresult nsXREDirProvider::GetFilesInter
LoadDirIntoArray(mXULAppDir, kAppendPrefDir, directories);
+ // Add /etc/<application>/pref/ directory if it exists
+ nsCOMPtr<nsIFile> systemPrefDir;
+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR,
+ getter_AddRefs(systemPrefDir));
+ if (NS_SUCCEEDED(rv)) {
+ rv = systemPrefDir->AppendNative(nsLiteralCString("pref"));
+ if (NS_SUCCEEDED(rv))
+ directories.AppendObject(systemPrefDir);
+ }
+
rv = NS_NewArrayEnumerator(aResult, directories, NS_GET_IID(nsIFile));
} else if (!strcmp(aProperty, NS_APP_CHROME_DIR_LIST)) {
// NS_APP_CHROME_DIR_LIST is only used to get default (native) icons
diff -up firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h
--- firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2020-04-03 21:35:39.000000000 +0200
+++ firefox-75.0/xpcom/io/nsAppDirectoryServiceDefs.h 2020-04-06 22:40:02.761674865 +0200
@@ -60,6 +60,7 @@
#define NS_APP_PREFS_DEFAULTS_DIR_LIST "PrefDL"
#define NS_APP_PREFS_OVERRIDE_DIR \
"PrefDOverride" // Directory for per-profile defaults
+#define NS_APP_PREFS_SYSTEM_CONFIG_DIR "PrefSysConf" // Directory with system-wide configuration
#define NS_APP_USER_PROFILE_50_DIR "ProfD"
#define NS_APP_USER_PROFILE_LOCAL_50_DIR "ProfLD"

13
mozilla-1196777.patch Normal file
View File

@ -0,0 +1,13 @@
diff -up firefox-80.0/widget/gtk/nsWindow.cpp.1196777 firefox-80.0/widget/gtk/nsWindow.cpp
--- firefox-80.0/widget/gtk/nsWindow.cpp.1196777 2020-08-18 09:47:18.662833910 +0200
+++ firefox-80.0/widget/gtk/nsWindow.cpp 2020-08-18 09:48:19.437478136 +0200
@@ -158,7 +158,8 @@ const gint kEvents =
GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK | GDK_VISIBILITY_NOTIFY_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK |
- GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK;
+ GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK |
+ GDK_FOCUS_CHANGE_MASK;
#if !GTK_CHECK_VERSION(3, 22, 0)
typedef enum {

16
mozilla-1516803.patch Normal file
View File

@ -0,0 +1,16 @@
diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build
--- a/security/sandbox/linux/moz.build
+++ b/security/sandbox/linux/moz.build
@@ -99,9 +99,8 @@
# gcc lto likes to put the top level asm in syscall.cc in a different partition
# from the function using it which breaks the build. Work around that by
# forcing there to be only one partition.
-for f in CONFIG['OS_CXXFLAGS']:
- if f.startswith('-flto') and CONFIG['CC_TYPE'] != 'clang':
- LDFLAGS += ['--param lto-partitions=1']
+if CONFIG['CC_TYPE'] != 'clang':
+ LDFLAGS += ['--param', 'lto-partitions=1']
DEFINES['NS_NO_XPCOM'] = True
DisableStlWrapping()

20
mozilla-1634404.patch Normal file
View File

@ -0,0 +1,20 @@
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1593,7 +1593,14 @@
// Get anchor rectangle
LayoutDeviceIntRect anchorRect(0, 0, 0, 0);
nsMenuPopupFrame* popupFrame = GetMenuPopupFrame(GetFrame());
- int32_t p2a = AppUnitsPerCSSPixel() / gfxPlatformGtk::GetFontScaleFactor();
+
+ int32_t p2a;
+ double devPixelsPerCSSPixel = StaticPrefs::layout_css_devPixelsPerPx();
+ if (devPixelsPerCSSPixel > 0.0) {
+ p2a = AppUnitsPerCSSPixel() / devPixelsPerCSSPixel * GdkScaleFactor();
+ } else {
+ p2a = AppUnitsPerCSSPixel() / gfxPlatformGtk::GetFontScaleFactor();
+ }
if (popupFrame) {
#ifdef MOZ_WAYLAND
anchorRect = LayoutDeviceIntRect::FromAppUnitsToOutside(

18
mozilla-1640567.patch Normal file
View File

@ -0,0 +1,18 @@
diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -1422,11 +1422,9 @@
!GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
screenPoint = nsPoint(anchorRect.x, anchorRect.y);
mAnchorRect = anchorRect;
- } else
+ }
#endif
- {
- screenPoint = AdjustPositionForAnchorAlign(anchorRect, hFlip, vFlip);
- }
+ screenPoint = AdjustPositionForAnchorAlign(anchorRect, hFlip, vFlip);
} else {
// with no anchor, the popup is positioned relative to the root frame
anchorRect = rootScreenRect;

16
mozilla-1640982.patch Normal file
View File

@ -0,0 +1,16 @@
diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
--- a/config/makefiles/rust.mk
+++ b/config/makefiles/rust.mk
@@ -61,7 +61,11 @@
# Enable link-time optimization for release builds, but not when linking
# gkrust_gtest.
ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+# Pass -Clto for older versions of rust, and CARGO_PROFILE_RELEASE_LTO=true
+# for newer ones that support it. Combining the latter with -Clto works, so
+# set both everywhere.
cargo_rustc_flags += -Clto
+export CARGO_PROFILE_RELEASE_LTO=true
endif
endif
endif

67
mozilla-1645671.patch Normal file
View File

@ -0,0 +1,67 @@
changeset: 544864:a8603f131703
tag: tip
parent: 544861:161920b70ae4
user: Martin Stransky <stransky@redhat.com>
date: Fri Jul 31 13:39:48 2020 +0200
files: dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
description:
Bug 1645671 [Linux/VA-API] Create DMABufSurfaceWrapper directly at nsTAttay and disable DMABufSurfaceWrapper class copy and assignment constructors, r?jya
When DMABufSurfaceWrapper is added to nsTArray, a temporary local DMABufSurfaceWrapper object is created. When the temporary
object is deleted after the adding, associated dmabuf data is released which leads to rendering artifact during VA-API video playback.
As a fix in this patch we create DMABufSurfaceWrapper 'in-place' at nsTAttay.
We also disable DMABufSurfaceWrapper class copy and assignment constructors to avoid similar potential issues.
Differential Revision: https://phabricator.services.mozilla.com/D85152
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -777,17 +777,17 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
RESULT_DETAIL("Unable to get DMABufSurfaceYUV"));
}
# ifdef MOZ_LOGGING
static int uid = 0;
surface->SetUID(++uid);
FFMPEG_LOG("Created new DMABufSurface UID = %d", uid);
# endif
- mDMABufSurfaces.AppendElement(DMABufSurfaceWrapper(surface, mLib));
+ mDMABufSurfaces.EmplaceBack(surface, mLib);
surfaceWrapper = &(mDMABufSurfaces[mDMABufSurfaces.Length() - 1]);
} else {
surface = surfaceWrapper->GetDMABufSurface();
bool ret;
if (mVAAPIDeviceContext) {
ret = surface->UpdateYUVData(vaDesc);
} else {
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
@@ -70,16 +70,22 @@ class DMABufSurfaceWrapper final {
// Check if DMABufSurface is used by any gecko rendering process
// (WebRender or GL compositor) or by DMABUFSurfaceImage/VideoData.
bool IsUsed() const { return mSurface->IsGlobalRefSet(); }
RefPtr<DMABufSurfaceYUV> GetDMABufSurface() const {
return mSurface->GetAsDMABufSurfaceYUV();
}
+ // Don't allow DMABufSurfaceWrapper plain copy as it leads to
+ // enexpected DMABufSurface/HW buffer releases and we don't want to
+ // deep copy them.
+ DMABufSurfaceWrapper(const DMABufSurfaceWrapper&) = delete;
+ const DMABufSurfaceWrapper& operator=(DMABufSurfaceWrapper const&) = delete;
+
private:
const RefPtr<DMABufSurface> mSurface;
const FFmpegLibWrapper* mLib;
AVBufferRef* mAVHWFramesContext;
AVBufferRef* mHWAVBuffer;
};
#endif

15
mozilla-1656505-1.patch Normal file
View File

@ -0,0 +1,15 @@
diff --git a/widget/gtk/DMABufLibWrapper.cpp b/widget/gtk/DMABufLibWrapper.cpp
--- a/widget/gtk/DMABufLibWrapper.cpp
+++ b/widget/gtk/DMABufLibWrapper.cpp
@@ -149,8 +149,8 @@
}
nsDMABufDevice::nsDMABufDevice()
- : mXRGBFormat({true, false, GBM_FORMAT_ARGB8888, nullptr, 0}),
- mARGBFormat({true, true, GBM_FORMAT_XRGB8888, nullptr, 0}),
+ : mXRGBFormat({true, false, GBM_FORMAT_XRGB8888, nullptr, 0}),
+ mARGBFormat({true, true, GBM_FORMAT_ARGB8888, nullptr, 0}),
mGbmDevice(nullptr),
mGbmFd(-1),
mGdmConfigured(false),

113
mozilla-1656505-2.patch Normal file
View File

@ -0,0 +1,113 @@
diff -up firefox-81.0/gfx/gl/SharedSurfaceDMABUF.cpp.1656505-2 firefox-81.0/gfx/gl/SharedSurfaceDMABUF.cpp
--- firefox-81.0/gfx/gl/SharedSurfaceDMABUF.cpp.1656505-2 2020-09-15 03:48:28.000000000 +0200
+++ firefox-81.0/gfx/gl/SharedSurfaceDMABUF.cpp 2020-09-15 18:13:03.683458125 +0200
@@ -63,6 +63,8 @@ UniquePtr<SurfaceFactory_DMABUF> Surface
return dmabufFactory;
}
+ LOGDMABUF(
+ ("SurfaceFactory_DMABUF::Create() failed, fallback to SW buffers.\n"));
gfxPlatformGtk::GetPlatform()->DisableDMABufWebGL();
return nullptr;
}
diff -up firefox-81.0/widget/gtk/DMABufSurface.cpp.1656505-2 firefox-81.0/widget/gtk/DMABufSurface.cpp
--- firefox-81.0/widget/gtk/DMABufSurface.cpp.1656505-2 2020-09-15 03:48:38.000000000 +0200
+++ firefox-81.0/widget/gtk/DMABufSurface.cpp 2020-09-15 18:13:03.683458125 +0200
@@ -26,6 +26,7 @@
#include "GLContextTypes.h" // for GLContext, etc
#include "GLContextEGL.h"
#include "GLContextProvider.h"
+#include "ScopedGLHelpers.h"
#include "mozilla/layers/LayersSurfaces.h"
@@ -320,6 +321,9 @@ bool DMABufSurfaceRGBA::Create(int aWidt
mWidth = aWidth;
mHeight = aHeight;
+ LOGDMABUF(("DMABufSurfaceRGBA::Create() UID %d size %d x %d\n", mUID, mWidth,
+ mHeight));
+
mGmbFormat = GetDMABufDevice()->GetGbmFormat(mSurfaceFlags & DMABUF_ALPHA);
if (!mGmbFormat) {
// Requested DRM format is not supported.
@@ -329,6 +333,7 @@ bool DMABufSurfaceRGBA::Create(int aWidt
bool useModifiers = (aDMABufSurfaceFlags & DMABUF_USE_MODIFIERS) &&
mGmbFormat->mModifiersCount > 0;
if (useModifiers) {
+ LOGDMABUF((" Creating with modifiers\n"));
mGbmBufferObject[0] = nsGbmLib::CreateWithModifiers(
GetDMABufDevice()->GetGbmDevice(), mWidth, mHeight, mGmbFormat->mFormat,
mGmbFormat->mModifiers, mGmbFormat->mModifiersCount);
@@ -360,6 +365,7 @@ bool DMABufSurfaceRGBA::Create(int aWidt
}
if (!mGbmBufferObject[0]) {
+ LOGDMABUF((" Failed to create GbmBufferObject\n"));
return false;
}
@@ -429,6 +435,8 @@ void DMABufSurfaceRGBA::ImportSurfaceDes
if (desc.refCount().Length() > 0) {
GlobalRefCountImport(desc.refCount()[0].ClonePlatformHandle().release());
}
+
+ LOGDMABUF(("DMABufSurfaceRGBA::Import() UID %d\n", mUID));
}
bool DMABufSurfaceRGBA::Create(const SurfaceDescriptor& aDesc) {
@@ -448,6 +456,8 @@ bool DMABufSurfaceRGBA::Serialize(
AutoTArray<ipc::FileDescriptor, 1> fenceFDs;
AutoTArray<ipc::FileDescriptor, 1> refCountFDs;
+ LOGDMABUF(("DMABufSurfaceRGBA::Serialize() UID %d\n", mUID));
+
width.AppendElement(mWidth);
height.AppendElement(mHeight);
format.AppendElement(mGmbFormat->mFormat);
@@ -469,7 +479,6 @@ bool DMABufSurfaceRGBA::Serialize(
SurfaceDescriptorDMABuf(mSurfaceType, mBufferModifier, mGbmBufferFlags,
fds, width, height, format, strides, offsets,
GetYUVColorSpace(), fenceFDs, mUID, refCountFDs);
-
return true;
}
@@ -556,7 +565,7 @@ bool DMABufSurfaceRGBA::CreateTexture(GL
aGLContext->MakeCurrent();
aGLContext->fGenTextures(1, &mTexture);
- aGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexture);
+ const ScopedBindTexture savedTex(aGLContext, mTexture);
aGLContext->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_S,
LOCAL_GL_CLAMP_TO_EDGE);
aGLContext->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_T,
@@ -567,6 +576,7 @@ bool DMABufSurfaceRGBA::CreateTexture(GL
LOCAL_GL_LINEAR);
aGLContext->fEGLImageTargetTexture2D(LOCAL_GL_TEXTURE_2D, mEGLImage);
mGL = aGLContext;
+
return true;
}
@@ -611,6 +621,10 @@ void* DMABufSurface::MapInternal(uint32_
return nullptr;
}
+ LOGDMABUF(
+ ("DMABufSurfaceRGBA::MapInternal() UID %d size %d x %d -> %d x %d\n",
+ mUID, aX, aY, aWidth, aHeight));
+
mMappedRegionStride[aPlane] = 0;
mMappedRegionData[aPlane] = nullptr;
mMappedRegion[aPlane] = nsGbmLib::Map(
@@ -988,7 +1002,7 @@ bool DMABufSurfaceYUV::CreateTexture(GLC
aGLContext->MakeCurrent();
aGLContext->fGenTextures(1, &mTexture[aPlane]);
- aGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexture[aPlane]);
+ const ScopedBindTexture savedTex(aGLContext, mTexture[aPlane]);
aGLContext->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_S,
LOCAL_GL_CLAMP_TO_EDGE);
aGLContext->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_T,

213
mozilla-1656727.patch Normal file
View File

@ -0,0 +1,213 @@
diff -up firefox-81.0.1/widget/gtk/WindowSurfaceWayland.cpp.1656727 firefox-81.0.1/widget/gtk/WindowSurfaceWayland.cpp
--- firefox-81.0.1/widget/gtk/WindowSurfaceWayland.cpp.1656727 2020-10-08 11:35:41.921508799 +0200
+++ firefox-81.0.1/widget/gtk/WindowSurfaceWayland.cpp 2020-10-08 11:37:05.036686876 +0200
@@ -158,7 +158,6 @@ We allocate shared memory (shm) by mmap(
between us and wayland compositor. We draw our graphics data to the shm and
handle to wayland compositor by WindowBackBuffer/WindowSurfaceWayland
(wl_buffer/wl_surface).
-
*/
#define EVENT_LOOP_DELAY (1000 / 240)
@@ -166,6 +165,44 @@ handle to wayland compositor by WindowBa
#define BUFFER_BPP 4
gfx::SurfaceFormat WindowBackBuffer::mFormat = gfx::SurfaceFormat::B8G8R8A8;
+static mozilla::Mutex* gDelayedCommitLock = nullptr;
+static GList* gDelayedCommits = nullptr;
+
+static void DelayedCommitsEnsureMutext() {
+ if (!gDelayedCommitLock) {
+ gDelayedCommitLock = new mozilla::Mutex("DelayedCommit lock");
+ }
+}
+
+static bool DelayedCommitsCheckAndRemoveSurface(
+ WindowSurfaceWayland* aSurface) {
+ MutexAutoLock lock(*gDelayedCommitLock);
+ GList* foundCommit = g_list_find(gDelayedCommits, aSurface);
+ if (foundCommit) {
+ gDelayedCommits = g_list_delete_link(gDelayedCommits, foundCommit);
+ }
+ return foundCommit != nullptr;
+}
+
+static bool DelayedCommitsCheckAndAddSurface(WindowSurfaceWayland* aSurface) {
+ MutexAutoLock lock(*gDelayedCommitLock);
+ GList* foundCommit = g_list_find(gDelayedCommits, aSurface);
+ if (!foundCommit) {
+ gDelayedCommits = g_list_prepend(gDelayedCommits, aSurface);
+ }
+ return foundCommit == nullptr;
+}
+
+// When a new window is created we may not have a valid wl_surface
+// for drawing (Gtk haven't created it yet). All commits are queued
+// and CommitWaylandBuffer() is called by timer when wl_surface is ready
+// for drawing.
+static void WaylandBufferDelayCommitHandler(WindowSurfaceWayland* aSurface) {
+ if (DelayedCommitsCheckAndRemoveSurface(aSurface)) {
+ aSurface->CommitWaylandBuffer();
+ }
+}
+
nsWaylandDisplay* WindowBackBuffer::GetWaylandDisplay() {
return mWindowSurfaceWayland->GetWaylandDisplay();
}
@@ -398,7 +435,6 @@ WindowSurfaceWayland::WindowSurfaceWayla
mWaylandFullscreenDamage(false),
mFrameCallback(nullptr),
mLastCommittedSurface(nullptr),
- mDelayedCommitHandle(nullptr),
mLastCommitTime(0),
mDrawToWaylandBufferDirectly(true),
mCanSwitchWaylandBuffer(true),
@@ -410,6 +446,7 @@ WindowSurfaceWayland::WindowSurfaceWayla
for (int i = 0; i < BACK_BUFFER_NUM; i++) {
mShmBackupBuffer[i] = nullptr;
}
+ DelayedCommitsEnsureMutext();
}
WindowSurfaceWayland::~WindowSurfaceWayland() {
@@ -417,12 +454,9 @@ WindowSurfaceWayland::~WindowSurfaceWayl
NS_WARNING("Deleted WindowSurfaceWayland with a pending commit!");
}
- if (mDelayedCommitHandle) {
- // Delete reference to this to prevent WaylandBufferDelayCommitHandler()
- // operate on released this. mDelayedCommitHandle itself will
- // be released at WaylandBufferDelayCommitHandler().
- *mDelayedCommitHandle = nullptr;
- }
+ // Delete reference to this to prevent WaylandBufferDelayCommitHandler()
+ // operate on released this.
+ DelayedCommitsCheckAndRemoveSurface(this);
if (mFrameCallback) {
wl_callback_destroy(mFrameCallback);
@@ -863,23 +897,11 @@ bool WindowSurfaceWayland::CommitImageCa
return true;
}
-static void WaylandBufferDelayCommitHandler(WindowSurfaceWayland** aSurface) {
- if (*aSurface) {
- (*aSurface)->DelayedCommitHandler();
- } else {
- // Referenced WindowSurfaceWayland is already deleted.
- // Do nothing but just release the mDelayedCommitHandle allocated at
- // WindowSurfaceWayland::CommitWaylandBuffer().
- free(aSurface);
- }
-}
-
void WindowSurfaceWayland::CommitWaylandBuffer() {
LOGWAYLAND(("WindowSurfaceWayland::CommitWaylandBuffer [%p]\n", (void*)this));
LOGWAYLAND(
(" mDrawToWaylandBufferDirectly = %d\n", mDrawToWaylandBufferDirectly));
LOGWAYLAND((" mCanSwitchWaylandBuffer = %d\n", mCanSwitchWaylandBuffer));
- LOGWAYLAND((" mDelayedCommitHandle = %p\n", mDelayedCommitHandle));
LOGWAYLAND((" mFrameCallback = %p\n", mFrameCallback));
LOGWAYLAND((" mLastCommittedSurface = %p\n", mLastCommittedSurface));
LOGWAYLAND((" mBufferPendingCommit = %d\n", mBufferPendingCommit));
@@ -915,16 +937,10 @@ void WindowSurfaceWayland::CommitWayland
MOZ_ASSERT(!mFrameCallback || waylandSurface != mLastCommittedSurface,
"Missing wayland surface at frame callback!");
- // Do nothing if there's already mDelayedCommitHandle pending.
- if (!mDelayedCommitHandle) {
- mDelayedCommitHandle = static_cast<WindowSurfaceWayland**>(
- moz_xmalloc(sizeof(*mDelayedCommitHandle)));
- *mDelayedCommitHandle = this;
-
+ if (DelayedCommitsCheckAndAddSurface(this)) {
MessageLoop::current()->PostDelayedTask(
NewRunnableFunction("WaylandBackBufferCommit",
- &WaylandBufferDelayCommitHandler,
- mDelayedCommitHandle),
+ &WaylandBufferDelayCommitHandler, this),
EVENT_LOOP_DELAY);
}
return;
@@ -1036,25 +1052,6 @@ void WindowSurfaceWayland::FrameCallback
CommitWaylandBuffer();
}
-
-void WindowSurfaceWayland::DelayedCommitHandler() {
- MOZ_ASSERT(mIsMainThread == NS_IsMainThread());
- MOZ_ASSERT(mDelayedCommitHandle != nullptr, "Missing mDelayedCommitHandle!");
-
- LOGWAYLAND(
- ("WindowSurfaceWayland::DelayedCommitHandler [%p]\n", (void*)this));
-
- if (!mDelayedCommitHandle) {
- LOGWAYLAND((" We're missing mDelayedCommitHandle!\n"));
- return;
- }
-
- *mDelayedCommitHandle = nullptr;
- free(mDelayedCommitHandle);
- mDelayedCommitHandle = nullptr;
-
- CommitWaylandBuffer();
-}
} // namespace widget
} // namespace mozilla
diff -up firefox-81.0.1/widget/gtk/WindowSurfaceWayland.h.1656727 firefox-81.0.1/widget/gtk/WindowSurfaceWayland.h
--- firefox-81.0.1/widget/gtk/WindowSurfaceWayland.h.1656727 2020-09-30 19:42:37.000000000 +0200
+++ firefox-81.0.1/widget/gtk/WindowSurfaceWayland.h 2020-10-08 11:35:41.928508817 +0200
@@ -161,7 +161,7 @@ class WindowSurfaceWayland : public Wind
// If we fail (wayland compositor is busy,
// wl_surface is not created yet) we queue the painting
// and we send it to wayland compositor in FrameCallbackHandler()/
- // DelayedCommitHandler/CommitWaylandBuffer().
+ // CommitWaylandBuffer().
already_AddRefed<gfx::DrawTarget> Lock(
const LayoutDeviceIntRegion& aRegion) override;
void Commit(const LayoutDeviceIntRegion& aInvalidRegion) final;
@@ -171,12 +171,6 @@ class WindowSurfaceWayland : public Wind
// queued commits.
void FrameCallbackHandler();
- // When a new window is created we may not have a valid wl_surface
- // for drawing (Gtk haven't created it yet). All commits are queued
- // and DelayedCommitHandler() is called by timer when wl_surface is ready
- // for drawing.
- void DelayedCommitHandler();
-
// Try to commit all queued drawings to Wayland compositor. This is usually
// called from other routines but can be used to explicitly flush
// all drawings as we do when wl_buffer is released
@@ -249,17 +243,14 @@ class WindowSurfaceWayland : public Wind
wl_callback* mFrameCallback;
wl_surface* mLastCommittedSurface;
- // Registered reference to pending DelayedCommitHandler() call.
- WindowSurfaceWayland** mDelayedCommitHandle;
-
// Cached drawings. If we can't get WaylandBuffer (wl_buffer) at
// WindowSurfaceWayland::Lock() we direct gecko rendering to
// mImageSurface.
// If we can't get WaylandBuffer at WindowSurfaceWayland::Commit()
// time, mImageSurface is moved to mDelayedImageCommits which
// holds all cached drawings.
- // mDelayedImageCommits can be drawn by FrameCallbackHandler(),
- // DelayedCommitHandler() or when WaylandBuffer is detached.
+ // mDelayedImageCommits can be drawn by FrameCallbackHandler()
+ // or when WaylandBuffer is detached.
RefPtr<gfxImageSurface> mImageSurface;
AutoTArray<WindowImageSurface, 30> mDelayedImageCommits;
@@ -282,8 +273,8 @@ class WindowSurfaceWayland : public Wind
// We can't send WaylandBuffer (wl_buffer) to compositor when gecko
// is rendering into it (i.e. between WindowSurfaceWayland::Lock() /
// WindowSurfaceWayland::Commit()).
- // Thus we use mBufferCommitAllowed to disable commit by callbacks
- // (FrameCallbackHandler(), DelayedCommitHandler())
+ // Thus we use mBufferCommitAllowed to disable commit by
+ // CommitWaylandBuffer().
bool mBufferCommitAllowed;
// We need to clear WaylandBuffer when entire transparent window is repainted.

25
mozilla-1661192.patch Normal file
View File

@ -0,0 +1,25 @@
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1600,9 +1600,11 @@
#endif
}
+ bool hasAnchorRect = true;
if (anchorRect.width == 0) {
LOG((" No anchor rect given, use aPosition for anchor"));
anchorRect.SetRect(aPosition->x, aPosition->y, 1, 1);
+ hasAnchorRect = false;
}
LOG((" anchor x %d y %d width %d height %d (absolute coords)\n",
anchorRect.x, anchorRect.y, anchorRect.width, anchorRect.height));
@@ -1704,7 +1706,7 @@
nsPoint cursorOffset(0, 0);
#ifdef MOZ_WAYLAND
// Offset is already computed to the tooltips
- if (popupFrame && mPopupType != ePopupTypeTooltip) {
+ if (hasAnchorRect && popupFrame && mPopupType != ePopupTypeTooltip) {
nsMargin margin(0, 0, 0, 0);
popupFrame->StyleMargin()->GetMargin(margin);
switch (popupFrame->GetPopupAlignment()) {

36
mozilla-1663844.patch Normal file
View File

@ -0,0 +1,36 @@
diff --git a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
--- a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
@@ -86,7 +86,7 @@ bool GMPDecoderModule::SupportsMimeType(
bool GMPDecoderModule::SupportsMimeType(
const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics) const {
- return false;
+ return MP4Decoder::IsH264(aMimeType);
}
} // namespace mozilla
diff --git a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
--- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
+++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
@@ -67,6 +67,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi4
RefPtr<GMPVideoDecoder> self = this;
if (v) {
mDecodedData.AppendElement(std::move(v));
+ mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__);
+ mDecodedData = DecodedData();
} else {
mDecodedData.Clear();
mDecodePromise.RejectIfExists(
diff -up firefox-81.0.2/dom/media/gmp/GMPSharedMemManager.h.oldd firefox-81.0.2/dom/media/gmp/GMPSharedMemManager.h
--- firefox-81.0.2/dom/media/gmp/GMPSharedMemManager.h.oldd 2020-10-12 18:19:09.158070701 +0200
+++ firefox-81.0.2/dom/media/gmp/GMPSharedMemManager.h 2020-10-12 18:19:18.398109540 +0200
@@ -27,7 +27,7 @@ class GMPSharedMem {
// returned to the parent pool (which is not included). If more than
// this are needed, we presume the client has either crashed or hung
// (perhaps temporarily).
- static const uint32_t kGMPBufLimit = 20;
+ static const uint32_t kGMPBufLimit = 40;
GMPSharedMem() {
for (size_t i = 0; i < sizeof(mGmpAllocated) / sizeof(mGmpAllocated[0]);

36
mozilla-1665324.patch Normal file
View File

@ -0,0 +1,36 @@
diff --git a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
--- a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
+++ b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
@@ -38,14 +38,6 @@
if (aParams.VideoConfig().HasAlpha()) {
return nullptr;
}
- if (VPXDecoder::IsVPX(aParams.mConfig.mMimeType) &&
- aParams.mOptions.contains(CreateDecoderParams::Option::LowLatency) &&
- !StaticPrefs::media_ffmpeg_low_latency_enabled()) {
- // We refuse to create a decoder with low latency enabled if it's VP8 or
- // VP9 unless specifically allowed: this will fallback to libvpx later.
- // We do allow it for h264.
- return nullptr;
- }
RefPtr<MediaDataDecoder> decoder = new FFmpegVideoDecoder<V>(
mLib, aParams.VideoConfig(), aParams.mKnowsCompositor,
aParams.mImageContainer,
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -7109,13 +7109,6 @@
mirror: always
#endif
-#if defined(MOZ_FFMPEG) || defined(MOZ_FFVPX)
-- name: media.ffmpeg.low-latency.enabled
- type: RelaxedAtomicBool
- value: false
- mirror: always
-#endif
-
#ifdef MOZ_WMF
- name: media.wmf.enabled

16
mozilla-1665329.patch Normal file
View File

@ -0,0 +1,16 @@
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -7565,11 +7565,7 @@
# acceleration for decoding.
- name: media.navigator.mediadatadecoder_vpx_enabled
type: RelaxedAtomicBool
- #if defined(NIGHTLY_BUILD)
value: true
- #else
- value: false
- #endif
mirror: always
# Use MediaDataDecoder API for H264 in WebRTC. This includes hardware

473
mozilla-1667096.patch Normal file
View File

@ -0,0 +1,473 @@
changeset: 551978:40c95986d358
tag: tip
parent: 551976:daadcfadb2f8
user: stransky <stransky@redhat.com>
date: Thu Sep 24 15:51:06 2020 +0200
files: media/ffvpx/libavcodec/codec_list.c media/ffvpx/libavcodec/libfdk-aacdec.c media/ffvpx/libavcodec/moz.build toolkit/moz.configure
description:
Bug 1667096 Add libfdk-aacdec.c to bundled ffvpx and allow build Firefox with system fdk-aac-free library, r?jya
Differential Revision: https://phabricator.services.mozilla.com/D91278
diff --git a/media/ffvpx/libavcodec/codec_list.c b/media/ffvpx/libavcodec/codec_list.c
--- a/media/ffvpx/libavcodec/codec_list.c
+++ b/media/ffvpx/libavcodec/codec_list.c
@@ -11,4 +11,8 @@ static const AVCodec * const codec_list[
#if CONFIG_MP3_DECODER
&ff_mp3_decoder,
#endif
+#ifdef CONFIG_LIBFDK_AAC
+ &ff_libfdk_aac_decoder,
+#endif
+
NULL };
diff --git a/media/ffvpx/libavcodec/libfdk-aacdec.c b/media/ffvpx/libavcodec/libfdk-aacdec.c
new file mode 100644
--- /dev/null
+++ b/media/ffvpx/libavcodec/libfdk-aacdec.c
@@ -0,0 +1,409 @@
+/*
+ * AAC decoder wrapper
+ * Copyright (c) 2012 Martin Storsjo
+ *
+ * This file is part of FFmpeg.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <fdk-aac/aacdecoder_lib.h>
+
+#include "libavutil/channel_layout.h"
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+#include "avcodec.h"
+#include "internal.h"
+
+#ifdef AACDECODER_LIB_VL0
+#define FDKDEC_VER_AT_LEAST(vl0, vl1) \
+ ((AACDECODER_LIB_VL0 > vl0) || \
+ (AACDECODER_LIB_VL0 == vl0 && AACDECODER_LIB_VL1 >= vl1))
+#else
+#define FDKDEC_VER_AT_LEAST(vl0, vl1) 0
+#endif
+
+#if !FDKDEC_VER_AT_LEAST(2, 5) // < 2.5.10
+#define AAC_PCM_MAX_OUTPUT_CHANNELS AAC_PCM_OUTPUT_CHANNELS
+#endif
+
+enum ConcealMethod {
+ CONCEAL_METHOD_SPECTRAL_MUTING = 0,
+ CONCEAL_METHOD_NOISE_SUBSTITUTION = 1,
+ CONCEAL_METHOD_ENERGY_INTERPOLATION = 2,
+ CONCEAL_METHOD_NB,
+};
+
+typedef struct FDKAACDecContext {
+ const AVClass *class;
+ HANDLE_AACDECODER handle;
+ uint8_t *decoder_buffer;
+ int decoder_buffer_size;
+ uint8_t *anc_buffer;
+ int conceal_method;
+ int drc_level;
+ int drc_boost;
+ int drc_heavy;
+ int drc_effect;
+ int drc_cut;
+ int level_limit;
+} FDKAACDecContext;
+
+
+#define DMX_ANC_BUFFSIZE 128
+#define DECODER_MAX_CHANNELS 8
+#define DECODER_BUFFSIZE 2048 * sizeof(INT_PCM)
+
+#define OFFSET(x) offsetof(FDKAACDecContext, x)
+#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
+static const AVOption fdk_aac_dec_options[] = {
+ { "conceal", "Error concealment method", OFFSET(conceal_method), AV_OPT_TYPE_INT, { .i64 = CONCEAL_METHOD_NOISE_SUBSTITUTION }, CONCEAL_METHOD_SPECTRAL_MUTING, CONCEAL_METHOD_NB - 1, AD, "conceal" },
+ { "spectral", "Spectral muting", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_SPECTRAL_MUTING }, INT_MIN, INT_MAX, AD, "conceal" },
+ { "noise", "Noise Substitution", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_NOISE_SUBSTITUTION }, INT_MIN, INT_MAX, AD, "conceal" },
+ { "energy", "Energy Interpolation", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_ENERGY_INTERPOLATION }, INT_MIN, INT_MAX, AD, "conceal" },
+ { "drc_boost", "Dynamic Range Control: boost, where [0] is none and [127] is max boost",
+ OFFSET(drc_boost), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL },
+ { "drc_cut", "Dynamic Range Control: attenuation factor, where [0] is none and [127] is max compression",
+ OFFSET(drc_cut), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL },
+ { "drc_level", "Dynamic Range Control: reference level, quantized to 0.25dB steps where [0] is 0dB and [127] is -31.75dB",
+ OFFSET(drc_level), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 127, AD, NULL },
+ { "drc_heavy", "Dynamic Range Control: heavy compression, where [1] is on (RF mode) and [0] is off",
+ OFFSET(drc_heavy), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL },
+#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10
+ { "level_limit", "Signal level limiting", OFFSET(level_limit), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, 1, AD },
+#endif
+#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0
+ { "drc_effect","Dynamic Range Control: effect type, where e.g. [0] is none and [6] is general",
+ OFFSET(drc_effect), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 8, AD, NULL },
+#endif
+ { NULL }
+};
+
+static const AVClass fdk_aac_dec_class = {
+ .class_name = "libfdk-aac decoder",
+ .item_name = av_default_item_name,
+ .option = fdk_aac_dec_options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static int get_stream_info(AVCodecContext *avctx)
+{
+ FDKAACDecContext *s = avctx->priv_data;
+ CStreamInfo *info = aacDecoder_GetStreamInfo(s->handle);
+ int channel_counts[0x24] = { 0 };
+ int i, ch_error = 0;
+ uint64_t ch_layout = 0;
+
+ if (!info) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to get stream info\n");
+ return AVERROR_UNKNOWN;
+ }
+
+ if (info->sampleRate <= 0) {
+ av_log(avctx, AV_LOG_ERROR, "Stream info not initialized\n");
+ return AVERROR_UNKNOWN;
+ }
+ avctx->sample_rate = info->sampleRate;
+ avctx->frame_size = info->frameSize;
+
+ for (i = 0; i < info->numChannels; i++) {
+ AUDIO_CHANNEL_TYPE ctype = info->pChannelType[i];
+ if (ctype <= ACT_NONE || ctype >= FF_ARRAY_ELEMS(channel_counts)) {
+ av_log(avctx, AV_LOG_WARNING, "unknown channel type\n");
+ break;
+ }
+ channel_counts[ctype]++;
+ }
+ av_log(avctx, AV_LOG_DEBUG,
+ "%d channels - front:%d side:%d back:%d lfe:%d top:%d\n",
+ info->numChannels,
+ channel_counts[ACT_FRONT], channel_counts[ACT_SIDE],
+ channel_counts[ACT_BACK], channel_counts[ACT_LFE],
+ channel_counts[ACT_FRONT_TOP] + channel_counts[ACT_SIDE_TOP] +
+ channel_counts[ACT_BACK_TOP] + channel_counts[ACT_TOP]);
+
+ switch (channel_counts[ACT_FRONT]) {
+ case 4:
+ ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_LEFT_OF_CENTER |
+ AV_CH_FRONT_RIGHT_OF_CENTER;
+ break;
+ case 3:
+ ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER;
+ break;
+ case 2:
+ ch_layout |= AV_CH_LAYOUT_STEREO;
+ break;
+ case 1:
+ ch_layout |= AV_CH_FRONT_CENTER;
+ break;
+ default:
+ av_log(avctx, AV_LOG_WARNING,
+ "unsupported number of front channels: %d\n",
+ channel_counts[ACT_FRONT]);
+ ch_error = 1;
+ break;
+ }
+ if (channel_counts[ACT_SIDE] > 0) {
+ if (channel_counts[ACT_SIDE] == 2) {
+ ch_layout |= AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT;
+ } else {
+ av_log(avctx, AV_LOG_WARNING,
+ "unsupported number of side channels: %d\n",
+ channel_counts[ACT_SIDE]);
+ ch_error = 1;
+ }
+ }
+ if (channel_counts[ACT_BACK] > 0) {
+ switch (channel_counts[ACT_BACK]) {
+ case 3:
+ ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_BACK_CENTER;
+ break;
+ case 2:
+ ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT;
+ break;
+ case 1:
+ ch_layout |= AV_CH_BACK_CENTER;
+ break;
+ default:
+ av_log(avctx, AV_LOG_WARNING,
+ "unsupported number of back channels: %d\n",
+ channel_counts[ACT_BACK]);
+ ch_error = 1;
+ break;
+ }
+ }
+ if (channel_counts[ACT_LFE] > 0) {
+ if (channel_counts[ACT_LFE] == 1) {
+ ch_layout |= AV_CH_LOW_FREQUENCY;
+ } else {
+ av_log(avctx, AV_LOG_WARNING,
+ "unsupported number of LFE channels: %d\n",
+ channel_counts[ACT_LFE]);
+ ch_error = 1;
+ }
+ }
+ if (!ch_error &&
+ av_get_channel_layout_nb_channels(ch_layout) != info->numChannels) {
+ av_log(avctx, AV_LOG_WARNING, "unsupported channel configuration\n");
+ ch_error = 1;
+ }
+ if (ch_error)
+ avctx->channel_layout = 0;
+ else
+ avctx->channel_layout = ch_layout;
+
+ avctx->channels = info->numChannels;
+
+ return 0;
+}
+
+static av_cold int fdk_aac_decode_close(AVCodecContext *avctx)
+{
+ FDKAACDecContext *s = avctx->priv_data;
+
+ if (s->handle)
+ aacDecoder_Close(s->handle);
+ av_freep(&s->decoder_buffer);
+ av_freep(&s->anc_buffer);
+
+ return 0;
+}
+
+static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
+{
+ FDKAACDecContext *s = avctx->priv_data;
+ AAC_DECODER_ERROR err;
+
+ s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1);
+ if (!s->handle) {
+ av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+
+ if (avctx->extradata_size) {
+ if ((err = aacDecoder_ConfigRaw(s->handle, &avctx->extradata,
+ &avctx->extradata_size)) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set extradata\n");
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
+ if ((err = aacDecoder_SetParam(s->handle, AAC_CONCEAL_METHOD,
+ s->conceal_method)) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set error concealment method\n");
+ return AVERROR_UNKNOWN;
+ }
+
+ if (avctx->request_channel_layout > 0 &&
+ avctx->request_channel_layout != AV_CH_LAYOUT_NATIVE) {
+ int downmix_channels = -1;
+
+ switch (avctx->request_channel_layout) {
+ case AV_CH_LAYOUT_STEREO:
+ case AV_CH_LAYOUT_STEREO_DOWNMIX:
+ downmix_channels = 2;
+ break;
+ case AV_CH_LAYOUT_MONO:
+ downmix_channels = 1;
+ break;
+ default:
+ av_log(avctx, AV_LOG_WARNING, "Invalid request_channel_layout\n");
+ break;
+ }
+
+ if (downmix_channels != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_PCM_MAX_OUTPUT_CHANNELS,
+ downmix_channels) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_WARNING, "Unable to set output channels in the decoder\n");
+ } else {
+ s->anc_buffer = av_malloc(DMX_ANC_BUFFSIZE);
+ if (!s->anc_buffer) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to allocate ancillary buffer for the decoder\n");
+ return AVERROR(ENOMEM);
+ }
+ if (aacDecoder_AncDataInit(s->handle, s->anc_buffer, DMX_ANC_BUFFSIZE)) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to register downmix ancillary buffer in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+ }
+ }
+
+ if (s->drc_boost != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_DRC_BOOST_FACTOR, s->drc_boost) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC boost factor in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+
+ if (s->drc_cut != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_DRC_ATTENUATION_FACTOR, s->drc_cut) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC attenuation factor in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+
+ if (s->drc_level != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_DRC_REFERENCE_LEVEL, s->drc_level) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC reference level in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+
+ if (s->drc_heavy != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_DRC_HEAVY_COMPRESSION, s->drc_heavy) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC heavy compression in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+
+#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10
+ if (aacDecoder_SetParam(s->handle, AAC_PCM_LIMITER_ENABLE, s->level_limit) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set in signal level limiting in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+#endif
+
+#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0
+ if (s->drc_effect != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_UNIDRC_SET_EFFECT, s->drc_effect) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC effect type in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+#endif
+
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ s->decoder_buffer_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS;
+ s->decoder_buffer = av_malloc(s->decoder_buffer_size);
+ if (!s->decoder_buffer)
+ return AVERROR(ENOMEM);
+
+ return 0;
+}
+
+static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame_ptr, AVPacket *avpkt)
+{
+ FDKAACDecContext *s = avctx->priv_data;
+ AVFrame *frame = data;
+ int ret;
+ AAC_DECODER_ERROR err;
+ UINT valid = avpkt->size;
+
+ err = aacDecoder_Fill(s->handle, &avpkt->data, &avpkt->size, &valid);
+ if (err != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "aacDecoder_Fill() failed: %x\n", err);
+ return AVERROR_INVALIDDATA;
+ }
+
+ err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, s->decoder_buffer_size / sizeof(INT_PCM), 0);
+ if (err == AAC_DEC_NOT_ENOUGH_BITS) {
+ ret = avpkt->size - valid;
+ goto end;
+ }
+ if (err != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR,
+ "aacDecoder_DecodeFrame() failed: %x\n", err);
+ ret = AVERROR_UNKNOWN;
+ goto end;
+ }
+
+ if ((ret = get_stream_info(avctx)) < 0)
+ goto end;
+ frame->nb_samples = avctx->frame_size;
+
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+ goto end;
+
+ memcpy(frame->extended_data[0], s->decoder_buffer,
+ avctx->channels * avctx->frame_size *
+ av_get_bytes_per_sample(avctx->sample_fmt));
+
+ *got_frame_ptr = 1;
+ ret = avpkt->size - valid;
+
+end:
+ return ret;
+}
+
+static av_cold void fdk_aac_decode_flush(AVCodecContext *avctx)
+{
+ FDKAACDecContext *s = avctx->priv_data;
+ AAC_DECODER_ERROR err;
+
+ if (!s->handle)
+ return;
+
+ if ((err = aacDecoder_SetParam(s->handle,
+ AAC_TPDEC_CLEAR_BUFFER, 1)) != AAC_DEC_OK)
+ av_log(avctx, AV_LOG_WARNING, "failed to clear buffer when flushing\n");
+}
+
+AVCodec ff_libfdk_aac_decoder = {
+ .name = "libfdk_aac",
+ .long_name = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_AAC,
+ .priv_data_size = sizeof(FDKAACDecContext),
+ .init = fdk_aac_decode_init,
+ .decode = fdk_aac_decode_frame,
+ .close = fdk_aac_decode_close,
+ .flush = fdk_aac_decode_flush,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
+ .priv_class = &fdk_aac_dec_class,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
+ FF_CODEC_CAP_INIT_CLEANUP,
+ .wrapper_name = "libfdk",
+};
diff --git a/media/ffvpx/libavcodec/moz.build b/media/ffvpx/libavcodec/moz.build
--- a/media/ffvpx/libavcodec/moz.build
+++ b/media/ffvpx/libavcodec/moz.build
@@ -97,6 +97,12 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']:
'vp9recon.c'
]
+if CONFIG['MOZ_FDK_AAC']:
+ SOURCES += [
+ 'libfdk-aacdec.c',
+ ]
+ OS_LIBS += CONFIG['MOZ_FDK_AAC_LIBS']
+
if CONFIG['MOZ_LIBAV_FFT']:
SOURCES += [
'avfft.c',
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -1592,6 +1592,14 @@ with only_when(compile_environment):
set_define('MOZ_LIBAV_FFT', depends(when=libav_fft)(lambda: True))
set_config('LIBAV_FFT_ASFLAGS', libav_fft.flags)
+# fdk aac support
+option('--with-system-fdk-aac',
+ help='Use system libfdk-aac (located with pkgconfig)')
+
+system_fdk_aac = pkg_check_modules('MOZ_FDK_AAC', 'fdk-aac',
+ when='--with-system-fdk-aac')
+
+set_config('MOZ_FDK_AAC', depends(when=system_fdk_aac)(lambda: True))
# FFmpeg's ffvpx configuration
# ==============================================================

41
mozilla-1668771.patch Normal file
View File

@ -0,0 +1,41 @@
changeset: 552978:b50cb0696eef
tag: tip
parent: 552976:2ce12e3e063c
user: stransky <stransky@redhat.com>
date: Fri Oct 02 12:19:53 2020 +0200
files: widget/gtk/WindowSurfaceWayland.cpp
description:
Bug 1668771 [Wayland] Use timeout for frame callbacks for basic compositor, r?jhorak
Differential Revision: https://phabricator.services.mozilla.com/D92200
diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp
--- a/widget/gtk/WindowSurfaceWayland.cpp
+++ b/widget/gtk/WindowSurfaceWayland.cpp
@@ -37,6 +37,9 @@ extern mozilla::LazyLogModule gWidgetWay
// Maximal compositing timeout it miliseconds
#define COMPOSITING_TIMEOUT 200
+// Maximal timeout between frame callbacks
+#define FRAME_CALLBACK_TIMEOUT 20
+
namespace mozilla {
namespace widget {
@@ -941,8 +944,12 @@ void WindowSurfaceWayland::CommitWayland
if (waylandSurface == mLastCommittedSurface) {
LOGWAYLAND((" [%p] wait for frame callback.\n", (void*)this));
// We have an active frame callback pending from our recent surface.
- // It means we should defer the commit to FrameCallbackHandler().
- return;
+ // It means we should defer the commit to FrameCallbackHandler(),
+ // but only if we're under frame callback timeout range.
+ if (mLastCommitTime && (g_get_monotonic_time() / 1000) - mLastCommitTime <
+ FRAME_CALLBACK_TIMEOUT) {
+ return;
+ }
}
// If our stored wl_surface does not match the actual one it means the frame
// callback is no longer active and we should release it.

13
mozilla-1669442.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/config/recurse.mk b/config/recurse.mk
--- a/config/recurse.mk
+++ b/config/recurse.mk
@@ -206,7 +206,7 @@
# Interdependencies that moz.build world don't know about yet for compilation.
# Note some others are hardcoded or "guessed" in recursivemake.py and emitter.py
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
-toolkit/library/target: widget/gtk/mozgtk/gtk3/target
+toolkit/library/build/target: widget/gtk/mozgtk/gtk3/target
endif
ifndef MOZ_FOLD_LIBS

130
mozilla-1669495.patch Normal file
View File

@ -0,0 +1,130 @@
diff -up firefox-81.0.1/layout/xul/nsMenuPopupFrame.cpp.1669495 firefox-81.0.1/layout/xul/nsMenuPopupFrame.cpp
--- firefox-81.0.1/layout/xul/nsMenuPopupFrame.cpp.1669495 2020-10-08 10:09:23.765819989 +0200
+++ firefox-81.0.1/layout/xul/nsMenuPopupFrame.cpp 2020-10-08 10:09:23.771820010 +0200
@@ -533,6 +533,26 @@ void nsMenuPopupFrame::LayoutPopup(nsBox
}
prefSize = XULBoundsCheck(minSize, prefSize, maxSize);
+#ifdef MOZ_WAYLAND
+ static bool inWayland = gdk_display_get_default() &&
+ !GDK_IS_X11_DISPLAY(gdk_display_get_default());
+#else
+ static bool inWayland = false;
+#endif
+ if (inWayland) {
+ // If prefSize it is not a whole number in css pixels we need round it up
+ // to avoid reflow of the tooltips/popups and putting the text on two lines
+ // (usually happens with 200% scale factor and font scale factor <> 1)
+ // because GTK thrown away the decimals.
+ int32_t appPerCSS = AppUnitsPerCSSPixel();
+ if (prefSize.width % appPerCSS > 0) {
+ prefSize.width += appPerCSS;
+ }
+ if (prefSize.height % appPerCSS > 0) {
+ prefSize.height += appPerCSS;
+ }
+ }
+
bool sizeChanged = (mPrefSize != prefSize);
// if the size changed then set the bounds to be the preferred size
if (sizeChanged) {
diff -up firefox-81.0.1/widget/gtk/nsWindow.cpp.1669495 firefox-81.0.1/widget/gtk/nsWindow.cpp
--- firefox-81.0.1/widget/gtk/nsWindow.cpp.1669495 2020-10-08 10:09:23.770820007 +0200
+++ firefox-81.0.1/widget/gtk/nsWindow.cpp 2020-10-08 10:10:29.225052014 +0200
@@ -1090,11 +1090,13 @@ void nsWindow::Show(bool aState) {
void nsWindow::ResizeInt(int aX, int aY, int aWidth, int aHeight, bool aMove,
bool aRepaint) {
- LOG(("nsWindow::ResizeInt [%p] %d %d -> %d %d repaint %d\n", (void*)this, aX,
- aY, aWidth, aHeight, aRepaint));
+ LOG(("nsWindow::ResizeInt [%p] x:%d y:%d -> w:%d h:%d repaint %d aMove %d\n",
+ (void*)this, aX, aY, aWidth, aHeight, aRepaint, aMove));
ConstrainSize(&aWidth, &aHeight);
+ LOG((" ConstrainSize: w:%d h;%d\n", aWidth, aHeight));
+
if (aMove) {
mBounds.x = aX;
mBounds.y = aY;
@@ -1132,8 +1134,7 @@ void nsWindow::ResizeInt(int aX, int aY,
}
void nsWindow::Resize(double aWidth, double aHeight, bool aRepaint) {
- LOG(("nsWindow::Resize [%p] %d %d\n", (void*)this, (int)aWidth,
- (int)aHeight));
+ LOG(("nsWindow::Resize [%p] %f %f\n", (void*)this, aWidth, aHeight));
double scale =
BoundsUseDesktopPixels() ? GetDesktopToDeviceScale().scale : 1.0;
@@ -1145,8 +1146,8 @@ void nsWindow::Resize(double aWidth, dou
void nsWindow::Resize(double aX, double aY, double aWidth, double aHeight,
bool aRepaint) {
- LOG(("nsWindow::Resize [%p] %d %d repaint %d\n", (void*)this, (int)aWidth,
- (int)aHeight, aRepaint));
+ LOG(("nsWindow::Resize [%p] %f %f repaint %d\n", (void*)this, aWidth, aHeight,
+ aRepaint));
double scale =
BoundsUseDesktopPixels() ? GetDesktopToDeviceScale().scale : 1.0;
@@ -1469,14 +1470,15 @@ void nsWindow::NativeMoveResizeWaylandPo
newBounds.x = GdkCoordToDevicePixels(newBounds.x);
newBounds.y = GdkCoordToDevicePixels(newBounds.y);
- LOG((" new mBounds x=%d y=%d width=%d height=%d\n", newBounds.x,
- newBounds.y, newBounds.width, newBounds.height));
double scale =
BoundsUseDesktopPixels() ? GetDesktopToDeviceScale().scale : 1.0;
int32_t newWidth = NSToIntRound(scale * newBounds.width);
int32_t newHeight = NSToIntRound(scale * newBounds.height);
+ LOG((" new mBounds x=%d y=%d width=%d height=%d\n", newBounds.x,
+ newBounds.y, newWidth, newHeight));
+
bool needsPositionUpdate =
(newBounds.x != mBounds.x || newBounds.y != mBounds.y);
bool needsSizeUpdate =
@@ -1484,6 +1486,7 @@ void nsWindow::NativeMoveResizeWaylandPo
// Update view
if (needsSizeUpdate) {
+ LOG((" needSizeUpdate\n"));
int32_t p2a = AppUnitsPerCSSPixel() / gfxPlatformGtk::GetFontScaleFactor();
mPreferredPopupRect = nsRect(NSIntPixelsToAppUnits(newBounds.x, p2a),
NSIntPixelsToAppUnits(newBounds.y, p2a),
@@ -1502,6 +1505,7 @@ void nsWindow::NativeMoveResizeWaylandPo
}
if (needsPositionUpdate) {
+ LOG((" needPositionUpdate\n"));
// The newBounds are in coordinates relative to the parent window/popup.
// The NotifyWindowMoved requires the coordinates relative to the toplevel.
// We use the gdk_window_get_origin to get correct coordinates.
@@ -4211,6 +4215,8 @@ nsresult nsWindow::Create(nsIWidget* aPa
// save our bounds
mBounds = aRect;
+ LOG((" mBounds: x:%d y:%d w:%d h:%d\n", mBounds.x, mBounds.y, mBounds.width,
+ mBounds.height));
mPreferredPopupRectFlushed = false;
@@ -5061,13 +5067,16 @@ void nsWindow::NativeShow(bool aAction)
}
}
+ LOG((" calling gtk_widget_show(mShell)\n"));
gtk_widget_show(mShell);
if (!mIsX11Display) {
WaylandStartVsync();
}
} else if (mContainer) {
+ LOG((" calling gtk_widget_show(mContainer)\n"));
gtk_widget_show(GTK_WIDGET(mContainer));
} else if (mGdkWindow) {
+ LOG((" calling gdk_window_show_unraised\n"));
gdk_window_show_unraised(mGdkWindow);
}
} else {

15
mozilla-1669639.patch Normal file
View File

@ -0,0 +1,15 @@
diff -up firefox-81.0.1/build/mach_bootstrap.py.old firefox-81.0.1/build/mach_bootstrap.py
--- firefox-81.0.1/build/mach_bootstrap.py.old 2020-10-06 14:16:06.212974910 +0200
+++ firefox-81.0.1/build/mach_bootstrap.py 2020-10-06 14:19:03.313179557 +0200
@@ -507,7 +507,10 @@ class ImportHook(object):
# doesn't happen or because it doesn't matter).
if not os.path.exists(module.__file__[:-1]):
if os.path.exists(module.__file__):
- os.remove(module.__file__)
+ try:
+ os.remove(module.__file__)
+ except:
+ pass
del sys.modules[module.__name__]
module = self(name, globals, locals, fromlist, level)

111
mozilla-440908.patch Normal file
View File

@ -0,0 +1,111 @@
diff -up firefox-56.0/modules/libpref/prefapi.cpp.440908 firefox-56.0/modules/libpref/prefapi.cpp
--- firefox-56.0/modules/libpref/prefapi.cpp.440908 2017-09-14 22:15:52.000000000 +0200
+++ firefox-56.0/modules/libpref/prefapi.cpp 2017-09-25 10:39:39.266572792 +0200
@@ -1036,8 +1036,8 @@ void PREF_ReaderCallback(void *clo
PrefValue value,
PrefType type,
bool isDefault,
- bool isStickyDefault)
-
+ bool isStickyDefault,
+ bool isLocked)
{
uint32_t flags = 0;
if (isDefault) {
@@ -1049,4 +1049,6 @@ void PREF_ReaderCallback(void *clo
flags |= kPrefForceSet;
}
pref_HashPref(pref, value, type, flags);
+ if (isLocked)
+ PREF_LockPref(pref, true);
}
diff -up firefox-56.0/modules/libpref/prefapi.h.440908 firefox-56.0/modules/libpref/prefapi.h
--- firefox-56.0/modules/libpref/prefapi.h.440908 2017-07-31 18:20:51.000000000 +0200
+++ firefox-56.0/modules/libpref/prefapi.h 2017-09-25 10:39:39.267572789 +0200
@@ -246,8 +246,8 @@ void PREF_ReaderCallback( void *closure,
PrefValue value,
PrefType type,
bool isDefault,
- bool isStickyDefault);
-
+ bool isStickyDefault,
+ bool isLocked);
/*
* Callback whenever we change a preference
diff -up firefox-56.0/modules/libpref/prefread.cpp.440908 firefox-56.0/modules/libpref/prefread.cpp
--- firefox-56.0/modules/libpref/prefread.cpp.440908 2017-09-14 22:15:52.000000000 +0200
+++ firefox-56.0/modules/libpref/prefread.cpp 2017-09-25 10:39:39.267572789 +0200
@@ -43,6 +43,7 @@ enum {
#define BITS_PER_HEX_DIGIT 4
static const char kUserPref[] = "user_pref";
+static const char kLockPref[] = "lockPref";
static const char kPref[] = "pref";
static const char kPrefSticky[] = "sticky_pref";
static const char kTrue[] = "true";
@@ -146,7 +147,7 @@ pref_DoCallback(PrefParseState *ps)
break;
}
(*ps->reader)(ps->closure, ps->lb, value, ps->vtype, ps->fdefault,
- ps->fstickydefault);
+ ps->fstickydefault, ps->flock);
return true;
}
@@ -215,6 +216,7 @@ PREF_ParseBuf(PrefParseState *ps, const
ps->vtype = PrefType::Invalid;
ps->fdefault = false;
ps->fstickydefault = false;
+ ps->flock = false;
}
switch (c) {
case '/': /* begin comment block or line? */
@@ -225,11 +227,14 @@ PREF_ParseBuf(PrefParseState *ps, const
break;
case 'u': /* indicating user_pref */
case 's': /* indicating sticky_pref */
+ case 'l': /* indicating lockPref */
case 'p': /* indicating pref */
if (c == 'u') {
ps->smatch = kUserPref;
} else if (c == 's') {
ps->smatch = kPrefSticky;
+ } else if (c == 'l') {
+ ps->smatch = kLockPref;
} else {
ps->smatch = kPref;
}
@@ -277,8 +282,10 @@ PREF_ParseBuf(PrefParseState *ps, const
/* name parsing */
case PREF_PARSE_UNTIL_NAME:
if (c == '\"' || c == '\'') {
- ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky);
+ ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky
+ || ps->smatch == kLockPref);
ps->fstickydefault = (ps->smatch == kPrefSticky);
+ ps->flock = (ps->smatch == kLockPref);
ps->quotechar = c;
ps->nextstate = PREF_PARSE_UNTIL_COMMA; /* return here when done */
state = PREF_PARSE_QUOTED_STRING;
diff -up firefox-56.0/modules/libpref/prefread.h.440908 firefox-56.0/modules/libpref/prefread.h
--- firefox-56.0/modules/libpref/prefread.h.440908 2017-09-14 22:15:52.000000000 +0200
+++ firefox-56.0/modules/libpref/prefread.h 2017-09-25 10:39:39.267572789 +0200
@@ -34,7 +34,8 @@ typedef void (*PrefReader)(void *c
PrefValue val,
PrefType type,
bool defPref,
- bool stickyPref);
+ bool stickyPref,
+ bool lockPref);
/**
* Report any errors or warnings we encounter during parsing.
@@ -62,6 +63,7 @@ typedef struct PrefParseState {
PrefType vtype; /* PREF_STRING,INT,BOOL */
bool fdefault; /* true if (default) pref */
bool fstickydefault; /* true if (sticky) pref */
+ bool flock; /* true if pref to be locked */
} PrefParseState;
/**

1
mozilla-api-key Normal file
View File

@ -0,0 +1 @@
9008bb7e-1e22-4038-94fe-047dd48ccc0b

14
mozilla-build-arm.patch Normal file
View File

@ -0,0 +1,14 @@
diff -up firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h.arm firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h
--- firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h.arm 2017-03-03 13:53:52.480754536 +0100
+++ firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h 2017-03-03 13:56:01.476018102 +0100
@@ -203,6 +203,10 @@
#define SK_ARM_HAS_CRC32
#endif
+#if defined(__aarch64__)
+ #undef SK_ARM_HAS_NEON
+#endif
+
//////////////////////////////////////////////////////////////////////
#if !defined(SKIA_IMPLEMENTATION)

View File

@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/node "$@" 2>&1 | cat -

153
pgo.patch Normal file
View File

@ -0,0 +1,153 @@
diff -up firefox-81.0.1/build/moz.configure/lto-pgo.configure.pgo firefox-81.0.1/build/moz.configure/lto-pgo.configure
--- firefox-81.0.1/build/moz.configure/lto-pgo.configure.pgo 2020-09-30 19:41:10.000000000 +0200
+++ firefox-81.0.1/build/moz.configure/lto-pgo.configure 2020-10-07 09:16:44.071786956 +0200
@@ -69,12 +69,14 @@ set_config('PGO_PROFILE_PATH', pgo_profi
@imports(_from='__builtin__', _import='min')
def pgo_flags(compiler, profdata, target_is_windows):
if compiler.type == 'gcc':
+ #profile_use = '-fprofile-use=$(topobjdir)'
+ profile_use = '-fprofile-use'
return namespace(
gen_cflags=['-fprofile-generate'],
gen_ldflags=['-fprofile-generate'],
- use_cflags=['-fprofile-use', '-fprofile-correction',
+ use_cflags=[profile_use, '-fprofile-correction',
'-Wcoverage-mismatch'],
- use_ldflags=['-fprofile-use'],
+ use_ldflags=[profile_use],
)
if compiler.type in ('clang-cl', 'clang'):
@@ -192,13 +194,13 @@ def lto(value, c_compiler, ld64_known_go
cflags.append("-flto")
ldflags.append("-flto")
else:
- cflags.append("-flto=thin")
- ldflags.append("-flto=thin")
+ cflags.append("-flto")
+ ldflags.append("-flto")
elif c_compiler.type == 'clang-cl':
if len(value) and value[0].lower() == 'full':
cflags.append("-flto")
else:
- cflags.append("-flto=thin")
+ cflags.append("-flto")
# With clang-cl, -flto can only be used with -c or -fuse-ld=lld.
# AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld.
cflags.append("-fuse-ld=lld");
@@ -232,7 +234,7 @@ def lto(value, c_compiler, ld64_known_go
if len(value) and value[0].lower() == 'full':
cflags.append("-flto")
else:
- cflags.append("-flto=thin")
+ cflags.append("-flto")
cflags.append("-flifetime-dse=1")
ldflags.append("-flto=%s" % num_cores)
diff -up firefox-81.0.1/build/pgo/profileserver.py.pgo firefox-81.0.1/build/pgo/profileserver.py
--- firefox-81.0.1/build/pgo/profileserver.py.pgo 2020-09-30 19:41:10.000000000 +0200
+++ firefox-81.0.1/build/pgo/profileserver.py 2020-10-07 09:16:44.071786956 +0200
@@ -11,7 +11,7 @@ import glob
import subprocess
import mozcrash
-from mozbuild.base import MozbuildObject, BinaryNotFoundException
+from mozbuild.base import MozbuildObject, BinaryNotFoundException, BuildEnvironmentNotFoundException
from mozfile import TemporaryDirectory
from mozhttpd import MozHttpd
from mozprofile import FirefoxProfile, Preferences
@@ -84,9 +84,22 @@ if __name__ == '__main__':
port=PORT,
options='primary,privileged')
- old_profraw_files = glob.glob('*.profraw')
- for f in old_profraw_files:
- os.remove(f)
+ using_gcc = False
+ try:
+ if build.config_environment.substs.get('CC_TYPE') == 'gcc':
+ using_gcc = True
+ except BuildEnvironmentNotFoundException:
+ pass
+
+ if using_gcc:
+ for dirpath, _, filenames in os.walk('.'):
+ for f in filenames:
+ if f.endswith('.gcda'):
+ os.remove(os.path.join(dirpath, f))
+ else:
+ old_profraw_files = glob.glob('*.profraw')
+ for f in old_profraw_files:
+ os.remove(f)
with TemporaryDirectory() as profilePath:
# TODO: refactor this into mozprofile
@@ -191,6 +204,11 @@ if __name__ == '__main__':
print("Firefox exited successfully, but produced a crashreport")
sys.exit(1)
+
+ print('Copying profile data....')
+ os.system('pwd');
+ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd ..; tar xf instrumented/profdata.tar.gz;');
+
llvm_profdata = env.get('LLVM_PROFDATA')
if llvm_profdata:
profraw_files = glob.glob('*.profraw')
diff -up firefox-81.0.1/build/unix/mozconfig.unix.pgo firefox-81.0.1/build/unix/mozconfig.unix
--- firefox-81.0.1/build/unix/mozconfig.unix.pgo 2020-09-30 19:41:10.000000000 +0200
+++ firefox-81.0.1/build/unix/mozconfig.unix 2020-10-07 09:16:44.071786956 +0200
@@ -6,6 +6,15 @@ if [ -n "$FORCE_GCC" ]; then
CC="$MOZ_FETCHES_DIR/gcc/bin/gcc"
CXX="$MOZ_FETCHES_DIR/gcc/bin/g++"
+ if [ -n "$MOZ_PGO" ]; then
+ if [ -z "$USE_ARTIFACT" ]; then
+ ac_add_options --enable-lto
+ fi
+ export AR="$topsrcdir/gcc/bin/gcc-ar"
+ export NM="$topsrcdir/gcc/bin/gcc-nm"
+ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib"
+ fi
+
# We want to make sure we use binutils and other binaries in the tooltool
# package.
mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$PATH"
diff -up firefox-81.0.1/extensions/spellcheck/src/moz.build.pgo firefox-81.0.1/extensions/spellcheck/src/moz.build
--- firefox-81.0.1/extensions/spellcheck/src/moz.build.pgo 2020-09-30 19:41:17.000000000 +0200
+++ firefox-81.0.1/extensions/spellcheck/src/moz.build 2020-10-07 09:16:44.071786956 +0200
@@ -31,3 +31,5 @@ EXPORTS.mozilla += [
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
+
+CXXFLAGS += ['-fno-devirtualize']
\ No newline at end of file
diff -up firefox-81.0.1/python/mozbuild/mozbuild/build_commands.py.pgo firefox-81.0.1/python/mozbuild/mozbuild/build_commands.py
--- firefox-81.0.1/python/mozbuild/mozbuild/build_commands.py.pgo 2020-09-30 19:41:46.000000000 +0200
+++ firefox-81.0.1/python/mozbuild/mozbuild/build_commands.py 2020-10-07 09:16:44.071786956 +0200
@@ -108,7 +108,8 @@ class Build(MachCommandBase):
return status
pgo_env = os.environ.copy()
- pgo_env['LLVM_PROFDATA'] = instr.config_environment.substs.get('LLVM_PROFDATA')
+ if instr.config_environment.substs.get('CC_TYPE') != 'gcc':
+ pgo_env['LLVM_PROFDATA'] = instr.config_environment.substs.get('LLVM_PROFDATA')
pgo_env['JARLOG_FILE'] = mozpath.join(orig_topobjdir, 'jarlog/en-US.log')
pgo_cmd = [
instr.virtualenv_manager.python_path,
diff -up firefox-81.0.1/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-81.0.1/toolkit/components/terminator/nsTerminator.cpp
--- firefox-81.0.1/toolkit/components/terminator/nsTerminator.cpp.pgo 2020-10-07 09:22:26.698243673 +0200
+++ firefox-81.0.1/toolkit/components/terminator/nsTerminator.cpp 2020-10-07 09:22:43.026312999 +0200
@@ -418,6 +418,11 @@ void nsTerminator::StartWatchdog() {
}
#endif
+ // Disable watchdog for PGO train builds - writting profile information at
+ // exit may take time and it is better to make build hang rather than
+ // silently produce poorly performing binary.
+ crashAfterMS = INT32_MAX;
+
UniquePtr<Options> options(new Options());
const PRIntervalTime ticksDuration = PR_MillisecondsToInterval(1000);
options->crashAfterTicks = crashAfterMS / ticksDuration;

12
rhbz-1173156.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp
--- firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 2019-01-22 10:36:09.284069020 +0100
+++ firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp 2019-01-22 10:37:12.669757744 +0100
@@ -161,7 +161,7 @@ nsresult nsAuthSambaNTLM::SpawnNTLMAuthH
const char* username = PR_GetEnv("USER");
if (!username) return NS_ERROR_FAILURE;
- const char* const args[] = {"ntlm_auth",
+ const char* const args[] = {"/usr/bin/ntlm_auth",
"--helper-protocol",
"ntlmssp-client-1",
"--use-cached-creds",

View File

@ -0,0 +1,23 @@
diff -up firefox-55.0/js/src/old-configure.in.rhbz-1219542-s390 firefox-55.0/js/src/old-configure.in
--- firefox-55.0/js/src/old-configure.in.rhbz-1219542-s390 2017-07-31 18:20:48.000000000 +0200
+++ firefox-55.0/js/src/old-configure.in 2017-08-02 14:31:32.190243669 +0200
@@ -541,7 +541,7 @@ case "$host" in
*-linux*|*-kfreebsd*-gnu|*-gnu*)
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
- HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
+ HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O1}"
;;
*)
@@ -617,8 +617,8 @@ case "$target" in
*-*linux*)
if test "$GNU_CC" -o "$GNU_CXX"; then
- MOZ_PGO_OPTIMIZE_FLAGS="-O3"
- MOZ_OPTIMIZE_FLAGS="-O3"
+ MOZ_PGO_OPTIMIZE_FLAGS="-O1"
+ MOZ_OPTIMIZE_FLAGS="-O1"
if test -z "$CLANG_CC"; then
MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS"
fi

12
rhbz-1354671.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up firefox-70.0/layout/base/PresShell.h.1354671 firefox-70.0/layout/base/PresShell.h
--- firefox-70.0/layout/base/PresShell.h.1354671 2019-10-22 12:33:12.987775587 +0200
+++ firefox-70.0/layout/base/PresShell.h 2019-10-22 12:36:39.999366086 +0200
@@ -257,7 +257,7 @@ class PresShell final : public nsStubDoc
* to the same aSize value. AllocateFrame is infallible and will abort
* on out-of-memory.
*/
- void* AllocateFrame(nsQueryFrame::FrameIID aID, size_t aSize) {
+ void* __attribute__((optimize("no-lifetime-dse"))) AllocateFrame(nsQueryFrame::FrameIID aID, size_t aSize) {
#define FRAME_ID(classname, ...) \
static_assert(size_t(nsQueryFrame::FrameIID::classname##_id) == \
size_t(eArenaObjectID_##classname), \

View File

@ -0,0 +1,72 @@
diff --git a/security/certverifier/CertVerifier.cpp b/security/certverifier/CertVerifier.cpp
--- a/security/certverifier/CertVerifier.cpp
+++ b/security/certverifier/CertVerifier.cpp
@@ -120,16 +120,20 @@ IsCertChainRootBuiltInRoot(const UniqueC
}
CERTCertificate* root = rootNode->cert;
if (!root) {
return Result::FATAL_ERROR_LIBRARY_FAILURE;
}
return IsCertBuiltInRoot(root, result);
}
+// The term "builtin root" traditionally refers to a root CA certificate that
+// has been added to the NSS trust store, because it has been approved
+// for inclusion according to the Mozilla CA policy, and might be accepted
+// by Mozilla applications as an issuer for certificates seen on the public web.
Result
IsCertBuiltInRoot(CERTCertificate* cert, bool& result)
{
result = false;
#ifdef DEBUG
nsCOMPtr<nsINSSComponent> component(do_GetService(PSM_COMPONENT_CONTRACTID));
if (!component) {
return Result::FATAL_ERROR_LIBRARY_FAILURE;
@@ -142,25 +146,38 @@ IsCertBuiltInRoot(CERTCertificate* cert,
return Success;
}
#endif // DEBUG
AutoSECMODListReadLock lock;
for (SECMODModuleList* list = SECMOD_GetDefaultModuleList(); list;
list = list->next) {
for (int i = 0; i < list->module->slotCount; i++) {
PK11SlotInfo* slot = list->module->slots[i];
- // PK11_HasRootCerts should return true if and only if the given slot has
- // an object with a CKA_CLASS of CKO_NETSCAPE_BUILTIN_ROOT_LIST, which
- // should be true only of the builtin root list.
- // If we can find a copy of the given certificate on the slot with the
- // builtin root list, that certificate must be a builtin.
- if (PK11_IsPresent(slot) && PK11_HasRootCerts(slot) &&
- PK11_FindCertInSlot(slot, cert, nullptr) != CK_INVALID_HANDLE) {
- result = true;
- return Success;
+ // We're searching for the "builtin root module", which is a module that
+ // contains an object with a CKA_CLASS of CKO_NETSCAPE_BUILTIN_ROOT_LIST.
+ // We use PK11_HasRootCerts() to identify a module with that property.
+ // In the past, we exclusively used the PKCS#11 module named nssckbi,
+ // which is provided by the NSS library.
+ // Nowadays, some distributions use a replacement module, which contains
+ // the builtin roots, but which also contains additional CA certificates,
+ // such as CAs trusted in a local deployment.
+ // We want to be able to distinguish between these two categories,
+ // because a CA, which may issue certificates for the public web,
+ // is expected to comply with additional requirements.
+ // If the certificate has attribute CKA_NSS_MOZILLA_CA_POLICY set to true,
+ // then we treat it as a "builtin root".
+ if (PK11_IsPresent(slot) && PK11_HasRootCerts(slot)) {
+ CK_OBJECT_HANDLE handle = PK11_FindCertInSlot(slot, cert, nullptr);
+ if (handle != CK_INVALID_HANDLE &&
+ PK11_HasAttributeSet(slot, handle, CKA_NSS_MOZILLA_CA_POLICY,
+ false)) {
+ // Attribute was found, and is set to true
+ result = true;
+ break;
+ }
}
}
}
return Success;
}
static Result
BuildCertChainForOneKeyUsage(NSSCertDBTrustDomain& trustDomain, Input certDER,

File diff suppressed because one or more lines are too long

3
sources Normal file
View File

@ -0,0 +1,3 @@
SHA512 (cbindgen-vendor.tar.xz) = f0425020e2d43a3d28b03f82bdb9719728112a2c94b1d595da384d0674ca21d0940a6f729a690434d670e598fbc6bb5193c89da0a4633a734c70dd786222e711
SHA512 (firefox-81.0.2.source.tar.xz) = 8a3ef4819120e93b860344ef05b4ef05262e3f127053ef66b3c1eb4b157932913f72fd4ba5500e86c2ef29f25be58e0c6e2c47a1c1ecde2abe77ece5f948fd75
SHA512 (firefox-langpacks-81.0.2-20201012.tar.xz) = 5cc72b8a2e27318a55cda9156c6ade3613ae7f560d76fa0a12182626c6051b8d02f23b95597d185daf35b85bd8491bc44a6ca214619b641dc47f98564db75c97