Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 FakeDesktopCapturer(); | 36 FakeDesktopCapturer(); |
| 37 ~FakeDesktopCapturer() override; | 37 ~FakeDesktopCapturer() override; |
| 38 | 38 |
| 39 // Decides the result which will be returned in next Capture() callback. | 39 // Decides the result which will be returned in next Capture() callback. |
| 40 void set_result(DesktopCapturer::Result result); | 40 void set_result(DesktopCapturer::Result result); |
| 41 | 41 |
| 42 // Uses the |generator| provided as DesktopFrameGenerator, FakeDesktopCapturer | 42 // Uses the |generator| provided as DesktopFrameGenerator, FakeDesktopCapturer |
| 43 // does not take the ownership of |generator|. | 43 // does not take the ownership of |generator|. |
| 44 void set_frame_generator(DesktopFrameGenerator* generator); | 44 void set_frame_generator(DesktopFrameGenerator* generator); |
| 45 | 45 |
| 46 // Count of DesktopFrame(s) have been returned by this instance. This field | |
| 47 // would never be negative. | |
|
Jamie
2017/02/15 18:43:48
Can you make the return type unsigned to signify t
Hzj_jie
2017/02/15 21:20:36
In coding style, https://google.github.io/stylegui
| |
| 48 int frame_captured() const; | |
| 49 | |
| 50 // Count of CaptureFrame() calls have been made. This field would never be | |
| 51 // negative. | |
| 52 int capture_attempts() const; | |
| 53 | |
| 46 // DesktopCapturer interface | 54 // DesktopCapturer interface |
| 47 void Start(DesktopCapturer::Callback* callback) override; | 55 void Start(DesktopCapturer::Callback* callback) override; |
| 48 void CaptureFrame() override; | 56 void CaptureFrame() override; |
| 49 void SetSharedMemoryFactory( | 57 void SetSharedMemoryFactory( |
| 50 std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override; | 58 std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override; |
| 51 bool GetSourceList(DesktopCapturer::SourceList* sources) override; | 59 bool GetSourceList(DesktopCapturer::SourceList* sources) override; |
| 52 bool SelectSource(DesktopCapturer::SourceId id) override; | 60 bool SelectSource(DesktopCapturer::SourceId id) override; |
| 53 | 61 |
| 54 private: | 62 private: |
| 55 static constexpr DesktopCapturer::SourceId kWindowId = 1378277495; | 63 static constexpr DesktopCapturer::SourceId kWindowId = 1378277495; |
| 56 static constexpr DesktopCapturer::SourceId kScreenId = 1378277496; | 64 static constexpr DesktopCapturer::SourceId kScreenId = 1378277496; |
| 57 | 65 |
| 58 DesktopCapturer::Callback* callback_; | 66 DesktopCapturer::Callback* callback_ = nullptr; |
| 59 std::unique_ptr<SharedMemoryFactory> shared_memory_factory_; | 67 std::unique_ptr<SharedMemoryFactory> shared_memory_factory_; |
| 60 DesktopCapturer::Result result_; | 68 DesktopCapturer::Result result_ = Result::SUCCESS; |
| 61 DesktopFrameGenerator* generator_; | 69 DesktopFrameGenerator* generator_ = nullptr; |
| 70 int frame_captured_ = 0; | |
| 71 int capture_attempts_ = 0; | |
| 62 }; | 72 }; |
| 63 | 73 |
| 64 } // namespace webrtc | 74 } // namespace webrtc |
| 65 | 75 |
| 66 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_FAKE_DESKTOP_CAPTURER_H_ | 76 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_FAKE_DESKTOP_CAPTURER_H_ |
| OLD | NEW |