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

Side by Side Diff: media/cast/rtcp/rtcp_sender.cc

Issue 248493002: Cast: Deduplicate packets in paced sender and always send older packets first (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: re-upping to trick build system Created 6 years, 7 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 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/rtcp/rtcp_sender.h" 5 #include "media/cast/rtcp/rtcp_sender.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 BuildCast(cast_message, target_delay_ms, &packet->data); 230 BuildCast(cast_message, target_delay_ms, &packet->data);
231 } 231 }
232 if (packet_type_flags & transport::kRtcpReceiverLog) { 232 if (packet_type_flags & transport::kRtcpReceiverLog) {
233 DCHECK(rtcp_events) << "Invalid argument"; 233 DCHECK(rtcp_events) << "Invalid argument";
234 BuildReceiverLog(*rtcp_events, &packet->data); 234 BuildReceiverLog(*rtcp_events, &packet->data);
235 } 235 }
236 236
237 if (packet->data.empty()) 237 if (packet->data.empty())
238 return; // Sanity don't send empty packets. 238 return; // Sanity don't send empty packets.
239 239
240 transport_->SendRtcpPacket(packet); 240 transport_->SendRtcpPacket(ssrc_, packet);
241 } 241 }
242 242
243 void RtcpSender::BuildRR(const transport::RtcpReportBlock* report_block, 243 void RtcpSender::BuildRR(const transport::RtcpReportBlock* report_block,
244 Packet* packet) const { 244 Packet* packet) const {
245 size_t start_size = packet->size(); 245 size_t start_size = packet->size();
246 DCHECK_LT(start_size + 32, kMaxIpPacketSize) << "Not enough buffer space"; 246 DCHECK_LT(start_size + 32, kMaxIpPacketSize) << "Not enough buffer space";
247 if (start_size + 32 > kMaxIpPacketSize) 247 if (start_size + 32 > kMaxIpPacketSize)
248 return; 248 return;
249 249
250 uint16 number_of_rows = (report_block) ? 7 : 1; 250 uint16 number_of_rows = (report_block) ? 7 : 1;
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 << "Not enough buffer space."; 852 << "Not enough buffer space.";
853 853
854 VLOG(3) << "number of frames: " << *number_of_frames; 854 VLOG(3) << "number of frames: " << *number_of_frames;
855 VLOG(3) << "total messages to send: " << *total_number_of_messages_to_send; 855 VLOG(3) << "total messages to send: " << *total_number_of_messages_to_send;
856 VLOG(3) << "rtcp log size: " << *rtcp_log_size; 856 VLOG(3) << "rtcp log size: " << *rtcp_log_size;
857 return *number_of_frames > 0; 857 return *number_of_frames > 0;
858 } 858 }
859 859
860 } // namespace cast 860 } // namespace cast
861 } // namespace media 861 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/audio_receiver/audio_receiver_unittest.cc ('k') | media/cast/rtcp/rtcp_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698