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 15 matching lines...) Expand all Loading... |
26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" |
27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.h" | 27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.h" |
28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" | 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" |
29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.h" | 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.h" |
30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/nack.h" | 30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/nack.h" |
31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/pli.h" | 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/pli.h" |
32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" | 32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" |
33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/remb.h" | 33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/remb.h" |
34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rpsi.h" | 34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rpsi.h" |
35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h" | 35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h" |
| 36 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" |
36 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sli.h" | 37 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sli.h" |
37 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.h" | 38 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.h" |
38 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.h" | 39 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.h" |
39 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" | 40 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" |
40 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" | 41 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" |
41 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 42 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
42 | 43 |
43 namespace webrtc { | 44 namespace webrtc { |
44 | 45 |
45 using RTCPUtility::RTCPCnameInformation; | 46 using RTCPUtility::RTCPCnameInformation; |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // the frame being captured at this moment. We are calculating that | 477 // the frame being captured at this moment. We are calculating that |
477 // timestamp as the last frame's timestamp + the time since the last frame | 478 // timestamp as the last frame's timestamp + the time since the last frame |
478 // was captured. | 479 // was captured. |
479 uint32_t rtp_timestamp = | 480 uint32_t rtp_timestamp = |
480 start_timestamp_ + last_rtp_timestamp_ + | 481 start_timestamp_ + last_rtp_timestamp_ + |
481 (clock_->TimeInMilliseconds() - last_frame_capture_time_ms_) * | 482 (clock_->TimeInMilliseconds() - last_frame_capture_time_ms_) * |
482 (ctx.feedback_state_.frequency_hz / 1000); | 483 (ctx.feedback_state_.frequency_hz / 1000); |
483 | 484 |
484 rtcp::SenderReport* report = new rtcp::SenderReport(); | 485 rtcp::SenderReport* report = new rtcp::SenderReport(); |
485 report->From(ssrc_); | 486 report->From(ssrc_); |
486 report->WithNtpSec(ctx.ntp_sec_); | 487 report->WithNtp(NtpTime(ctx.ntp_sec_, ctx.ntp_frac_)); |
487 report->WithNtpFrac(ctx.ntp_frac_); | |
488 report->WithRtpTimestamp(rtp_timestamp); | 488 report->WithRtpTimestamp(rtp_timestamp); |
489 report->WithPacketCount(ctx.feedback_state_.packets_sent); | 489 report->WithPacketCount(ctx.feedback_state_.packets_sent); |
490 report->WithOctetCount(ctx.feedback_state_.media_bytes_sent); | 490 report->WithOctetCount(ctx.feedback_state_.media_bytes_sent); |
491 | 491 |
492 for (auto it : report_blocks_) | 492 for (auto it : report_blocks_) |
493 report->WithReportBlock(it.second); | 493 report->WithReportBlock(it.second); |
494 | 494 |
495 report_blocks_.clear(); | 495 report_blocks_.clear(); |
496 | 496 |
497 return rtc::scoped_ptr<rtcp::SenderReport>(report); | 497 return rtc::scoped_ptr<rtcp::SenderReport>(report); |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 Transport* const transport_; | 1058 Transport* const transport_; |
1059 bool send_failure_; | 1059 bool send_failure_; |
1060 } sender(transport_); | 1060 } sender(transport_); |
1061 | 1061 |
1062 uint8_t buffer[IP_PACKET_SIZE]; | 1062 uint8_t buffer[IP_PACKET_SIZE]; |
1063 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) && | 1063 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) && |
1064 !sender.send_failure_; | 1064 !sender.send_failure_; |
1065 } | 1065 } |
1066 | 1066 |
1067 } // namespace webrtc | 1067 } // namespace webrtc |
OLD | NEW |