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

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

Issue 409943004: Cast: Remove an incorrect assert (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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/cast/net/pacing/paced_sender.h" 5 #include "media/cast/net/pacing/paced_sender.h"
6 6
7 #include "base/big_endian.h" 7 #include "base/big_endian.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "media/cast/logging/logging_impl.h" 10 #include "media/cast/logging/logging_impl.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 current_burst_size_++; 245 current_burst_size_++;
246 } 246 }
247 // Keep ~0.5 seconds of data (1000 packets) 247 // Keep ~0.5 seconds of data (1000 packets)
248 if (sent_time_buffer_.size() >= 248 if (sent_time_buffer_.size() >=
249 kMaxBurstSize * kMaxDedupeWindowMs / kPacingIntervalMs) { 249 kMaxBurstSize * kMaxDedupeWindowMs / kPacingIntervalMs) {
250 sent_time_.swap(sent_time_buffer_); 250 sent_time_.swap(sent_time_buffer_);
251 sent_time_buffer_.clear(); 251 sent_time_buffer_.clear();
252 } 252 }
253 DCHECK_LE(sent_time_buffer_.size(), 253 DCHECK_LE(sent_time_buffer_.size(),
254 kMaxBurstSize * kMaxDedupeWindowMs / kPacingIntervalMs); 254 kMaxBurstSize * kMaxDedupeWindowMs / kPacingIntervalMs);
255 DCHECK_LE(sent_time_.size(),
256 2 * kMaxBurstSize * kMaxDedupeWindowMs / kPacingIntervalMs);
257 state_ = State_Unblocked; 255 state_ = State_Unblocked;
258 } 256 }
259 257
260 void PacedSender::LogPacketEvent(const Packet& packet, CastLoggingEvent event) { 258 void PacedSender::LogPacketEvent(const Packet& packet, CastLoggingEvent event) {
261 // Get SSRC from packet and compare with the audio_ssrc / video_ssrc to see 259 // Get SSRC from packet and compare with the audio_ssrc / video_ssrc to see
262 // if the packet is audio or video. 260 // if the packet is audio or video.
263 DCHECK_GE(packet.size(), 12u); 261 DCHECK_GE(packet.size(), 12u);
264 base::BigEndianReader reader(reinterpret_cast<const char*>(&packet[8]), 4); 262 base::BigEndianReader reader(reinterpret_cast<const char*>(&packet[8]), 4);
265 uint32 ssrc; 263 uint32 ssrc;
266 bool success = reader.ReadU32(&ssrc); 264 bool success = reader.ReadU32(&ssrc);
267 DCHECK(success); 265 DCHECK(success);
268 bool is_audio; 266 bool is_audio;
269 if (ssrc == audio_ssrc_) { 267 if (ssrc == audio_ssrc_) {
270 is_audio = true; 268 is_audio = true;
271 } else if (ssrc == video_ssrc_) { 269 } else if (ssrc == video_ssrc_) {
272 is_audio = false; 270 is_audio = false;
273 } else { 271 } else {
274 DVLOG(3) << "Got unknown ssrc " << ssrc << " when logging packet event"; 272 DVLOG(3) << "Got unknown ssrc " << ssrc << " when logging packet event";
275 return; 273 return;
276 } 274 }
277 275
278 EventMediaType media_type = is_audio ? AUDIO_EVENT : VIDEO_EVENT; 276 EventMediaType media_type = is_audio ? AUDIO_EVENT : VIDEO_EVENT;
279 logging_->InsertSinglePacketEvent(clock_->NowTicks(), event, media_type, 277 logging_->InsertSinglePacketEvent(clock_->NowTicks(), event, media_type,
280 packet); 278 packet);
281 } 279 }
282 280
283 } // namespace cast 281 } // namespace cast
284 } // namespace media 282 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698