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}
diff --git a/modules/desktop_capture/desktop_capture_types.h b/modules/desktop_capture/desktop_capture_types.h
index f2aad8f..fd5f881 100644
--- a/modules/desktop_capture/desktop_capture_types.h
+++ b/modules/desktop_capture/desktop_capture_types.h
@@ -60,6 +60,8 @@
 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
diff --git a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc
index 2f99876..8bf0662 100644
--- a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc
+++ b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc
@@ -138,6 +138,7 @@
   // 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));
 }
 
diff --git a/modules/desktop_capture/linux/x11/screen_capturer_x11.cc b/modules/desktop_capture/linux/x11/screen_capturer_x11.cc
index 3cc256b..4b7cbf5 100644
--- a/modules/desktop_capture/linux/x11/screen_capturer_x11.cc
+++ b/modules/desktop_capture/linux/x11/screen_capturer_x11.cc
@@ -278,6 +278,7 @@
   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));
 }
 
diff --git a/modules/desktop_capture/linux/x11/window_capturer_x11.cc b/modules/desktop_capture/linux/x11/window_capturer_x11.cc
index 5b87e8c..b55f7e8 100644
--- a/modules/desktop_capture/linux/x11/window_capturer_x11.cc
+++ b/modules/desktop_capture/linux/x11/window_capturer_x11.cc
@@ -180,6 +180,7 @@
   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));
 }