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

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

Issue 1864813002: Tab/Desktop Capture: Use requests instead of timer-based refreshing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@video_refresh_from_sinks
Patch Set: Addressed comments from PS2, and sampling decision logic change w.r.t. recent animation. Created 4 years, 8 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
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
index 6b69a10cc698eed1525960ba8606f03622a8ef5d..748ad158de8b319dad332ac7774541ba7e0c9e88 100644
--- a/media/capture/content/smooth_event_sampler.h
+++ b/media/capture/content/smooth_event_sampler.h
@@ -14,15 +14,7 @@ namespace media {
// Filters a sequence of events to achieve a target frequency.
class MEDIA_EXPORT SmoothEventSampler {
public:
- enum {
- // The maximum amount of time that can elapse before considering unchanged
- // content as dirty for the purposes of timer-based overdue sampling. This
- // is the same value found in cc::FrameRateCounter.
- OVERDUE_DIRTY_THRESHOLD_MILLIS = 250 // 4 FPS
- };
-
- SmoothEventSampler(base::TimeDelta min_capture_period,
- int redundant_capture_goal);
+ 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.
@@ -42,22 +34,16 @@ class MEDIA_EXPORT SmoothEventSampler {
// we have sampled the most recent event.
void RecordSample();
- // Returns true if, at time |event_time|, sampling should occur because too
- // much time will have passed relative to the last event and/or sample.
- bool IsOverdueForSamplingAt(base::TimeTicks event_time) const;
-
// Returns true if ConsiderPresentationEvent() has been called since the last
// call to RecordSample().
bool HasUnrecordedEvent() const;
private:
base::TimeDelta min_capture_period_;
- const int redundant_capture_goal_;
base::TimeDelta token_bucket_capacity_;
base::TimeTicks current_event_;
base::TimeTicks last_sample_;
- int overdue_sample_count_;
base::TimeDelta token_bucket_;
DISALLOW_COPY_AND_ASSIGN(SmoothEventSampler);

Powered by Google App Engine
This is Rietveld 408576698