MFH: r561980 r562119

www/firefox: update to 85.0

- Backport fix for high CPU usage in OSS backend [1]

Changes:	https://www.mozilla.org/firefox/85.0/releasenotes/
Requested by:	Ka Ho Ng [1]
This commit is contained in:
Jan Beich 2021-01-25 16:16:04 +00:00
parent 95408651f7
commit 6062ca5fb9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2021Q1/; revision=562574
4 changed files with 164 additions and 152 deletions

View File

@ -2,7 +2,8 @@
# $FreeBSD$
PORTNAME= firefox
DISTVERSION= 84.0.2
DISTVERSION= 85.0
PORTREVISION= 1
PORTEPOCH= 2
CATEGORIES= www
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1609951210
SHA256 (firefox-84.0.2.source.tar.xz) = 92bfd518d4f9760c897388a8e06130b171c1c43524d8af181add9daac2be7b37
SIZE (firefox-84.0.2.source.tar.xz) = 363415420
TIMESTAMP = 1610994701
SHA256 (firefox-85.0.source.tar.xz) = 5f03712642f5e77de4581d2ba3ee3e87cfa44c3d2fdd8fe0fb56ea05a57f7b50
SIZE (firefox-85.0.source.tar.xz) = 378300292

View File

@ -1,148 +0,0 @@
commit 16e7bdc29390
Author: Dan Minor <dminor@mozilla.com>
Date: Thu Nov 19 14:14:40 2020 +0000
Bug 1677715 - Build libpipewire as a dependency of libwebrtc; r=ng
Differential Revision: https://phabricator.services.mozilla.com/D97431
---
dom/media/webrtc/third_party_build/moz.build | 3 +++
1 file changed, 3 insertions(+)
diff --git dom/media/webrtc/third_party_build/moz.build dom/media/webrtc/third_party_build/moz.build
index db10dab7ff21..dc0df3ba1b6c 100644
--- dom/media/webrtc/third_party_build/moz.build
+++ dom/media/webrtc/third_party_build/moz.build
@@ -56,6 +56,9 @@ webrtc_non_unified_sources = [
"../../../../third_party/libwebrtc/webrtc/video/overuse_frame_detector.cc", # Because of name clash with call_stats.cc on kWeightFactor
]
+if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
+ DIRS += ["../../../../third_party/pipewire/libpipewire"]
+
GN_DIRS += ["../../../../third_party/libwebrtc/webrtc"]
gn_vars_copy = gn_vars.copy()
commit 553093ff0fa7
Author: Dan Minor <dminor@mozilla.com>
Date: Thu Nov 19 14:14:50 2020 +0000
Bug 1677715 - Regenerate moz.build files; r=ng
Differential Revision: https://phabricator.services.mozilla.com/D97433
---
.../desktop_capture_generic_gn/moz.build | 51 +++++++++++++++++-----
third_party/libwebrtc/webrtc/moz.build | 3 --
2 files changed, 40 insertions(+), 14 deletions(-)
diff --git third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
index 8df8b8b993f9..a0e116195e0e 100644
--- third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
+++ third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
@@ -5,6 +5,8 @@
### This moz.build was AUTOMATICALLY GENERATED from a GN config, ###
### DO NOT edit it by hand. ###
+if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
+ CXXFLAGS += CONFIG["TK_CFLAGS"]
COMPILE_FLAGS["OS_INCLUDES"] = []
AllowCompilerWarnings()
@@ -25,8 +27,7 @@ LOCAL_INCLUDES += [
"/ipc/chromium/src",
"/ipc/glue",
"/media/libyuv/libyuv/include/",
- "/third_party/libwebrtc/webrtc/",
- "/third_party/pipewire"
+ "/third_party/libwebrtc/webrtc/"
]
UNIFIED_SOURCES += [
@@ -162,7 +163,6 @@ if CONFIG["OS_TARGET"] == "Linux":
DEFINES["WEBRTC_LINUX"] = True
DEFINES["WEBRTC_POSIX"] = True
DEFINES["_FILE_OFFSET_BITS"] = "64"
- DEFINES["WEBRTC_USE_PIPEWIRE"] = "1"
OS_LIBS += [
"rt",
@@ -195,14 +195,6 @@ if CONFIG["OS_TARGET"] == "Linux":
"/third_party/libwebrtc/webrtc/modules/desktop_capture/window_capturer_linux.cc"
]
- CXXFLAGS += CONFIG['TK_CFLAGS']
-
- UNIFIED_SOURCES += [
- "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc",
- "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
- "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc"
- ]
-
if CONFIG["OS_TARGET"] == "NetBSD":
DEFINES["USE_X11"] = "1"
@@ -393,6 +385,17 @@ if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux":
DEFINES["DISABLE_NACL"] = True
DEFINES["NO_TCMALLOC"] = True
+ DEFINES["WEBRTC_USE_PIPEWIRE"] = True
+
+ LOCAL_INCLUDES += [
+ "/third_party/pipewire/"
+ ]
+
+ UNIFIED_SOURCES += [
+ "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc",
+ "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
+ "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc"
+ ]
if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux":
@@ -400,6 +403,32 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux":
"-msse2"
]
+ DEFINES["WEBRTC_USE_PIPEWIRE"] = True
+
+ LOCAL_INCLUDES += [
+ "/third_party/pipewire/"
+ ]
+
+ UNIFIED_SOURCES += [
+ "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc",
+ "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
+ "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc"
+ ]
+
+if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux":
+
+ DEFINES["WEBRTC_USE_PIPEWIRE"] = True
+
+ LOCAL_INCLUDES += [
+ "/third_party/pipewire/"
+ ]
+
+ UNIFIED_SOURCES += [
+ "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc",
+ "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
+ "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc"
+ ]
+
if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "NetBSD":
CXXFLAGS += [
diff --git third_party/libwebrtc/webrtc/moz.build third_party/libwebrtc/webrtc/moz.build
index 53af3e5786bf..295247899372 100644
--- third_party/libwebrtc/webrtc/moz.build
+++ third_party/libwebrtc/webrtc/moz.build
@@ -186,9 +186,6 @@ if CONFIG["OS_TARGET"] == "Linux":
"/third_party/libwebrtc/webrtc/modules/video_capture/video_capture_internal_impl_gn",
"/third_party/libwebrtc/webrtc/system_wrappers/cpu_features_linux_gn"
]
- DIRS += [
- "/third_party/pipewire/libpipewire"
- ]
if CONFIG["OS_TARGET"] == "NetBSD":

View File

@ -0,0 +1,159 @@
commit f48008ba21c0
Author: Paul Adenot <paul@paul.cx>
Date: Tue Jan 19 07:04:00 2021 -0800
Bug 1687487 - Update libcubeb to 4a83932. r=kinetik
---
media/libcubeb/moz.yaml | 2 +-
media/libcubeb/src/cubeb_oss.c | 43 ++++++++++++++++++++++++++++++-------
media/libcubeb/src/cubeb_wasapi.cpp | 24 ++++++++++-----------
3 files changed, 48 insertions(+), 21 deletions(-)
diff --git media/libcubeb/moz.yaml media/libcubeb/moz.yaml
index c90f95e09a0a..c2eea799d1bf 100644
--- media/libcubeb/moz.yaml
+++ media/libcubeb/moz.yaml
@@ -19,5 +19,5 @@ origin:
license: "ISC"
# update.sh will update this value
- release: "85f1cf48dffd749dd32798681955155e1a1a6ff5 (2020-12-07 08:11:33 +0000)"
+ release: "4a83932caee16c9ee404b39144620fcbcc7a842f (2021-01-19 16:05:14 +0100)"
diff --git media/libcubeb/src/cubeb_oss.c media/libcubeb/src/cubeb_oss.c
index 32a4bf6de482..8c44c9e8d08a 100644
--- media/libcubeb/src/cubeb_oss.c
+++ media/libcubeb/src/cubeb_oss.c
@@ -781,6 +781,28 @@ oss_put_play_frames(cubeb_stream * s, unsigned int nframes)
return 0;
}
+static int
+oss_wait_playfd_for_space(cubeb_stream * s)
+{
+ /* For non-duplex stream we have to wait until we have space in the
+ * buffer */
+ int rate = s->play.info.sample_rate;
+ struct pollfd pfd;
+
+ pfd.events = POLLOUT|POLLHUP;
+ pfd.revents = 0;
+ pfd.fd = s->play.fd;
+
+ if (poll(&pfd, 1, s->nfr * 1000 + rate - 1 / rate) == -1) {
+ return CUBEB_ERROR;
+ }
+
+ if (pfd.revents & POLLHUP) {
+ return CUBEB_ERROR;
+ }
+ return 0;
+}
+
/* 1 - Stopped by cubeb_stream_stop, otherwise 0 */
static int
oss_audio_loop(cubeb_stream * s, cubeb_state *new_state)
@@ -873,26 +895,31 @@ oss_audio_loop(cubeb_stream * s, cubeb_state *new_state)
goto breakdown;
}
- audio_buf_info bi;
if (play_on) {
- if (ioctl(s->play.fd, SNDCTL_DSP_GETOSPACE, &bi)) {
- state = CUBEB_STATE_ERROR;
- goto breakdown;
- }
/*
* In duplex mode, playback direction drives recording direction to
* prevent building up latencies.
*/
+
+ if (oss_wait_playfd_for_space(s) != 0) {
+ state = CUBEB_STATE_ERROR;
+ goto breakdown;
+ }
+
+ audio_buf_info bi;
+ if (ioctl(s->play.fd, SNDCTL_DSP_GETOSPACE, &bi)) {
+ state = CUBEB_STATE_ERROR;
+ goto breakdown;
+ }
nfr = bi.fragsize * bi.fragments / s->play.frame_size;
if (nfr > s->bufframes) {
nfr = s->bufframes;
}
+ } else {
+ nfr = s->nfr;
}
if (record_on) {
- if (nfr == 0) {
- nfr = s->nfr;
- }
if (oss_get_rec_frames(s, nfr) == CUBEB_ERROR) {
state = CUBEB_STATE_ERROR;
goto breakdown;
diff --git media/libcubeb/src/cubeb_wasapi.cpp media/libcubeb/src/cubeb_wasapi.cpp
index 30a6d06c7e20..b7b337ce7829 100644
--- media/libcubeb/src/cubeb_wasapi.cpp
+++ media/libcubeb/src/cubeb_wasapi.cpp
@@ -778,12 +778,6 @@ hns_to_frames(cubeb_stream * stm, REFERENCE_TIME hns)
return hns_to_frames(get_rate(stm), hns);
}
-REFERENCE_TIME
-frames_to_hns(cubeb_stream * stm, uint32_t frames)
-{
- return std::ceil(frames * 10000000.0 / get_rate(stm));
-}
-
REFERENCE_TIME
frames_to_hns(uint32_t rate, uint32_t frames)
{
@@ -1834,7 +1828,8 @@ initialize_iaudioclient2(com_ptr<IAudioClient> & audio_client)
return CUBEB_OK;
}
-static bool
+// Not static to suppress a warning.
+/* static */ bool
initialize_iaudioclient3(com_ptr<IAudioClient> & audio_client,
cubeb_stream * stm,
const com_heap_ptr<WAVEFORMATEX> & mix_format,
@@ -2185,7 +2180,7 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
void wasapi_find_matching_output_device(cubeb_stream * stm) {
HRESULT hr;
- cubeb_device_info * input_device;
+ cubeb_device_info * input_device = nullptr;
cubeb_device_collection collection;
// Only try to match to an output device if the input device is a bluetooth
@@ -2207,6 +2202,9 @@ void wasapi_find_matching_output_device(cubeb_stream * stm) {
}
int rv = wasapi_enumerate_devices(stm->context, (cubeb_device_type)(CUBEB_DEVICE_TYPE_INPUT|CUBEB_DEVICE_TYPE_OUTPUT), &collection);
+ if (rv != CUBEB_OK) {
+ return;
+ }
// Find the input device, and then find the output device with the same group
// id and the same rate.
@@ -2220,11 +2218,13 @@ void wasapi_find_matching_output_device(cubeb_stream * stm) {
for (uint32_t i = 0; i < collection.count; i++) {
cubeb_device_info dev = collection.device[i];
- if (dev.type == CUBEB_DEVICE_TYPE_OUTPUT &&
- dev.group_id && !strcmp(dev.group_id, input_device->group_id) &&
+ if (dev.type == CUBEB_DEVICE_TYPE_OUTPUT && dev.group_id && input_device &&
+ !strcmp(dev.group_id, input_device->group_id) &&
dev.default_rate == input_device->default_rate) {
- LOG("Found matching device for %s: %s", input_device->friendly_name, dev.friendly_name);
- stm->output_device_id = utf8_to_wstr(reinterpret_cast<char const *>(dev.devid));
+ LOG("Found matching device for %s: %s", input_device->friendly_name,
+ dev.friendly_name);
+ stm->output_device_id =
+ utf8_to_wstr(reinterpret_cast<char const *>(dev.devid));
}
}