mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Add UMA histograms to track usage of fullscreen detection
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-Commit-Position: refs/heads/main@{#39254}
This commit is contained in:
parent
85abbdf526
commit
b311f6aba8
4 changed files with 25 additions and 1 deletions
|
@ -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"
|
||||
|
@ -27,6 +28,10 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
void LogDesktopCapturerFullscreenDetectorUsage() {
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Screenshare.DesktopCapturerUsage", 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(
|
||||
|
@ -178,7 +181,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);
|
||||
|
|
Loading…
Reference in a new issue