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

Side by Side Diff: webrtc/modules/desktop_capture/desktop_capturer_differ_wrapper.h

Issue 2697453002: [DesktopCapturer] FallbackDesktopCapturerWrapper and its tests (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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
11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_DIFFER_WRAPPER_H_ 11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_DIFFER_WRAPPER_H_
12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_DIFFER_WRAPPER_H_ 12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_DIFFER_WRAPPER_H_
13 13
14 #include <memory> 14 #include <memory>
15 15
16 #include "webrtc/modules/desktop_capture/desktop_capturer.h" 16 #include "webrtc/modules/desktop_capture/desktop_capturer.h"
17 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h" 17 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h"
18 18
19 namespace webrtc { 19 namespace webrtc {
20 20
21 // DesktopCapturer wrapper that calculates updated_region() by comparing frames 21 // DesktopCapturer wrapper that calculates updated_region() by comparing frames
22 // content. This class always expects the underlying DesktopCapturer 22 // content. This class always expects the underlying DesktopCapturer
23 // implementation returns a superset of updated regions in DestkopFrame. If a 23 // implementation returns a superset of updated regions in DestkopFrame. If a
24 // DesktopCapturer implementation does not know the updated region, it should 24 // DesktopCapturer implementation does not know the updated region, it should
25 // set updated_region() to full frame. 25 // set updated_region() to full frame.
26 // 26 //
27 // This class marks entire frame as updated if the frame size or frame stride 27 // This class marks entire frame as updated if the frame size or frame stride
28 // has been changed. 28 // has been changed.
29 class DesktopCapturerDifferWrapper : public DesktopCapturer, 29 class DesktopCapturerDifferWrapper final : public DesktopCapturer,
30 public DesktopCapturer::Callback { 30 private DesktopCapturer::Callback {
Jamie 2017/02/15 18:43:48 IIRC, private inheritance is not allowed in Chromi
Hzj_jie 2017/02/15 21:20:36 I have not noticed this guide. Since using private
31 public: 31 public:
32 // Creates a DesktopCapturerDifferWrapper with a DesktopCapturer 32 // Creates a DesktopCapturerDifferWrapper with a DesktopCapturer
33 // implementation, and takes its ownership. 33 // implementation, and takes its ownership.
34 explicit DesktopCapturerDifferWrapper( 34 explicit DesktopCapturerDifferWrapper(
35 std::unique_ptr<DesktopCapturer> base_capturer); 35 std::unique_ptr<DesktopCapturer> base_capturer);
36 36
37 ~DesktopCapturerDifferWrapper() override; 37 ~DesktopCapturerDifferWrapper() override;
38 38
39 // DesktopCapturer interface. 39 // DesktopCapturer interface.
40 void Start(DesktopCapturer::Callback* callback) override; 40 void Start(DesktopCapturer::Callback* callback) override;
(...skipping 11 matching lines...) Expand all
52 std::unique_ptr<DesktopFrame> frame) override; 52 std::unique_ptr<DesktopFrame> frame) override;
53 53
54 const std::unique_ptr<DesktopCapturer> base_capturer_; 54 const std::unique_ptr<DesktopCapturer> base_capturer_;
55 DesktopCapturer::Callback* callback_; 55 DesktopCapturer::Callback* callback_;
56 std::unique_ptr<SharedDesktopFrame> last_frame_; 56 std::unique_ptr<SharedDesktopFrame> last_frame_;
57 }; 57 };
58 58
59 } // namespace webrtc 59 } // namespace webrtc
60 60
61 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_DIFFER_WRAPPER_H_ 61 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_DIFFER_WRAPPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698