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

Side by Side Diff: media/cast/transport/rtcp/rtcp_builder.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, 8 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/transport/rtcp/rtcp_builder.h" 5 #include "media/cast/transport/rtcp/rtcp_builder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 if (packet_type_flags & kRtcpDlrr) { 64 if (packet_type_flags & kRtcpDlrr) {
65 if (!BuildDlrrRb(dlrr, &packet->data)) return; 65 if (!BuildDlrrRb(dlrr, &packet->data)) return;
66 } 66 }
67 if (packet_type_flags & kRtcpSenderLog) { 67 if (packet_type_flags & kRtcpSenderLog) {
68 if (!BuildSenderLog(sender_log, &packet->data)) return; 68 if (!BuildSenderLog(sender_log, &packet->data)) return;
69 } 69 }
70 if (packet->data.empty()) 70 if (packet->data.empty())
71 return; // Sanity - don't send empty packets. 71 return; // Sanity - don't send empty packets.
72 72
73 transport_->SendRtcpPacket(packet); 73 transport_->SendRtcpPacket(ssrc_, packet);
74 } 74 }
75 75
76 bool RtcpBuilder::BuildSR(const RtcpSenderInfo& sender_info, 76 bool RtcpBuilder::BuildSR(const RtcpSenderInfo& sender_info,
77 Packet* packet) const { 77 Packet* packet) const {
78 // Sender report. 78 // Sender report.
79 size_t start_size = packet->size(); 79 size_t start_size = packet->size();
80 if (start_size + 52 > kMaxIpPacketSize) { 80 if (start_size + 52 > kMaxIpPacketSize) {
81 DLOG(FATAL) << "Not enough buffer space"; 81 DLOG(FATAL) << "Not enough buffer space";
82 return false; 82 return false;
83 } 83 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 big_endian_writer.WriteU8(static_cast<uint8>(message.rtp_timestamp >> 8)); 243 big_endian_writer.WriteU8(static_cast<uint8>(message.rtp_timestamp >> 8));
244 big_endian_writer.WriteU8(static_cast<uint8>(message.rtp_timestamp)); 244 big_endian_writer.WriteU8(static_cast<uint8>(message.rtp_timestamp));
245 ++it; 245 ++it;
246 } 246 }
247 return true; 247 return true;
248 } 248 }
249 249
250 } // namespace transport 250 } // namespace transport
251 } // namespace cast 251 } // namespace cast
252 } // namespace media 252 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/transport/pacing/paced_sender_unittest.cc ('k') | media/cast/transport/rtp_sender/packet_storage/packet_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698