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

Side by Side Diff: webrtc/modules/desktop_capture/screen_capturer_x11.cc

Issue 2409833002: Remove DesktopRegion parameter in DesktopCapturer::Capture. (Closed)
Patch Set: Change Capture2 to CaptureFrame Created 4 years, 2 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 public SharedXDisplay::XEventHandler { 47 public SharedXDisplay::XEventHandler {
48 public: 48 public:
49 ScreenCapturerLinux(); 49 ScreenCapturerLinux();
50 virtual ~ScreenCapturerLinux(); 50 virtual ~ScreenCapturerLinux();
51 51
52 // TODO(ajwong): Do we really want this to be synchronous? 52 // TODO(ajwong): Do we really want this to be synchronous?
53 bool Init(const DesktopCaptureOptions& options); 53 bool Init(const DesktopCaptureOptions& options);
54 54
55 // DesktopCapturer interface. 55 // DesktopCapturer interface.
56 void Start(Callback* delegate) override; 56 void Start(Callback* delegate) override;
57 void Capture(const DesktopRegion& region) override; 57 void CaptureFrame() override;
58 58
59 // ScreenCapturer interface. 59 // ScreenCapturer interface.
60 bool GetScreenList(ScreenList* screens) override; 60 bool GetScreenList(ScreenList* screens) override;
61 bool SelectScreen(ScreenId id) override; 61 bool SelectScreen(ScreenId id) override;
62 62
63 private: 63 private:
64 Display* display() { return options_.x_display()->display(); } 64 Display* display() { return options_.x_display()->display(); }
65 65
66 // SharedXDisplay::XEventHandler interface. 66 // SharedXDisplay::XEventHandler interface.
67 bool HandleXEvent(const XEvent& event) override; 67 bool HandleXEvent(const XEvent& event) override;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 LOG(LS_INFO) << "Using XDamage extension."; 221 LOG(LS_INFO) << "Using XDamage extension.";
222 } 222 }
223 223
224 void ScreenCapturerLinux::Start(Callback* callback) { 224 void ScreenCapturerLinux::Start(Callback* callback) {
225 RTC_DCHECK(!callback_); 225 RTC_DCHECK(!callback_);
226 RTC_DCHECK(callback); 226 RTC_DCHECK(callback);
227 227
228 callback_ = callback; 228 callback_ = callback;
229 } 229 }
230 230
231 void ScreenCapturerLinux::Capture(const DesktopRegion& region) { 231 void ScreenCapturerLinux::CaptureFrame() {
232 int64_t capture_start_time_nanos = rtc::TimeNanos(); 232 int64_t capture_start_time_nanos = rtc::TimeNanos();
233 233
234 queue_.MoveToNextFrame(); 234 queue_.MoveToNextFrame();
235 RTC_DCHECK(!queue_.current_frame() || !queue_.current_frame()->IsShared()); 235 RTC_DCHECK(!queue_.current_frame() || !queue_.current_frame()->IsShared());
236 236
237 // Process XEvents for XDamage and cursor shape tracking. 237 // Process XEvents for XDamage and cursor shape tracking.
238 options_.x_display()->ProcessPendingXEvents(); 238 options_.x_display()->ProcessPendingXEvents();
239 239
240 // ProcessPendingXEvents() may call ScreenConfigurationChanged() which 240 // ProcessPendingXEvents() may call ScreenConfigurationChanged() which
241 // reinitializes |x_server_pixel_buffer_|. Check if the pixel buffer is still 241 // reinitializes |x_server_pixel_buffer_|. Check if the pixel buffer is still
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } 412 }
413 413
414 if (options.detect_updated_region()) { 414 if (options.detect_updated_region()) {
415 capturer.reset(new ScreenCapturerDifferWrapper(std::move(capturer))); 415 capturer.reset(new ScreenCapturerDifferWrapper(std::move(capturer)));
416 } 416 }
417 417
418 return capturer.release(); 418 return capturer.release();
419 } 419 }
420 420
421 } // namespace webrtc 421 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698