From cdc769dd76245df7e1ebf460d7634afb00e59bd8 Mon Sep 17 00:00:00 2001 From: Simon Hangl Date: Thu, 10 Nov 2022 15:06:39 +0100 Subject: [PATCH] Adds display_id field to DesktopCapturer. The display_id field will be used in https://chromium-review.googlesource.com/c/chromium/src/+/4020313. Bug: chromium:1358949 Change-Id: I57b445e0a0fca540a2f3a5941238aee2cd995005 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282960 Reviewed-by: Elad Alon Reviewed-by: Tony Herre Reviewed-by: Henrik Andreassson Commit-Queue: Simon Hangl Cr-Commit-Position: refs/heads/main@{#38617} --- modules/desktop_capture/desktop_capture_types.h | 6 ++++-- modules/desktop_capture/desktop_capturer.h | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/desktop_capture/desktop_capture_types.h b/modules/desktop_capture/desktop_capture_types.h index fd5f881122..9627076eea 100644 --- a/modules/desktop_capture/desktop_capture_types.h +++ b/modules/desktop_capture/desktop_capture_types.h @@ -25,6 +25,8 @@ typedef intptr_t WindowId; const WindowId kNullWindowId = 0; +const int64_t kInvalidDisplayId = -1; + // Type used to identify screens on the desktop. Values are platform-specific: // - On Windows: integer display device index. // - On OSX: CGDirectDisplayID cast to intptr_t. @@ -33,9 +35,9 @@ const WindowId kNullWindowId = 0; // On Windows, ScreenId is implementation dependent: sending a ScreenId from one // implementation to another usually won't work correctly. #if defined(CHROMEOS) - typedef int64_t ScreenId; +typedef int64_t ScreenId; #else - typedef intptr_t ScreenId; +typedef intptr_t ScreenId; #endif // The screen id corresponds to all screen combined together. diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h index 513bf50c57..3e8f0dcac5 100644 --- a/modules/desktop_capture/desktop_capturer.h +++ b/modules/desktop_capture/desktop_capturer.h @@ -86,6 +86,10 @@ class RTC_EXPORT DesktopCapturer { // TODO(https://crbug.com/1369162): Remove or refactor this value. WindowId in_process_id = kNullWindowId; #endif + + // The display's unique ID. If no ID is defined, it will hold the value + // kInvalidDisplayId. + int64_t display_id = kInvalidDisplayId; }; typedef std::vector SourceList;