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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc

Issue 2577023002: Use NtpTime in RTCPSender::RtcpContext instead of pair of uint32_t (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
index 29c740d134eb85a2087d4b9473b87bfbede78506..744ed625d100a4a0345a9f05e1cfd9c38e73c1c0 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -130,23 +130,20 @@ class RTCPSender::RtcpContext {
const uint16_t* nack_list,
bool repeat,
uint64_t picture_id,
- uint32_t ntp_sec,
- uint32_t ntp_frac)
+ NtpTime now)
: feedback_state_(feedback_state),
nack_size_(nack_size),
nack_list_(nack_list),
repeat_(repeat),
picture_id_(picture_id),
- ntp_sec_(ntp_sec),
- ntp_frac_(ntp_frac) {}
+ now_(now) {}
const FeedbackState& feedback_state_;
const int32_t nack_size_;
const uint16_t* nack_list_;
const bool repeat_;
const uint64_t picture_id_;
- const uint32_t ntp_sec_;
- const uint32_t ntp_frac_;
+ const NtpTime now_;
};
RTCPSender::RTCPSender(
@@ -453,7 +450,7 @@ std::unique_ptr<rtcp::RtcpPacket> RTCPSender::BuildSR(const RtcpContext& ctx) {
rtcp::SenderReport* report = new rtcp::SenderReport();
report->SetSenderSsrc(ssrc_);
- report->SetNtp(NtpTime(ctx.ntp_sec_, ctx.ntp_frac_));
+ report->SetNtp(ctx.now_);
report->SetRtpTimestamp(rtp_timestamp);
report->SetPacketCount(ctx.feedback_state_.packets_sent);
report->SetOctetCount(ctx.feedback_state_.media_bytes_sent);
@@ -702,7 +699,7 @@ std::unique_ptr<rtcp::RtcpPacket> RTCPSender::BuildExtendedReports(
if (!sending_ && xr_send_receiver_reference_time_enabled_) {
rtcp::Rrtr rrtr;
- rrtr.SetNtp(NtpTime(ctx.ntp_sec_, ctx.ntp_frac_));
+ rrtr.SetNtp(ctx.now_);
xr->SetRrtr(rrtr);
}
@@ -787,11 +784,8 @@ int32_t RTCPSender::SendCompoundRTCP(
packet_type_counter_.first_packet_time_ms = clock_->TimeInMilliseconds();
// We need to send our NTP even if we haven't received any reports.
- uint32_t ntp_sec;
- uint32_t ntp_frac;
- clock_->CurrentNtp(ntp_sec, ntp_frac);
RtcpContext context(feedback_state, nack_size, nack_list, repeat, pictureID,
- ntp_sec, ntp_frac);
+ NtpTime(*clock_));
PrepareReport(feedback_state);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698