| 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/rtcp/rtcp_sender.h" | 5 #include "media/cast/rtcp/rtcp_sender.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "media/cast/pacing/paced_sender.h" | 12 #include "media/cast/pacing/paced_sender.h" |
| 13 #include "media/cast/rtcp/rtcp_utility.h" | 13 #include "media/cast/rtcp/rtcp_utility.h" |
| 14 #include "net/base/big_endian.h" | 14 #include "net/base/big_endian.h" |
| 15 | 15 |
| 16 namespace media { | 16 namespace media { |
| 17 namespace cast { | 17 namespace cast { |
| 18 | 18 |
| 19 static const int kRtcpMaxNackFields = 253; | 19 static const int kRtcpMaxNackFields = 253; |
| 20 static const int kRtcpMaxCastLossFields = 100; | 20 static const int kRtcpMaxCastLossFields = 100; |
| 21 | 21 |
| 22 RtcpSender::RtcpSender(PacedPacketSender* outgoing_transport, | 22 RtcpSender::RtcpSender(PacedPacketSender* outgoing_transport, |
| 23 uint32 sending_ssrc, | 23 uint32 sending_ssrc, |
| 24 const std::string& c_name) | 24 const std::string& c_name) |
| 25 : ssrc_(sending_ssrc), | 25 : ssrc_(sending_ssrc), |
| 26 c_name_(c_name), | 26 c_name_(c_name), |
| 27 transport_(outgoing_transport) { | 27 transport_(outgoing_transport) { |
| 28 DCHECK_LT(static_cast<int>(c_name_.length()), | 28 DCHECK_LT(c_name_.length(), kRtcpCnameSize) << "Invalid config"; |
| 29 kRtcpCnameSize) << "Invalid config"; | |
| 30 } | 29 } |
| 31 | 30 |
| 32 RtcpSender::~RtcpSender() {} | 31 RtcpSender::~RtcpSender() {} |
| 33 | 32 |
| 34 void RtcpSender::SendRtcp(uint32 packet_type_flags, | 33 void RtcpSender::SendRtcp(uint32 packet_type_flags, |
| 35 const RtcpSenderInfo* sender_info, | 34 const RtcpSenderInfo* sender_info, |
| 36 const RtcpReportBlock* report_block, | 35 const RtcpReportBlock* report_block, |
| 37 uint32 pli_remote_ssrc, | 36 uint32 pli_remote_ssrc, |
| 38 const RtcpDlrrReportBlock* dlrr, | 37 const RtcpDlrrReportBlock* dlrr, |
| 39 const RtcpReceiverReferenceTimeReport* rrtr, | 38 const RtcpReceiverReferenceTimeReport* rrtr, |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 (*packet)[cast_size_pos] = static_cast<uint8>(4 + number_of_loss_fields); | 535 (*packet)[cast_size_pos] = static_cast<uint8>(4 + number_of_loss_fields); |
| 537 (*packet)[cast_loss_field_pos] = static_cast<uint8>(number_of_loss_fields); | 536 (*packet)[cast_loss_field_pos] = static_cast<uint8>(number_of_loss_fields); |
| 538 | 537 |
| 539 // Frames with missing packets. | 538 // Frames with missing packets. |
| 540 TRACE_COUNTER_ID1("cast_rtcp", "RtcpSender::CastNACK", ssrc_, | 539 TRACE_COUNTER_ID1("cast_rtcp", "RtcpSender::CastNACK", ssrc_, |
| 541 cast->missing_frames_and_packets_.size()); | 540 cast->missing_frames_and_packets_.size()); |
| 542 } | 541 } |
| 543 | 542 |
| 544 } // namespace cast | 543 } // namespace cast |
| 545 } // namespace media | 544 } // namespace media |
| OLD | NEW |