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

Side by Side Diff: chromecast/media/cma/base/buffering_controller.cc

Issue 2158923004: Convert media constants to constexpr. (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 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 #include "chromecast/media/cma/base/buffering_controller.h" 5 #include "chromecast/media/cma/base/buffering_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "chromecast/base/metrics/cast_metrics_helper.h" 10 #include "chromecast/base/metrics/cast_metrics_helper.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 void BufferingController::SetMediaTime(base::TimeDelta time) { 92 void BufferingController::SetMediaTime(base::TimeDelta time) {
93 for (StreamList::iterator it = stream_list_.begin(); 93 for (StreamList::iterator it = stream_list_.begin();
94 it != stream_list_.end(); ++it) { 94 it != stream_list_.end(); ++it) {
95 (*it)->SetMediaTime(time); 95 (*it)->SetMediaTime(time);
96 } 96 }
97 } 97 }
98 98
99 base::TimeDelta BufferingController::GetMaxRenderingTime() const { 99 base::TimeDelta BufferingController::GetMaxRenderingTime() const {
100 base::TimeDelta max_rendering_time(::media::kNoTimestamp()); 100 base::TimeDelta max_rendering_time(::media::kNoTimestamp);
101 for (StreamList::const_iterator it = stream_list_.begin(); 101 for (StreamList::const_iterator it = stream_list_.begin();
102 it != stream_list_.end(); ++it) { 102 it != stream_list_.end(); ++it) {
103 base::TimeDelta max_stream_rendering_time = 103 base::TimeDelta max_stream_rendering_time =
104 (*it)->GetMaxRenderingTime(); 104 (*it)->GetMaxRenderingTime();
105 if (max_stream_rendering_time == ::media::kNoTimestamp()) 105 if (max_stream_rendering_time == ::media::kNoTimestamp)
106 return ::media::kNoTimestamp(); 106 return ::media::kNoTimestamp;
107 if (max_rendering_time == ::media::kNoTimestamp() || 107 if (max_rendering_time == ::media::kNoTimestamp ||
108 max_stream_rendering_time < max_rendering_time) { 108 max_stream_rendering_time < max_rendering_time) {
109 max_rendering_time = max_stream_rendering_time; 109 max_rendering_time = max_stream_rendering_time;
110 } 110 }
111 } 111 }
112 return max_rendering_time; 112 return max_rendering_time;
113 } 113 }
114 114
115 void BufferingController::Reset() { 115 void BufferingController::Reset() {
116 DCHECK(thread_checker_.CalledOnValidThread()); 116 DCHECK(thread_checker_.CalledOnValidThread());
117 117
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 void BufferingController::DumpState() const { 218 void BufferingController::DumpState() const {
219 for (StreamList::const_iterator it = stream_list_.begin(); 219 for (StreamList::const_iterator it = stream_list_.begin();
220 it != stream_list_.end(); ++it) { 220 it != stream_list_.end(); ++it) {
221 CMALOG(kLogControl) << (*it)->ToString(); 221 CMALOG(kLogControl) << (*it)->ToString();
222 } 222 }
223 } 223 }
224 224
225 } // namespace media 225 } // namespace media
226 } // namespace chromecast 226 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698