Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_DIFFER_WRAPPER_H_ | |
| 12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_DIFFER_WRAPPER_H_ | |
| 13 | |
| 14 #include <memory> | |
| 15 | |
| 16 #include "webrtc/modules/desktop_capture/screen_capturer.h" | |
| 17 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h" | |
| 18 | |
| 19 namespace webrtc { | |
| 20 | |
| 21 class Differ; | |
| 22 | |
| 23 // A ScreenCapturer implementation to forward capture requests to the underlying | |
| 24 // implementation, and help to calculate the dirty region. | |
| 25 // This class expects the input ScreenCapturer uses SharedDesktopFrame to return | |
| 26 // captured DesktopFrames. | |
| 27 class ScreenCapturerDifferWrapper | |
|
Jamie
2016/08/03 23:52:26
This class is not currently being used. Will there
Hzj_jie
2016/08/04 02:28:07
Exactly. Bug 633802 is opened to track all the wor
| |
| 28 : public ScreenCapturer, public DesktopCapturer::Callback { | |
|
Sergey Ulanov
2016/08/03 23:19:11
Potentially the same mechanism could work for wind
Sergey Ulanov
2016/08/03 23:19:11
git cl format
btw, you can get clang-format integ
Hzj_jie
2016/08/04 02:28:07
Done.
Hzj_jie
2016/08/04 02:28:07
Sure. We can discuss it later.
Hzj_jie
2016/08/04 03:28:43
And I also found,
1. Nobody, both ScreenCapturer a
| |
| 29 public: | |
| 30 // Creates a ScreenCapturerDifferWrapper with a ScreenCapturer implementation, | |
| 31 // and takes ownership. | |
| 32 explicit ScreenCapturerDifferWrapper(std::unique_ptr<ScreenCapturer> impl); | |
|
Sergey Ulanov
2016/08/03 23:19:12
|impl| is not the best name. maybe call it base_ca
Hzj_jie
2016/08/04 02:28:07
Done.
| |
| 33 ~ScreenCapturerDifferWrapper() override; | |
| 34 | |
| 35 void Start(DesktopCapturer::Callback* callback) override; | |
|
Sergey Ulanov
2016/08/03 23:19:11
// ScreenCapturer interface.
Hzj_jie
2016/08/04 02:28:07
Done.
| |
| 36 void SetSharedMemoryFactory( | |
| 37 std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override; | |
| 38 void Capture(const DesktopRegion& region) override; | |
| 39 bool GetScreenList(ScreenList* screens) override; | |
| 40 bool SelectScreen(ScreenId id) override; | |
| 41 | |
| 42 // Catches callback from underlying implementation, uses Differ to update | |
|
Sergey Ulanov
2016/08/03 23:19:11
I don't think you really need this comment here. I
Hzj_jie
2016/08/04 02:28:07
Done.
| |
| 43 // |frame|->updated_region(), and calls callback_. | |
|
Sergey Ulanov
2016/08/03 23:19:12
Add
// DesktopCapturer::Callback interface.
mov
Hzj_jie
2016/08/04 02:28:07
Done.
| |
| 44 void OnCaptureResult(Result result, | |
| 45 std::unique_ptr<DesktopFrame> frame) override; | |
| 46 | |
| 47 private: | |
| 48 std::unique_ptr<ScreenCapturer> impl_; | |
|
Sergey Ulanov
2016/08/03 23:19:11
base_capturer_?
Hzj_jie
2016/08/04 02:28:07
Done.
| |
| 49 DesktopCapturer::Callback* callback_; | |
| 50 std::unique_ptr<SharedDesktopFrame> last_frame_; | |
| 51 std::unique_ptr<Differ> differ_; | |
| 52 }; | |
| 53 | |
| 54 } // namespace webrtc | |
| 55 | |
| 56 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_DIFFER_WRAPPER_H_ | |
| OLD | NEW |