OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |