Use int64_t more consistently for times, in particular for RTT values.

Existing code was inconsistent about whether to use uint16_t, int, unsigned int,
or uint32_t, and sometimes silently truncated one to another, or truncated
int64_t.  Because most core time-handling functions use int64_t, being
consistent about using int64_t unless otherwise necessary minimizes the number
of explicit or implicit casts.

BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, holmer@google.com, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/31349004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8045 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/video_coding/main/source/generic_encoder.cc b/webrtc/modules/video_coding/main/source/generic_encoder.cc
index 096287f..6baf833 100644
--- a/webrtc/modules/video_coding/main/source/generic_encoder.cc
+++ b/webrtc/modules/video_coding/main/source/generic_encoder.cc
@@ -106,7 +106,7 @@
 }
 
 int32_t
-VCMGenericEncoder::SetChannelParameters(int32_t packetLoss, int rtt)
+VCMGenericEncoder::SetChannelParameters(int32_t packetLoss, int64_t rtt)
 {
     return _encoder.SetChannelParameters(packetLoss, rtt);
 }
diff --git a/webrtc/modules/video_coding/main/source/generic_encoder.h b/webrtc/modules/video_coding/main/source/generic_encoder.h
index a986ada..70569fa 100644
--- a/webrtc/modules/video_coding/main/source/generic_encoder.h
+++ b/webrtc/modules/video_coding/main/source/generic_encoder.h
@@ -103,7 +103,7 @@
     /**
     * Set a new packet loss rate and a new round-trip time in milliseconds.
     */
-    int32_t SetChannelParameters(int32_t packetLoss, int rtt);
+    int32_t SetChannelParameters(int32_t packetLoss, int64_t rtt);
     int32_t CodecConfigParameters(uint8_t* buffer, int32_t size);
     /**
     * Register a transport callback which will be called to deliver the encoded
diff --git a/webrtc/modules/video_coding/main/source/jitter_buffer.cc b/webrtc/modules/video_coding/main/source/jitter_buffer.cc
index 2a590df..14f33ff 100644
--- a/webrtc/modules/video_coding/main/source/jitter_buffer.cc
+++ b/webrtc/modules/video_coding/main/source/jitter_buffer.cc
@@ -31,7 +31,7 @@
 namespace webrtc {
 
 // Use this rtt if no value has been reported.
-static const uint32_t kDefaultRtt = 200;
+static const int64_t kDefaultRtt = 200;
 
 typedef std::pair<uint32_t, VCMFrameBuffer*> FrameListPair;
 
@@ -783,7 +783,7 @@
   // low_rtt_nackThresholdMs_ == -1 means no FEC.
   double rtt_mult = 1.0f;
   if (low_rtt_nack_threshold_ms_ >= 0 &&
-      static_cast<int>(rtt_ms_) >= low_rtt_nack_threshold_ms_) {
+      rtt_ms_ >= low_rtt_nack_threshold_ms_) {
     // For RTTs above low_rtt_nack_threshold_ms_ we don't apply extra delay
     // when waiting for retransmissions.
     rtt_mult = 0.0f;
@@ -791,15 +791,15 @@
   return jitter_estimate_.GetJitterEstimate(rtt_mult);
 }
 
-void VCMJitterBuffer::UpdateRtt(uint32_t rtt_ms) {
+void VCMJitterBuffer::UpdateRtt(int64_t rtt_ms) {
   CriticalSectionScoped cs(crit_sect_);
   rtt_ms_ = rtt_ms;
   jitter_estimate_.UpdateRtt(rtt_ms);
 }
 
 void VCMJitterBuffer::SetNackMode(VCMNackMode mode,
-                                  int low_rtt_nack_threshold_ms,
-                                  int high_rtt_nack_threshold_ms) {
+                                  int64_t low_rtt_nack_threshold_ms,
+                                  int64_t high_rtt_nack_threshold_ms) {
   CriticalSectionScoped cs(crit_sect_);
   nack_mode_ = mode;
   if (mode == kNoNack) {
@@ -1214,7 +1214,7 @@
   // Evaluate if the RTT is higher than |high_rtt_nack_threshold_ms_|, and in
   // that case we don't wait for retransmissions.
   if (high_rtt_nack_threshold_ms_ >= 0 &&
-      rtt_ms_ >= static_cast<unsigned int>(high_rtt_nack_threshold_ms_)) {
+      rtt_ms_ >= high_rtt_nack_threshold_ms_) {
     return false;
   }
   return true;
diff --git a/webrtc/modules/video_coding/main/source/jitter_buffer.h b/webrtc/modules/video_coding/main/source/jitter_buffer.h
index 5ac2b7a..7857aaa 100644
--- a/webrtc/modules/video_coding/main/source/jitter_buffer.h
+++ b/webrtc/modules/video_coding/main/source/jitter_buffer.h
@@ -153,7 +153,7 @@
   uint32_t EstimatedJitterMs();
 
   // Updates the round-trip time estimate.
-  void UpdateRtt(uint32_t rtt_ms);
+  void UpdateRtt(int64_t rtt_ms);
 
   // Set the NACK mode. |highRttNackThreshold| is an RTT threshold in ms above
   // which NACK will be disabled if the NACK mode is |kNackHybrid|, -1 meaning
@@ -161,8 +161,8 @@
   // |lowRttNackThreshold| is an RTT threshold in ms below which we expect to
   // rely on NACK only, and therefore are using larger buffers to have time to
   // wait for retransmissions.
-  void SetNackMode(VCMNackMode mode, int low_rtt_nack_threshold_ms,
-                   int high_rtt_nack_threshold_ms);
+  void SetNackMode(VCMNackMode mode, int64_t low_rtt_nack_threshold_ms,
+                   int64_t high_rtt_nack_threshold_ms);
 
   void SetNackSettings(size_t max_nack_list_size,
                        int max_packet_age_to_nack,
@@ -331,12 +331,12 @@
   // Calculates network delays used for jitter calculations.
   VCMInterFrameDelay inter_frame_delay_;
   VCMJitterSample waiting_for_completion_;
-  uint32_t rtt_ms_;
+  int64_t rtt_ms_;
 
   // NACK and retransmissions.
   VCMNackMode nack_mode_;
-  int low_rtt_nack_threshold_ms_;
-  int high_rtt_nack_threshold_ms_;
+  int64_t low_rtt_nack_threshold_ms_;
+  int64_t high_rtt_nack_threshold_ms_;
   // Holds the internal NACK list (the missing sequence numbers).
   SequenceNumberSet missing_sequence_numbers_;
   uint16_t latest_received_sequence_number_;
diff --git a/webrtc/modules/video_coding/main/source/jitter_estimator.cc b/webrtc/modules/video_coding/main/source/jitter_estimator.cc
index b36775a..9024443 100644
--- a/webrtc/modules/video_coding/main/source/jitter_estimator.cc
+++ b/webrtc/modules/video_coding/main/source/jitter_estimator.cc
@@ -406,7 +406,7 @@
 }
 
 void
-VCMJitterEstimator::UpdateRtt(uint32_t rttMs)
+VCMJitterEstimator::UpdateRtt(int64_t rttMs)
 {
     _rttFilter.Update(rttMs);
 }
diff --git a/webrtc/modules/video_coding/main/source/jitter_estimator.h b/webrtc/modules/video_coding/main/source/jitter_estimator.h
index ec7e35c..46ed67b 100644
--- a/webrtc/modules/video_coding/main/source/jitter_estimator.h
+++ b/webrtc/modules/video_coding/main/source/jitter_estimator.h
@@ -59,7 +59,7 @@
     //
     // Input:
     //          - rttMs               : RTT in ms
-    void UpdateRtt(uint32_t rttMs);
+    void UpdateRtt(int64_t rttMs);
 
     void UpdateMaxFrameSize(uint32_t frameSizeBytes);
 
diff --git a/webrtc/modules/video_coding/main/source/media_opt_util.cc b/webrtc/modules/video_coding/main/source/media_opt_util.cc
index b506a5b..79e1268 100644
--- a/webrtc/modules/video_coding/main/source/media_opt_util.cc
+++ b/webrtc/modules/video_coding/main/source/media_opt_util.cc
@@ -53,8 +53,8 @@
     _qmRobustness->UpdateContent(contentMetrics);
 }
 
-VCMNackFecMethod::VCMNackFecMethod(int lowRttNackThresholdMs,
-                                   int highRttNackThresholdMs)
+VCMNackFecMethod::VCMNackFecMethod(int64_t lowRttNackThresholdMs,
+                                   int64_t highRttNackThresholdMs)
     : VCMFecMethod(),
       _lowRttNackMs(lowRttNackThresholdMs),
       _highRttNackMs(highRttNackThresholdMs),
@@ -159,6 +159,8 @@
   }
   // TODO (marpan): add condition based on maximum frames used for FEC,
   // and expand condition based on frame size.
+  // Max round trip time threshold in ms.
+  const int64_t kMaxRttTurnOffFec = 200;
   if (estimate_bytes_per_frame < max_bytes_per_frame &&
       parameters->numLayers < 3 &&
       parameters->rtt < kMaxRttTurnOffFec) {
@@ -737,7 +739,7 @@
 }
 
 void
-VCMLossProtectionLogic::UpdateRtt(uint32_t rtt)
+VCMLossProtectionLogic::UpdateRtt(int64_t rtt)
 {
     _rtt = rtt;
 }
diff --git a/webrtc/modules/video_coding/main/source/media_opt_util.h b/webrtc/modules/video_coding/main/source/media_opt_util.h
index d421d9e..3b6fa8f 100644
--- a/webrtc/modules/video_coding/main/source/media_opt_util.h
+++ b/webrtc/modules/video_coding/main/source/media_opt_util.h
@@ -41,10 +41,7 @@
 
 // Thresholds for hybrid NACK/FEC
 // common to media optimization and the jitter buffer.
-enum HybridNackTH {
-    kHighRttNackMs = 100,
-    kLowRttNackMs = 20
-};
+const int64_t kLowRttNackMs = 20;
 
 struct VCMProtectionParameters
 {
@@ -55,7 +52,7 @@
         numLayers(1)
         {}
 
-    int                 rtt;
+    int64_t             rtt;
     float               lossPr;
     float               bitRate;
     float               packetsPerFrame;
@@ -211,16 +208,14 @@
     enum { kMaxBytesPerFrameForFecLow = 400 };
     // Max bytes/frame for frame size larger than VGA, ~200k at 25fps.
     enum { kMaxBytesPerFrameForFecHigh = 1000 };
-    // Max round trip time threshold in ms.
-    enum { kMaxRttTurnOffFec = 200 };
 };
 
 
 class VCMNackFecMethod : public VCMFecMethod
 {
 public:
-    VCMNackFecMethod(int lowRttNackThresholdMs,
-                     int highRttNackThresholdMs);
+    VCMNackFecMethod(int64_t lowRttNackThresholdMs,
+                     int64_t highRttNackThresholdMs);
     virtual ~VCMNackFecMethod();
     virtual bool UpdateParameters(const VCMProtectionParameters* parameters);
     // Get the effective packet loss for ER
@@ -234,8 +229,8 @@
 private:
     int ComputeMaxFramesFec(const VCMProtectionParameters* parameters);
 
-    int _lowRttNackMs;
-    int _highRttNackMs;
+    int64_t _lowRttNackMs;
+    int64_t _highRttNackMs;
     int _maxFramesFec;
 };
 
@@ -267,7 +262,7 @@
     //
     // Input:
     //          - rtt           : Round-trip time in seconds.
-    void UpdateRtt(uint32_t rtt);
+    void UpdateRtt(int64_t rtt);
 
     // Update residual packet loss
     //
@@ -369,7 +364,7 @@
     uint8_t MaxFilteredLossPr(int64_t nowMs) const;
     VCMProtectionMethod* _selectedMethod;
     VCMProtectionParameters _currentParameters;
-    uint32_t _rtt;
+    int64_t _rtt;
     float _lossPr;
     float _bitRate;
     float _frameRate;
diff --git a/webrtc/modules/video_coding/main/source/media_optimization.cc b/webrtc/modules/video_coding/main/source/media_optimization.cc
index 85cce8f..1151d5b 100644
--- a/webrtc/modules/video_coding/main/source/media_optimization.cc
+++ b/webrtc/modules/video_coding/main/source/media_optimization.cc
@@ -200,7 +200,7 @@
 uint32_t MediaOptimization::SetTargetRates(
     uint32_t target_bitrate,
     uint8_t fraction_lost,
-    uint32_t round_trip_time_ms,
+    int64_t round_trip_time_ms,
     VCMProtectionCallback* protection_callback,
     VCMQMSettingsCallback* qmsettings_callback) {
   CriticalSectionScoped lock(crit_sect_.get());
diff --git a/webrtc/modules/video_coding/main/source/media_optimization.h b/webrtc/modules/video_coding/main/source/media_optimization.h
index 675d64e..aa21921 100644
--- a/webrtc/modules/video_coding/main/source/media_optimization.h
+++ b/webrtc/modules/video_coding/main/source/media_optimization.h
@@ -58,7 +58,7 @@
   // an internal critical section.
   uint32_t SetTargetRates(uint32_t target_bitrate,
                           uint8_t fraction_lost,
-                          uint32_t round_trip_time_ms,
+                          int64_t round_trip_time_ms,
                           VCMProtectionCallback* protection_callback,
                           VCMQMSettingsCallback* qmsettings_callback);
 
diff --git a/webrtc/modules/video_coding/main/source/nack_fec_tables.h b/webrtc/modules/video_coding/main/source/nack_fec_tables.h
index acf62bf..b82bb1b 100644
--- a/webrtc/modules/video_coding/main/source/nack_fec_tables.h
+++ b/webrtc/modules/video_coding/main/source/nack_fec_tables.h
@@ -15,9 +15,8 @@
 {
 
 // Table for adjusting FEC rate for NACK/FEC protection method
-// Table values are built as a sigmoid function, ranging from 0 to
-// kHighRttNackMs (100), based on the HybridNackTH values defined in
-// media_opt_util.h.
+// Table values are built as a sigmoid function, ranging from 0 to 100, based on
+// the HybridNackTH values defined in media_opt_util.h.
 const uint16_t VCMNackFecTable[100] = {
 0,
 0,
diff --git a/webrtc/modules/video_coding/main/source/qm_select.cc b/webrtc/modules/video_coding/main/source/qm_select.cc
index 9255aed..3007f63 100644
--- a/webrtc/modules/video_coding/main/source/qm_select.cc
+++ b/webrtc/modules/video_coding/main/source/qm_select.cc
@@ -925,7 +925,7 @@
 float VCMQmRobustness::AdjustFecFactor(uint8_t code_rate_delta,
                                        float total_rate,
                                        float framerate,
-                                       uint32_t rtt_time,
+                                       int64_t rtt_time,
                                        uint8_t packet_loss) {
   // Default: no adjustment
   float adjust_fec =  1.0f;
diff --git a/webrtc/modules/video_coding/main/source/qm_select.h b/webrtc/modules/video_coding/main/source/qm_select.h
index 654c078..079e7f8 100644
--- a/webrtc/modules/video_coding/main/source/qm_select.h
+++ b/webrtc/modules/video_coding/main/source/qm_select.h
@@ -353,7 +353,7 @@
   float AdjustFecFactor(uint8_t code_rate_delta,
                         float total_rate,
                         float framerate,
-                        uint32_t rtt_time,
+                        int64_t rtt_time,
                         uint8_t packet_loss);
 
   // Set the UEP protection on/off.
@@ -365,7 +365,7 @@
  private:
   // Previous state of network parameters.
   float prev_total_rate_;
-  uint32_t prev_rtt_time_;
+  int64_t prev_rtt_time_;
   uint8_t prev_packet_loss_;
   uint8_t prev_code_rate_delta_;
 };
diff --git a/webrtc/modules/video_coding/main/source/receiver.cc b/webrtc/modules/video_coding/main/source/receiver.cc
index e1a4e2f..c84d992 100644
--- a/webrtc/modules/video_coding/main/source/receiver.cc
+++ b/webrtc/modules/video_coding/main/source/receiver.cc
@@ -59,7 +59,7 @@
   return VCM_OK;
 }
 
-void VCMReceiver::UpdateRtt(uint32_t rtt) {
+void VCMReceiver::UpdateRtt(int64_t rtt) {
   jitter_buffer_.UpdateRtt(rtt);
 }
 
@@ -191,8 +191,8 @@
 }
 
 void VCMReceiver::SetNackMode(VCMNackMode nackMode,
-                              int low_rtt_nack_threshold_ms,
-                              int high_rtt_nack_threshold_ms) {
+                              int64_t low_rtt_nack_threshold_ms,
+                              int64_t high_rtt_nack_threshold_ms) {
   CriticalSectionScoped cs(crit_sect_);
   // Default to always having NACK enabled in hybrid mode.
   jitter_buffer_.SetNackMode(nackMode, low_rtt_nack_threshold_ms,
diff --git a/webrtc/modules/video_coding/main/source/receiver.h b/webrtc/modules/video_coding/main/source/receiver.h
index 068715f..f531ac8 100644
--- a/webrtc/modules/video_coding/main/source/receiver.h
+++ b/webrtc/modules/video_coding/main/source/receiver.h
@@ -44,7 +44,7 @@
 
   void Reset();
   int32_t Initialize();
-  void UpdateRtt(uint32_t rtt);
+  void UpdateRtt(int64_t rtt);
   int32_t InsertPacket(const VCMPacket& packet,
                        uint16_t frame_width,
                        uint16_t frame_height);
@@ -57,8 +57,8 @@
 
   // NACK.
   void SetNackMode(VCMNackMode nackMode,
-                   int low_rtt_nack_threshold_ms,
-                   int high_rtt_nack_threshold_ms);
+                   int64_t low_rtt_nack_threshold_ms,
+                   int64_t high_rtt_nack_threshold_ms);
   void SetNackSettings(size_t max_nack_list_size,
                        int max_packet_age_to_nack,
                        int max_incomplete_time_ms);
diff --git a/webrtc/modules/video_coding/main/source/rtt_filter.cc b/webrtc/modules/video_coding/main/source/rtt_filter.cc
index 739cc82..5742e8f 100644
--- a/webrtc/modules/video_coding/main/source/rtt_filter.cc
+++ b/webrtc/modules/video_coding/main/source/rtt_filter.cc
@@ -58,7 +58,7 @@
 }
 
 void
-VCMRttFilter::Update(uint32_t rttMs)
+VCMRttFilter::Update(int64_t rttMs)
 {
     if (!_gotNonZeroUpdate)
     {
@@ -103,7 +103,7 @@
 }
 
 bool
-VCMRttFilter::JumpDetection(uint32_t rttMs)
+VCMRttFilter::JumpDetection(int64_t rttMs)
 {
     double diffFromAvg = _avgRtt - rttMs;
     if (fabs(diffFromAvg) > _jumpStdDevs * sqrt(_varRtt))
@@ -147,7 +147,7 @@
 }
 
 bool
-VCMRttFilter::DriftDetection(uint32_t rttMs)
+VCMRttFilter::DriftDetection(int64_t rttMs)
 {
     if (_maxRtt - _avgRtt > _driftStdDevs * sqrt(_varRtt))
     {
@@ -174,7 +174,7 @@
 }
 
 void
-VCMRttFilter::ShortRttFilter(uint32_t* buf, uint32_t length)
+VCMRttFilter::ShortRttFilter(int64_t* buf, uint32_t length)
 {
     if (length == 0)
     {
@@ -193,10 +193,10 @@
     _avgRtt = _avgRtt / static_cast<double>(length);
 }
 
-uint32_t
+int64_t
 VCMRttFilter::RttMs() const
 {
-    return static_cast<uint32_t>(_maxRtt + 0.5);
+    return static_cast<int64_t>(_maxRtt + 0.5);
 }
 
 }
diff --git a/webrtc/modules/video_coding/main/source/rtt_filter.h b/webrtc/modules/video_coding/main/source/rtt_filter.h
index 8b816a0..9e14a1a 100644
--- a/webrtc/modules/video_coding/main/source/rtt_filter.h
+++ b/webrtc/modules/video_coding/main/source/rtt_filter.h
@@ -26,9 +26,9 @@
     // Resets the filter.
     void Reset();
     // Updates the filter with a new sample.
-    void Update(uint32_t rttMs);
+    void Update(int64_t rttMs);
     // A getter function for the current RTT level in ms.
-    uint32_t RttMs() const;
+    int64_t RttMs() const;
 
 private:
     // The size of the drift and jump memory buffers
@@ -39,19 +39,19 @@
     // samples and average to the standard deviation.
     // Returns true if the long time statistics should be updated
     // and false otherwise
-    bool JumpDetection(uint32_t rttMs);
+    bool JumpDetection(int64_t rttMs);
     // Detects RTT drifts by comparing the difference between
     // max and average to the standard deviation.
     // Returns true if the long time statistics should be updated
     // and false otherwise
-    bool DriftDetection(uint32_t rttMs);
+    bool DriftDetection(int64_t rttMs);
     // Computes the short time average and maximum of the vector buf.
-    void ShortRttFilter(uint32_t* buf, uint32_t length);
+    void ShortRttFilter(int64_t* buf, uint32_t length);
 
     bool                  _gotNonZeroUpdate;
     double                _avgRtt;
     double                _varRtt;
-    uint32_t        _maxRtt;
+    int64_t         _maxRtt;
     uint32_t        _filtFactCount;
     const uint32_t  _filtFactMax;
     const double          _jumpStdDevs;
@@ -59,8 +59,8 @@
     int32_t         _jumpCount;
     int32_t         _driftCount;
     const int32_t   _detectThreshold;
-    uint32_t        _jumpBuf[kMaxDriftJumpCount];
-    uint32_t        _driftBuf[kMaxDriftJumpCount];
+    int64_t         _jumpBuf[kMaxDriftJumpCount];
+    int64_t         _driftBuf[kMaxDriftJumpCount];
 };
 
 }  // namespace webrtc
diff --git a/webrtc/modules/video_coding/main/source/session_info.cc b/webrtc/modules/video_coding/main/source/session_info.cc
index c981829..361c0a1 100644
--- a/webrtc/modules/video_coding/main/source/session_info.cc
+++ b/webrtc/modules/video_coding/main/source/session_info.cc
@@ -14,18 +14,13 @@
 #include "webrtc/system_wrappers/interface/logging.h"
 
 namespace webrtc {
-namespace {
-// Used in determining whether a frame is decodable.
-enum {kRttThreshold = 100};  // Not decodable if Rtt is lower than this.
 
-// Do not decode frames if the number of packets is between these two
-// thresholds.
-static const float kLowPacketPercentageThreshold = 0.2f;
-static const float kHighPacketPercentageThreshold = 0.8f;
+namespace {
 
 uint16_t BufferToUWord16(const uint8_t* dataBuffer) {
   return (dataBuffer[0] << 8) | dataBuffer[1];
 }
+
 }  // namespace
 
 VCMSessionInfo::VCMSessionInfo()
@@ -233,6 +228,12 @@
     return;
   // TODO(agalusza): Account for bursty loss.
   // TODO(agalusza): Refine these values to better approximate optimal ones.
+  // Do not decode frames if the RTT is lower than this.
+  const int64_t kRttThreshold = 100;
+  // Do not decode frames if the number of packets is between these two
+  // thresholds.
+  const float kLowPacketPercentageThreshold = 0.2f;
+  const float kHighPacketPercentageThreshold = 0.8f;
   if (frame_data.rtt_ms < kRttThreshold
       || frame_type_ == kVideoFrameKey
       || !HaveFirstPacket()
diff --git a/webrtc/modules/video_coding/main/source/session_info.h b/webrtc/modules/video_coding/main/source/session_info.h
index cd55130..21f6c43 100644
--- a/webrtc/modules/video_coding/main/source/session_info.h
+++ b/webrtc/modules/video_coding/main/source/session_info.h
@@ -22,7 +22,7 @@
 // Used to pass data from jitter buffer to session info.
 // This data is then used in determining whether a frame is decodable.
 struct FrameData {
-  int rtt_ms;
+  int64_t rtt_ms;
   float rolling_average_packets_per_frame;
 };
 
diff --git a/webrtc/modules/video_coding/main/source/video_coding_impl.cc b/webrtc/modules/video_coding/main/source/video_coding_impl.cc
index ac938e6..b7c72da 100644
--- a/webrtc/modules/video_coding/main/source/video_coding_impl.cc
+++ b/webrtc/modules/video_coding/main/source/video_coding_impl.cc
@@ -142,7 +142,7 @@
 
   virtual int32_t SetChannelParameters(uint32_t target_bitrate,  // bits/s.
                                        uint8_t lossRate,
-                                       uint32_t rtt) OVERRIDE {
+                                       int64_t rtt) OVERRIDE {
     return sender_->SetChannelParameters(target_bitrate, lossRate, rtt);
   }
 
@@ -332,7 +332,7 @@
     return receiver_->SetMinReceiverDelay(desired_delay_ms);
   }
 
-  virtual int32_t SetReceiveChannelParameters(uint32_t rtt) OVERRIDE {
+  virtual int32_t SetReceiveChannelParameters(int64_t rtt) OVERRIDE {
     return receiver_->SetReceiveChannelParameters(rtt);
   }
 
diff --git a/webrtc/modules/video_coding/main/source/video_coding_impl.h b/webrtc/modules/video_coding/main/source/video_coding_impl.h
index 3454e9c..cf4a986 100644
--- a/webrtc/modules/video_coding/main/source/video_coding_impl.h
+++ b/webrtc/modules/video_coding/main/source/video_coding_impl.h
@@ -79,7 +79,7 @@
 
   int32_t SetChannelParameters(uint32_t target_bitrate,  // bits/s.
                                uint8_t lossRate,
-                               uint32_t rtt);
+                               int64_t rtt);
 
   int32_t RegisterTransportCallback(VCMPacketizationCallback* transport);
   int32_t RegisterSendStatisticsCallback(VCMSendStatisticsCallback* sendStats);
@@ -175,7 +175,7 @@
   void SetDecodeErrorMode(VCMDecodeErrorMode decode_error_mode);
   int SetMinReceiverDelay(int desired_delay_ms);
 
-  int32_t SetReceiveChannelParameters(uint32_t rtt);
+  int32_t SetReceiveChannelParameters(int64_t rtt);
   int32_t SetVideoProtection(VCMVideoProtection videoProtection, bool enable);
 
   int64_t TimeUntilNextProcess();
diff --git a/webrtc/modules/video_coding/main/source/video_receiver.cc b/webrtc/modules/video_coding/main/source/video_receiver.cc
index f623c7d..5d87553 100644
--- a/webrtc/modules/video_coding/main/source/video_receiver.cc
+++ b/webrtc/modules/video_coding/main/source/video_receiver.cc
@@ -168,7 +168,7 @@
   return timeUntilNextProcess;
 }
 
-int32_t VideoReceiver::SetReceiveChannelParameters(uint32_t rtt) {
+int32_t VideoReceiver::SetReceiveChannelParameters(int64_t rtt) {
   CriticalSectionScoped receiveCs(_receiveCritSect);
   _receiver.UpdateRtt(rtt);
   return 0;
diff --git a/webrtc/modules/video_coding/main/source/video_sender.cc b/webrtc/modules/video_coding/main/source/video_sender.cc
index 6fdc29d..b2dd23e 100644
--- a/webrtc/modules/video_coding/main/source/video_sender.cc
+++ b/webrtc/modules/video_coding/main/source/video_sender.cc
@@ -244,7 +244,7 @@
 // Set channel parameters
 int32_t VideoSender::SetChannelParameters(uint32_t target_bitrate,
                                           uint8_t lossRate,
-                                          uint32_t rtt) {
+                                          int64_t rtt) {
   int32_t ret = 0;
   {
     CriticalSectionScoped sendCs(_sendCritSect);