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

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

Issue 2241193002: StartTimestamp generated randomly in RtpSender constructor (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Renames start_timestamp->timestamp_offset in RtcpSender 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 e58ac3c61bb6f41c998c743ef3c9a0d5d8d59cec..0763ba9a2c28f03021d5c5a701c7dcf2fe6ecd63 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -105,6 +105,11 @@ ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration)
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);
}
@@ -262,13 +267,13 @@ int8_t ModuleRtpRtcpImpl::SendPayloadType() const {
}
uint32_t ModuleRtpRtcpImpl::StartTimestamp() const {
- return rtp_sender_.StartTimestamp();
+ return rtp_sender_.TimestampOffset();
}
// Configure start timestamp, default is a random number.
void ModuleRtpRtcpImpl::SetStartTimestamp(const uint32_t timestamp) {
- rtcp_sender_.SetStartTimestamp(timestamp);
- rtp_sender_.SetStartTimestamp(timestamp, true);
+ rtcp_sender_.SetTimestampOffset(timestamp);
+ rtp_sender_.SetTimestampOffset(timestamp);
}
uint16_t ModuleRtpRtcpImpl::SequenceNumber() const {
@@ -281,8 +286,8 @@ void ModuleRtpRtcpImpl::SetSequenceNumber(const uint16_t seq_num) {
}
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) {
@@ -353,13 +358,8 @@ int32_t ModuleRtpRtcpImpl::SetSendingStatus(const bool sending) {
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