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/call.h b/webrtc/call.h
index 56efacb..99f8b27 100644
--- a/webrtc/call.h
+++ b/webrtc/call.h
@@ -105,8 +105,8 @@
int send_bandwidth_bps;
int recv_bandwidth_bps;
- int pacer_delay_ms;
- int rtt_ms;
+ int64_t pacer_delay_ms;
+ int64_t rtt_ms;
};
static Call* Create(const Call::Config& config);
diff --git a/webrtc/examples/android/media_demo/jni/video_engine_jni.cc b/webrtc/examples/android/media_demo/jni/video_engine_jni.cc
index c7af1c5..d9e6312 100644
--- a/webrtc/examples/android/media_demo/jni/video_engine_jni.cc
+++ b/webrtc/examples/android/media_demo/jni/video_engine_jni.cc
@@ -594,7 +594,7 @@
unsigned int cumulative_lost; // NOLINT
unsigned int extended_max; // NOLINT
unsigned int jitter; // NOLINT
- int rtt_ms;
+ int64_t rtt_ms;
VideoEngineData* vie_data = GetVideoEngineData(jni, j_vie);
if (vie_data->rtp->GetReceivedRTCPStatistics(channel, fraction_lost,
cumulative_lost, extended_max,
@@ -608,7 +608,7 @@
jobject j_rtcp_statistics =
jni->NewObject(j_rtcp_statistics_class, j_rtcp_statistics_ctor,
fraction_lost, cumulative_lost, extended_max, jitter,
- rtt_ms);
+ static_cast<int>(rtt_ms));
CHECK_EXCEPTION(jni, "error during NewObject");
return j_rtcp_statistics;
}
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc b/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
index f0531ed..07c2784 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
@@ -15,6 +15,7 @@
#include <algorithm> // sort
#include <vector>
+#include "webrtc/base/format_macros.h"
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/audio_coding/codecs/audio_decoder.h"
@@ -727,12 +728,12 @@
}
std::vector<uint16_t> AcmReceiver::GetNackList(
- int round_trip_time_ms) const {
+ int64_t round_trip_time_ms) const {
CriticalSectionScoped lock(crit_sect_.get());
if (round_trip_time_ms < 0) {
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceAudioCoding, id_,
"GetNackList: round trip time cannot be negative."
- " round_trip_time_ms=%d", round_trip_time_ms);
+ " round_trip_time_ms=%" PRId64, round_trip_time_ms);
}
if (nack_enabled_ && round_trip_time_ms >= 0) {
assert(nack_.get());
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver.h b/webrtc/modules/audio_coding/main/acm2/acm_receiver.h
index 057cb5a..f6ce463 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_receiver.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver.h
@@ -305,7 +305,7 @@
// -round_trip_time_ms : estimate of the round-trip-time (in milliseconds).
// Return value : list of packets to be retransmitted.
//
- std::vector<uint16_t> GetNackList(int round_trip_time_ms) const;
+ std::vector<uint16_t> GetNackList(int64_t round_trip_time_ms) const;
//
// Get statistics of calls to GetAudio().
diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
index cbea050..4aa372f 100644
--- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
+++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
@@ -2017,7 +2017,7 @@
}
std::vector<uint16_t> AudioCodingModuleImpl::GetNackList(
- int round_trip_time_ms) const {
+ int64_t round_trip_time_ms) const {
return receiver_.GetNackList(round_trip_time_ms);
}
diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h
index 2d0f767..a06d877 100644
--- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h
+++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h
@@ -246,7 +246,7 @@
virtual void DisableNack() OVERRIDE;
virtual std::vector<uint16_t> GetNackList(
- int round_trip_time_ms) const OVERRIDE;
+ int64_t round_trip_time_ms) const OVERRIDE;
virtual void GetDecodingCallStatistics(
AudioDecodingCallStats* stats) const OVERRIDE;
diff --git a/webrtc/modules/audio_coding/main/acm2/nack.cc b/webrtc/modules/audio_coding/main/acm2/nack.cc
index 7265fe6..4324cd2 100644
--- a/webrtc/modules/audio_coding/main/acm2/nack.cc
+++ b/webrtc/modules/audio_coding/main/acm2/nack.cc
@@ -207,13 +207,13 @@
nack_list_.erase(nack_list_.begin(), nack_list_.upper_bound(limit));
}
-int Nack::TimeToPlay(uint32_t timestamp) const {
+int64_t Nack::TimeToPlay(uint32_t timestamp) const {
uint32_t timestamp_increase = timestamp - timestamp_last_decoded_rtp_;
return timestamp_increase / sample_rate_khz_;
}
// We don't erase elements with time-to-play shorter than round-trip-time.
-std::vector<uint16_t> Nack::GetNackList(int round_trip_time_ms) const {
+std::vector<uint16_t> Nack::GetNackList(int64_t round_trip_time_ms) const {
std::vector<uint16_t> sequence_numbers;
for (NackList::const_iterator it = nack_list_.begin(); it != nack_list_.end();
++it) {
diff --git a/webrtc/modules/audio_coding/main/acm2/nack.h b/webrtc/modules/audio_coding/main/acm2/nack.h
index 3809327..d74bb1f 100644
--- a/webrtc/modules/audio_coding/main/acm2/nack.h
+++ b/webrtc/modules/audio_coding/main/acm2/nack.h
@@ -87,7 +87,7 @@
// Get a list of "missing" packets which have expected time-to-play larger
// than the given round-trip-time (in milliseconds).
// Note: Late packets are not included.
- std::vector<uint16_t> GetNackList(int round_trip_time_ms) const;
+ std::vector<uint16_t> GetNackList(int64_t round_trip_time_ms) const;
// Reset to default values. The NACK list is cleared.
// |nack_threshold_packets_| & |max_nack_list_size_| preserve their values.
@@ -98,7 +98,7 @@
FRIEND_TEST_ALL_PREFIXES(NackTest, EstimateTimestampAndTimeToPlay);
struct NackElement {
- NackElement(int initial_time_to_play_ms,
+ NackElement(int64_t initial_time_to_play_ms,
uint32_t initial_timestamp,
bool missing)
: time_to_play_ms(initial_time_to_play_ms),
@@ -107,7 +107,7 @@
// Estimated time (ms) left for this packet to be decoded. This estimate is
// updated every time jitter buffer decodes a packet.
- int time_to_play_ms;
+ int64_t time_to_play_ms;
// A guess about the timestamp of the missing packet, it is used for
// estimation of |time_to_play_ms|. The estimate might be slightly wrong if
@@ -171,7 +171,7 @@
uint32_t EstimateTimestamp(uint16_t sequence_number);
// Compute time-to-play given a timestamp.
- int TimeToPlay(uint32_t timestamp) const;
+ int64_t TimeToPlay(uint32_t timestamp) const;
// If packet N is arrived, any packet prior to N - |nack_threshold_packets_|
// which is not arrived is considered missing, and should be in NACK list.
diff --git a/webrtc/modules/audio_coding/main/acm2/nack_unittest.cc b/webrtc/modules/audio_coding/main/acm2/nack_unittest.cc
index 7863c75..c175908 100644
--- a/webrtc/modules/audio_coding/main/acm2/nack_unittest.cc
+++ b/webrtc/modules/audio_coding/main/acm2/nack_unittest.cc
@@ -29,7 +29,7 @@
const int kSampleRateHz = 16000;
const int kPacketSizeMs = 30;
const uint32_t kTimestampIncrement = 480; // 30 ms.
-const int kShortRoundTripTimeMs = 1;
+const int64_t kShortRoundTripTimeMs = 1;
bool IsNackListCorrect(const std::vector<uint16_t>& nack_list,
const uint16_t* lost_sequence_numbers,
diff --git a/webrtc/modules/audio_coding/main/interface/audio_coding_module.h b/webrtc/modules/audio_coding/main/interface/audio_coding_module.h
index 83e6dce..8826194 100644
--- a/webrtc/modules/audio_coding/main/interface/audio_coding_module.h
+++ b/webrtc/modules/audio_coding/main/interface/audio_coding_module.h
@@ -991,7 +991,8 @@
// Negative |round_trip_time_ms| results is an error message and empty list
// is returned.
//
- virtual std::vector<uint16_t> GetNackList(int round_trip_time_ms) const = 0;
+ virtual std::vector<uint16_t> GetNackList(
+ int64_t round_trip_time_ms) const = 0;
virtual void GetDecodingCallStatistics(
AudioDecodingCallStats* call_stats) const = 0;
diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc b/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
index 605190d..acfeb59 100644
--- a/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
+++ b/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc
@@ -33,7 +33,7 @@
// Received RTCP receiver block.
virtual void OnReceivedRtcpReceiverReport(
const ReportBlockList& report_blocks,
- uint16_t rtt,
+ int64_t rtt,
int64_t now_ms) OVERRIDE {
if (report_blocks.empty())
return;
@@ -153,7 +153,7 @@
}
uint32_t current_estimate;
uint8_t loss;
- uint32_t rtt;
+ int64_t rtt;
bandwidth_estimation_.CurrentEstimate(¤t_estimate, &loss, &rtt);
bandwidth_estimation_.SetSendBitrate(std::max(sum_start_bitrate,
current_estimate));
@@ -252,7 +252,7 @@
void BitrateControllerImpl::OnReceivedRtcpReceiverReport(
uint8_t fraction_loss,
- uint32_t rtt,
+ int64_t rtt,
int number_of_packets,
int64_t now_ms) {
CriticalSectionScoped cs(critsect_);
@@ -264,7 +264,7 @@
void BitrateControllerImpl::MaybeTriggerOnNetworkChanged() {
uint32_t bitrate;
uint8_t fraction_loss;
- uint32_t rtt;
+ int64_t rtt;
bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt);
bitrate -= std::min(bitrate, reserved_bitrate_bps_);
@@ -286,7 +286,7 @@
void BitrateControllerImpl::OnNetworkChanged(uint32_t bitrate,
uint8_t fraction_loss,
- uint32_t rtt) {
+ int64_t rtt) {
// Sanity check.
if (bitrate_observers_.empty())
return;
@@ -304,7 +304,7 @@
void BitrateControllerImpl::NormalRateAllocation(uint32_t bitrate,
uint8_t fraction_loss,
- uint32_t rtt,
+ int64_t rtt,
uint32_t sum_min_bitrates) {
uint32_t number_of_observers = bitrate_observers_.size();
uint32_t bitrate_per_observer = (bitrate - sum_min_bitrates) /
@@ -344,7 +344,7 @@
void BitrateControllerImpl::LowRateAllocation(uint32_t bitrate,
uint8_t fraction_loss,
- uint32_t rtt,
+ int64_t rtt,
uint32_t sum_min_bitrates) {
if (enforce_min_bitrate_) {
// Min bitrate to all observers.
@@ -375,7 +375,7 @@
CriticalSectionScoped cs(critsect_);
uint32_t bitrate;
uint8_t fraction_loss;
- uint32_t rtt;
+ int64_t rtt;
bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt);
if (bitrate) {
*bandwidth = bitrate - std::min(bitrate, reserved_bitrate_bps_);
diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
index fb2622f..f8d8022 100644
--- a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
+++ b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h
@@ -89,7 +89,7 @@
void OnReceivedEstimatedBitrate(uint32_t bitrate);
void OnReceivedRtcpReceiverReport(uint8_t fraction_loss,
- uint32_t rtt,
+ int64_t rtt,
int number_of_packets,
int64_t now_ms);
@@ -97,18 +97,18 @@
void OnNetworkChanged(uint32_t bitrate,
uint8_t fraction_loss, // 0 - 255.
- uint32_t rtt)
+ int64_t rtt)
EXCLUSIVE_LOCKS_REQUIRED(*critsect_);
void NormalRateAllocation(uint32_t bitrate,
uint8_t fraction_loss,
- uint32_t rtt,
+ int64_t rtt,
uint32_t sum_min_bitrates)
EXCLUSIVE_LOCKS_REQUIRED(*critsect_);
void LowRateAllocation(uint32_t bitrate,
uint8_t fraction_loss,
- uint32_t rtt,
+ int64_t rtt,
uint32_t sum_min_bitrates)
EXCLUSIVE_LOCKS_REQUIRED(*critsect_);
@@ -129,7 +129,7 @@
uint32_t last_bitrate_bps_ GUARDED_BY(*critsect_);
uint8_t last_fraction_loss_ GUARDED_BY(*critsect_);
- uint32_t last_rtt_ms_ GUARDED_BY(*critsect_);
+ int64_t last_rtt_ms_ GUARDED_BY(*critsect_);
bool last_enforce_min_bitrate_ GUARDED_BY(*critsect_);
bool bitrate_observers_modified_ GUARDED_BY(*critsect_);
uint32_t last_reserved_bitrate_bps_ GUARDED_BY(*critsect_);
diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc b/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc
index 6344ee8..f89da9f 100644
--- a/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc
+++ b/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc
@@ -45,14 +45,14 @@
virtual void OnNetworkChanged(uint32_t bitrate,
uint8_t fraction_loss,
- uint32_t rtt) {
+ int64_t rtt) {
last_bitrate_ = bitrate;
last_fraction_loss_ = fraction_loss;
last_rtt_ = rtt;
}
uint32_t last_bitrate_;
uint8_t last_fraction_loss_;
- uint32_t last_rtt_;
+ int64_t last_rtt_;
};
class BitrateControllerTest : public ::testing::Test {
@@ -112,7 +112,7 @@
bandwidth_observer_->OnReceivedEstimatedBitrate(200000);
EXPECT_EQ(200000u, bitrate_observer.last_bitrate_);
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
- EXPECT_EQ(0u, bitrate_observer.last_rtt_);
+ EXPECT_EQ(0, bitrate_observer.last_rtt_);
bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms);
report_blocks.clear();
time_ms += 2000;
@@ -125,7 +125,7 @@
bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms);
EXPECT_EQ(217000u, bitrate_observer.last_bitrate_);
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer.last_rtt_);
time_ms += 1000;
report_blocks.clear();
@@ -133,7 +133,7 @@
bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms);
EXPECT_EQ(235360u, bitrate_observer.last_bitrate_);
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer.last_rtt_);
time_ms += 1000;
report_blocks.clear();
@@ -170,7 +170,7 @@
bandwidth_observer_->OnReceivedEstimatedBitrate(250000);
EXPECT_EQ(250000u, bitrate_observer.last_bitrate_);
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer.last_rtt_);
bandwidth_observer_->OnReceivedEstimatedBitrate(1000);
EXPECT_EQ(100000u, bitrate_observer.last_bitrate_); // Min cap.
@@ -198,7 +198,7 @@
report_blocks, 100, 1);
EXPECT_EQ(217000u, bitrate_observer.last_bitrate_);
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
- EXPECT_EQ(100u, bitrate_observer.last_rtt_);
+ EXPECT_EQ(100, bitrate_observer.last_rtt_);
time_ms += 500;
// Test bitrate increase 8% per second.
@@ -210,7 +210,7 @@
report_blocks, 100, time_ms);
EXPECT_EQ(235360u, bitrate_observer.last_bitrate_);
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
- EXPECT_EQ(100u, bitrate_observer.last_rtt_);
+ EXPECT_EQ(100, bitrate_observer.last_rtt_);
time_ms += 500;
// Extra report should not change estimate.
@@ -268,7 +268,7 @@
second_bandwidth_observer->OnReceivedEstimatedBitrate(250000);
EXPECT_EQ(250000u, bitrate_observer.last_bitrate_);
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer.last_rtt_);
// Min cap.
bandwidth_observer_->OnReceivedEstimatedBitrate(1000);
@@ -307,7 +307,7 @@
time_ms);
EXPECT_GT(bitrate_observer.last_bitrate_, last_bitrate);
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer.last_rtt_);
last_bitrate = bitrate_observer.last_bitrate_;
time_ms += 1000;
sequence_number[0] += 20;
@@ -323,7 +323,7 @@
bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms);
EXPECT_LT(bitrate_observer.last_bitrate_, last_bitrate);
EXPECT_EQ(WeightedLoss(20, 50, 1, 0), bitrate_observer.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer.last_rtt_);
last_bitrate = bitrate_observer.last_bitrate_;
sequence_number[0] += 20;
sequence_number[1] += 20;
@@ -336,7 +336,7 @@
bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms);
EXPECT_LT(bitrate_observer.last_bitrate_, last_bitrate);
EXPECT_EQ(WeightedLoss(20, 0, 20, 75), bitrate_observer.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer.last_rtt_);
last_bitrate = bitrate_observer.last_bitrate_;
sequence_number[0] += 20;
sequence_number[1] += 1;
@@ -349,7 +349,7 @@
bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms);
EXPECT_EQ(bitrate_observer.last_bitrate_, last_bitrate);
EXPECT_EQ(WeightedLoss(20, 1, 1, 255), bitrate_observer.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer.last_rtt_);
last_bitrate = bitrate_observer.last_bitrate_;
sequence_number[0] += 20;
sequence_number[1] += 1;
@@ -369,7 +369,7 @@
bandwidth_observer_->OnReceivedEstimatedBitrate(200000);
EXPECT_EQ(100000u, bitrate_observer_1.last_bitrate_);
EXPECT_EQ(0, bitrate_observer_1.last_fraction_loss_);
- EXPECT_EQ(0u, bitrate_observer_1.last_rtt_);
+ EXPECT_EQ(0, bitrate_observer_1.last_rtt_);
bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms);
report_blocks.clear();
time_ms += 2000;
@@ -383,12 +383,12 @@
bandwidth_observer_->OnReceivedRtcpReceiverReport(report_blocks, 50, time_ms);
EXPECT_EQ(112500u, bitrate_observer_1.last_bitrate_);
EXPECT_EQ(0, bitrate_observer_1.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer_1.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer_1.last_rtt_);
time_ms += 1000;
EXPECT_EQ(212500u, bitrate_observer_2.last_bitrate_);
EXPECT_EQ(0, bitrate_observer_2.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer_2.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer_2.last_rtt_);
report_blocks.clear();
report_blocks.push_back(CreateReportBlock(1, 2, 0, 41));
@@ -460,10 +460,10 @@
bandwidth_observer_->OnReceivedEstimatedBitrate(350000);
EXPECT_EQ(125000u, bitrate_observer_1.last_bitrate_);
EXPECT_EQ(0, bitrate_observer_1.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer_1.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer_1.last_rtt_);
EXPECT_EQ(225000u, bitrate_observer_2.last_bitrate_);
EXPECT_EQ(0, bitrate_observer_2.last_fraction_loss_);
- EXPECT_EQ(50u, bitrate_observer_2.last_rtt_);
+ EXPECT_EQ(50, bitrate_observer_2.last_rtt_);
bandwidth_observer_->OnReceivedEstimatedBitrate(1000);
EXPECT_EQ(100000u, bitrate_observer_1.last_bitrate_); // Min cap.
diff --git a/webrtc/modules/bitrate_controller/include/bitrate_controller.h b/webrtc/modules/bitrate_controller/include/bitrate_controller.h
index 2b84ada..aea822b 100644
--- a/webrtc/modules/bitrate_controller/include/bitrate_controller.h
+++ b/webrtc/modules/bitrate_controller/include/bitrate_controller.h
@@ -31,7 +31,7 @@
public:
virtual void OnNetworkChanged(uint32_t target_bitrate,
uint8_t fraction_loss, // 0 - 255.
- uint32_t rtt) = 0;
+ int64_t rtt) = 0;
virtual ~BitrateObserver() {}
};
diff --git a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc
index 9fb8c1b..a08e123 100644
--- a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc
+++ b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc
@@ -27,7 +27,7 @@
// Calculate the rate that TCP-Friendly Rate Control (TFRC) would apply.
// The formula in RFC 3448, Section 3.1, is used.
-uint32_t CalcTfrcBps(uint16_t rtt, uint8_t loss) {
+uint32_t CalcTfrcBps(int64_t rtt, uint8_t loss) {
if (rtt == 0 || loss == 0) {
// Input variables out of range.
return 0;
@@ -89,7 +89,7 @@
void SendSideBandwidthEstimation::CurrentEstimate(uint32_t* bitrate,
uint8_t* loss,
- uint32_t* rtt) const {
+ int64_t* rtt) const {
*bitrate = bitrate_;
*loss = last_fraction_loss_;
*rtt = last_round_trip_time_ms_;
@@ -101,7 +101,7 @@
}
void SendSideBandwidthEstimation::UpdateReceiverBlock(uint8_t fraction_loss,
- uint32_t rtt,
+ int64_t rtt,
int number_of_packets,
int64_t now_ms) {
if (first_report_time_ms_ == -1)
@@ -137,7 +137,7 @@
}
void SendSideBandwidthEstimation::UpdateUmaStats(int64_t now_ms,
- int rtt,
+ int64_t rtt,
int lost_packets) {
if (IsInStartPhase(now_ms)) {
initially_lost_packets_ += lost_packets;
@@ -146,7 +146,8 @@
bitrate_at_2_seconds_kbps_ = (bitrate_ + 500) / 1000;
RTC_HISTOGRAM_COUNTS(
"WebRTC.BWE.InitiallyLostPackets", initially_lost_packets_, 0, 100, 50);
- RTC_HISTOGRAM_COUNTS("WebRTC.BWE.InitialRtt", rtt, 0, 2000, 50);
+ RTC_HISTOGRAM_COUNTS(
+ "WebRTC.BWE.InitialRtt", static_cast<int>(rtt), 0, 2000, 50);
RTC_HISTOGRAM_COUNTS("WebRTC.BWE.InitialBandwidthEstimate",
bitrate_at_2_seconds_kbps_,
0,
@@ -203,8 +204,7 @@
// Loss > 10%: Limit the rate decreases to once a kBweDecreaseIntervalMs +
// rtt.
if ((now_ms - time_last_decrease_ms_) >=
- static_cast<uint32_t>(kBweDecreaseIntervalMs +
- last_round_trip_time_ms_)) {
+ (kBweDecreaseIntervalMs + last_round_trip_time_ms_)) {
time_last_decrease_ms_ = now_ms;
// Reduce rate:
diff --git a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.h b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.h
index b8006e4..20ce5ee 100644
--- a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.h
+++ b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.h
@@ -24,7 +24,7 @@
SendSideBandwidthEstimation();
virtual ~SendSideBandwidthEstimation();
- void CurrentEstimate(uint32_t* bitrate, uint8_t* loss, uint32_t* rtt) const;
+ void CurrentEstimate(uint32_t* bitrate, uint8_t* loss, int64_t* rtt) const;
// Call periodically to update estimate.
void UpdateEstimate(int64_t now_ms);
@@ -34,7 +34,7 @@
// Call when we receive a RTCP message with a ReceiveBlock.
void UpdateReceiverBlock(uint8_t fraction_loss,
- uint32_t rtt,
+ int64_t rtt,
int number_of_packets,
int64_t now_ms);
@@ -50,7 +50,7 @@
bool IsInStartPhase(int64_t now_ms) const;
- void UpdateUmaStats(int64_t now_ms, int rtt, int lost_packets);
+ void UpdateUmaStats(int64_t now_ms, int64_t rtt, int lost_packets);
// Returns the input bitrate capped to the thresholds defined by the max,
// min and incoming bandwidth.
@@ -73,7 +73,7 @@
int64_t time_last_receiver_block_ms_;
uint8_t last_fraction_loss_;
- uint16_t last_round_trip_time_ms_;
+ int64_t last_round_trip_time_ms_;
uint32_t bwe_incoming_;
int64_t time_last_decrease_ms_;
diff --git a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc
index 4fe9ea9..eed2d9e 100644
--- a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc
+++ b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc
@@ -45,7 +45,7 @@
bwe.UpdateEstimate(now_ms);
uint32_t bitrate;
uint8_t fraction_loss;
- uint32_t rtt;
+ int64_t rtt;
bwe.CurrentEstimate(&bitrate, &fraction_loss, &rtt);
EXPECT_EQ(kRemb, bitrate);
@@ -73,7 +73,7 @@
bwe.UpdateEstimate(now_ms);
uint32_t bitrate;
uint8_t fraction_loss;
- uint32_t rtt;
+ int64_t rtt;
bwe.CurrentEstimate(&bitrate, &fraction_loss, &rtt);
EXPECT_EQ(kStartBitrate, bitrate);
}
diff --git a/webrtc/modules/desktop_capture/desktop_frame.h b/webrtc/modules/desktop_capture/desktop_frame.h
index 7bcc346..047ee63 100644
--- a/webrtc/modules/desktop_capture/desktop_frame.h
+++ b/webrtc/modules/desktop_capture/desktop_frame.h
@@ -51,8 +51,8 @@
void set_dpi(const DesktopVector& dpi) { dpi_ = dpi; }
// Time taken to capture the frame in milliseconds.
- int32_t capture_time_ms() const { return capture_time_ms_; }
- void set_capture_time_ms(int32_t time_ms) { capture_time_ms_ = time_ms; }
+ int64_t capture_time_ms() const { return capture_time_ms_; }
+ void set_capture_time_ms(int64_t time_ms) { capture_time_ms_ = time_ms; }
// Optional shape for the frame. Frames may be shaped e.g. if
// capturing the contents of a shaped window.
@@ -87,7 +87,7 @@
DesktopRegion updated_region_;
DesktopVector dpi_;
- int32_t capture_time_ms_;
+ int64_t capture_time_ms_;
scoped_ptr<DesktopRegion> shape_;
private:
diff --git a/webrtc/modules/interface/module_common_types.h b/webrtc/modules/interface/module_common_types.h
index fea76ce..5cb2c56 100644
--- a/webrtc/modules/interface/module_common_types.h
+++ b/webrtc/modules/interface/module_common_types.h
@@ -279,7 +279,7 @@
// CallStats object using RegisterStatsObserver.
class CallStatsObserver {
public:
- virtual void OnRttUpdate(uint32_t rtt_ms) = 0;
+ virtual void OnRttUpdate(int64_t rtt_ms) = 0;
virtual ~CallStatsObserver() {}
};
diff --git a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
index f6a4864..bed5d99 100644
--- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
+++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
@@ -18,7 +18,7 @@
namespace webrtc {
-static const uint32_t kDefaultRttMs = 200;
+static const int64_t kDefaultRttMs = 200;
static const int64_t kLogIntervalMs = 1000;
static const double kWithinIncomingBitrateHysteresis = 1.05;
@@ -66,7 +66,8 @@
bool AimdRateControl::TimeToReduceFurther(int64_t time_now,
uint32_t incoming_bitrate_bps) const {
- const int bitrate_reduction_interval = std::max(std::min(rtt_, 200u), 10u);
+ const int64_t bitrate_reduction_interval =
+ std::max<int64_t>(std::min<int64_t>(rtt_, 200), 10);
if (time_now - time_last_bitrate_change_ >= bitrate_reduction_interval) {
return true;
}
@@ -93,7 +94,7 @@
return current_bitrate_bps_;
}
-void AimdRateControl::SetRtt(uint32_t rtt) {
+void AimdRateControl::SetRtt(int64_t rtt) {
rtt_ = rtt;
}
@@ -168,7 +169,7 @@
}
if (rate_control_region_ == kRcNearMax) {
// Approximate the over-use estimator delay to 100 ms.
- const uint32_t response_time = rtt_ + 100;
+ const int64_t response_time = rtt_ + 100;
uint32_t additive_increase_bps = AdditiveRateIncrease(
now_ms, time_last_bitrate_change_, response_time);
BWE_TEST_LOGGING_PLOT("add_increase#1", -1,
@@ -253,7 +254,7 @@
}
uint32_t AimdRateControl::AdditiveRateIncrease(
- int64_t now_ms, int64_t last_ms, uint32_t response_time_ms) const {
+ int64_t now_ms, int64_t last_ms, int64_t response_time_ms) const {
assert(response_time_ms > 0);
double beta = 0.0;
if (last_ms > 0) {
diff --git a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h
index a862071..b5aee76 100644
--- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h
+++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h
@@ -39,7 +39,7 @@
int64_t time_now, uint32_t incoming_bitrate_bps) const OVERRIDE;
virtual uint32_t LatestEstimate() const OVERRIDE;
virtual uint32_t UpdateBandwidthEstimate(int64_t now_ms) OVERRIDE;
- virtual void SetRtt(uint32_t rtt) OVERRIDE;
+ virtual void SetRtt(int64_t rtt) OVERRIDE;
virtual RateControlRegion Update(const RateControlInput* input,
int64_t now_ms) OVERRIDE;
virtual void SetEstimate(int bitrate_bps, int64_t now_ms) OVERRIDE;
@@ -58,7 +58,7 @@
uint32_t MultiplicativeRateIncrease(int64_t now_ms, int64_t last_ms,
uint32_t current_bitrate_bps) const;
uint32_t AdditiveRateIncrease(int64_t now_ms, int64_t last_ms,
- uint32_t response_time_ms) const;
+ int64_t response_time_ms) const;
void UpdateChangePeriod(int64_t now_ms);
void UpdateMaxBitRateEstimate(float incoming_bit_rate_kbps);
void ChangeState(const RateControlInput& input, int64_t now_ms);
@@ -80,7 +80,7 @@
int64_t time_first_incoming_estimate_;
bool bitrate_is_initialized_;
float beta_;
- uint32_t rtt_;
+ int64_t rtt_;
int64_t time_of_last_log_;
DISALLOW_IMPLICIT_CONSTRUCTORS(AimdRateControl);
diff --git a/webrtc/modules/remote_bitrate_estimator/mimd_rate_control.cc b/webrtc/modules/remote_bitrate_estimator/mimd_rate_control.cc
index 941409c..ab8f4db 100644
--- a/webrtc/modules/remote_bitrate_estimator/mimd_rate_control.cc
+++ b/webrtc/modules/remote_bitrate_estimator/mimd_rate_control.cc
@@ -17,7 +17,7 @@
namespace webrtc {
-const uint32_t kDefaultRttMs = 200;
+const int64_t kDefaultRttMs = 200;
const int64_t kLogIntervalMs = 1000;
MimdRateControl::MimdRateControl(uint32_t min_bitrate_bps)
@@ -61,7 +61,8 @@
bool MimdRateControl::TimeToReduceFurther(int64_t time_now,
uint32_t incoming_bitrate_bps) const {
- const int bitrate_reduction_interval = std::max(std::min(rtt_, 200u), 10u);
+ const int64_t bitrate_reduction_interval =
+ std::max<int64_t>(std::min<int64_t>(rtt_, 200), 10);
if (time_now - last_bit_rate_change_ >= bitrate_reduction_interval) {
return true;
}
@@ -88,7 +89,7 @@
return current_bit_rate_;
}
-void MimdRateControl::SetRtt(uint32_t rtt) {
+void MimdRateControl::SetRtt(int64_t rtt) {
rtt_ = rtt;
}
@@ -156,8 +157,8 @@
ChangeRegion(kRcAboveMax);
}
}
- const uint32_t response_time = static_cast<uint32_t>(avg_change_period_ +
- 0.5f) + rtt_ + 300;
+ const int64_t response_time =
+ static_cast<int64_t>(avg_change_period_ + 0.5f) + rtt_ + 300;
double alpha = RateIncreaseFactor(now_ms, last_bit_rate_change_,
response_time, noise_var);
@@ -215,9 +216,9 @@
}
double MimdRateControl::RateIncreaseFactor(int64_t now_ms,
- int64_t last_ms,
- uint32_t reaction_time_ms,
- double noise_var) const {
+ int64_t last_ms,
+ int64_t reaction_time_ms,
+ double noise_var) const {
// alpha = 1.02 + B ./ (1 + exp(b*(tr - (c1*s2 + c2))))
// Parameters
const double B = 0.0407;
diff --git a/webrtc/modules/remote_bitrate_estimator/mimd_rate_control.h b/webrtc/modules/remote_bitrate_estimator/mimd_rate_control.h
index 94c9b6b..1b1862c 100644
--- a/webrtc/modules/remote_bitrate_estimator/mimd_rate_control.h
+++ b/webrtc/modules/remote_bitrate_estimator/mimd_rate_control.h
@@ -33,7 +33,7 @@
int64_t time_now, uint32_t incoming_bitrate_bps) const OVERRIDE;
virtual uint32_t LatestEstimate() const OVERRIDE;
virtual uint32_t UpdateBandwidthEstimate(int64_t now_ms) OVERRIDE;
- virtual void SetRtt(uint32_t rtt) OVERRIDE;
+ virtual void SetRtt(int64_t rtt) OVERRIDE;
virtual RateControlRegion Update(const RateControlInput* input,
int64_t now_ms) OVERRIDE;
virtual void SetEstimate(int bitrate_bps, int64_t now_ms) OVERRIDE;
@@ -45,7 +45,7 @@
int64_t now_ms);
double RateIncreaseFactor(int64_t now_ms,
int64_t last_ms,
- uint32_t reaction_time_ms,
+ int64_t reaction_time_ms,
double noise_var) const;
void UpdateChangePeriod(int64_t now_ms);
void UpdateMaxBitRateEstimate(float incoming_bit_rate_kbps);
@@ -70,7 +70,7 @@
float avg_change_period_;
int64_t last_change_ms_;
float beta_;
- uint32_t rtt_;
+ int64_t rtt_;
int64_t time_of_last_log_;
DISALLOW_IMPLICIT_CONSTRUCTORS(MimdRateControl);
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
index 5398834..98f5893 100644
--- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
+++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
@@ -84,7 +84,7 @@
// deleted.
virtual int32_t Process() OVERRIDE;
virtual int64_t TimeUntilNextProcess() OVERRIDE;
- virtual void OnRttUpdate(uint32_t rtt) OVERRIDE;
+ virtual void OnRttUpdate(int64_t rtt) OVERRIDE;
virtual void RemoveStream(unsigned int ssrc) OVERRIDE;
virtual bool LatestEstimate(std::vector<unsigned int>* ssrcs,
unsigned int* bitrate_bps) const OVERRIDE;
@@ -419,7 +419,7 @@
detector_.SetRateControlRegion(region);
}
-void RemoteBitrateEstimatorAbsSendTimeImpl::OnRttUpdate(uint32_t rtt) {
+void RemoteBitrateEstimatorAbsSendTimeImpl::OnRttUpdate(int64_t rtt) {
CriticalSectionScoped cs(crit_sect_.get());
remote_rate_->SetRtt(rtt);
}
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
index 47e6b02..c3de19b 100644
--- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
+++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
@@ -41,7 +41,7 @@
const RTPHeader& header) OVERRIDE;
virtual int32_t Process() OVERRIDE;
virtual int64_t TimeUntilNextProcess() OVERRIDE;
- virtual void OnRttUpdate(uint32_t rtt) OVERRIDE;
+ virtual void OnRttUpdate(int64_t rtt) OVERRIDE;
virtual void RemoveStream(unsigned int ssrc) OVERRIDE;
virtual bool LatestEstimate(std::vector<unsigned int>* ssrcs,
unsigned int* bitrate_bps) const OVERRIDE;
@@ -230,7 +230,7 @@
}
}
-void RemoteBitrateEstimatorImpl::OnRttUpdate(uint32_t rtt) {
+void RemoteBitrateEstimatorImpl::OnRttUpdate(int64_t rtt) {
CriticalSectionScoped cs(crit_sect_.get());
remote_rate_->SetRtt(rtt);
}
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_rate_control.h b/webrtc/modules/remote_bitrate_estimator/remote_rate_control.h
index 41d9253..4398c57 100644
--- a/webrtc/modules/remote_bitrate_estimator/remote_rate_control.h
+++ b/webrtc/modules/remote_bitrate_estimator/remote_rate_control.h
@@ -38,7 +38,7 @@
uint32_t incoming_bitrate_bps) const = 0;
virtual uint32_t LatestEstimate() const = 0;
virtual uint32_t UpdateBandwidthEstimate(int64_t now_ms) = 0;
- virtual void SetRtt(unsigned int rtt) = 0;
+ virtual void SetRtt(int64_t rtt) = 0;
virtual RateControlRegion Update(const RateControlInput* input,
int64_t now_ms) = 0;
virtual void SetEstimate(int bitrate_bps, int64_t time_now_ms) = 0;
diff --git a/webrtc/modules/rtp_rtcp/interface/receive_statistics.h b/webrtc/modules/rtp_rtcp/interface/receive_statistics.h
index b3aa733..701d8dd 100644
--- a/webrtc/modules/rtp_rtcp/interface/receive_statistics.h
+++ b/webrtc/modules/rtp_rtcp/interface/receive_statistics.h
@@ -41,7 +41,7 @@
// Returns true if the packet with RTP header |header| is likely to be a
// retransmitted packet, false otherwise.
virtual bool IsRetransmitOfOldPacket(const RTPHeader& header,
- int min_rtt) const = 0;
+ int64_t min_rtt) const = 0;
// Returns true if |sequence_number| is received in order, false otherwise.
virtual bool IsPacketInOrder(uint16_t sequence_number) const = 0;
diff --git a/webrtc/modules/rtp_rtcp/interface/remote_ntp_time_estimator.h b/webrtc/modules/rtp_rtcp/interface/remote_ntp_time_estimator.h
index c237986..80f1803 100644
--- a/webrtc/modules/rtp_rtcp/interface/remote_ntp_time_estimator.h
+++ b/webrtc/modules/rtp_rtcp/interface/remote_ntp_time_estimator.h
@@ -31,7 +31,7 @@
// Updates the estimator with round trip time |rtt|, NTP seconds |ntp_secs|,
// NTP fraction |ntp_frac| and RTP timestamp |rtcp_timestamp|.
- bool UpdateRtcpTimestamp(uint16_t rtt, uint32_t ntp_secs, uint32_t ntp_frac,
+ bool UpdateRtcpTimestamp(int64_t rtt, uint32_t ntp_secs, uint32_t ntp_frac,
uint32_t rtp_timestamp);
// Estimates the NTP timestamp in local timebase from |rtp_timestamp|.
diff --git a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h
index 6b9a554..52dfeab 100644
--- a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h
+++ b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h
@@ -376,10 +376,10 @@
* return -1 on failure else 0
*/
virtual int32_t RTT(uint32_t remoteSSRC,
- uint16_t* RTT,
- uint16_t* avgRTT,
- uint16_t* minRTT,
- uint16_t* maxRTT) const = 0;
+ int64_t* RTT,
+ int64_t* avgRTT,
+ int64_t* minRTT,
+ int64_t* maxRTT) const = 0;
/*
* Force a send of a RTCP packet
diff --git a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h
index b1903a4..76091a1 100644
--- a/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h
+++ b/webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h
@@ -287,7 +287,7 @@
virtual void OnReceivedRtcpReceiverReport(
const ReportBlockList& report_blocks,
- uint16_t rtt,
+ int64_t rtt,
int64_t now_ms) = 0;
virtual ~RtcpBandwidthObserver() {}
@@ -295,9 +295,9 @@
class RtcpRttStats {
public:
- virtual void OnRttUpdate(uint32_t rtt) = 0;
+ virtual void OnRttUpdate(int64_t rtt) = 0;
- virtual uint32_t LastProcessedRtt() const = 0;
+ virtual int64_t LastProcessedRtt() const = 0;
virtual ~RtcpRttStats() {};
};
diff --git a/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h b/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h
index 31fade4..3ea1626 100644
--- a/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h
+++ b/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h
@@ -155,7 +155,11 @@
MOCK_METHOD1(RemoveMixedCNAME,
int32_t(const uint32_t SSRC));
MOCK_CONST_METHOD5(RTT,
- int32_t(const uint32_t remoteSSRC, uint16_t* RTT, uint16_t* avgRTT, uint16_t* minRTT, uint16_t* maxRTT));
+ int32_t(const uint32_t remoteSSRC,
+ int64_t* RTT,
+ int64_t* avgRTT,
+ int64_t* minRTT,
+ int64_t* maxRTT));
MOCK_METHOD1(SendRTCP,
int32_t(uint32_t rtcpPacketType));
MOCK_METHOD1(SendRTCPReferencePictureSelection,
diff --git a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc
index 76b2075..302c42c 100644
--- a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc
@@ -345,7 +345,7 @@
}
bool StreamStatisticianImpl::IsRetransmitOfOldPacket(
- const RTPHeader& header, int min_rtt) const {
+ const RTPHeader& header, int64_t min_rtt) const {
CriticalSectionScoped cs(stream_lock_.get());
if (InOrderPacketInternal(header.sequenceNumber)) {
return false;
@@ -358,17 +358,16 @@
// Diff in time stamp since last received in order.
uint32_t timestamp_diff = header.timestamp - last_received_timestamp_;
- int32_t rtp_time_stamp_diff_ms = static_cast<int32_t>(timestamp_diff) /
- frequency_khz;
+ uint32_t rtp_time_stamp_diff_ms = timestamp_diff / frequency_khz;
- int32_t max_delay_ms = 0;
+ int64_t max_delay_ms = 0;
if (min_rtt == 0) {
// Jitter standard deviation in samples.
float jitter_std = sqrt(static_cast<float>(jitter_q4_ >> 4));
// 2 times the standard deviation => 95% confidence.
// And transform to milliseconds by dividing by the frequency in kHz.
- max_delay_ms = static_cast<int32_t>((2 * jitter_std) / frequency_khz);
+ max_delay_ms = static_cast<int64_t>((2 * jitter_std) / frequency_khz);
// Min max_delay_ms is 1.
if (max_delay_ms == 0) {
diff --git a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h
index 22e42ea..4b02f36 100644
--- a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h
+++ b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h
@@ -38,7 +38,7 @@
virtual uint32_t BitrateReceived() const OVERRIDE;
virtual void ResetStatistics() OVERRIDE;
virtual bool IsRetransmitOfOldPacket(const RTPHeader& header,
- int min_rtt) const OVERRIDE;
+ int64_t min_rtt) const OVERRIDE;
virtual bool IsPacketInOrder(uint16_t sequence_number) const OVERRIDE;
void IncomingPacket(const RTPHeader& rtp_header,
diff --git a/webrtc/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc b/webrtc/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc
index 8e2651c..0c968bd 100644
--- a/webrtc/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc
+++ b/webrtc/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc
@@ -28,7 +28,7 @@
RemoteNtpTimeEstimator::~RemoteNtpTimeEstimator() {}
-bool RemoteNtpTimeEstimator::UpdateRtcpTimestamp(uint16_t rtt,
+bool RemoteNtpTimeEstimator::UpdateRtcpTimestamp(int64_t rtt,
uint32_t ntp_secs,
uint32_t ntp_frac,
uint32_t rtcp_timestamp) {
diff --git a/webrtc/modules/rtp_rtcp/source/remote_ntp_time_estimator_unittest.cc b/webrtc/modules/rtp_rtcp/source/remote_ntp_time_estimator_unittest.cc
index a320a85..45817b0 100644
--- a/webrtc/modules/rtp_rtcp/source/remote_ntp_time_estimator_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/remote_ntp_time_estimator_unittest.cc
@@ -21,7 +21,7 @@
namespace webrtc {
-static const int kTestRtt = 10;
+static const int64_t kTestRtt = 10;
static const int64_t kLocalClockInitialTimeMs = 123;
static const int64_t kRemoteClockInitialTimeMs = 345;
static const uint32_t kTimestampOffset = 567;
@@ -54,14 +54,14 @@
ReceiveRtcpSr(kTestRtt, rtcp_timestamp, ntp_seconds, ntp_fractions);
}
- void UpdateRtcpTimestamp(uint16_t rtt, uint32_t ntp_secs, uint32_t ntp_frac,
+ void UpdateRtcpTimestamp(int64_t rtt, uint32_t ntp_secs, uint32_t ntp_frac,
uint32_t rtp_timestamp, bool expected_result) {
EXPECT_EQ(expected_result,
estimator_.UpdateRtcpTimestamp(rtt, ntp_secs, ntp_frac,
rtp_timestamp));
}
- void ReceiveRtcpSr(uint16_t rtt,
+ void ReceiveRtcpSr(int64_t rtt,
uint32_t rtcp_timestamp,
uint32_t ntp_seconds,
uint32_t ntp_fractions) {
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
index 3978332..a4e51f5 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -163,10 +163,10 @@
}
int32_t RTCPReceiver::RTT(uint32_t remoteSSRC,
- uint16_t* RTT,
- uint16_t* avgRTT,
- uint16_t* minRTT,
- uint16_t* maxRTT) const {
+ int64_t* RTT,
+ int64_t* avgRTT,
+ int64_t* minRTT,
+ int64_t* maxRTT) const {
CriticalSectionScoped lock(_criticalSectionRTCPReceiver);
RTCPReportBlockInformation* reportBlock =
@@ -190,7 +190,7 @@
return 0;
}
-bool RTCPReceiver::GetAndResetXrRrRtt(uint16_t* rtt_ms) {
+bool RTCPReceiver::GetAndResetXrRrRtt(int64_t* rtt_ms) {
assert(rtt_ms);
CriticalSectionScoped lock(_criticalSectionRTCPReceiver);
if (xr_rr_rtt_ms_ == 0) {
@@ -480,7 +480,7 @@
// To avoid problem with acquiring _criticalSectionRTCPSender while holding
// _criticalSectionRTCPReceiver.
_criticalSectionRTCPReceiver->Leave();
- uint32_t sendTimeMS =
+ int64_t sendTimeMS =
_rtpRtcp.SendTimeOfSendReport(rtcpPacket.ReportBlockItem.LastSR);
_criticalSectionRTCPReceiver->Enter();
@@ -526,15 +526,15 @@
_clock->CurrentNtp(lastReceivedRRNTPsecs, lastReceivedRRNTPfrac);
// time when we received this in MS
- uint32_t receiveTimeMS = Clock::NtpToMs(lastReceivedRRNTPsecs,
- lastReceivedRRNTPfrac);
+ int64_t receiveTimeMS = Clock::NtpToMs(lastReceivedRRNTPsecs,
+ lastReceivedRRNTPfrac);
// Estimate RTT
uint32_t d = (delaySinceLastSendReport & 0x0000ffff) * 1000;
d /= 65536;
d += ((delaySinceLastSendReport & 0xffff0000) >> 16) * 1000;
- int32_t RTT = 0;
+ int64_t RTT = 0;
if (sendTimeMS > 0) {
RTT = receiveTimeMS - d - sendTimeMS;
@@ -543,27 +543,27 @@
}
if (RTT > reportBlock->maxRTT) {
// store max RTT
- reportBlock->maxRTT = (uint16_t) RTT;
+ reportBlock->maxRTT = RTT;
}
if (reportBlock->minRTT == 0) {
// first RTT
- reportBlock->minRTT = (uint16_t) RTT;
+ reportBlock->minRTT = RTT;
} else if (RTT < reportBlock->minRTT) {
// Store min RTT
- reportBlock->minRTT = (uint16_t) RTT;
+ reportBlock->minRTT = RTT;
}
// store last RTT
- reportBlock->RTT = (uint16_t) RTT;
+ reportBlock->RTT = RTT;
// store average RTT
if (reportBlock->numAverageCalcs != 0) {
- float ac = static_cast<float> (reportBlock->numAverageCalcs);
- float newAverage = ((ac / (ac + 1)) * reportBlock->avgRTT)
- + ((1 / (ac + 1)) * RTT);
- reportBlock->avgRTT = static_cast<int> (newAverage + 0.5f);
+ float ac = static_cast<float>(reportBlock->numAverageCalcs);
+ float newAverage =
+ ((ac / (ac + 1)) * reportBlock->avgRTT) + ((1 / (ac + 1)) * RTT);
+ reportBlock->avgRTT = static_cast<int64_t>(newAverage + 0.5f);
} else {
// first RTT
- reportBlock->avgRTT = (uint16_t) RTT;
+ reportBlock->avgRTT = RTT;
}
reportBlock->numAverageCalcs++;
}
@@ -962,9 +962,9 @@
(((packet.XRDLRRReportBlockItem.DelayLastRR & 0x0000ffff) * 1000) >> 16) +
(((packet.XRDLRRReportBlockItem.DelayLastRR & 0xffff0000) >> 16) * 1000);
- int32_t rtt = _clock->CurrentNtpInMilliseconds() - delay_rr_ms - send_time_ms;
+ int64_t rtt = _clock->CurrentNtpInMilliseconds() - delay_rr_ms - send_time_ms;
- xr_rr_rtt_ms_ = static_cast<uint16_t>(std::max(rtt, 1));
+ xr_rr_rtt_ms_ = std::max<int64_t>(rtt, 1);
rtcpPacketInformation.rtcpPacketTypeFlags |= kRtcpXrDlrrReportBlock;
}
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h
index 223da76..0301977 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h
@@ -71,14 +71,14 @@
// get rtt
int32_t RTT(uint32_t remoteSSRC,
- uint16_t* RTT,
- uint16_t* avgRTT,
- uint16_t* minRTT,
- uint16_t* maxRTT) const;
+ int64_t* RTT,
+ int64_t* avgRTT,
+ int64_t* minRTT,
+ int64_t* maxRTT) const;
int32_t SenderInfoReceived(RTCPSenderInfo* senderInfo) const;
- bool GetAndResetXrRrRtt(uint16_t* rtt_ms);
+ bool GetAndResetXrRrRtt(int64_t* rtt_ms);
// get statistics
int32_t StatisticsReceived(
@@ -257,7 +257,7 @@
uint32_t _lastReceivedXRNTPsecs;
uint32_t _lastReceivedXRNTPfrac;
// Estimated rtt, zero when there is no valid estimate.
- uint16_t xr_rr_rtt_ms_;
+ int64_t xr_rr_rtt_ms_;
// Received report blocks.
ReportBlockMap _receivedReportBlockMap
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h
index 0ca43fa..73ac7a5 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h
@@ -34,11 +34,11 @@
uint32_t remoteMaxJitter;
// RTT
- uint16_t RTT;
- uint16_t minRTT;
- uint16_t maxRTT;
- uint16_t avgRTT;
- uint32_t numAverageCalcs;
+ int64_t RTT;
+ int64_t minRTT;
+ int64_t maxRTT;
+ int64_t avgRTT;
+ uint32_t numAverageCalcs;
};
class RTCPPacketInformation
@@ -68,7 +68,7 @@
uint16_t applicationLength;
ReportBlockList report_blocks;
- uint16_t rtt;
+ int64_t rtt;
uint32_t interArrivalJitter;
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc
index a7d8477..cceb544 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc
@@ -744,7 +744,7 @@
}
TEST_F(RtcpReceiverTest, TestXrRrRttInitiallyFalse) {
- uint16_t rtt_ms;
+ int64_t rtt_ms;
EXPECT_FALSE(rtcp_receiver_->GetAndResetXrRrRtt(&rtt_ms));
}
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
index c896d14..95256ba 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -438,8 +438,7 @@
return false;
}
-uint32_t
-RTCPSender::LastSendReport( uint32_t& lastRTCPTime)
+uint32_t RTCPSender::LastSendReport(int64_t& lastRTCPTime)
{
CriticalSectionScoped lock(_criticalSectionRTCPSender);
@@ -447,7 +446,7 @@
return _lastSendReport[0];
}
-uint32_t RTCPSender::SendTimeOfSendReport(uint32_t sendReport) {
+int64_t RTCPSender::SendTimeOfSendReport(uint32_t sendReport) {
CriticalSectionScoped lock(_criticalSectionRTCPSender);
// This is only saved when we are the sender
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.h b/webrtc/modules/rtp_rtcp/source/rtcp_sender.h
index 0cb08aa..255d8ad 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.h
@@ -103,13 +103,13 @@
int32_t RemoveMixedCNAME(uint32_t SSRC);
- uint32_t SendTimeOfSendReport(uint32_t sendReport);
+ int64_t SendTimeOfSendReport(uint32_t sendReport);
bool SendTimeOfXrRrReport(uint32_t mid_ntp, int64_t* time_ms) const;
bool TimeToSendRTCPReport(bool sendKeyframeBeforeRTP = false) const;
- uint32_t LastSendReport(uint32_t& lastRTCPTime);
+ uint32_t LastSendReport(int64_t& lastRTCPTime);
int32_t SendRTCP(
const FeedbackState& feedback_state,
@@ -310,7 +310,7 @@
// Sent
uint32_t _lastSendReport[RTCP_NUMBER_OF_SR] GUARDED_BY(
_criticalSectionRTCPSender); // allow packet loss and RTT above 1 sec
- uint32_t _lastRTCPTime[RTCP_NUMBER_OF_SR] GUARDED_BY(
+ int64_t _lastRTCPTime[RTCP_NUMBER_OF_SR] GUARDED_BY(
_criticalSectionRTCPSender);
// Sent XR receiver reference time report.
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_packet_history.cc b/webrtc/modules/rtp_rtcp/source/rtp_packet_history.cc
index 2546ac0..455f3dc 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_packet_history.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_packet_history.cc
@@ -178,7 +178,7 @@
}
bool RTPPacketHistory::GetPacketAndSetSendTime(uint16_t sequence_number,
- uint32_t min_elapsed_time_ms,
+ int64_t min_elapsed_time_ms,
bool retransmit,
uint8_t* packet,
size_t* packet_length,
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h b/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h
index eea3f12..9d58125 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h
@@ -53,7 +53,7 @@
// stored_time_ms: returns the time when the packet was stored.
// type: returns the storage type set in PutRTPPacket.
bool GetPacketAndSetSendTime(uint16_t sequence_number,
- uint32_t min_elapsed_time_ms,
+ int64_t min_elapsed_time_ms,
bool retransmit,
uint8_t* packet,
size_t* packet_length,
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
index 4dd74ce..817a6be 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -181,10 +181,10 @@
last_rtt_process_time_ && process_rtt) {
std::vector<RTCPReportBlock> receive_blocks;
rtcp_receiver_.StatisticsReceived(&receive_blocks);
- uint16_t max_rtt = 0;
+ int64_t max_rtt = 0;
for (std::vector<RTCPReportBlock>::iterator it = receive_blocks.begin();
it != receive_blocks.end(); ++it) {
- uint16_t rtt = 0;
+ int64_t rtt = 0;
rtcp_receiver_.RTT(it->remoteSSRC, &rtt, NULL, NULL, NULL);
max_rtt = (rtt > max_rtt) ? rtt : max_rtt;
}
@@ -216,7 +216,7 @@
} else {
// Report rtt from receiver.
if (process_rtt) {
- uint16_t rtt_ms;
+ int64_t rtt_ms;
if (rtt_stats_ && rtcp_receiver_.GetAndResetXrRrRtt(&rtt_ms)) {
rtt_stats_->OnRttUpdate(rtt_ms);
}
@@ -707,7 +707,7 @@
// Only for internal test.
uint32_t ModuleRtpRtcpImpl::LastSendReport(
- uint32_t& last_rtcptime) {
+ int64_t& last_rtcptime) {
return rtcp_sender_.LastSendReport(last_rtcptime);
}
@@ -747,14 +747,14 @@
// Get RoundTripTime.
int32_t ModuleRtpRtcpImpl::RTT(const uint32_t remote_ssrc,
- uint16_t* rtt,
- uint16_t* avg_rtt,
- uint16_t* min_rtt,
- uint16_t* max_rtt) const {
+ int64_t* rtt,
+ int64_t* avg_rtt,
+ int64_t* min_rtt,
+ int64_t* max_rtt) const {
int32_t ret = rtcp_receiver_.RTT(remote_ssrc, rtt, avg_rtt, min_rtt, max_rtt);
if (rtt && *rtt == 0) {
// Try to get RTT from RtcpRttStats class.
- *rtt = static_cast<uint16_t>(rtt_ms());
+ *rtt = rtt_ms();
}
return ret;
}
@@ -944,7 +944,7 @@
bool ModuleRtpRtcpImpl::TimeToSendFullNackList(int64_t now) const {
// Use RTT from RtcpRttStats class if provided.
- uint16_t rtt = rtt_ms();
+ int64_t rtt = rtt_ms();
if (rtt == 0) {
rtcp_receiver_.RTT(rtcp_receiver_.RemoteSSRC(), NULL, &rtt, NULL, NULL);
}
@@ -1244,7 +1244,7 @@
GetFeedbackState(), kRtcpRpsi, 0, 0, false, picture_id);
}
-uint32_t ModuleRtpRtcpImpl::SendTimeOfSendReport(
+int64_t ModuleRtpRtcpImpl::SendTimeOfSendReport(
const uint32_t send_report) {
return rtcp_sender_.SendTimeOfSendReport(send_report);
}
@@ -1261,7 +1261,7 @@
return;
}
// Use RTT from RtcpRttStats class if provided.
- uint16_t rtt = rtt_ms();
+ int64_t rtt = rtt_ms();
if (rtt == 0) {
rtcp_receiver_.RTT(rtcp_receiver_.RemoteSSRC(), NULL, &rtt, NULL, NULL);
}
@@ -1324,12 +1324,12 @@
rtcp_receiver_.SetSsrcs(main_ssrc, ssrcs);
}
-void ModuleRtpRtcpImpl::set_rtt_ms(uint32_t rtt_ms) {
+void ModuleRtpRtcpImpl::set_rtt_ms(int64_t rtt_ms) {
CriticalSectionScoped cs(critical_section_rtt_.get());
rtt_ms_ = rtt_ms;
}
-uint32_t ModuleRtpRtcpImpl::rtt_ms() const {
+int64_t ModuleRtpRtcpImpl::rtt_ms() const {
CriticalSectionScoped cs(critical_section_rtt_.get());
return rtt_ms_;
}
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h
index ec06783..306f49a 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h
@@ -158,10 +158,10 @@
// Get RoundTripTime.
virtual int32_t RTT(uint32_t remote_ssrc,
- uint16_t* rtt,
- uint16_t* avg_rtt,
- uint16_t* min_rtt,
- uint16_t* max_rtt) const OVERRIDE;
+ int64_t* rtt,
+ int64_t* avg_rtt,
+ int64_t* min_rtt,
+ int64_t* max_rtt) const OVERRIDE;
// Force a send of an RTCP packet.
// Normal SR and RR are triggered via the process function.
@@ -326,7 +326,7 @@
uint32_t* fec_rate,
uint32_t* nackRate) const OVERRIDE;
- uint32_t SendTimeOfSendReport(uint32_t send_report);
+ int64_t SendTimeOfSendReport(uint32_t send_report);
bool SendTimeOfXrRrReport(uint32_t mid_ntp, int64_t* time_ms) const;
@@ -367,7 +367,7 @@
uint16_t RemoteSequenceNumber() const;
// Only for internal testing.
- uint32_t LastSendReport(uint32_t& last_rtcptime);
+ uint32_t LastSendReport(int64_t& last_rtcptime);
RTPSender rtp_sender_;
@@ -382,8 +382,8 @@
int64_t RtcpReportInterval();
void SetRtcpReceiverSsrcs(uint32_t main_ssrc);
- void set_rtt_ms(uint32_t rtt_ms);
- uint32_t rtt_ms() const;
+ void set_rtt_ms(int64_t rtt_ms);
+ int64_t rtt_ms() const;
bool TimeToSendFullNackList(int64_t now) const;
@@ -419,7 +419,7 @@
// The processed RTT from RtcpRttStats.
scoped_ptr<CriticalSectionWrapper> critical_section_rtt_;
- uint32_t rtt_ms_;
+ int64_t rtt_ms_;
};
} // namespace webrtc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc
index 3f9e95f..7f209ea 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc
@@ -31,7 +31,7 @@
const uint32_t kSenderSsrc = 0x12345;
const uint32_t kReceiverSsrc = 0x23456;
const uint32_t kSenderRtxSsrc = 0x32345;
-const uint32_t kOneWayNetworkDelayMs = 100;
+const int64_t kOneWayNetworkDelayMs = 100;
const uint8_t kBaseLayerTid = 0;
const uint8_t kHigherLayerTid = 1;
const uint16_t kSequenceNumber = 100;
@@ -41,13 +41,13 @@
RtcpRttStatsTestImpl() : rtt_ms_(0) {}
virtual ~RtcpRttStatsTestImpl() {}
- virtual void OnRttUpdate(uint32_t rtt_ms) OVERRIDE {
+ virtual void OnRttUpdate(int64_t rtt_ms) OVERRIDE {
rtt_ms_ = rtt_ms;
}
- virtual uint32_t LastProcessedRtt() const OVERRIDE {
+ virtual int64_t LastProcessedRtt() const OVERRIDE {
return rtt_ms_;
}
- uint32_t rtt_ms_;
+ int64_t rtt_ms_;
};
class SendTransport : public Transport,
@@ -63,7 +63,7 @@
void SetRtpRtcpModule(ModuleRtpRtcpImpl* receiver) {
receiver_ = receiver;
}
- void SimulateNetworkDelay(uint32_t delay_ms, SimulatedClock* clock) {
+ void SimulateNetworkDelay(int64_t delay_ms, SimulatedClock* clock) {
clock_ = clock;
delay_ms_ = delay_ms;
}
@@ -92,7 +92,7 @@
}
ModuleRtpRtcpImpl* receiver_;
SimulatedClock* clock_;
- uint32_t delay_ms_;
+ int64_t delay_ms_;
int rtp_packets_sent_;
RTPHeader last_rtp_header_;
std::vector<uint16_t> last_nack_list_;
@@ -277,10 +277,10 @@
EXPECT_EQ(0, receiver_.impl_->SendRTCP(kRtcpReport));
// Verify RTT.
- uint16_t rtt;
- uint16_t avg_rtt;
- uint16_t min_rtt;
- uint16_t max_rtt;
+ int64_t rtt;
+ int64_t avg_rtt;
+ int64_t min_rtt;
+ int64_t max_rtt;
EXPECT_EQ(0,
sender_.impl_->RTT(kReceiverSsrc, &rtt, &avg_rtt, &min_rtt, &max_rtt));
EXPECT_EQ(2 * kOneWayNetworkDelayMs, rtt);
@@ -293,8 +293,8 @@
sender_.impl_->RTT(kReceiverSsrc+1, &rtt, &avg_rtt, &min_rtt, &max_rtt));
// Verify RTT from rtt_stats config.
- EXPECT_EQ(0U, sender_.rtt_stats_.LastProcessedRtt());
- EXPECT_EQ(0U, sender_.impl_->rtt_ms());
+ EXPECT_EQ(0, sender_.rtt_stats_.LastProcessedRtt());
+ EXPECT_EQ(0, sender_.impl_->rtt_ms());
sender_.impl_->Process();
EXPECT_EQ(2 * kOneWayNetworkDelayMs, sender_.rtt_stats_.LastProcessedRtt());
EXPECT_EQ(2 * kOneWayNetworkDelayMs, sender_.impl_->rtt_ms());
@@ -317,8 +317,8 @@
EXPECT_EQ(0, sender_.impl_->SendRTCP(kRtcpReport));
// Verify RTT.
- EXPECT_EQ(0U, receiver_.rtt_stats_.LastProcessedRtt());
- EXPECT_EQ(0U, receiver_.impl_->rtt_ms());
+ EXPECT_EQ(0, receiver_.rtt_stats_.LastProcessedRtt());
+ EXPECT_EQ(0, receiver_.impl_->rtt_ms());
receiver_.impl_->Process();
EXPECT_EQ(2 * kOneWayNetworkDelayMs, receiver_.rtt_stats_.LastProcessedRtt());
EXPECT_EQ(2 * kOneWayNetworkDelayMs, receiver_.impl_->rtt_ms());
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
index a1810f2..6801cfd 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
@@ -653,7 +653,7 @@
return packet_history_.StorePackets();
}
-int32_t RTPSender::ReSendPacket(uint16_t packet_id, uint32_t min_resend_time) {
+int32_t RTPSender::ReSendPacket(uint16_t packet_id, int64_t min_resend_time) {
size_t length = IP_PACKET_SIZE;
uint8_t data_buffer[IP_PACKET_SIZE];
int64_t capture_time_ms;
@@ -720,7 +720,7 @@
}
void RTPSender::OnReceivedNACK(const std::list<uint16_t>& nack_sequence_numbers,
- uint16_t avg_rtt) {
+ int64_t avg_rtt) {
TRACE_EVENT2("webrtc_rtp", "RTPSender::OnReceivedNACK",
"num_seqnum", nack_sequence_numbers.size(), "avg_rtt", avg_rtt);
const int64_t now = clock_->TimeInMilliseconds();
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.h b/webrtc/modules/rtp_rtcp/source/rtp_sender.h
index 2703fea..d2ee2fa 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.h
@@ -173,13 +173,13 @@
int SelectiveRetransmissions() const;
int SetSelectiveRetransmissions(uint8_t settings);
void OnReceivedNACK(const std::list<uint16_t>& nack_sequence_numbers,
- uint16_t avg_rtt);
+ int64_t avg_rtt);
void SetStorePacketsStatus(bool enable, uint16_t number_to_store);
bool StorePackets() const;
- int32_t ReSendPacket(uint16_t packet_id, uint32_t min_resend_time = 0);
+ int32_t ReSendPacket(uint16_t packet_id, int64_t min_resend_time = 0);
bool ProcessNACKBitRate(uint32_t now);
diff --git a/webrtc/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc b/webrtc/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
index bf06d7f..78c065e 100644
--- a/webrtc/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
+++ b/webrtc/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
@@ -319,10 +319,10 @@
EXPECT_EQ(test_sequence_number, stats.extended_max_sequence_number);
EXPECT_EQ(reportBlockReceived.jitter, stats.jitter);
- uint16_t RTT;
- uint16_t avgRTT;
- uint16_t minRTT;
- uint16_t maxRTT;
+ int64_t RTT;
+ int64_t avgRTT;
+ int64_t minRTT;
+ int64_t maxRTT;
// Get RoundTripTime.
EXPECT_EQ(0, module1->RTT(test_ssrc + 1, &RTT, &avgRTT, &minRTT, &maxRTT));
diff --git a/webrtc/modules/video_capture/include/video_capture.h b/webrtc/modules/video_capture/include/video_capture.h
index 6e728d1..50539ea 100644
--- a/webrtc/modules/video_capture/include/video_capture.h
+++ b/webrtc/modules/video_capture/include/video_capture.h
@@ -87,7 +87,7 @@
// - packetLoss : Fraction lost
// (loss rate in percent = 100 * packetLoss / 255).
// - rtt : Round-trip time in milliseconds.
- virtual int32_t SetChannelParameters(uint32_t packetLoss, int rtt) = 0;
+ virtual int32_t SetChannelParameters(uint32_t packetLoss, int64_t rtt) = 0;
// Encode the next frame as key frame.
virtual int32_t EncodeFrameType(const FrameType type) = 0;
diff --git a/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h b/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h
index 2d41fd0..7fef060 100644
--- a/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h
+++ b/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h
@@ -73,7 +73,7 @@
}
virtual int SetChannelParameters(uint32_t /*packetLoss*/,
- int /*rtt*/) OVERRIDE {
+ int64_t /*rtt*/) OVERRIDE {
return WEBRTC_VIDEO_CODEC_OK;
}
diff --git a/webrtc/modules/video_coding/codecs/interface/mock/mock_video_codec_interface.h b/webrtc/modules/video_coding/codecs/interface/mock/mock_video_codec_interface.h
index 4758aa1..ad72071 100644
--- a/webrtc/modules/video_coding/codecs/interface/mock/mock_video_codec_interface.h
+++ b/webrtc/modules/video_coding/codecs/interface/mock/mock_video_codec_interface.h
@@ -39,7 +39,7 @@
int32_t(EncodedImageCallback* callback));
MOCK_METHOD0(Release, int32_t());
MOCK_METHOD0(Reset, int32_t());
- MOCK_METHOD2(SetChannelParameters, int32_t(uint32_t packetLoss, int rtt));
+ MOCK_METHOD2(SetChannelParameters, int32_t(uint32_t packetLoss, int64_t rtt));
MOCK_METHOD2(SetRates, int32_t(uint32_t newBitRate, uint32_t frameRate));
MOCK_METHOD1(SetPeriodicKeyFrames, int32_t(bool enable));
MOCK_METHOD2(CodecConfigParameters,
diff --git a/webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.cc b/webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.cc
index 5e258c3..a922e35 100644
--- a/webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.cc
@@ -78,7 +78,8 @@
// enough for an RPSI to arrive after the decoder decoded the reference frame.
// Ideally that should happen after one round-trip time.
// Add a margin defined by |kRttConfidence|.
- uint32_t update_interval = kRttConfidence * rtt_;
+ int64_t update_interval = static_cast<int64_t>(kRttConfidence * rtt_);
+ const int64_t kMinUpdateInterval = 90 * 10; // Timestamp frequency
if (update_interval < kMinUpdateInterval)
update_interval = kMinUpdateInterval;
// Don't send reference frame updates until we have an established reference.
@@ -114,13 +115,13 @@
received_ack_ = false;
}
-void ReferencePictureSelection::SetRtt(int rtt) {
+void ReferencePictureSelection::SetRtt(int64_t rtt) {
// Convert from milliseconds to timestamp frequency.
rtt_ = 90 * rtt;
}
-uint32_t ReferencePictureSelection::TimestampDiff(uint32_t new_ts,
- uint32_t old_ts) {
+int64_t ReferencePictureSelection::TimestampDiff(uint32_t new_ts,
+ uint32_t old_ts) {
if (old_ts > new_ts) {
// Assuming this is a wrap, doing a compensated subtraction.
return (new_ts + (static_cast<int64_t>(1) << 32)) - old_ts;
diff --git a/webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.h b/webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.h
index a47b8de..51acc4c 100644
--- a/webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.h
+++ b/webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.h
@@ -54,13 +54,11 @@
// Set the round-trip time between the sender and the receiver to |rtt|
// milliseconds.
- void SetRtt(int rtt);
+ void SetRtt(int64_t rtt);
private:
- static uint32_t TimestampDiff(uint32_t new_ts, uint32_t old_ts);
+ static int64_t TimestampDiff(uint32_t new_ts, uint32_t old_ts);
- // The minimum time between reference frame updates.
- enum { kMinUpdateInterval = 90 * 10 }; // Timestamp frequency
const double kRttConfidence;
bool update_golden_next_;
@@ -70,7 +68,7 @@
uint32_t last_sent_ref_update_time_;
int established_ref_picture_id_;
uint32_t last_refresh_time_;
- uint32_t rtt_;
+ int64_t rtt_;
};
} // namespace webrtc
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
index 38a5bdd..d37308b 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
@@ -297,7 +297,7 @@
}
int SimulcastEncoderAdapter::SetChannelParameters(uint32_t packet_loss,
- int rtt) {
+ int64_t rtt) {
for (size_t stream_idx = 0; stream_idx < streaminfos_.size(); ++stream_idx) {
streaminfos_[stream_idx].encoder->SetChannelParameters(packet_loss, rtt);
}
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h
index 8b27bed..51127fb 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h
@@ -47,7 +47,7 @@
const std::vector<VideoFrameType>* frame_types) OVERRIDE;
virtual int RegisterEncodeCompleteCallback(
EncodedImageCallback* callback) OVERRIDE;
- virtual int SetChannelParameters(uint32_t packet_loss, int rtt) OVERRIDE;
+ virtual int SetChannelParameters(uint32_t packet_loss, int64_t rtt) OVERRIDE;
virtual int SetRates(uint32_t new_bitrate_kbit,
uint32_t new_framerate) OVERRIDE;
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
index 8f2eb7a..870dcc7 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
@@ -132,7 +132,7 @@
}
MOCK_METHOD2(SetChannelParameters,
- int32_t(uint32_t packetLoss, int rtt));
+ int32_t(uint32_t packetLoss, int64_t rtt));
virtual ~MockVideoEncoder() {
}
@@ -175,7 +175,7 @@
return new SimulcastEncoderAdapter(scoped_factory.Pass());
}
- void ExpectCallSetChannelParameters(uint32_t packetLoss, int rtt) {
+ void ExpectCallSetChannelParameters(uint32_t packetLoss, int64_t rtt) {
EXPECT_TRUE(!factory_->encoders().empty());
for (size_t i = 0; i < factory_->encoders().size(); ++i) {
EXPECT_CALL(*factory_->encoders()[i],
@@ -295,7 +295,7 @@
TEST_F(TestSimulcastEncoderAdapterFake, SetChannelParameters) {
SetupCodec();
const uint32_t packetLoss = 5;
- const int rtt = 30;
+ const int64_t rtt = 30;
helper_->ExpectCallSetChannelParameters(packetLoss, rtt);
adapter_->SetChannelParameters(packetLoss, rtt);
}
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
index 21b07bc..d871eb8 100644
--- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
@@ -1024,7 +1024,7 @@
return WEBRTC_VIDEO_CODEC_OK;
}
-int VP8EncoderImpl::SetChannelParameters(uint32_t packetLoss, int rtt) {
+int VP8EncoderImpl::SetChannelParameters(uint32_t packetLoss, int64_t rtt) {
rps_.SetRtt(rtt);
return WEBRTC_VIDEO_CODEC_OK;
}
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h
index 82b2f24..c9bdb98 100644
--- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h
@@ -51,7 +51,7 @@
virtual int RegisterEncodeCompleteCallback(EncodedImageCallback* callback);
- virtual int SetChannelParameters(uint32_t packet_loss, int rtt);
+ virtual int SetChannelParameters(uint32_t packet_loss, int64_t rtt);
virtual int SetRates(uint32_t new_bitrate_kbit, uint32_t frame_rate);
diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
index 486acdf..5491bd0 100644
--- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
+++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
@@ -334,7 +334,7 @@
return WEBRTC_VIDEO_CODEC_OK;
}
-int VP9EncoderImpl::SetChannelParameters(uint32_t packet_loss, int rtt) {
+int VP9EncoderImpl::SetChannelParameters(uint32_t packet_loss, int64_t rtt) {
return WEBRTC_VIDEO_CODEC_OK;
}
diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.h b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.h
index ee40749..6c9f1ab 100644
--- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.h
+++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.h
@@ -38,7 +38,7 @@
virtual int RegisterEncodeCompleteCallback(EncodedImageCallback* callback)
OVERRIDE;
- virtual int SetChannelParameters(uint32_t packet_loss, int rtt) OVERRIDE;
+ virtual int SetChannelParameters(uint32_t packet_loss, int64_t rtt) OVERRIDE;
virtual int SetRates(uint32_t new_bitrate_kbit, uint32_t frame_rate) OVERRIDE;
diff --git a/webrtc/modules/video_coding/main/interface/video_coding.h b/webrtc/modules/video_coding/main/interface/video_coding.h
index 94e8f9d..f1ce2ec 100644
--- a/webrtc/modules/video_coding/main/interface/video_coding.h
+++ b/webrtc/modules/video_coding/main/interface/video_coding.h
@@ -196,8 +196,8 @@
// Return value : VCM_OK, on success.
// < 0, on error.
virtual int32_t SetChannelParameters(uint32_t target_bitrate,
- uint8_t lossRate,
- uint32_t rtt) = 0;
+ uint8_t lossRate,
+ int64_t rtt) = 0;
// Sets the parameters describing the receive channel. These parameters are inputs to the
// Media Optimization inside the VCM.
@@ -209,7 +209,7 @@
//
// Return value : VCM_OK, on success.
// < 0, on error.
- virtual int32_t SetReceiveChannelParameters(uint32_t rtt) = 0;
+ virtual int32_t SetReceiveChannelParameters(int64_t rtt) = 0;
// Register a transport callback which will be called to deliver the encoded data and
// side information.
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 3454e9cf..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);
diff --git a/webrtc/modules/video_coding/main/test/media_opt_test.h b/webrtc/modules/video_coding/main/test/media_opt_test.h
index 57398eb..662faa8 100644
--- a/webrtc/modules/video_coding/main/test/media_opt_test.h
+++ b/webrtc/modules/video_coding/main/test/media_opt_test.h
@@ -75,7 +75,7 @@
bool _nackEnabled;
bool _fecEnabled;
bool _nackFecEnabled;
- uint8_t _rttMS;
+ int64_t _rttMS;
float _bitRate;
double _lossRate;
uint32_t _renderDelayMs;
diff --git a/webrtc/modules/video_coding/main/test/mt_rx_tx_test.cc b/webrtc/modules/video_coding/main/test/mt_rx_tx_test.cc
index 35cd1f3..d7beb46 100644
--- a/webrtc/modules/video_coding/main/test/mt_rx_tx_test.cc
+++ b/webrtc/modules/video_coding/main/test/mt_rx_tx_test.cc
@@ -119,7 +119,7 @@
// Nack support is currently not implemented in this test.
bool nackEnabled = false;
bool fecEnabled = false;
- uint8_t rttMS = 20;
+ int64_t rttMS = 20;
float lossRate = 0.0*255; // no packet loss
uint32_t renderDelayMs = 0;
uint32_t minPlayoutDelayMs = 0;
diff --git a/webrtc/modules/video_coding/main/test/rtp_player.cc b/webrtc/modules/video_coding/main/test/rtp_player.cc
index 02ae7c2..5057f7d 100644
--- a/webrtc/modules/video_coding/main/test/rtp_player.cc
+++ b/webrtc/modules/video_coding/main/test/rtp_player.cc
@@ -71,7 +71,7 @@
class LostPackets {
public:
- LostPackets(Clock* clock, uint32_t rtt_ms)
+ LostPackets(Clock* clock, int64_t rtt_ms)
: crit_sect_(CriticalSectionWrapper::CreateCriticalSection()),
debug_file_(fopen("PacketLossDebug.txt", "w")),
loss_count_(0),
@@ -180,7 +180,7 @@
int loss_count_;
RtpPacketList packets_;
Clock* clock_;
- uint32_t rtt_ms_;
+ int64_t rtt_ms_;
DISALLOW_IMPLICIT_CONSTRUCTORS(LostPackets);
};
@@ -323,7 +323,7 @@
RtpPlayerImpl(PayloadSinkFactoryInterface* payload_sink_factory,
const PayloadTypes& payload_types, Clock* clock,
scoped_ptr<test::RtpFileReader>* packet_source,
- float loss_rate, uint32_t rtt_ms, bool reordering)
+ float loss_rate, int64_t rtt_ms, bool reordering)
: ssrc_handlers_(payload_sink_factory, payload_types),
clock_(clock),
next_rtp_time_(0),
@@ -468,7 +468,7 @@
RtpPlayerInterface* Create(const std::string& input_filename,
PayloadSinkFactoryInterface* payload_sink_factory, Clock* clock,
- const PayloadTypes& payload_types, float loss_rate, uint32_t rtt_ms,
+ const PayloadTypes& payload_types, float loss_rate, int64_t rtt_ms,
bool reordering) {
scoped_ptr<test::RtpFileReader> packet_source(test::RtpFileReader::Create(
test::RtpFileReader::kRtpDump, input_filename));
diff --git a/webrtc/modules/video_coding/main/test/rtp_player.h b/webrtc/modules/video_coding/main/test/rtp_player.h
index 1703618..7459231 100644
--- a/webrtc/modules/video_coding/main/test/rtp_player.h
+++ b/webrtc/modules/video_coding/main/test/rtp_player.h
@@ -88,7 +88,7 @@
RtpPlayerInterface* Create(const std::string& inputFilename,
PayloadSinkFactoryInterface* payloadSinkFactory, Clock* clock,
- const PayloadTypes& payload_types, float lossRate, uint32_t rttMs,
+ const PayloadTypes& payload_types, float lossRate, int64_t rttMs,
bool reordering);
} // namespace rtpplayer
diff --git a/webrtc/modules/video_coding/main/test/vcm_payload_sink_factory.cc b/webrtc/modules/video_coding/main/test/vcm_payload_sink_factory.cc
index 4b40cb3..76d5478 100644
--- a/webrtc/modules/video_coding/main/test/vcm_payload_sink_factory.cc
+++ b/webrtc/modules/video_coding/main/test/vcm_payload_sink_factory.cc
@@ -108,7 +108,7 @@
Clock* clock,
bool protection_enabled,
VCMVideoProtection protection_method,
- uint32_t rtt_ms,
+ int64_t rtt_ms,
uint32_t render_delay_ms,
uint32_t min_playout_delay_ms)
: base_out_filename_(base_out_filename),
diff --git a/webrtc/modules/video_coding/main/test/vcm_payload_sink_factory.h b/webrtc/modules/video_coding/main/test/vcm_payload_sink_factory.h
index 130bd42..0817423 100644
--- a/webrtc/modules/video_coding/main/test/vcm_payload_sink_factory.h
+++ b/webrtc/modules/video_coding/main/test/vcm_payload_sink_factory.h
@@ -28,7 +28,7 @@
VcmPayloadSinkFactory(const std::string& base_out_filename,
Clock* clock, bool protection_enabled,
VCMVideoProtection protection_method,
- uint32_t rtt_ms, uint32_t render_delay_ms,
+ int64_t rtt_ms, uint32_t render_delay_ms,
uint32_t min_playout_delay_ms);
virtual ~VcmPayloadSinkFactory();
@@ -50,7 +50,7 @@
Clock* clock_;
bool protection_enabled_;
VCMVideoProtection protection_method_;
- uint32_t rtt_ms_;
+ int64_t rtt_ms_;
uint32_t render_delay_ms_;
uint32_t min_playout_delay_ms_;
scoped_ptr<NullEventFactory> null_event_factory_;
diff --git a/webrtc/modules/video_coding/main/test/video_rtp_play.cc b/webrtc/modules/video_coding/main/test/video_rtp_play.cc
index b285056..5f8ea35 100644
--- a/webrtc/modules/video_coding/main/test/video_rtp_play.cc
+++ b/webrtc/modules/video_coding/main/test/video_rtp_play.cc
@@ -20,7 +20,7 @@
webrtc::kProtectionNack;
const float kConfigLossRate = 0.0f;
const bool kConfigReordering = false;
-const uint32_t kConfigRttMs = 0;
+const int64_t kConfigRttMs = 0;
const uint32_t kConfigRenderDelayMs = 0;
const uint32_t kConfigMinPlayoutDelayMs = 0;
const int64_t kConfigMaxRuntimeMs = -1;
diff --git a/webrtc/modules/video_coding/main/test/video_rtp_play_mt.cc b/webrtc/modules/video_coding/main/test/video_rtp_play_mt.cc
index 8abd8b8..f334db5 100644
--- a/webrtc/modules/video_coding/main/test/video_rtp_play_mt.cc
+++ b/webrtc/modules/video_coding/main/test/video_rtp_play_mt.cc
@@ -26,7 +26,7 @@
const webrtc::VCMVideoProtection kConfigProtectionMethod =
webrtc::kProtectionNack;
const float kConfigLossRate = 0.05f;
-const uint32_t kConfigRttMs = 50;
+const int64_t kConfigRttMs = 50;
const bool kConfigReordering = false;
const uint32_t kConfigRenderDelayMs = 0;
const uint32_t kConfigMinPlayoutDelayMs = 0;
diff --git a/webrtc/test/configurable_frame_size_encoder.cc b/webrtc/test/configurable_frame_size_encoder.cc
index f25f443..7d13be6 100644
--- a/webrtc/test/configurable_frame_size_encoder.cc
+++ b/webrtc/test/configurable_frame_size_encoder.cc
@@ -69,7 +69,7 @@
}
int32_t ConfigurableFrameSizeEncoder::SetChannelParameters(uint32_t packet_loss,
- int rtt) {
+ int64_t rtt) {
return WEBRTC_VIDEO_CODEC_OK;
}
diff --git a/webrtc/test/configurable_frame_size_encoder.h b/webrtc/test/configurable_frame_size_encoder.h
index 43c4b29..17a02aa 100644
--- a/webrtc/test/configurable_frame_size_encoder.h
+++ b/webrtc/test/configurable_frame_size_encoder.h
@@ -38,7 +38,8 @@
virtual int32_t Release() OVERRIDE;
- virtual int32_t SetChannelParameters(uint32_t packet_loss, int rtt) OVERRIDE;
+ virtual int32_t SetChannelParameters(uint32_t packet_loss,
+ int64_t rtt) OVERRIDE;
virtual int32_t SetRates(uint32_t new_bit_rate, uint32_t frame_rate) OVERRIDE;
diff --git a/webrtc/test/fake_encoder.cc b/webrtc/test/fake_encoder.cc
index 42b6e9f..cb763a5 100644
--- a/webrtc/test/fake_encoder.cc
+++ b/webrtc/test/fake_encoder.cc
@@ -119,7 +119,7 @@
int32_t FakeEncoder::Release() { return 0; }
-int32_t FakeEncoder::SetChannelParameters(uint32_t packet_loss, int rtt) {
+int32_t FakeEncoder::SetChannelParameters(uint32_t packet_loss, int64_t rtt) {
return 0;
}
diff --git a/webrtc/test/fake_encoder.h b/webrtc/test/fake_encoder.h
index 4d31e1c..2cb28ca 100644
--- a/webrtc/test/fake_encoder.h
+++ b/webrtc/test/fake_encoder.h
@@ -38,7 +38,8 @@
virtual int32_t RegisterEncodeCompleteCallback(
EncodedImageCallback* callback) OVERRIDE;
virtual int32_t Release() OVERRIDE;
- virtual int32_t SetChannelParameters(uint32_t packet_loss, int rtt) OVERRIDE;
+ virtual int32_t SetChannelParameters(uint32_t packet_loss,
+ int64_t rtt) OVERRIDE;
virtual int32_t SetRates(uint32_t new_target_bitrate,
uint32_t framerate) OVERRIDE;
diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc
index b8ef4d3..e61f5a2 100644
--- a/webrtc/video/video_send_stream.cc
+++ b/webrtc/video/video_send_stream.cc
@@ -517,17 +517,17 @@
rtp_rtcp_->SetRTCPStatus(channel_, kRtcpNone);
}
-int VideoSendStream::GetPacerQueuingDelayMs() const {
- int pacer_delay_ms = 0;
+int64_t VideoSendStream::GetPacerQueuingDelayMs() const {
+ int64_t pacer_delay_ms = 0;
if (rtp_rtcp_->GetPacerQueuingDelayMs(channel_, &pacer_delay_ms) != 0) {
return 0;
}
return pacer_delay_ms;
}
-int VideoSendStream::GetRtt() const {
+int64_t VideoSendStream::GetRtt() const {
webrtc::RtcpStatistics rtcp_stats;
- int rtt_ms;
+ int64_t rtt_ms;
if (rtp_rtcp_->GetSendChannelRtcpStatistics(channel_, rtcp_stats, rtt_ms) ==
0) {
return rtt_ms;
diff --git a/webrtc/video/video_send_stream.h b/webrtc/video/video_send_stream.h
index 6f7f400..cff2fb1 100644
--- a/webrtc/video/video_send_stream.h
+++ b/webrtc/video/video_send_stream.h
@@ -75,9 +75,9 @@
void SetBitrateConfig(const Call::Config::BitrateConfig& bitrate_config);
void SignalNetworkState(Call::NetworkState state);
- int GetPacerQueuingDelayMs() const;
+ int64_t GetPacerQueuingDelayMs() const;
- int GetRtt() const;
+ int64_t GetRtt() const;
private:
void ConfigureSsrcs();
diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc
index 915bf9e3..9d8ffb8 100644
--- a/webrtc/video/video_send_stream_tests.cc
+++ b/webrtc/video/video_send_stream_tests.cc
@@ -258,7 +258,7 @@
virtual uint32_t BitrateReceived() const OVERRIDE { return 0; }
virtual void ResetStatistics() OVERRIDE {}
virtual bool IsRetransmitOfOldPacket(const RTPHeader& header,
- int min_rtt) const OVERRIDE {
+ int64_t min_rtt) const OVERRIDE {
return false;
}
@@ -1302,7 +1302,7 @@
}
virtual int32_t SetChannelParameters(uint32_t packetLoss,
- int rtt) OVERRIDE {
+ int64_t rtt) OVERRIDE {
EXPECT_TRUE(IsReadyForEncode());
return 0;
}
diff --git a/webrtc/video_encoder.h b/webrtc/video_encoder.h
index a66a51a..2a5a09f 100644
--- a/webrtc/video_encoder.h
+++ b/webrtc/video_encoder.h
@@ -109,7 +109,7 @@
// - rtt : Round-trip time in milliseconds
// Return value : WEBRTC_VIDEO_CODEC_OK if OK
// <0 - Errors: WEBRTC_VIDEO_CODEC_ERROR
- virtual int32_t SetChannelParameters(uint32_t packet_loss, int rtt) = 0;
+ virtual int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) = 0;
// Inform the encoder about the new target bit rate.
//
diff --git a/webrtc/video_engine/call_stats.cc b/webrtc/video_engine/call_stats.cc
index 2d324ff..6e51eeb 100644
--- a/webrtc/video_engine/call_stats.cc
+++ b/webrtc/video_engine/call_stats.cc
@@ -32,8 +32,8 @@
}
}
-uint32_t GetMaxRttMs(std::list<CallStats::RttTime>* reports) {
- uint32_t max_rtt_ms = 0;
+int64_t GetMaxRttMs(std::list<CallStats::RttTime>* reports) {
+ int64_t max_rtt_ms = 0;
for (std::list<CallStats::RttTime>::const_iterator it = reports->begin();
it != reports->end(); ++it) {
max_rtt_ms = std::max(it->rtt, max_rtt_ms);
@@ -41,11 +41,11 @@
return max_rtt_ms;
}
-uint32_t GetAvgRttMs(std::list<CallStats::RttTime>* reports) {
+int64_t GetAvgRttMs(std::list<CallStats::RttTime>* reports) {
if (reports->empty()) {
return 0;
}
- uint32_t sum = 0;
+ int64_t sum = 0;
for (std::list<CallStats::RttTime>::const_iterator it = reports->begin();
it != reports->end(); ++it) {
sum += it->rtt;
@@ -53,7 +53,7 @@
return sum / reports->size();
}
-void UpdateAvgRttMs(std::list<CallStats::RttTime>* reports, uint32_t* avg_rtt) {
+void UpdateAvgRttMs(std::list<CallStats::RttTime>* reports, int64_t* avg_rtt) {
uint32_t cur_rtt_ms = GetAvgRttMs(reports);
if (cur_rtt_ms == 0) {
// Reset.
@@ -74,12 +74,12 @@
explicit RtcpObserver(CallStats* owner) : owner_(owner) {}
virtual ~RtcpObserver() {}
- virtual void OnRttUpdate(uint32_t rtt) {
+ virtual void OnRttUpdate(int64_t rtt) {
owner_->OnRttUpdate(rtt);
}
// Returns the average RTT.
- virtual uint32_t LastProcessedRtt() const {
+ virtual int64_t LastProcessedRtt() const {
return owner_->avg_rtt_ms();
}
@@ -129,7 +129,7 @@
return 0;
}
-uint32_t CallStats::avg_rtt_ms() const {
+int64_t CallStats::avg_rtt_ms() const {
CriticalSectionScoped cs(crit_.get());
return avg_rtt_ms_;
}
@@ -159,7 +159,7 @@
}
}
-void CallStats::OnRttUpdate(uint32_t rtt) {
+void CallStats::OnRttUpdate(int64_t rtt) {
CriticalSectionScoped cs(crit_.get());
reports_.push_back(RttTime(rtt, TickTime::MillisecondTimestamp()));
}
diff --git a/webrtc/video_engine/call_stats.h b/webrtc/video_engine/call_stats.h
index ce7a15a..da5c2e6 100644
--- a/webrtc/video_engine/call_stats.h
+++ b/webrtc/video_engine/call_stats.h
@@ -45,16 +45,16 @@
// Helper struct keeping track of the time a rtt value is reported.
struct RttTime {
- RttTime(uint32_t new_rtt, int64_t rtt_time)
+ RttTime(int64_t new_rtt, int64_t rtt_time)
: rtt(new_rtt), time(rtt_time) {}
- const uint32_t rtt;
+ const int64_t rtt;
const int64_t time;
};
protected:
- void OnRttUpdate(uint32_t rtt);
+ void OnRttUpdate(int64_t rtt);
- uint32_t avg_rtt_ms() const;
+ int64_t avg_rtt_ms() const;
private:
// Protecting all members.
@@ -64,8 +64,8 @@
// The last time 'Process' resulted in statistic update.
int64_t last_process_time_;
// The last RTT in the statistics update (zero if there is no valid estimate).
- uint32_t max_rtt_ms_;
- uint32_t avg_rtt_ms_;
+ int64_t max_rtt_ms_;
+ int64_t avg_rtt_ms_;
// All Rtt reports within valid time interval, oldest first.
std::list<RttTime> reports_;
diff --git a/webrtc/video_engine/call_stats_unittest.cc b/webrtc/video_engine/call_stats_unittest.cc
index 1196ada..9f8f398 100644
--- a/webrtc/video_engine/call_stats_unittest.cc
+++ b/webrtc/video_engine/call_stats_unittest.cc
@@ -27,7 +27,7 @@
MockStatsObserver() {}
virtual ~MockStatsObserver() {}
- MOCK_METHOD1(OnRttUpdate, void(uint32_t));
+ MOCK_METHOD1(OnRttUpdate, void(int64_t));
};
class CallStatsTest : public ::testing::Test {
@@ -44,21 +44,21 @@
RtcpRttStats* rtcp_rtt_stats = call_stats_->rtcp_rtt_stats();
call_stats_->RegisterStatsObserver(&stats_observer);
TickTime::AdvanceFakeClock(1000);
- EXPECT_EQ(0U, rtcp_rtt_stats->LastProcessedRtt());
+ EXPECT_EQ(0, rtcp_rtt_stats->LastProcessedRtt());
- const uint32_t kRtt = 25;
+ const int64_t kRtt = 25;
rtcp_rtt_stats->OnRttUpdate(kRtt);
EXPECT_CALL(stats_observer, OnRttUpdate(kRtt))
.Times(1);
call_stats_->Process();
EXPECT_EQ(kRtt, rtcp_rtt_stats->LastProcessedRtt());
- const int kRttTimeOutMs = 1500 + 10;
+ const int64_t kRttTimeOutMs = 1500 + 10;
TickTime::AdvanceFakeClock(kRttTimeOutMs);
EXPECT_CALL(stats_observer, OnRttUpdate(_))
.Times(0);
call_stats_->Process();
- EXPECT_EQ(0U, rtcp_rtt_stats->LastProcessedRtt());
+ EXPECT_EQ(0, rtcp_rtt_stats->LastProcessedRtt());
call_stats_->DeregisterStatsObserver(&stats_observer);
}
@@ -108,7 +108,7 @@
call_stats_->RegisterStatsObserver(&stats_observer_2);
RtcpRttStats* rtcp_rtt_stats = call_stats_->rtcp_rtt_stats();
- const uint32_t kRtt = 100;
+ const int64_t kRtt = 100;
rtcp_rtt_stats->OnRttUpdate(kRtt);
// Verify both observers are updated.
@@ -151,7 +151,7 @@
TickTime::AdvanceFakeClock(1000);
// Set a first value and verify the callback is triggered.
- const uint32_t kFirstRtt = 100;
+ const int64_t kFirstRtt = 100;
rtcp_rtt_stats->OnRttUpdate(kFirstRtt);
EXPECT_CALL(stats_observer, OnRttUpdate(kFirstRtt))
.Times(1);
@@ -159,7 +159,7 @@
// Increase rtt and verify the new value is reported.
TickTime::AdvanceFakeClock(1000);
- const uint32_t kHighRtt = kFirstRtt + 20;
+ const int64_t kHighRtt = kFirstRtt + 20;
rtcp_rtt_stats->OnRttUpdate(kHighRtt);
EXPECT_CALL(stats_observer, OnRttUpdate(kHighRtt))
.Times(1);
@@ -169,7 +169,7 @@
// rtt invalid. Report a lower rtt and verify the old/high value still is sent
// in the callback.
TickTime::AdvanceFakeClock(1000);
- const uint32_t kLowRtt = kFirstRtt - 20;
+ const int64_t kLowRtt = kFirstRtt - 20;
rtcp_rtt_stats->OnRttUpdate(kLowRtt);
EXPECT_CALL(stats_observer, OnRttUpdate(kHighRtt))
.Times(1);
@@ -193,9 +193,9 @@
// Set a first values and verify that LastProcessedRtt initially returns the
// average rtt.
- const uint32_t kRttLow = 10;
- const uint32_t kRttHigh = 30;
- const uint32_t kAvgRtt = 20;
+ const int64_t kRttLow = 10;
+ const int64_t kRttHigh = 30;
+ const int64_t kAvgRtt = 20;
rtcp_rtt_stats->OnRttUpdate(kRttLow);
rtcp_rtt_stats->OnRttUpdate(kRttHigh);
EXPECT_CALL(stats_observer, OnRttUpdate(kRttHigh))
diff --git a/webrtc/video_engine/include/vie_rtp_rtcp.h b/webrtc/video_engine/include/vie_rtp_rtcp.h
index 103a196..051eba0 100644
--- a/webrtc/video_engine/include/vie_rtp_rtcp.h
+++ b/webrtc/video_engine/include/vie_rtp_rtcp.h
@@ -275,7 +275,7 @@
// stream.
virtual int GetReceiveChannelRtcpStatistics(const int video_channel,
RtcpStatistics& basic_stats,
- int& rtt_ms) const = 0;
+ int64_t& rtt_ms) const = 0;
// This function returns statistics reported by the remote client in RTCP
// report blocks. If several streams are reported, the statistics will be
@@ -284,16 +284,16 @@
// and will always be set to 0.
virtual int GetSendChannelRtcpStatistics(const int video_channel,
RtcpStatistics& basic_stats,
- int& rtt_ms) const = 0;
+ int64_t& rtt_ms) const = 0;
// TODO(sprang): Temporary hacks to prevent libjingle build from failing,
// remove when libjingle has been lifted to support webrtc issue 2589
virtual int GetReceivedRTCPStatistics(const int video_channel,
- unsigned short& fraction_lost,
- unsigned int& cumulative_lost,
- unsigned int& extended_max,
- unsigned int& jitter,
- int& rtt_ms) const {
+ unsigned short& fraction_lost,
+ unsigned int& cumulative_lost,
+ unsigned int& extended_max,
+ unsigned int& jitter,
+ int64_t& rtt_ms) const {
RtcpStatistics stats;
int ret_code = GetReceiveChannelRtcpStatistics(video_channel,
stats,
@@ -305,11 +305,11 @@
return ret_code;
}
virtual int GetSentRTCPStatistics(const int video_channel,
- unsigned short& fraction_lost,
- unsigned int& cumulative_lost,
- unsigned int& extended_max,
- unsigned int& jitter,
- int& rtt_ms) const {
+ unsigned short& fraction_lost,
+ unsigned int& cumulative_lost,
+ unsigned int& extended_max,
+ unsigned int& jitter,
+ int64_t& rtt_ms) const {
RtcpStatistics stats;
int ret_code = GetSendChannelRtcpStatistics(video_channel,
stats,
@@ -416,7 +416,7 @@
// This function gets the PacedSender queuing delay for the last sent frame.
// TODO(jiayl): remove the default impl when libjingle is updated.
virtual int GetPacerQueuingDelayMs(
- const int video_channel, int* delay_ms) const {
+ const int video_channel, int64_t* delay_ms) const {
return -1;
}
diff --git a/webrtc/video_engine/test/auto_test/source/vie_autotest_custom_call.cc b/webrtc/video_engine/test/auto_test/source/vie_autotest_custom_call.cc
index b22e367..c4d458a 100644
--- a/webrtc/video_engine/test/auto_test/source/vie_autotest_custom_call.cc
+++ b/webrtc/video_engine/test/auto_test/source/vie_autotest_custom_call.cc
@@ -1510,7 +1510,7 @@
int error = 0;
int number_of_errors = 0;
webrtc::RtcpStatistics rtcp_stats;
- int rtt_ms = 0;
+ int64_t rtt_ms = 0;
switch (stat_type) {
case kReceivedStatistic:
diff --git a/webrtc/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc b/webrtc/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc
index 923fe41..711bc58 100644
--- a/webrtc/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc
+++ b/webrtc/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc
@@ -120,7 +120,7 @@
// Pacing
//
webrtc::RtcpStatistics received;
- int recRttMs = 0;
+ int64_t recRttMs = 0;
unsigned int sentTotalBitrate = 0;
unsigned int sentVideoBitrate = 0;
unsigned int sentFecBitrate = 0;
@@ -240,7 +240,7 @@
EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel));
webrtc::RtcpStatistics sent;
- int sentRttMs = 0;
+ int64_t sentRttMs = 0;
// Fraction lost is a transient value that can get reset after a new rtcp
// report block. Make regular polls to make sure it is propagated.
diff --git a/webrtc/video_engine/test/libvietest/include/tb_I420_codec.h b/webrtc/video_engine/test/libvietest/include/tb_I420_codec.h
index 484afd5..3c4757f 100644
--- a/webrtc/video_engine/test/libvietest/include/tb_I420_codec.h
+++ b/webrtc/video_engine/test/libvietest/include/tb_I420_codec.h
@@ -38,7 +38,8 @@
virtual int32_t Release() OVERRIDE;
- virtual int32_t SetChannelParameters(uint32_t packetLoss, int rtt) OVERRIDE;
+ virtual int32_t SetChannelParameters(uint32_t packetLoss,
+ int64_t rtt) OVERRIDE;
virtual int32_t SetRates(uint32_t newBitRate, uint32_t frameRate) OVERRIDE;
diff --git a/webrtc/video_engine/test/libvietest/testbed/tb_I420_codec.cc b/webrtc/video_engine/test/libvietest/testbed/tb_I420_codec.cc
index 747e06e..55055dd 100644
--- a/webrtc/video_engine/test/libvietest/testbed/tb_I420_codec.cc
+++ b/webrtc/video_engine/test/libvietest/testbed/tb_I420_codec.cc
@@ -46,7 +46,7 @@
return WEBRTC_VIDEO_CODEC_OK;
}
-int32_t TbI420Encoder::SetChannelParameters(uint32_t packetLoss, int rtt) {
+int32_t TbI420Encoder::SetChannelParameters(uint32_t packetLoss, int64_t rtt) {
_functionCalls.SetChannelParameters++;
return WEBRTC_VIDEO_CODEC_OK;
}
diff --git a/webrtc/video_engine/vie_channel.cc b/webrtc/video_engine/vie_channel.cc
index 79ebe70..7b9d2cc 100644
--- a/webrtc/video_engine/vie_channel.cc
+++ b/webrtc/video_engine/vie_channel.cc
@@ -51,7 +51,7 @@
virtual ~ChannelStatsObserver() {}
// Implements StatsObserver.
- virtual void OnRttUpdate(uint32_t rtt) {
+ virtual void OnRttUpdate(int64_t rtt) {
owner_->OnRttUpdate(rtt);
}
@@ -1006,7 +1006,7 @@
uint32_t* cumulative_lost,
uint32_t* extended_max,
uint32_t* jitter_samples,
- int32_t* rtt_ms) {
+ int64_t* rtt_ms) {
// Aggregate the report blocks associated with streams sent on this channel.
std::vector<RTCPReportBlock> report_blocks;
rtp_rtcp_->RemoteRTCPStat(&report_blocks);
@@ -1046,8 +1046,8 @@
*extended_max = report.extendedHighSeqNum;
*jitter_samples = report.jitter;
- uint16_t dummy;
- uint16_t rtt = 0;
+ int64_t dummy;
+ int64_t rtt = 0;
if (rtp_rtcp_->RTT(remote_ssrc, &rtt, &dummy, &dummy, &dummy) != 0) {
return -1;
}
@@ -1073,7 +1073,7 @@
uint32_t* cumulative_lost,
uint32_t* extended_max,
uint32_t* jitter_samples,
- int32_t* rtt_ms) {
+ int64_t* rtt_ms) {
uint32_t remote_ssrc = vie_receiver_.GetRemoteSsrc();
StreamStatistician* statistician =
vie_receiver_.GetReceiveStatistics()->GetStatistician(remote_ssrc);
@@ -1091,8 +1091,8 @@
// GetReceivedRtcpStatistics to be called.
report_block_stats_receiver_->Store(receive_stats, remote_ssrc, 0);
- uint16_t dummy = 0;
- uint16_t rtt = 0;
+ int64_t dummy = 0;
+ int64_t rtt = 0;
rtp_rtcp_->RTT(remote_ssrc, &rtt, &dummy, &dummy, &dummy);
*rtt_ms = rtt;
return 0;
@@ -1599,7 +1599,7 @@
return true;
}
-void ViEChannel::OnRttUpdate(uint32_t rtt) {
+void ViEChannel::OnRttUpdate(int64_t rtt) {
vcm_->SetReceiveChannelParameters(rtt);
}
diff --git a/webrtc/video_engine/vie_channel.h b/webrtc/video_engine/vie_channel.h
index 7a46d1f..bc91b3a 100644
--- a/webrtc/video_engine/vie_channel.h
+++ b/webrtc/video_engine/vie_channel.h
@@ -171,7 +171,7 @@
uint32_t* cumulative_lost,
uint32_t* extended_max,
uint32_t* jitter_samples,
- int32_t* rtt_ms);
+ int64_t* rtt_ms);
// Called on receipt of RTCP report block from remote side.
void RegisterSendChannelRtcpStatisticsCallback(
@@ -182,7 +182,7 @@
uint32_t* cumulative_lost,
uint32_t* extended_max,
uint32_t* jitter_samples,
- int32_t* rtt_ms);
+ int64_t* rtt_ms);
// Called on generation of RTCP stats
void RegisterReceiveChannelRtcpStatisticsCallback(
@@ -364,7 +364,7 @@
static bool ChannelDecodeThreadFunction(void* obj);
bool ChannelDecodeProcess();
- void OnRttUpdate(uint32_t rtt);
+ void OnRttUpdate(int64_t rtt);
private:
void ReserveRtpRtcpModules(size_t total_modules)
diff --git a/webrtc/video_engine/vie_channel_group.cc b/webrtc/video_engine/vie_channel_group.cc
index d4a3f20..16e25d3 100644
--- a/webrtc/video_engine/vie_channel_group.cc
+++ b/webrtc/video_engine/vie_channel_group.cc
@@ -70,7 +70,7 @@
return rbe_->TimeUntilNextProcess();
}
- virtual void OnRttUpdate(uint32_t rtt) OVERRIDE {
+ virtual void OnRttUpdate(int64_t rtt) OVERRIDE {
CriticalSectionScoped cs(crit_sect_.get());
rbe_->OnRttUpdate(rtt);
}
diff --git a/webrtc/video_engine/vie_encoder.cc b/webrtc/video_engine/vie_encoder.cc
index 3b2ab8d..ca02002 100644
--- a/webrtc/video_engine/vie_encoder.cc
+++ b/webrtc/video_engine/vie_encoder.cc
@@ -98,7 +98,7 @@
// Implements BitrateObserver.
virtual void OnNetworkChanged(uint32_t bitrate_bps,
uint8_t fraction_lost,
- uint32_t rtt) {
+ int64_t rtt) {
owner_->OnNetworkChanged(bitrate_bps, fraction_lost, rtt);
}
private:
@@ -646,7 +646,7 @@
return 0;
}
-int32_t ViEEncoder::PacerQueuingDelayMs() const {
+int64_t ViEEncoder::PacerQueuingDelayMs() const {
return paced_sender_->QueueInMs();
}
@@ -869,7 +869,7 @@
// Called from ViEBitrateObserver.
void ViEEncoder::OnNetworkChanged(uint32_t bitrate_bps,
uint8_t fraction_lost,
- uint32_t round_trip_time_ms) {
+ int64_t round_trip_time_ms) {
LOG(LS_VERBOSE) << "OnNetworkChanged, bitrate" << bitrate_bps
<< " packet loss " << fraction_lost
<< " rtt " << round_trip_time_ms;
diff --git a/webrtc/video_engine/vie_encoder.h b/webrtc/video_engine/vie_encoder.h
index 9ef6426..ba7de53 100644
--- a/webrtc/video_engine/vie_encoder.h
+++ b/webrtc/video_engine/vie_encoder.h
@@ -110,7 +110,7 @@
int32_t SendCodecStatistics(uint32_t* num_key_frames,
uint32_t* num_delta_frames);
- int PacerQueuingDelayMs() const;
+ int64_t PacerQueuingDelayMs() const;
int CodecTargetBitrate(uint32_t* bitrate) const;
// Loss protection.
@@ -181,7 +181,7 @@
// Called by BitrateObserver.
void OnNetworkChanged(uint32_t bitrate_bps,
uint8_t fraction_lost,
- uint32_t round_trip_time_ms);
+ int64_t round_trip_time_ms);
// Called by PacedSender.
bool TimeToSendPacket(uint32_t ssrc, uint16_t sequence_number,
diff --git a/webrtc/video_engine/vie_receiver.cc b/webrtc/video_engine/vie_receiver.cc
index 6dec985..6adcffd 100644
--- a/webrtc/video_engine/vie_receiver.cc
+++ b/webrtc/video_engine/vie_receiver.cc
@@ -365,7 +365,7 @@
return ret;
}
- uint16_t rtt = 0;
+ int64_t rtt = 0;
rtp_rtcp_->RTT(rtp_receiver_->SSRC(), &rtt, NULL, NULL, NULL);
if (rtt == 0) {
// Waiting for valid rtt.
@@ -454,7 +454,7 @@
if (!statistician)
return false;
// Check if this is a retransmission.
- uint16_t min_rtt = 0;
+ int64_t min_rtt = 0;
rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL);
return !in_order &&
statistician->IsRetransmitOfOldPacket(header, min_rtt);
diff --git a/webrtc/video_engine/vie_rtp_rtcp_impl.cc b/webrtc/video_engine/vie_rtp_rtcp_impl.cc
index ae21307..f9d96e6 100644
--- a/webrtc/video_engine/vie_rtp_rtcp_impl.cc
+++ b/webrtc/video_engine/vie_rtp_rtcp_impl.cc
@@ -669,7 +669,7 @@
int ViERTP_RTCPImpl::GetReceiveChannelRtcpStatistics(
const int video_channel,
RtcpStatistics& basic_stats,
- int& rtt_ms) const {
+ int64_t& rtt_ms) const {
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
ViEChannel* vie_channel = cs.Channel(video_channel);
if (!vie_channel) {
@@ -694,7 +694,7 @@
int ViERTP_RTCPImpl::GetSendChannelRtcpStatistics(const int video_channel,
RtcpStatistics& basic_stats,
- int& rtt_ms) const {
+ int64_t& rtt_ms) const {
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
ViEChannel* vie_channel = cs.Channel(video_channel);
if (!vie_channel) {
@@ -802,7 +802,7 @@
}
int ViERTP_RTCPImpl::GetPacerQueuingDelayMs(
- const int video_channel, int* delay_ms) const {
+ const int video_channel, int64_t* delay_ms) const {
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
ViEEncoder* vie_encoder = cs.Encoder(video_channel);
if (!vie_encoder) {
diff --git a/webrtc/video_engine/vie_rtp_rtcp_impl.h b/webrtc/video_engine/vie_rtp_rtcp_impl.h
index 8e9f097..6c20f1e 100644
--- a/webrtc/video_engine/vie_rtp_rtcp_impl.h
+++ b/webrtc/video_engine/vie_rtp_rtcp_impl.h
@@ -99,10 +99,10 @@
int video_channel, unsigned int reserved_transmit_bitrate_bps);
virtual int GetReceiveChannelRtcpStatistics(const int video_channel,
RtcpStatistics& basic_stats,
- int& rtt_ms) const;
+ int64_t& rtt_ms) const;
virtual int GetSendChannelRtcpStatistics(const int video_channel,
RtcpStatistics& basic_stats,
- int& rtt_ms) const;
+ int64_t& rtt_ms) const;
virtual int GetRtpStatistics(const int video_channel,
StreamDataCounters& sent,
StreamDataCounters& received) const;
@@ -124,7 +124,7 @@
virtual int GetReceiveBandwidthEstimatorStats(
const int video_channel, ReceiveBandwidthEstimatorStats* output) const;
virtual int GetPacerQueuingDelayMs(const int video_channel,
- int* delay_ms) const;
+ int64_t* delay_ms) const;
virtual int StartRTPDump(const int video_channel,
const char file_nameUTF8[1024],
RTPDirections direction);
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index 7900ac9..5b24b9b 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -101,7 +101,7 @@
// Implements BitrateObserver.
virtual void OnNetworkChanged(const uint32_t bitrate_bps,
const uint8_t fraction_lost,
- const uint32_t rtt) OVERRIDE {
+ const int64_t rtt) OVERRIDE {
// |fraction_lost| has a scale of 0 - 255.
owner_->OnNetworkChanged(bitrate_bps, fraction_lost, rtt);
}
@@ -410,7 +410,7 @@
UpdatePacketDelay(rtpHeader->header.timestamp,
rtpHeader->header.sequenceNumber);
- uint16_t round_trip_time = 0;
+ int64_t round_trip_time = 0;
_rtpRtcpModule->RTT(rtp_receiver_->SSRC(), &round_trip_time,
NULL, NULL, NULL);
@@ -1330,10 +1330,10 @@
void
Channel::OnNetworkChanged(const uint32_t bitrate_bps,
const uint8_t fraction_lost, // 0 - 255.
- const uint32_t rtt) {
+ const int64_t rtt) {
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
- "Channel::OnNetworkChanged(bitrate_bps=%d, fration_lost=%d, rtt=%d)",
- bitrate_bps, fraction_lost, rtt);
+ "Channel::OnNetworkChanged(bitrate_bps=%d, fration_lost=%d, rtt=%" PRId64
+ ")", bitrate_bps, fraction_lost, rtt);
// |fraction_lost| from BitrateObserver is short time observation of packet
// loss rate from past. We use network predictor to make a more reasonable
// loss rate estimation.
@@ -1717,7 +1717,7 @@
if (!statistician)
return false;
// Check if this is a retransmission.
- uint16_t min_rtt = 0;
+ int64_t min_rtt = 0;
_rtpRtcpModule->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL);
return !in_order &&
statistician->IsRetransmitOfOldPacket(header, min_rtt);
@@ -1745,7 +1745,7 @@
{
CriticalSectionScoped lock(ts_stats_lock_.get());
- uint16_t rtt = GetRTT();
+ int64_t rtt = GetRTT();
if (rtt == 0) {
// Waiting for valid RTT.
return 0;
@@ -3218,7 +3218,7 @@
"GetRTPStatistics() failed to get RTT");
} else {
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId, _channelId),
- "GetRTPStatistics() => rttMs=%d", stats.rttMs);
+ "GetRTPStatistics() => rttMs=%" PRId64, stats.rttMs);
}
// --- Data counters
@@ -4245,7 +4245,7 @@
return playout_frequency;
}
-int Channel::GetRTT() const {
+int64_t Channel::GetRTT() const {
RTCPMethod method = _rtpRtcpModule->RTCP();
if (method == kRtcpOff) {
return 0;
@@ -4269,15 +4269,15 @@
// the SSRC of the other end.
remoteSSRC = report_blocks[0].remoteSSRC;
}
- uint16_t rtt = 0;
- uint16_t avg_rtt = 0;
- uint16_t max_rtt= 0;
- uint16_t min_rtt = 0;
+ int64_t rtt = 0;
+ int64_t avg_rtt = 0;
+ int64_t max_rtt= 0;
+ int64_t min_rtt = 0;
if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt)
!= 0) {
return 0;
}
- return static_cast<int>(rtt);
+ return rtt;
}
} // namespace voe
diff --git a/webrtc/voice_engine/channel.h b/webrtc/voice_engine/channel.h
index 57ae563..eedd35a 100644
--- a/webrtc/voice_engine/channel.h
+++ b/webrtc/voice_engine/channel.h
@@ -457,7 +457,7 @@
// From BitrateObserver (called by the RTP/RTCP module).
void OnNetworkChanged(const uint32_t bitrate_bps,
const uint8_t fraction_lost, // 0 - 255.
- const uint32_t rtt);
+ const int64_t rtt);
private:
bool ReceivePacket(const uint8_t* packet, size_t packet_length,
@@ -481,7 +481,7 @@
unsigned char id);
int32_t GetPlayoutFrequency();
- int GetRTT() const;
+ int64_t GetRTT() const;
CriticalSectionWrapper& _fileCritSect;
CriticalSectionWrapper& _callbackCritSect;
diff --git a/webrtc/voice_engine/include/voe_rtp_rtcp.h b/webrtc/voice_engine/include/voe_rtp_rtcp.h
index 6230211..fedb134 100644
--- a/webrtc/voice_engine/include/voe_rtp_rtcp.h
+++ b/webrtc/voice_engine/include/voe_rtp_rtcp.h
@@ -68,7 +68,7 @@
unsigned int cumulativeLost;
unsigned int extendedMax;
unsigned int jitterSamples;
- int rttMs;
+ int64_t rttMs;
size_t bytesSent;
int packetsSent;
size_t bytesReceived;