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

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

Issue 2248413002: Revert of StartTimestamp generated randomly in RtpSender constructor (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
index 0763ba9a2c28f03021d5c5a701c7dcf2fe6ecd63..e58ac3c61bb6f41c998c743ef3c9a0d5d8d59cec 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -105,11 +105,6 @@
uint32_t SSRC = rtp_sender_.SSRC();
rtcp_sender_.SetSSRC(SSRC);
SetRtcpReceiverSsrcs(SSRC);
-
- // Make sure rtcp sender use same timestamp offset as rtp sender.
- rtcp_sender_.SetTimestampOffset(rtp_sender_.TimestampOffset());
-
- // Set default packet size limit.
SetMaxTransferUnit(IP_PACKET_SIZE);
}
@@ -267,13 +262,13 @@
}
uint32_t ModuleRtpRtcpImpl::StartTimestamp() const {
- return rtp_sender_.TimestampOffset();
+ return rtp_sender_.StartTimestamp();
}
// Configure start timestamp, default is a random number.
void ModuleRtpRtcpImpl::SetStartTimestamp(const uint32_t timestamp) {
- rtcp_sender_.SetTimestampOffset(timestamp);
- rtp_sender_.SetTimestampOffset(timestamp);
+ rtcp_sender_.SetStartTimestamp(timestamp);
+ rtp_sender_.SetStartTimestamp(timestamp, true);
}
uint16_t ModuleRtpRtcpImpl::SequenceNumber() const {
@@ -286,8 +281,8 @@
}
void ModuleRtpRtcpImpl::SetRtpState(const RtpState& rtp_state) {
+ SetStartTimestamp(rtp_state.start_timestamp);
rtp_sender_.SetRtpState(rtp_state);
- rtcp_sender_.SetTimestampOffset(rtp_state.start_timestamp);
}
void ModuleRtpRtcpImpl::SetRtxState(const RtpState& rtp_state) {
@@ -358,8 +353,13 @@
collision_detected_ = false;
+ // Generate a new time_stamp if true and not configured via API
// Generate a new SSRC for the next "call" if false
rtp_sender_.SetSendingStatus(sending);
+ if (sending) {
+ // Make sure the RTCP sender has the same timestamp offset.
+ rtcp_sender_.SetStartTimestamp(rtp_sender_.StartTimestamp());
+ }
// Make sure that RTCP objects are aware of our SSRC (it could have changed
// Due to collision)
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698