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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/fake_desktop_capturer.h
diff --git a/webrtc/modules/desktop_capture/fake_desktop_capturer.h b/webrtc/modules/desktop_capture/fake_desktop_capturer.h
index 33073a00f7d59df834894cf7b348d0ccbdd19a2e..9cab2d6edeaf3636b2fd3db76abb83d993be0cd1 100644
--- a/webrtc/modules/desktop_capture/fake_desktop_capturer.h
+++ b/webrtc/modules/desktop_capture/fake_desktop_capturer.h
@@ -43,6 +43,14 @@ class FakeDesktopCapturer : public DesktopCapturer {
// does not take the ownership of |generator|.
void set_frame_generator(DesktopFrameGenerator* generator);
+ // Count of DesktopFrame(s) have been returned by this instance. This field
+ // would never be negative.
+ int num_frames_captured() const;
+
+ // Count of CaptureFrame() calls have been made. This field would never be
+ // negative.
+ int num_capture_attempts() const;
+
// DesktopCapturer interface
void Start(DesktopCapturer::Callback* callback) override;
void CaptureFrame() override;
@@ -55,10 +63,12 @@ class FakeDesktopCapturer : public DesktopCapturer {
static constexpr DesktopCapturer::SourceId kWindowId = 1378277495;
static constexpr DesktopCapturer::SourceId kScreenId = 1378277496;
- DesktopCapturer::Callback* callback_;
+ DesktopCapturer::Callback* callback_ = nullptr;
std::unique_ptr<SharedMemoryFactory> shared_memory_factory_;
- DesktopCapturer::Result result_;
- DesktopFrameGenerator* generator_;
+ DesktopCapturer::Result result_ = Result::SUCCESS;
+ DesktopFrameGenerator* generator_ = nullptr;
+ int num_frames_captured_ = 0;
+ int num_capture_attempts_ = 0;
};
} // namespace webrtc
« 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