| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 last_xr_rr_.insert(std::pair<uint32_t, int64_t>( | 755 last_xr_rr_.insert(std::pair<uint32_t, int64_t>( |
| 756 RTCPUtility::MidNtp(ctx.ntp_sec_, ctx.ntp_frac_), | 756 RTCPUtility::MidNtp(ctx.ntp_sec_, ctx.ntp_frac_), |
| 757 Clock::NtpToMs(ctx.ntp_sec_, ctx.ntp_frac_))); | 757 Clock::NtpToMs(ctx.ntp_sec_, ctx.ntp_frac_))); |
| 758 | 758 |
| 759 rtcp::ExtendedReports* xr = new rtcp::ExtendedReports(); | 759 rtcp::ExtendedReports* xr = new rtcp::ExtendedReports(); |
| 760 xr->From(ssrc_); | 760 xr->From(ssrc_); |
| 761 | 761 |
| 762 rtcp::Rrtr rrtr; | 762 rtcp::Rrtr rrtr; |
| 763 rrtr.WithNtp(NtpTime(ctx.ntp_sec_, ctx.ntp_frac_)); | 763 rrtr.WithNtp(NtpTime(ctx.ntp_sec_, ctx.ntp_frac_)); |
| 764 | 764 |
| 765 xr->WithRrtr(&rrtr); | 765 xr->WithRrtr(rrtr); |
| 766 | 766 |
| 767 // TODO(sprang): Merge XR report sending to contain all of RRTR, DLRR, VOIP? | 767 // TODO(sprang): Merge XR report sending to contain all of RRTR, DLRR, VOIP? |
| 768 | 768 |
| 769 return rtc::scoped_ptr<rtcp::RtcpPacket>(xr); | 769 return rtc::scoped_ptr<rtcp::RtcpPacket>(xr); |
| 770 } | 770 } |
| 771 | 771 |
| 772 rtc::scoped_ptr<rtcp::RtcpPacket> RTCPSender::BuildDlrr( | 772 rtc::scoped_ptr<rtcp::RtcpPacket> RTCPSender::BuildDlrr( |
| 773 const RtcpContext& ctx) { | 773 const RtcpContext& ctx) { |
| 774 rtcp::ExtendedReports* xr = new rtcp::ExtendedReports(); | 774 rtcp::ExtendedReports* xr = new rtcp::ExtendedReports(); |
| 775 xr->From(ssrc_); | 775 xr->From(ssrc_); |
| 776 | 776 |
| 777 rtcp::Dlrr dlrr; | 777 rtcp::Dlrr dlrr; |
| 778 const RtcpReceiveTimeInfo& info = ctx.feedback_state_.last_xr_rr; | 778 const RtcpReceiveTimeInfo& info = ctx.feedback_state_.last_xr_rr; |
| 779 dlrr.WithDlrrItem(info.sourceSSRC, info.lastRR, info.delaySinceLastRR); | 779 dlrr.WithDlrrItem(info.sourceSSRC, info.lastRR, info.delaySinceLastRR); |
| 780 | 780 |
| 781 xr->WithDlrr(&dlrr); | 781 xr->WithDlrr(dlrr); |
| 782 | 782 |
| 783 return rtc::scoped_ptr<rtcp::RtcpPacket>(xr); | 783 return rtc::scoped_ptr<rtcp::RtcpPacket>(xr); |
| 784 } | 784 } |
| 785 | 785 |
| 786 // TODO(sprang): Add a unit test for this, or remove if the code isn't used. | 786 // TODO(sprang): Add a unit test for this, or remove if the code isn't used. |
| 787 rtc::scoped_ptr<rtcp::RtcpPacket> RTCPSender::BuildVoIPMetric( | 787 rtc::scoped_ptr<rtcp::RtcpPacket> RTCPSender::BuildVoIPMetric( |
| 788 const RtcpContext& context) { | 788 const RtcpContext& context) { |
| 789 rtcp::ExtendedReports* xr = new rtcp::ExtendedReports(); | 789 rtcp::ExtendedReports* xr = new rtcp::ExtendedReports(); |
| 790 xr->From(ssrc_); | 790 xr->From(ssrc_); |
| 791 | 791 |
| 792 rtcp::VoipMetric voip; | 792 rtcp::VoipMetric voip; |
| 793 voip.To(remote_ssrc_); | 793 voip.To(remote_ssrc_); |
| 794 voip.WithVoipMetric(xr_voip_metric_); | 794 voip.WithVoipMetric(xr_voip_metric_); |
| 795 | 795 |
| 796 xr->WithVoipMetric(&voip); | 796 xr->WithVoipMetric(voip); |
| 797 | 797 |
| 798 return rtc::scoped_ptr<rtcp::RtcpPacket>(xr); | 798 return rtc::scoped_ptr<rtcp::RtcpPacket>(xr); |
| 799 } | 799 } |
| 800 | 800 |
| 801 int32_t RTCPSender::SendRTCP(const FeedbackState& feedback_state, | 801 int32_t RTCPSender::SendRTCP(const FeedbackState& feedback_state, |
| 802 RTCPPacketType packetType, | 802 RTCPPacketType packetType, |
| 803 int32_t nack_size, | 803 int32_t nack_size, |
| 804 const uint16_t* nack_list, | 804 const uint16_t* nack_list, |
| 805 bool repeat, | 805 bool repeat, |
| 806 uint64_t pictureID) { | 806 uint64_t pictureID) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 // RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Sender); | 1079 // RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Sender); |
| 1080 // but we can't because of an incorrect warning (C4822) in MVS 2013. | 1080 // but we can't because of an incorrect warning (C4822) in MVS 2013. |
| 1081 } sender(transport_, event_log_); | 1081 } sender(transport_, event_log_); |
| 1082 | 1082 |
| 1083 uint8_t buffer[IP_PACKET_SIZE]; | 1083 uint8_t buffer[IP_PACKET_SIZE]; |
| 1084 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) && | 1084 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) && |
| 1085 !sender.send_failure_; | 1085 !sender.send_failure_; |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 } // namespace webrtc | 1088 } // namespace webrtc |
| OLD | NEW |