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

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

Issue 2697453002: [DesktopCapturer] FallbackDesktopCapturerWrapper and its tests (Closed)
Patch Set: Resolve review comments 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
(...skipping 25 matching lines...) Expand all
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.
48 int num_frames_captured() const;
49
50 // Count of CaptureFrame() calls have been made. This field would never be
51 // negative.
52 int num_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 num_frames_captured_ = 0;
71 int num_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_
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/BUILD.gn ('k') | webrtc/modules/desktop_capture/fake_desktop_capturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698