Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1222)

Unified Diff: webrtc/modules/desktop_capture/win/screen_capture_utils.cc

Issue 2971393002: Output DeviceName from various windows ScreenCapturer related implementations (Closed)
Patch Set: Resolve review comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/desktop_capture/win/screen_capture_utils.cc
diff --git a/webrtc/modules/desktop_capture/win/screen_capture_utils.cc b/webrtc/modules/desktop_capture/win/screen_capture_utils.cc
index 9fa5c8b12db42a1816998c224ea25947b2b7b1ff..d06c869567382d223a2d27aaf38ee424c7063b87 100644
--- a/webrtc/modules/desktop_capture/win/screen_capture_utils.cc
+++ b/webrtc/modules/desktop_capture/win/screen_capture_utils.cc
@@ -13,11 +13,16 @@
#include <windows.h>
#include "webrtc/rtc_base/checks.h"
+#include "webrtc/rtc_base/win32.h"
namespace webrtc {
-bool GetScreenList(DesktopCapturer::SourceList* screens) {
- RTC_DCHECK(screens->size() == 0);
+bool GetScreenList(DesktopCapturer::SourceList* screens,
+ std::vector<std::string>* device_names /* = nullptr */) {
+ RTC_DCHECK_EQ(screens->size(), 0U);
+ if (device_names) {
+ RTC_DCHECK_EQ(device_names->size(), 0U);
+ }
BOOL enum_result = TRUE;
for (int device_index = 0;; ++device_index) {
@@ -34,6 +39,9 @@ bool GetScreenList(DesktopCapturer::SourceList* screens) {
continue;
screens->push_back({device_index, std::string()});
+ if (device_names) {
+ device_names->push_back(rtc::ToUtf8(device.DeviceName));
+ }
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698