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

Side by Side Diff: media/cast/congestion_control/congestion_control.cc

Issue 25544003: Fix code style and gyp files in cast to build cast_unittest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed gyp files Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/cast/congestion_control/congestion_control.h" 5 #include "media/cast/congestion_control/congestion_control.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/cast/cast_config.h" 8 #include "media/cast/cast_config.h"
9 #include "media/cast/cast_defines.h" 9 #include "media/cast/cast_defines.h"
10 10
(...skipping 19 matching lines...) Expand all
30 bitrate_(start_bitrate), 30 bitrate_(start_bitrate),
31 default_tick_clock_(new base::DefaultTickClock()), 31 default_tick_clock_(new base::DefaultTickClock()),
32 clock_(default_tick_clock_.get()) { 32 clock_(default_tick_clock_.get()) {
33 DCHECK_GT(congestion_control_back_off, 0.0f) << "Invalid config"; 33 DCHECK_GT(congestion_control_back_off, 0.0f) << "Invalid config";
34 DCHECK_LT(congestion_control_back_off, 1.0f) << "Invalid config"; 34 DCHECK_LT(congestion_control_back_off, 1.0f) << "Invalid config";
35 DCHECK_GE(max_bitrate_configured, min_bitrate_configured) << "Invalid config"; 35 DCHECK_GE(max_bitrate_configured, min_bitrate_configured) << "Invalid config";
36 DCHECK_GE(max_bitrate_configured, start_bitrate) << "Invalid config"; 36 DCHECK_GE(max_bitrate_configured, start_bitrate) << "Invalid config";
37 DCHECK_GE(start_bitrate, min_bitrate_configured) << "Invalid config"; 37 DCHECK_GE(start_bitrate, min_bitrate_configured) << "Invalid config";
38 } 38 }
39 39
40 CongestionControl::~CongestionControl() {
41 }
42
40 bool CongestionControl::OnAck(base::TimeDelta rtt, uint32* new_bitrate) { 43 bool CongestionControl::OnAck(base::TimeDelta rtt, uint32* new_bitrate) {
41 base::TimeTicks now = clock_->NowTicks(); 44 base::TimeTicks now = clock_->NowTicks();
42 45
43 // First feedback? 46 // First feedback?
44 if (time_last_increase_.is_null()) { 47 if (time_last_increase_.is_null()) {
45 time_last_increase_ = now; 48 time_last_increase_ = now;
46 time_last_decrease_ = now; 49 time_last_decrease_ = now;
47 return false; 50 return false;
48 } 51 }
49 // Are we at the max bitrate? 52 // Are we at the max bitrate?
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 *new_bitrate = std::max( 106 *new_bitrate = std::max(
104 static_cast<uint32>(bitrate_ * congestion_control_back_off_), 107 static_cast<uint32>(bitrate_ * congestion_control_back_off_),
105 min_bitrate_configured_); 108 min_bitrate_configured_);
106 109
107 bitrate_ = *new_bitrate; 110 bitrate_ = *new_bitrate;
108 return true; 111 return true;
109 } 112 }
110 113
111 } // namespace cast 114 } // namespace cast
112 } // namespace media 115 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/congestion_control/congestion_control.h ('k') | media/cast/framer/cast_message_builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698