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

Unified Diff: webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.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/dxgi_duplicator_controller.cc
diff --git a/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.cc b/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.cc
index 1c015e4a82a71a4d8e7fffd4e684237bf19a9972..83e0fda5ffec6b5ea30f8085c9186474f2ae9170 100644
--- a/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.cc
+++ b/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.cc
@@ -114,6 +114,16 @@ int DxgiDuplicatorController::ScreenCount() {
return 0;
}
+bool DxgiDuplicatorController::GetDeviceNames(
+ std::vector<std::string>* output) {
+ rtc::CritScope lock(&lock_);
+ if (Initialize()) {
+ GetDeviceNamesUnlocked(output);
+ return true;
+ }
+ return false;
+}
+
DxgiDuplicatorController::Result
DxgiDuplicatorController::DoDuplicate(DxgiFrame* frame, int monitor_id) {
RTC_DCHECK(frame);
@@ -370,6 +380,16 @@ int DxgiDuplicatorController::ScreenCountUnlocked() const {
return result;
}
+void DxgiDuplicatorController::GetDeviceNamesUnlocked(
+ std::vector<std::string>* output) const {
+ RTC_DCHECK(output);
+ for (auto& duplicator : duplicators_) {
+ for (int i = 0; i < duplicator.screen_count(); i++) {
+ output->push_back(duplicator.GetDeviceName(i));
+ }
+ }
+}
+
DesktopSize DxgiDuplicatorController::SelectedDesktopSize(
int monitor_id) const {
if (monitor_id < 0) {

Powered by Google App Engine
This is Rietveld 408576698