Add CapturerID for X11 and Wayland for telemetry

Chrome Remote Desktop will support both X11 and Wayland desktop
capturers in the near future and we'd like to differentiate between
the two in our video frame stats and telemetry.  I beleive other
products are in a similar position so I would like to add a capturer
ID to the frames generated by the capturer classes.

Bug: chromium:1366062
Change-Id: If27c35ad6ef89b6396120982edc4dd0cf2a1e51c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276081
Commit-Queue: Joe Downing <joedow@google.com>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/main@{#38185}
This commit is contained in:
Joe Downing 2022-09-23 10:29:14 -07:00 committed by WebRTC LUCI CQ
parent f863182ce5
commit 0c01606ab2
4 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,8 @@ constexpr uint32_t kScreenCapturerWinMagnifier = 2;
constexpr uint32_t kWindowCapturerWinGdi = 3;
constexpr uint32_t kScreenCapturerWinGdi = CreateFourCC('G', 'D', 'I', ' ');
constexpr uint32_t kScreenCapturerWinDirectx = CreateFourCC('D', 'X', 'G', 'I');
constexpr uint32_t kX11CapturerLinux = CreateFourCC('X', '1', '1', ' ');
constexpr uint32_t kWaylandCapturerLinux = CreateFourCC('W', 'L', ' ', ' ');
} // namespace DesktopCapturerId
} // namespace webrtc

View File

@ -138,6 +138,7 @@ void BaseCapturerPipeWire::CaptureFrame() {
// TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on
// the frame, see ScreenCapturerX11::CaptureFrame.
frame->set_capturer_id(DesktopCapturerId::kWaylandCapturerLinux);
callback_->OnCaptureResult(Result::SUCCESS, std::move(frame));
}

View File

@ -278,6 +278,7 @@ void ScreenCapturerX11::CaptureFrame() {
last_invalid_region_ = result->updated_region();
result->set_capture_time_ms((rtc::TimeNanos() - capture_start_time_nanos) /
rtc::kNumNanosecsPerMillisec);
result->set_capturer_id(DesktopCapturerId::kX11CapturerLinux);
callback_->OnCaptureResult(Result::SUCCESS, std::move(result));
}

View File

@ -180,6 +180,7 @@ void WindowCapturerX11::CaptureFrame() {
frame->mutable_updated_region()->SetRect(
DesktopRect::MakeSize(frame->size()));
frame->set_top_left(x_server_pixel_buffer_.window_rect().top_left());
frame->set_capturer_id(DesktopCapturerId::kX11CapturerLinux);
callback_->OnCaptureResult(Result::SUCCESS, std::move(frame));
}