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; |
} |