This change implements the GetSourceList and SelectSource APIs from the DesktopCapturer interface for WindowCapturerWinWgc. No functional changes were made as the WGC capturer is not in use yet. I refactored the source enumeration functionality out of the GDI capturer and into the utils file, so both of the capturers can share the implementation. This change also renames the window capturers to include Win in the name, and updates some of the out dated code style. I've tested these changes by running the related unit tests and applying them to a Chromium enlistment and testing on https://webrtc.github.io/samples/src/content/getusermedia/getdisplaymedia/ Bug: webrtc:9273 Change-Id: If0ca023cb13900ab2b897aec0f38333f75a1b748 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178960 Reviewed-by: Jamie Walch <jamiewalch@chromium.org> Reviewed-by: Tommi <tommi@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Austin Orion <auorion@microsoft.com> Cr-Commit-Position: refs/heads/master@{#31748}
32 lines
1.2 KiB
C++
32 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "modules/desktop_capture/desktop_capture_options.h"
|
|
#include "modules/desktop_capture/desktop_capturer.h"
|
|
#include "modules/desktop_capture/win/window_capturer_win_gdi.h"
|
|
#include "modules/desktop_capture/win/window_capturer_win_wgc.h"
|
|
|
|
namespace webrtc {
|
|
|
|
// static
|
|
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
|
|
const DesktopCaptureOptions& options) {
|
|
// TODO(bugs.webrtc.org/11760): Add a WebRTC field trial (or similar
|
|
// mechanism) and Windows version check here that leads to use of the WGC
|
|
// capturer once it is fully implemented.
|
|
if (true) {
|
|
return WindowCapturerWinGdi::CreateRawWindowCapturer(options);
|
|
} else {
|
|
return WindowCapturerWinWgc::CreateRawWindowCapturer(options);
|
|
}
|
|
}
|
|
|
|
} // namespace webrtc
|