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

Side by Side Diff: media/cast/transport/pacing/paced_sender.cc

Issue 100823015: Cast: move net->transport (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updating transport callback Created 6 years, 11 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/net/pacing/paced_sender.h" 5 #include "media/cast/transport/pacing/paced_sender.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 9
10 namespace media { 10 namespace media {
11 namespace cast { 11 namespace cast {
12 namespace transport {
12 13
13 static const int64 kPacingIntervalMs = 10; 14 static const int64 kPacingIntervalMs = 10;
14 // Each frame will be split into no more than kPacingMaxBurstsPerFrame 15 // Each frame will be split into no more than kPacingMaxBurstsPerFrame
15 // bursts of packets. 16 // bursts of packets.
16 static const size_t kPacingMaxBurstsPerFrame = 3; 17 static const size_t kPacingMaxBurstsPerFrame = 3;
17 18
18 PacedSender::PacedSender(scoped_refptr<CastEnvironment> cast_environment, 19 PacedSender::PacedSender(scoped_refptr<CastEnvironment> cast_environment,
19 PacketSender* transport) 20 PacketSender* transport)
20 : cast_environment_(cast_environment), 21 : cast_environment_(cast_environment),
21 transport_(transport), 22 transport_(transport),
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 void PacedSender::UpdateBurstSize(size_t packets_to_send) { 141 void PacedSender::UpdateBurstSize(size_t packets_to_send) {
141 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 142 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
142 packets_to_send = std::max(packets_to_send, 143 packets_to_send = std::max(packets_to_send,
143 resend_packet_list_.size() + packet_list_.size()); 144 resend_packet_list_.size() + packet_list_.size());
144 145
145 packets_to_send += (kPacingMaxBurstsPerFrame - 1); // Round up. 146 packets_to_send += (kPacingMaxBurstsPerFrame - 1); // Round up.
146 burst_size_ = std::max(packets_to_send / kPacingMaxBurstsPerFrame, 147 burst_size_ = std::max(packets_to_send / kPacingMaxBurstsPerFrame,
147 burst_size_); 148 burst_size_);
148 } 149 }
149 150
151 } // namespace transport
150 } // namespace cast 152 } // namespace cast
151 } // namespace media 153 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/transport/pacing/paced_sender.h ('k') | media/cast/transport/pacing/paced_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698