Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc

Issue 1544983002: [rtp_rtcp] rtcp::SenderReport moved into own file and got Parse function (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698