Austin Orion | e871e02 | 2021-04-13 00:32:43 | [diff] [blame] | 1 | /* |
| 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 | |
| 16 | namespace webrtc { |
| 17 | namespace { |
| 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. |
| 21 | enum class SequentialDesktopCapturerId { |
| 22 | kUnknown = 0, |
| 23 | kWgcCapturerWin = 1, |
henrika | b9313b9 | 2023-04-13 18:57:44 | [diff] [blame] | 24 | // kScreenCapturerWinMagnifier = 2, |
Austin Orion | e871e02 | 2021-04-13 00:32:43 | [diff] [blame] | 25 | kWindowCapturerWinGdi = 3, |
| 26 | kScreenCapturerWinGdi = 4, |
| 27 | kScreenCapturerWinDirectx = 5, |
| 28 | kMaxValue = kScreenCapturerWinDirectx |
| 29 | }; |
| 30 | } // namespace |
| 31 | |
| 32 | void 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 Orion | e871e02 | 2021-04-13 00:32:43 | [diff] [blame] | 38 | 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 |