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

Unified Diff: media/capture/content/smooth_event_sampler.h

Issue 2143903003: [WIP] Move media/capture to device/capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « media/capture/content/screen_capture_device_core.cc ('k') | media/capture/content/smooth_event_sampler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/content/smooth_event_sampler.h
diff --git a/media/capture/content/smooth_event_sampler.h b/media/capture/content/smooth_event_sampler.h
deleted file mode 100644
index 47ed58e13724ab6cebbd56bb8479387bf289805a..0000000000000000000000000000000000000000
--- a/media/capture/content/smooth_event_sampler.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MEDIA_CAPTURE_CONTENT_SMOOTH_EVENT_SAMPLER_H_
-#define MEDIA_CAPTURE_CONTENT_SMOOTH_EVENT_SAMPLER_H_
-
-#include "base/macros.h"
-#include "base/time/time.h"
-#include "media/capture/capture_export.h"
-
-namespace media {
-
-// Filters a sequence of events to achieve a target frequency.
-class CAPTURE_EXPORT SmoothEventSampler {
- public:
- explicit SmoothEventSampler(base::TimeDelta min_capture_period);
-
- // Get/Set minimum capture period. When setting a new value, the state of the
- // sampler is retained so that sampling will continue smoothly.
- base::TimeDelta min_capture_period() const { return min_capture_period_; }
- void SetMinCapturePeriod(base::TimeDelta p);
-
- // Add a new event to the event history, and consider whether it ought to be
- // sampled. The event is not recorded as a sample until RecordSample() is
- // called.
- void ConsiderPresentationEvent(base::TimeTicks event_time);
-
- // Returns true if the last event considered should be sampled.
- bool ShouldSample() const;
-
- // Operates on the last event added by ConsiderPresentationEvent(), marking
- // it as sampled. After this point we are current in the stream of events, as
- // we have sampled the most recent event.
- void RecordSample();
-
- // Returns true if ConsiderPresentationEvent() has been called since the last
- // call to RecordSample().
- bool HasUnrecordedEvent() const;
-
- private:
- base::TimeDelta min_capture_period_;
- base::TimeDelta token_bucket_capacity_;
-
- base::TimeTicks current_event_;
- base::TimeTicks last_sample_;
- base::TimeDelta token_bucket_;
-
- DISALLOW_COPY_AND_ASSIGN(SmoothEventSampler);
-};
-
-} // namespace media
-
-#endif // MEDIA_CAPTURE_CONTENT_SMOOTH_EVENT_SAMPLER_H_
« no previous file with comments | « media/capture/content/screen_capture_device_core.cc ('k') | media/capture/content/smooth_event_sampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698