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

Side by Side Diff: media/base/time_delta_interpolator.h

Issue 2239243002: Interpolate media time for mojo rendering pipeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_TIME_DELTA_INTERPOLATOR_H_ 5 #ifndef MEDIA_BASE_TIME_DELTA_INTERPOLATOR_H_
6 #define MEDIA_BASE_TIME_DELTA_INTERPOLATOR_H_ 6 #define MEDIA_BASE_TIME_DELTA_INTERPOLATOR_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // Sets a new rate at which to interpolate. 42 // Sets a new rate at which to interpolate.
43 // 43 //
44 // |tick_clock| will be queried for a new reference time value. 44 // |tick_clock| will be queried for a new reference time value.
45 void SetPlaybackRate(double playback_rate); 45 void SetPlaybackRate(double playback_rate);
46 46
47 // Sets the two timestamps to interpolate between at |playback_rate_|. 47 // Sets the two timestamps to interpolate between at |playback_rate_|.
48 // |upper_bound| must be greater or equal to |lower_bound|. 48 // |upper_bound| must be greater or equal to |lower_bound|.
49 // 49 //
50 // |upper_bound| is typically the media timestamp of the last audio frame 50 // |upper_bound| is typically the media timestamp of the last audio frame
51 // buffered by the audio hardware. 51 // buffered by the audio hardware.
52 void SetBounds(base::TimeDelta lower_bound, base::TimeDelta upper_bound); 52 void SetBounds(base::TimeDelta lower_bound,
53 base::TimeDelta upper_bound,
54 base::TimeTicks capture_time);
alokp 2016/09/02 22:51:17 Added to avoid calling TimeTicks::Now multiple tim
53 55
54 // Sets the upper bound used for interpolation. Note that if |upper_bound| is 56 // Sets the upper bound used for interpolation. Note that if |upper_bound| is
55 // less than what was previously set via SetTime(), then all future calls 57 // less than what was previously set via SetTime(), then all future calls
56 // to GetInterpolatedTime() will return |upper_bound|. 58 // to GetInterpolatedTime() will return |upper_bound|.
57 void SetUpperBound(base::TimeDelta upper_bound); 59 void SetUpperBound(base::TimeDelta upper_bound);
58 60
59 // Computes an interpolated time based on SetTime(). 61 // Computes an interpolated time based on SetTime().
60 base::TimeDelta GetInterpolatedTime(); 62 base::TimeDelta GetInterpolatedTime();
61 63
62 private: 64 private:
(...skipping 10 matching lines...) Expand all
73 base::TimeTicks reference_; 75 base::TimeTicks reference_;
74 76
75 double playback_rate_; 77 double playback_rate_;
76 78
77 DISALLOW_COPY_AND_ASSIGN(TimeDeltaInterpolator); 79 DISALLOW_COPY_AND_ASSIGN(TimeDeltaInterpolator);
78 }; 80 };
79 81
80 } // namespace media 82 } // namespace media
81 83
82 #endif // MEDIA_BASE_TIME_DELTA_INTERPOLATOR_H_ 84 #endif // MEDIA_BASE_TIME_DELTA_INTERPOLATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698