blob: 9f20b56c350e5d4beff967105c3a75de63021c24 [file] [log] [blame]
Austin Orione871e022021-04-13 00:32:431/*
2 * Copyright (c) 2021 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#include "modules/desktop_capture/desktop_capture_metrics_helper.h"
12
13#include "modules/desktop_capture/desktop_capture_types.h"
14#include "system_wrappers/include/metrics.h"
15
16namespace webrtc {
17namespace {
18// This enum is logged via UMA so entries should not be reordered or have their
19// values changed. This should also be kept in sync with the values in the
20// DesktopCapturerId namespace.
21enum class SequentialDesktopCapturerId {
22 kUnknown = 0,
23 kWgcCapturerWin = 1,
henrikab9313b92023-04-13 18:57:4424 // kScreenCapturerWinMagnifier = 2,
Austin Orione871e022021-04-13 00:32:4325 kWindowCapturerWinGdi = 3,
26 kScreenCapturerWinGdi = 4,
27 kScreenCapturerWinDirectx = 5,
28 kMaxValue = kScreenCapturerWinDirectx
29};
30} // namespace
31
32void RecordCapturerImpl(uint32_t capturer_id) {
33 SequentialDesktopCapturerId sequential_id;
34 switch (capturer_id) {
35 case DesktopCapturerId::kWgcCapturerWin:
36 sequential_id = SequentialDesktopCapturerId::kWgcCapturerWin;
37 break;
Austin Orione871e022021-04-13 00:32:4338 case DesktopCapturerId::kWindowCapturerWinGdi:
39 sequential_id = SequentialDesktopCapturerId::kWindowCapturerWinGdi;
40 break;
41 case DesktopCapturerId::kScreenCapturerWinGdi:
42 sequential_id = SequentialDesktopCapturerId::kScreenCapturerWinGdi;
43 break;
44 case DesktopCapturerId::kScreenCapturerWinDirectx:
45 sequential_id = SequentialDesktopCapturerId::kScreenCapturerWinDirectx;
46 break;
47 case DesktopCapturerId::kUnknown:
48 default:
49 sequential_id = SequentialDesktopCapturerId::kUnknown;
50 }
51 RTC_HISTOGRAM_ENUMERATION(
52 "WebRTC.DesktopCapture.Win.DesktopCapturerImpl",
53 static_cast<int>(sequential_id),
54 static_cast<int>(SequentialDesktopCapturerId::kMaxValue));
55}
56
57} // namespace webrtc