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 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "media/cast/rtcp/rtcp_utility.h" | |
13 #include "media/cast/transport/cast_transport_defines.h" | 12 #include "media/cast/transport/cast_transport_defines.h" |
14 #include "media/cast/transport/pacing/paced_sender.h" | 13 #include "media/cast/transport/pacing/paced_sender.h" |
15 #include "net/base/big_endian.h" | 14 #include "net/base/big_endian.h" |
16 | 15 |
17 static const size_t kRtcpCastLogHeaderSize = 12; | 16 static const size_t kRtcpCastLogHeaderSize = 12; |
18 static const size_t kRtcpSenderFrameLogSize = 4; | 17 static const size_t kRtcpSenderFrameLogSize = 4; |
19 | 18 |
20 namespace media { | 19 namespace media { |
21 namespace cast { | 20 namespace cast { |
22 namespace transport { | 21 namespace transport { |
23 | 22 |
| 23 namespace { |
| 24 // RFC 3550 page 44, including end null. |
| 25 static const size_t kRtcpCnameSize = 256; |
| 26 static const uint32 kCast = ('C' << 24) + ('A' << 16) + ('S' << 8) + 'T'; |
| 27 static const uint8 kSenderLogSubtype = 1; |
| 28 }; |
| 29 |
24 RtcpBuilder::RtcpBuilder(PacedPacketSender* outgoing_transport, | 30 RtcpBuilder::RtcpBuilder(PacedPacketSender* outgoing_transport, |
25 uint32 sending_ssrc, | 31 uint32 sending_ssrc, |
26 const std::string& c_name) | 32 const std::string& c_name) |
27 : ssrc_(sending_ssrc), | 33 : ssrc_(sending_ssrc), |
28 c_name_(c_name), | 34 c_name_(c_name), |
29 transport_(outgoing_transport) { | 35 transport_(outgoing_transport) { |
30 DCHECK_LT(c_name_.length(), kRtcpCnameSize) << "Invalid config"; | 36 DCHECK_LT(c_name_.length(), kRtcpCnameSize) << "Invalid config"; |
31 } | 37 } |
32 | 38 |
33 RtcpBuilder::~RtcpBuilder() {} | 39 RtcpBuilder::~RtcpBuilder() {} |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 big_endian_writer.WriteU8(static_cast<uint8>(message.rtp_timestamp >> 16)); | 262 big_endian_writer.WriteU8(static_cast<uint8>(message.rtp_timestamp >> 16)); |
257 big_endian_writer.WriteU8(static_cast<uint8>(message.rtp_timestamp >> 8)); | 263 big_endian_writer.WriteU8(static_cast<uint8>(message.rtp_timestamp >> 8)); |
258 big_endian_writer.WriteU8(static_cast<uint8>(message.rtp_timestamp)); | 264 big_endian_writer.WriteU8(static_cast<uint8>(message.rtp_timestamp)); |
259 sender_log_message->pop_front(); | 265 sender_log_message->pop_front(); |
260 } | 266 } |
261 } | 267 } |
262 | 268 |
263 } // namespace transport | 269 } // namespace transport |
264 } // namespace cast | 270 } // namespace cast |
265 } // namespace media | 271 } // namespace media |
OLD | NEW |