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

Side by Side Diff: webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h

Issue 1678073003: Cleanup shared memory handling in DesktopCapturer interface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 26 matching lines...) Expand all
37 public: 37 public:
38 // |fallback_capturer| will be used to capture the screen if a non-primary 38 // |fallback_capturer| will be used to capture the screen if a non-primary
39 // screen is being captured, or the OS does not support Magnification API, or 39 // screen is being captured, or the OS does not support Magnification API, or
40 // the magnifier capturer fails (e.g. in Windows8 Metro mode). 40 // the magnifier capturer fails (e.g. in Windows8 Metro mode).
41 explicit ScreenCapturerWinMagnifier( 41 explicit ScreenCapturerWinMagnifier(
42 rtc::scoped_ptr<ScreenCapturer> fallback_capturer); 42 rtc::scoped_ptr<ScreenCapturer> fallback_capturer);
43 virtual ~ScreenCapturerWinMagnifier(); 43 virtual ~ScreenCapturerWinMagnifier();
44 44
45 // Overridden from ScreenCapturer: 45 // Overridden from ScreenCapturer:
46 void Start(Callback* callback) override; 46 void Start(Callback* callback) override;
47 void SetSharedMemoryFactory(
48 rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override;
47 void Capture(const DesktopRegion& region) override; 49 void Capture(const DesktopRegion& region) override;
48 bool GetScreenList(ScreenList* screens) override; 50 bool GetScreenList(ScreenList* screens) override;
49 bool SelectScreen(ScreenId id) override; 51 bool SelectScreen(ScreenId id) override;
50 void SetExcludedWindow(WindowId window) override; 52 void SetExcludedWindow(WindowId window) override;
51 53
52 private: 54 private:
53 typedef BOOL(WINAPI* MagImageScalingCallback)(HWND hwnd, 55 typedef BOOL(WINAPI* MagImageScalingCallback)(HWND hwnd,
54 void* srcdata, 56 void* srcdata,
55 MAGIMAGEHEADER srcheader, 57 MAGIMAGEHEADER srcheader,
56 void* destdata, 58 void* destdata,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 void CreateCurrentFrameIfNecessary(const DesktopSize& size); 99 void CreateCurrentFrameIfNecessary(const DesktopSize& size);
98 100
99 // Start the fallback capturer and select the screen. 101 // Start the fallback capturer and select the screen.
100 void StartFallbackCapturer(); 102 void StartFallbackCapturer();
101 103
102 static Atomic32 tls_index_; 104 static Atomic32 tls_index_;
103 105
104 rtc::scoped_ptr<ScreenCapturer> fallback_capturer_; 106 rtc::scoped_ptr<ScreenCapturer> fallback_capturer_;
105 bool fallback_capturer_started_; 107 bool fallback_capturer_started_;
106 Callback* callback_; 108 Callback* callback_;
109 rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory_;
107 ScreenId current_screen_id_; 110 ScreenId current_screen_id_;
108 std::wstring current_device_key_; 111 std::wstring current_device_key_;
109 HWND excluded_window_; 112 HWND excluded_window_;
110 113
111 // A thread-safe list of invalid rectangles, and the size of the most 114 // A thread-safe list of invalid rectangles, and the size of the most
112 // recently captured screen. 115 // recently captured screen.
113 ScreenCapturerHelper helper_; 116 ScreenCapturerHelper helper_;
114 117
115 // Queue of the frames buffers. 118 // Queue of the frames buffers.
116 ScreenCaptureFrameQueue queue_; 119 ScreenCaptureFrameQueue queue_;
(...skipping 27 matching lines...) Expand all
144 // True if the last OnMagImageScalingCallback was called and handled 147 // True if the last OnMagImageScalingCallback was called and handled
145 // successfully. Reset at the beginning of each CaptureImage call. 148 // successfully. Reset at the beginning of each CaptureImage call.
146 bool magnifier_capture_succeeded_; 149 bool magnifier_capture_succeeded_;
147 150
148 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinMagnifier); 151 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinMagnifier);
149 }; 152 };
150 153
151 } // namespace webrtc 154 } // namespace webrtc
152 155
153 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_MAGNIFIER_H_ 156 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_MAGNIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698