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

Side by Side Diff: media/base/wall_clock_time_source.cc

Issue 2161193003: Use __func__ instead of __FUNCTION__. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync Created 4 years, 4 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
« no previous file with comments | « media/base/video_frame.cc ('k') | media/blink/cdm_session_adapter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "media/base/wall_clock_time_source.h" 5 #include "media/base/wall_clock_time_source.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace media { 9 namespace media {
10 10
11 WallClockTimeSource::WallClockTimeSource() 11 WallClockTimeSource::WallClockTimeSource()
12 : tick_clock_(&default_tick_clock_), ticking_(false), playback_rate_(1.0) { 12 : tick_clock_(&default_tick_clock_), ticking_(false), playback_rate_(1.0) {
13 } 13 }
14 14
15 WallClockTimeSource::~WallClockTimeSource() { 15 WallClockTimeSource::~WallClockTimeSource() {
16 } 16 }
17 17
18 void WallClockTimeSource::StartTicking() { 18 void WallClockTimeSource::StartTicking() {
19 DVLOG(1) << __FUNCTION__; 19 DVLOG(1) << __func__;
20 base::AutoLock auto_lock(lock_); 20 base::AutoLock auto_lock(lock_);
21 DCHECK(!ticking_); 21 DCHECK(!ticking_);
22 ticking_ = true; 22 ticking_ = true;
23 reference_time_ = tick_clock_->NowTicks(); 23 reference_time_ = tick_clock_->NowTicks();
24 } 24 }
25 25
26 void WallClockTimeSource::StopTicking() { 26 void WallClockTimeSource::StopTicking() {
27 DVLOG(1) << __FUNCTION__; 27 DVLOG(1) << __func__;
28 base::AutoLock auto_lock(lock_); 28 base::AutoLock auto_lock(lock_);
29 DCHECK(ticking_); 29 DCHECK(ticking_);
30 base_timestamp_ = CurrentMediaTime_Locked(); 30 base_timestamp_ = CurrentMediaTime_Locked();
31 ticking_ = false; 31 ticking_ = false;
32 reference_time_ = tick_clock_->NowTicks(); 32 reference_time_ = tick_clock_->NowTicks();
33 } 33 }
34 34
35 void WallClockTimeSource::SetPlaybackRate(double playback_rate) { 35 void WallClockTimeSource::SetPlaybackRate(double playback_rate) {
36 DVLOG(1) << __FUNCTION__ << "(" << playback_rate << ")"; 36 DVLOG(1) << __func__ << "(" << playback_rate << ")";
37 base::AutoLock auto_lock(lock_); 37 base::AutoLock auto_lock(lock_);
38 // Estimate current media time using old rate to use as a new base time for 38 // Estimate current media time using old rate to use as a new base time for
39 // the new rate. 39 // the new rate.
40 if (ticking_) { 40 if (ticking_) {
41 base_timestamp_ = CurrentMediaTime_Locked(); 41 base_timestamp_ = CurrentMediaTime_Locked();
42 reference_time_ = tick_clock_->NowTicks(); 42 reference_time_ = tick_clock_->NowTicks();
43 } 43 }
44 44
45 playback_rate_ = playback_rate; 45 playback_rate_ = playback_rate;
46 } 46 }
47 47
48 void WallClockTimeSource::SetMediaTime(base::TimeDelta time) { 48 void WallClockTimeSource::SetMediaTime(base::TimeDelta time) {
49 DVLOG(1) << __FUNCTION__ << "(" << time.InMicroseconds() << ")"; 49 DVLOG(1) << __func__ << "(" << time.InMicroseconds() << ")";
50 base::AutoLock auto_lock(lock_); 50 base::AutoLock auto_lock(lock_);
51 CHECK(!ticking_); 51 CHECK(!ticking_);
52 base_timestamp_ = time; 52 base_timestamp_ = time;
53 } 53 }
54 54
55 base::TimeDelta WallClockTimeSource::CurrentMediaTime() { 55 base::TimeDelta WallClockTimeSource::CurrentMediaTime() {
56 base::AutoLock auto_lock(lock_); 56 base::AutoLock auto_lock(lock_);
57 return CurrentMediaTime_Locked(); 57 return CurrentMediaTime_Locked();
58 } 58 }
59 59
(...skipping 25 matching lines...) Expand all
85 if (!ticking_ || !playback_rate_) 85 if (!ticking_ || !playback_rate_)
86 return base_timestamp_; 86 return base_timestamp_;
87 87
88 base::TimeTicks now = tick_clock_->NowTicks(); 88 base::TimeTicks now = tick_clock_->NowTicks();
89 return base_timestamp_ + 89 return base_timestamp_ +
90 base::TimeDelta::FromMicroseconds( 90 base::TimeDelta::FromMicroseconds(
91 (now - reference_time_).InMicroseconds() * playback_rate_); 91 (now - reference_time_).InMicroseconds() * playback_rate_);
92 } 92 }
93 93
94 } // namespace media 94 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame.cc ('k') | media/blink/cdm_session_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698