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

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

Issue 2971393002: Output DeviceName from various windows ScreenCapturer related implementations (Closed)
Patch Set: 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_capturer_win_directx.cc
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc
index 74b7b4501a939ee90c33422d5fa7a311e595cfe9..3aa48320d5db82c8635ef0a7d94f13545e752636 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc
@@ -12,6 +12,7 @@
#include <string>
#include <utility>
+#include <vector>
#include "webrtc/modules/desktop_capture/desktop_frame.h"
#include "webrtc/rtc_base/checks.h"
@@ -110,9 +111,13 @@ void ScreenCapturerWinDirectx::CaptureFrame() {
}
bool ScreenCapturerWinDirectx::GetSourceList(SourceList* sources) {
- int screen_count = controller_->ScreenCount();
- for (int i = 0; i < screen_count; i++) {
- sources->push_back({i});
+ std::vector<std::string> device_names;
+ if (!controller_->GetDeviceNames(&device_names)) {
+ return false;
+ }
+
+ for (int i = 0; i < static_cast<int>(device_names.size()); i++) {
Do not use (sergeyu) 2017/07/11 18:21:09 Use size_t for i, then you wouldn't need the cast.
Hzj_jie 2017/07/11 19:09:25 Then we will need to convert from size_t to int in
+ sources->push_back({i, device_names[i]});
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698