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

Unified Diff: webrtc/modules/desktop_capture/screen_capturer_win.cc

Issue 2709523003: BlankDetectorDesktopCapturerWrapper to detect a blank DesktopFrame (Closed)
Patch Set: Remove HISTOGRAM Created 3 years, 10 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
« no previous file with comments | « webrtc/modules/desktop_capture/rgba_color.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/screen_capturer_win.cc
diff --git a/webrtc/modules/desktop_capture/screen_capturer_win.cc b/webrtc/modules/desktop_capture/screen_capturer_win.cc
index 602600be89b309a5912c732ec1ffde3cf257753b..d8aecb15c7e86a6f5c124504f1c72f569baa9b7c 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_win.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_win.cc
@@ -11,24 +11,38 @@
#include <memory>
#include <utility>
+#include "webrtc/modules/desktop_capture/blank_detector_desktop_capturer_wrapper.h"
#include "webrtc/modules/desktop_capture/desktop_capturer.h"
#include "webrtc/modules/desktop_capture/desktop_capture_options.h"
#include "webrtc/modules/desktop_capture/fallback_desktop_capturer_wrapper.h"
+#include "webrtc/modules/desktop_capture/rgba_color.h"
#include "webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h"
#include "webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h"
#include "webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h"
namespace webrtc {
+namespace {
+
+std::unique_ptr<DesktopCapturer> CreateScreenCapturerWinDirectx(
+ const DesktopCaptureOptions& options) {
+ std::unique_ptr<DesktopCapturer> capturer(
+ new ScreenCapturerWinDirectx(options));
+ capturer.reset(new BlankDetectorDesktopCapturerWrapper(
+ std::move(capturer), RgbaColor(0, 0, 0, 0)));
+ return capturer;
+}
+
+} // namespace
+
// static
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer(
const DesktopCaptureOptions& options) {
- std::unique_ptr<DesktopCapturer> capturer;
+ std::unique_ptr<DesktopCapturer> capturer(new ScreenCapturerWinGdi(options));
if (options.allow_directx_capturer() &&
ScreenCapturerWinDirectx::IsSupported()) {
- capturer.reset(new ScreenCapturerWinDirectx(options));
- } else {
- capturer.reset(new ScreenCapturerWinGdi(options));
+ capturer.reset(new FallbackDesktopCapturerWrapper(
+ CreateScreenCapturerWinDirectx(options), std::move(capturer)));
}
if (options.allow_use_magnification_api()) {
« no previous file with comments | « webrtc/modules/desktop_capture/rgba_color.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698