зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1828517 - Vendor libwebrtc from 5bdb4418e9
Upstream commit: https://webrtc.googlesource.com/src/+/5bdb4418e90cf0e9788aa7ca75082e5ea0746e3b M111: Add UMA histograms to track usage of fullscreen detection Cherry picked from commits: b311f6aba82cd93b2d748b8e47c6f8d29a21746d fd29662c61b2145d6de4c38eb55e48421a4d427b (cherry picked from commit b311f6aba82cd93b2d748b8e47c6f8d29a21746d) No-Try: True Bug: chromium:1348011 Change-Id: I3219e74c49ff77e00b2224c8cf82f78d1e0fd9cf Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291708 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Johannes Kron <kron@webrtc.org> Cr-Original-Commit-Position: refs/heads/main@{#39254} Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/292460 Cr-Commit-Position: refs/branch-heads/5563@{#1} Cr-Branched-From: 6c032cb8356b0d3f717c4fcf50796241f2bba6c2-refs/heads/main@{#39207}
This commit is contained in:
Родитель
5d4e53f0e2
Коммит
8b6ed85ff2
|
@ -21240,3 +21240,6 @@ dcb09ff218
|
|||
# MOZ_LIBWEBRTC_SRC=/home/mfroman/mozilla/moz-central/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
|
||||
# base of lastest vendoring
|
||||
6c032cb835
|
||||
# MOZ_LIBWEBRTC_SRC=/home/mfroman/mozilla/moz-central/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
|
||||
# base of lastest vendoring
|
||||
5bdb4418e9
|
||||
|
|
|
@ -14182,3 +14182,5 @@ libwebrtc updated from /home/mfroman/mozilla/moz-central/.moz-fast-forward/moz-l
|
|||
libwebrtc updated from /home/mfroman/mozilla/moz-central/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-04-24T23:01:29.543622.
|
||||
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/moz-central/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
|
||||
libwebrtc updated from /home/mfroman/mozilla/moz-central/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-04-24T23:03:00.188080.
|
||||
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/moz-central/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
|
||||
libwebrtc updated from /home/mfroman/mozilla/moz-central/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-04-24T23:03:58.539902.
|
||||
|
|
|
@ -153,6 +153,9 @@ class CroppingWindowCapturerWin : public CroppingWindowCapturer {
|
|||
bool enumerate_current_process_windows_;
|
||||
|
||||
rtc::scoped_refptr<FullScreenWindowDetector> full_screen_window_detector_;
|
||||
|
||||
// Used to make sure that we only log the usage of fullscreen detection once.
|
||||
mutable bool fullscreen_usage_logged_ = false;
|
||||
};
|
||||
|
||||
void CroppingWindowCapturerWin::CaptureFrame() {
|
||||
|
@ -307,6 +310,10 @@ WindowId CroppingWindowCapturerWin::GetWindowToCapture() const {
|
|||
full_screen_window_detector_
|
||||
? full_screen_window_detector_->FindFullScreenWindow(selected_source)
|
||||
: 0;
|
||||
if (full_screen_source != selected_source && !fullscreen_usage_logged_) {
|
||||
fullscreen_usage_logged_ = true;
|
||||
LogDesktopCapturerFullscreenDetectorUsage();
|
||||
}
|
||||
return full_screen_source ? full_screen_source : selected_source;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "modules/desktop_capture/cropping_window_capturer.h"
|
||||
#include "modules/desktop_capture/desktop_capture_options.h"
|
||||
#include "modules/desktop_capture/desktop_capturer_differ_wrapper.h"
|
||||
#include "system_wrappers/include/metrics.h"
|
||||
|
||||
#if defined(RTC_ENABLE_WIN_WGC)
|
||||
#include "modules/desktop_capture/win/wgc_capturer_win.h"
|
||||
|
@ -31,6 +32,11 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
void LogDesktopCapturerFullscreenDetectorUsage() {
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Screenshare.DesktopCapturerFullscreenDetector",
|
||||
true);
|
||||
}
|
||||
|
||||
DesktopCapturer::~DesktopCapturer() = default;
|
||||
|
||||
DelegatedSourceListController*
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
void RTC_EXPORT LogDesktopCapturerFullscreenDetectorUsage();
|
||||
|
||||
class DesktopCaptureOptions;
|
||||
class DesktopFrame;
|
||||
|
||||
|
|
|
@ -73,6 +73,9 @@ class WindowCapturerMac : public DesktopCapturer {
|
|||
const rtc::scoped_refptr<DesktopConfigurationMonitor> configuration_monitor_;
|
||||
|
||||
WindowFinderMac window_finder_;
|
||||
|
||||
// Used to make sure that we only log the usage of fullscreen detection once.
|
||||
bool fullscreen_usage_logged_ = false;
|
||||
};
|
||||
|
||||
WindowCapturerMac::WindowCapturerMac(
|
||||
|
@ -179,7 +182,14 @@ void WindowCapturerMac::CaptureFrame() {
|
|||
|
||||
CGWindowID full_screen_window = full_screen_window_detector_->FindFullScreenWindow(window_id_);
|
||||
|
||||
if (full_screen_window != kCGNullWindowID) on_screen_window = full_screen_window;
|
||||
if (full_screen_window != kCGNullWindowID) {
|
||||
// If this is the first time this happens, report to UMA that the feature is active.
|
||||
if (!fullscreen_usage_logged_) {
|
||||
LogDesktopCapturerFullscreenDetectorUsage();
|
||||
fullscreen_usage_logged_ = true;
|
||||
}
|
||||
on_screen_window = full_screen_window;
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<DesktopFrame> frame = DesktopFrameCGImage::CreateForWindow(on_screen_window);
|
||||
|
|
|
@ -622,10 +622,10 @@ index 4ab6baad83..aa8496819b 100644
|
|||
};
|
||||
|
||||
diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h
|
||||
index 3e8f0dcac5..558217badd 100644
|
||||
index d336723f18..6909a57891 100644
|
||||
--- a/modules/desktop_capture/desktop_capturer.h
|
||||
+++ b/modules/desktop_capture/desktop_capturer.h
|
||||
@@ -77,6 +77,7 @@ class RTC_EXPORT DesktopCapturer {
|
||||
@@ -79,6 +79,7 @@ class RTC_EXPORT DesktopCapturer {
|
||||
struct Source {
|
||||
// The unique id to represent a Source of current DesktopCapturer.
|
||||
SourceId id;
|
||||
|
|
|
@ -14,10 +14,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/d57a030e6e3ae9ff5
|
|||
2 files changed, 19 insertions(+)
|
||||
|
||||
diff --git a/modules/desktop_capture/desktop_capturer.cc b/modules/desktop_capture/desktop_capturer.cc
|
||||
index dc24b387d5..4debc75394 100644
|
||||
index 5211f1acec..4baa93cab9 100644
|
||||
--- a/modules/desktop_capture/desktop_capturer.cc
|
||||
+++ b/modules/desktop_capture/desktop_capturer.cc
|
||||
@@ -95,6 +95,17 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer(
|
||||
@@ -101,6 +101,17 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer(
|
||||
return capturer;
|
||||
}
|
||||
|
||||
|
@ -36,10 +36,10 @@ index dc24b387d5..4debc75394 100644
|
|||
bool DesktopCapturer::IsRunningUnderWayland() {
|
||||
const char* xdg_session_type = getenv("XDG_SESSION_TYPE");
|
||||
diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h
|
||||
index 558217badd..3fdcd2c5d0 100644
|
||||
index 6909a57891..cf75004af5 100644
|
||||
--- a/modules/desktop_capture/desktop_capturer.h
|
||||
+++ b/modules/desktop_capture/desktop_capturer.h
|
||||
@@ -176,6 +176,10 @@ class RTC_EXPORT DesktopCapturer {
|
||||
@@ -178,6 +178,10 @@ class RTC_EXPORT DesktopCapturer {
|
||||
static std::unique_ptr<DesktopCapturer> CreateScreenCapturer(
|
||||
const DesktopCaptureOptions& options);
|
||||
|
||||
|
@ -50,7 +50,7 @@ index 558217badd..3fdcd2c5d0 100644
|
|||
#if defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11)
|
||||
static bool IsRunningUnderWayland();
|
||||
|
||||
@@ -201,6 +205,10 @@ class RTC_EXPORT DesktopCapturer {
|
||||
@@ -203,6 +207,10 @@ class RTC_EXPORT DesktopCapturer {
|
||||
// capture screens.
|
||||
static std::unique_ptr<DesktopCapturer> CreateRawScreenCapturer(
|
||||
const DesktopCaptureOptions& options);
|
||||
|
|
|
@ -10,10 +10,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/1495ca5ef535f8ad6
|
|||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules/desktop_capture/window_capturer_mac.mm b/modules/desktop_capture/window_capturer_mac.mm
|
||||
index f0b413b0a6..882498bc34 100644
|
||||
index f99b4a74d1..10f6a74650 100644
|
||||
--- a/modules/desktop_capture/window_capturer_mac.mm
|
||||
+++ b/modules/desktop_capture/window_capturer_mac.mm
|
||||
@@ -167,8 +167,9 @@ void WindowCapturerMac::CaptureFrame() {
|
||||
@@ -170,8 +170,9 @@ void WindowCapturerMac::CaptureFrame() {
|
||||
return webrtc::GetWindowList(
|
||||
[sources](CFDictionaryRef window) {
|
||||
WindowId window_id = GetWindowId(window);
|
||||
|
|
|
@ -46,10 +46,10 @@ index 381d1021c4..e777a45f92 100644
|
|||
// Type used to identify windows on the desktop. Values are platform-specific:
|
||||
// - On Windows: HWND cast to intptr_t.
|
||||
diff --git a/modules/desktop_capture/desktop_capturer.cc b/modules/desktop_capture/desktop_capturer.cc
|
||||
index 4debc75394..65a4045f8c 100644
|
||||
index 4baa93cab9..7df6becb4e 100644
|
||||
--- a/modules/desktop_capture/desktop_capturer.cc
|
||||
+++ b/modules/desktop_capture/desktop_capturer.cc
|
||||
@@ -25,6 +25,10 @@
|
||||
@@ -26,6 +26,10 @@
|
||||
#include "rtc_base/win/windows_version.h"
|
||||
#endif // defined(RTC_ENABLE_WIN_WGC)
|
||||
|
||||
|
@ -59,8 +59,8 @@ index 4debc75394..65a4045f8c 100644
|
|||
+
|
||||
namespace webrtc {
|
||||
|
||||
DesktopCapturer::~DesktopCapturer() = default;
|
||||
@@ -78,6 +82,30 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer(
|
||||
void LogDesktopCapturerFullscreenDetectorUsage() {
|
||||
@@ -84,6 +88,30 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer(
|
||||
return capturer;
|
||||
}
|
||||
|
||||
|
@ -92,10 +92,10 @@ index 4debc75394..65a4045f8c 100644
|
|||
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer(
|
||||
const DesktopCaptureOptions& options) {
|
||||
diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h
|
||||
index 3fdcd2c5d0..2713c0e603 100644
|
||||
index cf75004af5..951c4a9b10 100644
|
||||
--- a/modules/desktop_capture/desktop_capturer.h
|
||||
+++ b/modules/desktop_capture/desktop_capturer.h
|
||||
@@ -168,6 +168,12 @@ class RTC_EXPORT DesktopCapturer {
|
||||
@@ -170,6 +170,12 @@ class RTC_EXPORT DesktopCapturer {
|
||||
// The return value if `pos` is out of the scope of the source is undefined.
|
||||
virtual bool IsOccluded(const DesktopVector& pos);
|
||||
|
||||
|
@ -108,7 +108,7 @@ index 3fdcd2c5d0..2713c0e603 100644
|
|||
// Creates a DesktopCapturer instance which targets to capture windows.
|
||||
static std::unique_ptr<DesktopCapturer> CreateWindowCapturer(
|
||||
const DesktopCaptureOptions& options);
|
||||
@@ -196,6 +202,13 @@ class RTC_EXPORT DesktopCapturer {
|
||||
@@ -198,6 +204,13 @@ class RTC_EXPORT DesktopCapturer {
|
||||
// CroppingWindowCapturer needs to create raw capturers without wrappers, so
|
||||
// the following two functions are protected.
|
||||
|
||||
|
|
|
@ -26,10 +26,10 @@ Also includes:
|
|||
2 files changed, 3 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/modules/desktop_capture/desktop_capturer.cc b/modules/desktop_capture/desktop_capturer.cc
|
||||
index 65a4045f8c..042d9f7633 100644
|
||||
index 7df6becb4e..1af19a1fd2 100644
|
||||
--- a/modules/desktop_capture/desktop_capturer.cc
|
||||
+++ b/modules/desktop_capture/desktop_capturer.cc
|
||||
@@ -25,7 +25,7 @@
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "rtc_base/win/windows_version.h"
|
||||
#endif // defined(RTC_ENABLE_WIN_WGC)
|
||||
|
||||
|
@ -38,7 +38,7 @@ index 65a4045f8c..042d9f7633 100644
|
|||
#include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h"
|
||||
#endif
|
||||
|
||||
@@ -82,7 +82,6 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer(
|
||||
@@ -88,7 +88,6 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer(
|
||||
return capturer;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ index 65a4045f8c..042d9f7633 100644
|
|||
// static
|
||||
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateGenericCapturer(
|
||||
const DesktopCaptureOptions& options) {
|
||||
@@ -94,17 +93,17 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateGenericCapturer(
|
||||
@@ -100,17 +99,17 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateGenericCapturer(
|
||||
return capturer;
|
||||
}
|
||||
|
||||
|
@ -67,10 +67,10 @@ index 65a4045f8c..042d9f7633 100644
|
|||
// static
|
||||
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer(
|
||||
diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h
|
||||
index 2713c0e603..99a3606a05 100644
|
||||
index 951c4a9b10..12ef57ba26 100644
|
||||
--- a/modules/desktop_capture/desktop_capturer.h
|
||||
+++ b/modules/desktop_capture/desktop_capturer.h
|
||||
@@ -168,11 +168,9 @@ class RTC_EXPORT DesktopCapturer {
|
||||
@@ -170,11 +170,9 @@ class RTC_EXPORT DesktopCapturer {
|
||||
// The return value if `pos` is out of the scope of the source is undefined.
|
||||
virtual bool IsOccluded(const DesktopVector& pos);
|
||||
|
||||
|
@ -82,7 +82,7 @@ index 2713c0e603..99a3606a05 100644
|
|||
|
||||
// Creates a DesktopCapturer instance which targets to capture windows.
|
||||
static std::unique_ptr<DesktopCapturer> CreateWindowCapturer(
|
||||
@@ -202,12 +200,10 @@ class RTC_EXPORT DesktopCapturer {
|
||||
@@ -204,12 +202,10 @@ class RTC_EXPORT DesktopCapturer {
|
||||
// CroppingWindowCapturer needs to create raw capturers without wrappers, so
|
||||
// the following two functions are protected.
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче