Use newer version of TimeDelta and TimeStamp factories in webrtc
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Micros<\(.*\)>()/TimeDelta::Micros(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Millis<\(.*\)>()/TimeDelta::Millis(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Seconds<\(.*\)>()/TimeDelta::Seconds(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::us/TimeDelta::Micros/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::ms/TimeDelta::Millis/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::seconds/TimeDelta::Seconds/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Micros<\(.*\)>()/Timestamp::Micros(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Millis<\(.*\)>()/Timestamp::Millis(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Seconds<\(.*\)>()/Timestamp::Seconds(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::us/Timestamp::Micros/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::ms/Timestamp::Millis/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::seconds/Timestamp::Seconds/g" git cl format Bug: None Change-Id: I87469d2e4a38369654da839ab7c838215a7911e7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168402 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30491}
This commit is contained in:
parent
9b05803e19
commit
0c626afcf3
@ -101,7 +101,7 @@ struct RTPHeaderExtension {
|
|||||||
Timestamp GetAbsoluteSendTimestamp() const {
|
Timestamp GetAbsoluteSendTimestamp() const {
|
||||||
RTC_DCHECK(hasAbsoluteSendTime);
|
RTC_DCHECK(hasAbsoluteSendTime);
|
||||||
RTC_DCHECK(absoluteSendTime < (1ul << 24));
|
RTC_DCHECK(absoluteSendTime < (1ul << 24));
|
||||||
return Timestamp::us((absoluteSendTime * 1000000ll) /
|
return Timestamp::Micros((absoluteSendTime * 1000000ll) /
|
||||||
(1 << kAbsSendTimeFraction));
|
(1 << kAbsSendTimeFraction));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ struct RTPHeaderExtension {
|
|||||||
RTC_DCHECK(previous_sendtime < (1ul << 24));
|
RTC_DCHECK(previous_sendtime < (1ul << 24));
|
||||||
int32_t delta =
|
int32_t delta =
|
||||||
static_cast<int32_t>((absoluteSendTime - previous_sendtime) << 8) >> 8;
|
static_cast<int32_t>((absoluteSendTime - previous_sendtime) << 8) >> 8;
|
||||||
return TimeDelta::us((delta * 1000000ll) / (1 << kAbsSendTimeFraction));
|
return TimeDelta::Micros((delta * 1000000ll) / (1 << kAbsSendTimeFraction));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasTransmissionTimeOffset;
|
bool hasTransmissionTimeOffset;
|
||||||
|
|||||||
@ -25,7 +25,7 @@ std::unique_ptr<TimeController> CreateTimeController(
|
|||||||
|
|
||||||
std::unique_ptr<TimeController> CreateSimulatedTimeController() {
|
std::unique_ptr<TimeController> CreateSimulatedTimeController() {
|
||||||
return std::make_unique<GlobalSimulatedTimeController>(
|
return std::make_unique<GlobalSimulatedTimeController>(
|
||||||
Timestamp::seconds(10000));
|
Timestamp::Seconds(10000));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<CallFactoryInterface> CreateTimeControllerBasedCallFactory(
|
std::unique_ptr<CallFactoryInterface> CreateTimeControllerBasedCallFactory(
|
||||||
|
|||||||
@ -68,7 +68,7 @@ void FakeAlarm::Sleep(TimeDelta duration) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(CreateTimeControllerTest, CreatesNonNullController) {
|
TEST(CreateTimeControllerTest, CreatesNonNullController) {
|
||||||
FakeAlarm alarm(Timestamp::ms(100));
|
FakeAlarm alarm(Timestamp::Millis(100));
|
||||||
EXPECT_NE(CreateTimeController(&alarm), nullptr);
|
EXPECT_NE(CreateTimeController(&alarm), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -280,7 +280,7 @@ RTCError MediaTransportPair::LoopbackDatagramTransport::SendDatagram(
|
|||||||
if (sink_) {
|
if (sink_) {
|
||||||
DatagramAck ack;
|
DatagramAck ack;
|
||||||
ack.datagram_id = datagram_id;
|
ack.datagram_id = datagram_id;
|
||||||
ack.receive_timestamp = Timestamp::us(rtc::TimeMicros());
|
ack.receive_timestamp = Timestamp::Micros(rtc::TimeMicros());
|
||||||
sink_->OnDatagramAcked(ack);
|
sink_->OnDatagramAcked(ack);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -322,7 +322,7 @@ class PeerConnectionE2EQualityTestFixture {
|
|||||||
struct EchoEmulationConfig {
|
struct EchoEmulationConfig {
|
||||||
// Delay which represents the echo path delay, i.e. how soon rendered signal
|
// Delay which represents the echo path delay, i.e. how soon rendered signal
|
||||||
// should reach capturer.
|
// should reach capturer.
|
||||||
TimeDelta echo_delay = TimeDelta::ms(50);
|
TimeDelta echo_delay = TimeDelta::Millis(50);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct VideoCodecConfig {
|
struct VideoCodecConfig {
|
||||||
|
|||||||
@ -31,7 +31,7 @@ bool TimeController::Wait(const std::function<bool()>& done,
|
|||||||
// Step size is chosen to be short enough to not significantly affect latency
|
// Step size is chosen to be short enough to not significantly affect latency
|
||||||
// in real time tests while being long enough to avoid adding too much load to
|
// in real time tests while being long enough to avoid adding too much load to
|
||||||
// the system.
|
// the system.
|
||||||
const auto kStep = TimeDelta::ms(5);
|
const auto kStep = TimeDelta::Millis(5);
|
||||||
for (auto elapsed = TimeDelta::Zero(); elapsed < max_duration;
|
for (auto elapsed = TimeDelta::Zero(); elapsed < max_duration;
|
||||||
elapsed += kStep) {
|
elapsed += kStep) {
|
||||||
if (done())
|
if (done())
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class TimeController {
|
|||||||
|
|
||||||
// Waits until done() == true, polling done() in small time intervals.
|
// Waits until done() == true, polling done() in small time intervals.
|
||||||
bool Wait(const std::function<bool()>& done,
|
bool Wait(const std::function<bool()>& done,
|
||||||
TimeDelta max_duration = TimeDelta::seconds(5));
|
TimeDelta max_duration = TimeDelta::Seconds(5));
|
||||||
};
|
};
|
||||||
|
|
||||||
// Interface for telling time, scheduling an event to fire at a particular time,
|
// Interface for telling time, scheduling an event to fire at a particular time,
|
||||||
|
|||||||
@ -53,7 +53,7 @@ GoogCcNetworkControllerFactory::Create(NetworkControllerConfig config) {
|
|||||||
|
|
||||||
TimeDelta GoogCcNetworkControllerFactory::GetProcessInterval() const {
|
TimeDelta GoogCcNetworkControllerFactory::GetProcessInterval() const {
|
||||||
const int64_t kUpdateIntervalMs = 25;
|
const int64_t kUpdateIntervalMs = 25;
|
||||||
return TimeDelta::ms(kUpdateIntervalMs);
|
return TimeDelta::Millis(kUpdateIntervalMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
GoogCcFeedbackNetworkControllerFactory::GoogCcFeedbackNetworkControllerFactory(
|
GoogCcFeedbackNetworkControllerFactory::GoogCcFeedbackNetworkControllerFactory(
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class FeedbackGenerator {
|
|||||||
struct Config {
|
struct Config {
|
||||||
BuiltInNetworkBehaviorConfig send_link;
|
BuiltInNetworkBehaviorConfig send_link;
|
||||||
BuiltInNetworkBehaviorConfig return_link;
|
BuiltInNetworkBehaviorConfig return_link;
|
||||||
TimeDelta feedback_interval = TimeDelta::ms(50);
|
TimeDelta feedback_interval = TimeDelta::Millis(50);
|
||||||
DataSize feedback_packet_size = DataSize::bytes(20);
|
DataSize feedback_packet_size = DataSize::bytes(20);
|
||||||
};
|
};
|
||||||
virtual ~FeedbackGenerator() = default;
|
virtual ~FeedbackGenerator() = default;
|
||||||
|
|||||||
@ -106,7 +106,7 @@ inline constexpr DataRate operator/(const DataSize size,
|
|||||||
return DataRate::bps(data_rate_impl::Microbits(size) / duration.us());
|
return DataRate::bps(data_rate_impl::Microbits(size) / duration.us());
|
||||||
}
|
}
|
||||||
inline constexpr TimeDelta operator/(const DataSize size, const DataRate rate) {
|
inline constexpr TimeDelta operator/(const DataSize size, const DataRate rate) {
|
||||||
return TimeDelta::us(data_rate_impl::Microbits(size) / rate.bps());
|
return TimeDelta::Micros(data_rate_impl::Microbits(size) / rate.bps());
|
||||||
}
|
}
|
||||||
inline constexpr DataSize operator*(const DataRate rate,
|
inline constexpr DataSize operator*(const DataRate rate,
|
||||||
const TimeDelta duration) {
|
const TimeDelta duration) {
|
||||||
|
|||||||
@ -153,7 +153,7 @@ TEST(UnitConversionTest, DataRateAndDataSizeAndTimeDelta) {
|
|||||||
const int64_t kSeconds = 5;
|
const int64_t kSeconds = 5;
|
||||||
const int64_t kBitsPerSecond = 440;
|
const int64_t kBitsPerSecond = 440;
|
||||||
const int64_t kBytes = 44000;
|
const int64_t kBytes = 44000;
|
||||||
const TimeDelta delta_a = TimeDelta::seconds(kSeconds);
|
const TimeDelta delta_a = TimeDelta::Seconds(kSeconds);
|
||||||
const DataRate rate_b = DataRate::bps(kBitsPerSecond);
|
const DataRate rate_b = DataRate::bps(kBitsPerSecond);
|
||||||
const DataSize size_c = DataSize::bytes(kBytes);
|
const DataSize size_c = DataSize::bytes(kBytes);
|
||||||
EXPECT_EQ((delta_a * rate_b).bytes(), kSeconds * kBitsPerSecond / 8);
|
EXPECT_EQ((delta_a * rate_b).bytes(), kSeconds * kBitsPerSecond / 8);
|
||||||
@ -183,7 +183,7 @@ TEST(UnitConversionTest, DivisionFailsOnLargeSize) {
|
|||||||
std::numeric_limits<int64_t>::max() / 8000000;
|
std::numeric_limits<int64_t>::max() / 8000000;
|
||||||
const DataSize large_size = DataSize::bytes(kJustSmallEnoughForDivision);
|
const DataSize large_size = DataSize::bytes(kJustSmallEnoughForDivision);
|
||||||
const DataRate data_rate = DataRate::kbps(100);
|
const DataRate data_rate = DataRate::kbps(100);
|
||||||
const TimeDelta time_delta = TimeDelta::ms(100);
|
const TimeDelta time_delta = TimeDelta::Millis(100);
|
||||||
EXPECT_TRUE((large_size / data_rate).IsFinite());
|
EXPECT_TRUE((large_size / data_rate).IsFinite());
|
||||||
EXPECT_TRUE((large_size / time_delta).IsFinite());
|
EXPECT_TRUE((large_size / time_delta).IsFinite());
|
||||||
#if GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) && RTC_DCHECK_IS_ON
|
#if GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) && RTC_DCHECK_IS_ON
|
||||||
|
|||||||
@ -76,7 +76,7 @@ inline constexpr TimeDelta operator/(int64_t nominator,
|
|||||||
RTC_DCHECK_LE(nominator, std::numeric_limits<int64_t>::max() / kMegaPerMilli);
|
RTC_DCHECK_LE(nominator, std::numeric_limits<int64_t>::max() / kMegaPerMilli);
|
||||||
RTC_CHECK(frequency.IsFinite());
|
RTC_CHECK(frequency.IsFinite());
|
||||||
RTC_CHECK(!frequency.IsZero());
|
RTC_CHECK(!frequency.IsZero());
|
||||||
return TimeDelta::us(nominator * kMegaPerMilli / frequency.millihertz());
|
return TimeDelta::Micros(nominator * kMegaPerMilli / frequency.millihertz());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline constexpr double operator*(Frequency frequency, TimeDelta time_delta) {
|
inline constexpr double operator*(Frequency frequency, TimeDelta time_delta) {
|
||||||
|
|||||||
@ -152,9 +152,9 @@ TEST(FrequencyTest, InfinityOperations) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(UnitConversionTest, TimeDeltaAndFrequency) {
|
TEST(UnitConversionTest, TimeDeltaAndFrequency) {
|
||||||
EXPECT_EQ(1 / Frequency::hertz(50), TimeDelta::ms(20));
|
EXPECT_EQ(1 / Frequency::hertz(50), TimeDelta::Millis(20));
|
||||||
EXPECT_EQ(1 / TimeDelta::ms(20), Frequency::hertz(50));
|
EXPECT_EQ(1 / TimeDelta::Millis(20), Frequency::hertz(50));
|
||||||
EXPECT_EQ(Frequency::kHz(200) * TimeDelta::ms(2), 400.0);
|
EXPECT_EQ(Frequency::kHz(200) * TimeDelta::Millis(2), 400.0);
|
||||||
}
|
}
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -107,7 +107,7 @@ class TimeDelta final : public rtc_units_impl::RelativeUnit<TimeDelta> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constexpr TimeDelta Abs() const {
|
constexpr TimeDelta Abs() const {
|
||||||
return us() < 0 ? TimeDelta::us(-us()) : *this;
|
return us() < 0 ? TimeDelta::Micros(-us()) : *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -109,7 +109,7 @@ class Timestamp final : public rtc_units_impl::UnitBase<Timestamp> {
|
|||||||
RTC_DCHECK(!delta.IsPlusInfinity());
|
RTC_DCHECK(!delta.IsPlusInfinity());
|
||||||
return MinusInfinity();
|
return MinusInfinity();
|
||||||
}
|
}
|
||||||
return Timestamp::us(us() + delta.us());
|
return Timestamp::Micros(us() + delta.us());
|
||||||
}
|
}
|
||||||
constexpr Timestamp operator-(const TimeDelta delta) const {
|
constexpr Timestamp operator-(const TimeDelta delta) const {
|
||||||
if (IsPlusInfinity() || delta.IsMinusInfinity()) {
|
if (IsPlusInfinity() || delta.IsMinusInfinity()) {
|
||||||
@ -121,7 +121,7 @@ class Timestamp final : public rtc_units_impl::UnitBase<Timestamp> {
|
|||||||
RTC_DCHECK(!delta.IsMinusInfinity());
|
RTC_DCHECK(!delta.IsMinusInfinity());
|
||||||
return MinusInfinity();
|
return MinusInfinity();
|
||||||
}
|
}
|
||||||
return Timestamp::us(us() - delta.us());
|
return Timestamp::Micros(us() - delta.us());
|
||||||
}
|
}
|
||||||
constexpr TimeDelta operator-(const Timestamp other) const {
|
constexpr TimeDelta operator-(const Timestamp other) const {
|
||||||
if (IsPlusInfinity() || other.IsMinusInfinity()) {
|
if (IsPlusInfinity() || other.IsMinusInfinity()) {
|
||||||
@ -133,7 +133,7 @@ class Timestamp final : public rtc_units_impl::UnitBase<Timestamp> {
|
|||||||
RTC_DCHECK(!other.IsMinusInfinity());
|
RTC_DCHECK(!other.IsMinusInfinity());
|
||||||
return TimeDelta::MinusInfinity();
|
return TimeDelta::MinusInfinity();
|
||||||
}
|
}
|
||||||
return TimeDelta::us(us() - other.us());
|
return TimeDelta::Micros(us() - other.us());
|
||||||
}
|
}
|
||||||
constexpr Timestamp& operator-=(const TimeDelta delta) {
|
constexpr Timestamp& operator-=(const TimeDelta delta) {
|
||||||
*this = *this - delta;
|
*this = *this - delta;
|
||||||
|
|||||||
@ -422,7 +422,7 @@ class ForcedFallbackTest : public VideoEncoderSoftwareFallbackWrapperTest {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
clock_.SetTime(Timestamp::us(1234));
|
clock_.SetTime(Timestamp::Micros(1234));
|
||||||
ConfigureVp8Codec();
|
ConfigureVp8Codec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -802,7 +802,7 @@ void AudioSendStream::ConfigureBitrateObserver() {
|
|||||||
if (use_legacy_overhead_calculation_) {
|
if (use_legacy_overhead_calculation_) {
|
||||||
// OverheadPerPacket = Ipv4(20B) + UDP(8B) + SRTP(10B) + RTP(12)
|
// OverheadPerPacket = Ipv4(20B) + UDP(8B) + SRTP(10B) + RTP(12)
|
||||||
constexpr int kOverheadPerPacket = 20 + 8 + 10 + 12;
|
constexpr int kOverheadPerPacket = 20 + 8 + 10 + 12;
|
||||||
const TimeDelta kMinPacketDuration = TimeDelta::ms(20);
|
const TimeDelta kMinPacketDuration = TimeDelta::Millis(20);
|
||||||
DataRate max_overhead =
|
DataRate max_overhead =
|
||||||
DataSize::bytes(kOverheadPerPacket) / kMinPacketDuration;
|
DataSize::bytes(kOverheadPerPacket) / kMinPacketDuration;
|
||||||
priority_bitrate += max_overhead;
|
priority_bitrate += max_overhead;
|
||||||
@ -858,7 +858,7 @@ AudioSendStream::GetMinMaxBitrateConstraints() const {
|
|||||||
// OverheadPerPacket = Ipv4(20B) + UDP(8B) + SRTP(10B) + RTP(12)
|
// OverheadPerPacket = Ipv4(20B) + UDP(8B) + SRTP(10B) + RTP(12)
|
||||||
const DataSize kOverheadPerPacket = DataSize::bytes(20 + 8 + 10 + 12);
|
const DataSize kOverheadPerPacket = DataSize::bytes(20 + 8 + 10 + 12);
|
||||||
const TimeDelta kMaxFrameLength =
|
const TimeDelta kMaxFrameLength =
|
||||||
TimeDelta::ms(60); // Based on Opus spec
|
TimeDelta::Millis(60); // Based on Opus spec
|
||||||
const DataRate kMinOverhead = kOverheadPerPacket / kMaxFrameLength;
|
const DataRate kMinOverhead = kOverheadPerPacket / kMaxFrameLength;
|
||||||
constraints.min += kMinOverhead;
|
constraints.min += kMinOverhead;
|
||||||
constraints.max += kMinOverhead;
|
constraints.max += kMinOverhead;
|
||||||
|
|||||||
@ -83,8 +83,8 @@ const AudioCodecSpec kCodecSpecs[] = {
|
|||||||
// should be made more precise in the future. This can be changed when that
|
// should be made more precise in the future. This can be changed when that
|
||||||
// logic is more accurate.
|
// logic is more accurate.
|
||||||
const DataSize kOverheadPerPacket = DataSize::bytes(20 + 8 + 10 + 12);
|
const DataSize kOverheadPerPacket = DataSize::bytes(20 + 8 + 10 + 12);
|
||||||
const TimeDelta kMinFrameLength = TimeDelta::ms(20);
|
const TimeDelta kMinFrameLength = TimeDelta::Millis(20);
|
||||||
const TimeDelta kMaxFrameLength = TimeDelta::ms(120);
|
const TimeDelta kMaxFrameLength = TimeDelta::Millis(120);
|
||||||
const DataRate kMinOverheadRate = kOverheadPerPacket / kMaxFrameLength;
|
const DataRate kMinOverheadRate = kOverheadPerPacket / kMaxFrameLength;
|
||||||
const DataRate kMaxOverheadRate = kOverheadPerPacket / kMinFrameLength;
|
const DataRate kMaxOverheadRate = kOverheadPerPacket / kMinFrameLength;
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ std::unique_ptr<MockAudioEncoder> SetupAudioEncoderMock(
|
|||||||
.WillByDefault(Return(spec.format.clockrate_hz));
|
.WillByDefault(Return(spec.format.clockrate_hz));
|
||||||
ON_CALL(*encoder.get(), GetFrameLengthRange())
|
ON_CALL(*encoder.get(), GetFrameLengthRange())
|
||||||
.WillByDefault(Return(absl::optional<std::pair<TimeDelta, TimeDelta>>{
|
.WillByDefault(Return(absl::optional<std::pair<TimeDelta, TimeDelta>>{
|
||||||
{TimeDelta::ms(20), TimeDelta::ms(120)}}));
|
{TimeDelta::Millis(20), TimeDelta::Millis(120)}}));
|
||||||
return encoder;
|
return encoder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -555,8 +555,8 @@ TEST(AudioSendStreamTest, DoesNotPassHigherBitrateThanMaxBitrate) {
|
|||||||
BitrateAllocationUpdate update;
|
BitrateAllocationUpdate update;
|
||||||
update.target_bitrate = DataRate::bps(helper.config().max_bitrate_bps + 5000);
|
update.target_bitrate = DataRate::bps(helper.config().max_bitrate_bps + 5000);
|
||||||
update.packet_loss_ratio = 0;
|
update.packet_loss_ratio = 0;
|
||||||
update.round_trip_time = TimeDelta::ms(50);
|
update.round_trip_time = TimeDelta::Millis(50);
|
||||||
update.bwe_period = TimeDelta::ms(6000);
|
update.bwe_period = TimeDelta::Millis(6000);
|
||||||
helper.worker()->SendTask([&] { send_stream->OnBitrateUpdated(update); },
|
helper.worker()->SendTask([&] { send_stream->OnBitrateUpdated(update); },
|
||||||
RTC_FROM_HERE);
|
RTC_FROM_HERE);
|
||||||
}
|
}
|
||||||
@ -673,12 +673,12 @@ TEST(AudioSendStreamTest, ProbingIntervalOnBitrateUpdated) {
|
|||||||
|
|
||||||
EXPECT_CALL(*helper.channel_send(),
|
EXPECT_CALL(*helper.channel_send(),
|
||||||
OnBitrateAllocation(Field(&BitrateAllocationUpdate::bwe_period,
|
OnBitrateAllocation(Field(&BitrateAllocationUpdate::bwe_period,
|
||||||
Eq(TimeDelta::ms(5000)))));
|
Eq(TimeDelta::Millis(5000)))));
|
||||||
BitrateAllocationUpdate update;
|
BitrateAllocationUpdate update;
|
||||||
update.target_bitrate = DataRate::bps(helper.config().max_bitrate_bps + 5000);
|
update.target_bitrate = DataRate::bps(helper.config().max_bitrate_bps + 5000);
|
||||||
update.packet_loss_ratio = 0;
|
update.packet_loss_ratio = 0;
|
||||||
update.round_trip_time = TimeDelta::ms(50);
|
update.round_trip_time = TimeDelta::Millis(50);
|
||||||
update.bwe_period = TimeDelta::ms(5000);
|
update.bwe_period = TimeDelta::Millis(5000);
|
||||||
helper.worker()->SendTask([&] { send_stream->OnBitrateUpdated(update); },
|
helper.worker()->SendTask([&] { send_stream->OnBitrateUpdated(update); },
|
||||||
RTC_FROM_HERE);
|
RTC_FROM_HERE);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -140,7 +140,7 @@ TEST(PCLowBandwidthAudioTest, PCGoodNetworkHighBitrate) {
|
|||||||
alice->SetAudioConfig(std::move(audio));
|
alice->SetAudioConfig(std::move(audio));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
fixture->Run(RunParams(TimeDelta::ms(
|
fixture->Run(RunParams(TimeDelta::Millis(
|
||||||
absl::GetFlag(FLAGS_quick) ? kQuickTestDurationMs : kTestDurationMs)));
|
absl::GetFlag(FLAGS_quick) ? kQuickTestDurationMs : kTestDurationMs)));
|
||||||
LogTestResults();
|
LogTestResults();
|
||||||
}
|
}
|
||||||
@ -166,7 +166,7 @@ TEST(PCLowBandwidthAudioTest, PC40kbpsNetwork) {
|
|||||||
alice->SetAudioConfig(std::move(audio));
|
alice->SetAudioConfig(std::move(audio));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
fixture->Run(RunParams(TimeDelta::ms(
|
fixture->Run(RunParams(TimeDelta::Millis(
|
||||||
absl::GetFlag(FLAGS_quick) ? kQuickTestDurationMs : kTestDurationMs)));
|
absl::GetFlag(FLAGS_quick) ? kQuickTestDurationMs : kTestDurationMs)));
|
||||||
LogTestResults();
|
LogTestResults();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -407,8 +407,8 @@ void BitrateAllocator::OnNetworkEstimateChanged(TargetTransferRate msg) {
|
|||||||
update.target_bitrate = DataRate::bps(allocated_bitrate);
|
update.target_bitrate = DataRate::bps(allocated_bitrate);
|
||||||
update.stable_target_bitrate = DataRate::bps(allocated_stable_target_rate);
|
update.stable_target_bitrate = DataRate::bps(allocated_stable_target_rate);
|
||||||
update.packet_loss_ratio = last_fraction_loss_ / 256.0;
|
update.packet_loss_ratio = last_fraction_loss_ / 256.0;
|
||||||
update.round_trip_time = TimeDelta::ms(last_rtt_);
|
update.round_trip_time = TimeDelta::Millis(last_rtt_);
|
||||||
update.bwe_period = TimeDelta::ms(last_bwe_period_ms_);
|
update.bwe_period = TimeDelta::Millis(last_bwe_period_ms_);
|
||||||
update.cwnd_reduce_ratio = msg.cwnd_reduce_ratio;
|
update.cwnd_reduce_ratio = msg.cwnd_reduce_ratio;
|
||||||
uint32_t protection_bitrate = config.observer->OnBitrateUpdated(update);
|
uint32_t protection_bitrate = config.observer->OnBitrateUpdated(update);
|
||||||
|
|
||||||
@ -472,8 +472,8 @@ void BitrateAllocator::AddObserver(BitrateAllocatorObserver* observer,
|
|||||||
update.target_bitrate = DataRate::bps(allocated_bitrate);
|
update.target_bitrate = DataRate::bps(allocated_bitrate);
|
||||||
update.stable_target_bitrate = DataRate::bps(allocated_stable_bitrate);
|
update.stable_target_bitrate = DataRate::bps(allocated_stable_bitrate);
|
||||||
update.packet_loss_ratio = last_fraction_loss_ / 256.0;
|
update.packet_loss_ratio = last_fraction_loss_ / 256.0;
|
||||||
update.round_trip_time = TimeDelta::ms(last_rtt_);
|
update.round_trip_time = TimeDelta::Millis(last_rtt_);
|
||||||
update.bwe_period = TimeDelta::ms(last_bwe_period_ms_);
|
update.bwe_period = TimeDelta::Millis(last_bwe_period_ms_);
|
||||||
uint32_t protection_bitrate = config.observer->OnBitrateUpdated(update);
|
uint32_t protection_bitrate = config.observer->OnBitrateUpdated(update);
|
||||||
config.allocated_bitrate_bps = allocated_bitrate;
|
config.allocated_bitrate_bps = allocated_bitrate;
|
||||||
if (allocated_bitrate > 0)
|
if (allocated_bitrate > 0)
|
||||||
@ -488,8 +488,8 @@ void BitrateAllocator::AddObserver(BitrateAllocatorObserver* observer,
|
|||||||
update.target_bitrate = DataRate::Zero();
|
update.target_bitrate = DataRate::Zero();
|
||||||
update.stable_target_bitrate = DataRate::Zero();
|
update.stable_target_bitrate = DataRate::Zero();
|
||||||
update.packet_loss_ratio = last_fraction_loss_ / 256.0;
|
update.packet_loss_ratio = last_fraction_loss_ / 256.0;
|
||||||
update.round_trip_time = TimeDelta::ms(last_rtt_);
|
update.round_trip_time = TimeDelta::Millis(last_rtt_);
|
||||||
update.bwe_period = TimeDelta::ms(last_bwe_period_ms_);
|
update.bwe_period = TimeDelta::Millis(last_bwe_period_ms_);
|
||||||
observer->OnBitrateUpdated(update);
|
observer->OnBitrateUpdated(update);
|
||||||
}
|
}
|
||||||
UpdateAllocationLimits();
|
UpdateAllocationLimits();
|
||||||
|
|||||||
@ -88,13 +88,13 @@ TargetTransferRate CreateTargetRateMessage(uint32_t target_bitrate_bps,
|
|||||||
TargetTransferRate msg;
|
TargetTransferRate msg;
|
||||||
// The timestamp is just for log output, keeping it fixed just means fewer log
|
// The timestamp is just for log output, keeping it fixed just means fewer log
|
||||||
// messages in the test.
|
// messages in the test.
|
||||||
msg.at_time = Timestamp::seconds(10000);
|
msg.at_time = Timestamp::Seconds(10000);
|
||||||
msg.target_rate = DataRate::bps(target_bitrate_bps);
|
msg.target_rate = DataRate::bps(target_bitrate_bps);
|
||||||
msg.stable_target_rate = msg.target_rate;
|
msg.stable_target_rate = msg.target_rate;
|
||||||
msg.network_estimate.bandwidth = msg.target_rate;
|
msg.network_estimate.bandwidth = msg.target_rate;
|
||||||
msg.network_estimate.loss_rate_ratio = fraction_loss / 255.0;
|
msg.network_estimate.loss_rate_ratio = fraction_loss / 255.0;
|
||||||
msg.network_estimate.round_trip_time = TimeDelta::ms(rtt_ms);
|
msg.network_estimate.round_trip_time = TimeDelta::Millis(rtt_ms);
|
||||||
msg.network_estimate.bwe_period = TimeDelta::ms(bwe_period_ms);
|
msg.network_estimate.bwe_period = TimeDelta::Millis(bwe_period_ms);
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@ -1352,7 +1352,7 @@ void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet,
|
|||||||
|
|
||||||
ReceivedPacket packet_msg;
|
ReceivedPacket packet_msg;
|
||||||
packet_msg.size = DataSize::bytes(packet.payload_size());
|
packet_msg.size = DataSize::bytes(packet.payload_size());
|
||||||
packet_msg.receive_time = Timestamp::ms(packet.arrival_time_ms());
|
packet_msg.receive_time = Timestamp::Millis(packet.arrival_time_ms());
|
||||||
if (header.extension.hasAbsoluteSendTime) {
|
if (header.extension.hasAbsoluteSendTime) {
|
||||||
packet_msg.send_time = header.extension.GetAbsoluteSendTimestamp();
|
packet_msg.send_time = header.extension.GetAbsoluteSendTimestamp();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ ABSL_FLAG(std::string,
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr TimeDelta kPollInterval = TimeDelta::Millis<20>();
|
constexpr TimeDelta kPollInterval = TimeDelta::Millis(20);
|
||||||
static const int kExpectedHighVideoBitrateBps = 80000;
|
static const int kExpectedHighVideoBitrateBps = 80000;
|
||||||
static const int kExpectedHighAudioBitrateBps = 30000;
|
static const int kExpectedHighAudioBitrateBps = 30000;
|
||||||
static const int kLowBandwidthLimitBps = 20000;
|
static const int kLowBandwidthLimitBps = 20000;
|
||||||
|
|||||||
@ -26,10 +26,10 @@ const char kBweReceiveTimeCorrection[] = "WebRTC-Bwe-ReceiveTimeFix";
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
ReceiveTimeCalculatorConfig::ReceiveTimeCalculatorConfig()
|
ReceiveTimeCalculatorConfig::ReceiveTimeCalculatorConfig()
|
||||||
: max_packet_time_repair("maxrep", TimeDelta::ms(2000)),
|
: max_packet_time_repair("maxrep", TimeDelta::Millis(2000)),
|
||||||
stall_threshold("stall", TimeDelta::ms(5)),
|
stall_threshold("stall", TimeDelta::Millis(5)),
|
||||||
tolerance("tol", TimeDelta::ms(1)),
|
tolerance("tol", TimeDelta::Millis(1)),
|
||||||
max_stall("maxstall", TimeDelta::seconds(5)) {
|
max_stall("maxstall", TimeDelta::Seconds(5)) {
|
||||||
std::string trial_string =
|
std::string trial_string =
|
||||||
field_trial::FindFullName(kBweReceiveTimeCorrection);
|
field_trial::FindFullName(kBweReceiveTimeCorrection);
|
||||||
ParseFieldTrial(
|
ParseFieldTrial(
|
||||||
|
|||||||
@ -32,14 +32,14 @@ namespace {
|
|||||||
static const int64_t kRetransmitWindowSizeMs = 500;
|
static const int64_t kRetransmitWindowSizeMs = 500;
|
||||||
static const size_t kMaxOverheadBytes = 500;
|
static const size_t kMaxOverheadBytes = 500;
|
||||||
|
|
||||||
constexpr TimeDelta kPacerQueueUpdateInterval = TimeDelta::Millis<25>();
|
constexpr TimeDelta kPacerQueueUpdateInterval = TimeDelta::Millis(25);
|
||||||
|
|
||||||
TargetRateConstraints ConvertConstraints(int min_bitrate_bps,
|
TargetRateConstraints ConvertConstraints(int min_bitrate_bps,
|
||||||
int max_bitrate_bps,
|
int max_bitrate_bps,
|
||||||
int start_bitrate_bps,
|
int start_bitrate_bps,
|
||||||
Clock* clock) {
|
Clock* clock) {
|
||||||
TargetRateConstraints msg;
|
TargetRateConstraints msg;
|
||||||
msg.at_time = Timestamp::ms(clock->TimeInMilliseconds());
|
msg.at_time = Timestamp::Millis(clock->TimeInMilliseconds());
|
||||||
msg.min_data_rate =
|
msg.min_data_rate =
|
||||||
min_bitrate_bps >= 0 ? DataRate::bps(min_bitrate_bps) : DataRate::Zero();
|
min_bitrate_bps >= 0 ? DataRate::bps(min_bitrate_bps) : DataRate::Zero();
|
||||||
msg.max_data_rate = max_bitrate_bps > 0 ? DataRate::bps(max_bitrate_bps)
|
msg.max_data_rate = max_bitrate_bps > 0 ? DataRate::bps(max_bitrate_bps)
|
||||||
@ -96,7 +96,7 @@ RtpTransportControllerSend::RtpTransportControllerSend(
|
|||||||
controller_factory_fallback_(
|
controller_factory_fallback_(
|
||||||
std::make_unique<GoogCcNetworkControllerFactory>(predictor_factory)),
|
std::make_unique<GoogCcNetworkControllerFactory>(predictor_factory)),
|
||||||
process_interval_(controller_factory_fallback_->GetProcessInterval()),
|
process_interval_(controller_factory_fallback_->GetProcessInterval()),
|
||||||
last_report_block_time_(Timestamp::ms(clock_->TimeInMilliseconds())),
|
last_report_block_time_(Timestamp::Millis(clock_->TimeInMilliseconds())),
|
||||||
reset_feedback_on_route_change_(
|
reset_feedback_on_route_change_(
|
||||||
!IsEnabled(trials, "WebRTC-Bwe-NoFeedbackReset")),
|
!IsEnabled(trials, "WebRTC-Bwe-NoFeedbackReset")),
|
||||||
send_side_bwe_with_overhead_(
|
send_side_bwe_with_overhead_(
|
||||||
@ -225,7 +225,7 @@ void RtpTransportControllerSend::SetPacingFactor(float pacing_factor) {
|
|||||||
UpdateStreamsConfig();
|
UpdateStreamsConfig();
|
||||||
}
|
}
|
||||||
void RtpTransportControllerSend::SetQueueTimeLimit(int limit_ms) {
|
void RtpTransportControllerSend::SetQueueTimeLimit(int limit_ms) {
|
||||||
pacer()->SetQueueTimeLimit(TimeDelta::ms(limit_ms));
|
pacer()->SetQueueTimeLimit(TimeDelta::Millis(limit_ms));
|
||||||
}
|
}
|
||||||
StreamFeedbackProvider*
|
StreamFeedbackProvider*
|
||||||
RtpTransportControllerSend::GetStreamFeedbackProvider() {
|
RtpTransportControllerSend::GetStreamFeedbackProvider() {
|
||||||
@ -284,7 +284,7 @@ void RtpTransportControllerSend::OnNetworkRouteChanged(
|
|||||||
network_route.connected, network_route.packet_overhead));
|
network_route.connected, network_route.packet_overhead));
|
||||||
}
|
}
|
||||||
NetworkRouteChange msg;
|
NetworkRouteChange msg;
|
||||||
msg.at_time = Timestamp::ms(clock_->TimeInMilliseconds());
|
msg.at_time = Timestamp::Millis(clock_->TimeInMilliseconds());
|
||||||
msg.constraints = ConvertConstraints(bitrate_config, clock_);
|
msg.constraints = ConvertConstraints(bitrate_config, clock_);
|
||||||
task_queue_.PostTask([this, msg, network_route] {
|
task_queue_.PostTask([this, msg, network_route] {
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_);
|
RTC_DCHECK_RUN_ON(&task_queue_);
|
||||||
@ -306,7 +306,7 @@ void RtpTransportControllerSend::OnNetworkAvailability(bool network_available) {
|
|||||||
RTC_LOG(LS_VERBOSE) << "SignalNetworkState "
|
RTC_LOG(LS_VERBOSE) << "SignalNetworkState "
|
||||||
<< (network_available ? "Up" : "Down");
|
<< (network_available ? "Up" : "Down");
|
||||||
NetworkAvailability msg;
|
NetworkAvailability msg;
|
||||||
msg.at_time = Timestamp::ms(clock_->TimeInMilliseconds());
|
msg.at_time = Timestamp::Millis(clock_->TimeInMilliseconds());
|
||||||
msg.network_available = network_available;
|
msg.network_available = network_available;
|
||||||
task_queue_.PostTask([this, msg]() {
|
task_queue_.PostTask([this, msg]() {
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_);
|
RTC_DCHECK_RUN_ON(&task_queue_);
|
||||||
@ -443,7 +443,7 @@ void RtpTransportControllerSend::IncludeOverheadInPacedSender() {
|
|||||||
|
|
||||||
void RtpTransportControllerSend::OnReceivedEstimatedBitrate(uint32_t bitrate) {
|
void RtpTransportControllerSend::OnReceivedEstimatedBitrate(uint32_t bitrate) {
|
||||||
RemoteBitrateReport msg;
|
RemoteBitrateReport msg;
|
||||||
msg.receive_time = Timestamp::ms(clock_->TimeInMilliseconds());
|
msg.receive_time = Timestamp::Millis(clock_->TimeInMilliseconds());
|
||||||
msg.bandwidth = DataRate::bps(bitrate);
|
msg.bandwidth = DataRate::bps(bitrate);
|
||||||
task_queue_.PostTask([this, msg]() {
|
task_queue_.PostTask([this, msg]() {
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_);
|
RTC_DCHECK_RUN_ON(&task_queue_);
|
||||||
@ -464,8 +464,8 @@ void RtpTransportControllerSend::OnReceivedRtcpReceiverReport(
|
|||||||
task_queue_.PostTask([this, now_ms, rtt_ms]() {
|
task_queue_.PostTask([this, now_ms, rtt_ms]() {
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_);
|
RTC_DCHECK_RUN_ON(&task_queue_);
|
||||||
RoundTripTimeUpdate report;
|
RoundTripTimeUpdate report;
|
||||||
report.receive_time = Timestamp::ms(now_ms);
|
report.receive_time = Timestamp::Millis(now_ms);
|
||||||
report.round_trip_time = TimeDelta::ms(rtt_ms);
|
report.round_trip_time = TimeDelta::Millis(rtt_ms);
|
||||||
report.smoothed = false;
|
report.smoothed = false;
|
||||||
if (controller_ && !report.round_trip_time.IsZero())
|
if (controller_ && !report.round_trip_time.IsZero())
|
||||||
PostUpdates(controller_->OnRoundTripTimeUpdate(report));
|
PostUpdates(controller_->OnRoundTripTimeUpdate(report));
|
||||||
@ -476,7 +476,7 @@ void RtpTransportControllerSend::OnAddPacket(
|
|||||||
const RtpPacketSendInfo& packet_info) {
|
const RtpPacketSendInfo& packet_info) {
|
||||||
feedback_demuxer_.AddPacket(packet_info);
|
feedback_demuxer_.AddPacket(packet_info);
|
||||||
|
|
||||||
Timestamp creation_time = Timestamp::ms(clock_->TimeInMilliseconds());
|
Timestamp creation_time = Timestamp::Millis(clock_->TimeInMilliseconds());
|
||||||
task_queue_.PostTask([this, packet_info, creation_time]() {
|
task_queue_.PostTask([this, packet_info, creation_time]() {
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_);
|
RTC_DCHECK_RUN_ON(&task_queue_);
|
||||||
transport_feedback_adapter_.AddPacket(
|
transport_feedback_adapter_.AddPacket(
|
||||||
@ -489,7 +489,7 @@ void RtpTransportControllerSend::OnAddPacket(
|
|||||||
void RtpTransportControllerSend::OnTransportFeedback(
|
void RtpTransportControllerSend::OnTransportFeedback(
|
||||||
const rtcp::TransportFeedback& feedback) {
|
const rtcp::TransportFeedback& feedback) {
|
||||||
feedback_demuxer_.OnTransportFeedback(feedback);
|
feedback_demuxer_.OnTransportFeedback(feedback);
|
||||||
auto feedback_time = Timestamp::ms(clock_->TimeInMilliseconds());
|
auto feedback_time = Timestamp::Millis(clock_->TimeInMilliseconds());
|
||||||
task_queue_.PostTask([this, feedback, feedback_time]() {
|
task_queue_.PostTask([this, feedback, feedback_time]() {
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_);
|
RTC_DCHECK_RUN_ON(&task_queue_);
|
||||||
absl::optional<TransportPacketsFeedback> feedback_msg =
|
absl::optional<TransportPacketsFeedback> feedback_msg =
|
||||||
@ -509,7 +509,7 @@ void RtpTransportControllerSend::OnRemoteNetworkEstimate(
|
|||||||
event_log_->Log(std::make_unique<RtcEventRemoteEstimate>(
|
event_log_->Log(std::make_unique<RtcEventRemoteEstimate>(
|
||||||
estimate.link_capacity_lower, estimate.link_capacity_upper));
|
estimate.link_capacity_lower, estimate.link_capacity_upper));
|
||||||
}
|
}
|
||||||
estimate.update_time = Timestamp::ms(clock_->TimeInMilliseconds());
|
estimate.update_time = Timestamp::Millis(clock_->TimeInMilliseconds());
|
||||||
task_queue_.PostTask([this, estimate] {
|
task_queue_.PostTask([this, estimate] {
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_);
|
RTC_DCHECK_RUN_ON(&task_queue_);
|
||||||
if (controller_)
|
if (controller_)
|
||||||
@ -526,7 +526,7 @@ void RtpTransportControllerSend::MaybeCreateControllers() {
|
|||||||
control_handler_ = std::make_unique<CongestionControlHandler>();
|
control_handler_ = std::make_unique<CongestionControlHandler>();
|
||||||
|
|
||||||
initial_config_.constraints.at_time =
|
initial_config_.constraints.at_time =
|
||||||
Timestamp::ms(clock_->TimeInMilliseconds());
|
Timestamp::Millis(clock_->TimeInMilliseconds());
|
||||||
initial_config_.stream_based_config = streams_config_;
|
initial_config_.stream_based_config = streams_config_;
|
||||||
|
|
||||||
// TODO(srte): Use fallback controller if no feedback is available.
|
// TODO(srte): Use fallback controller if no feedback is available.
|
||||||
@ -576,14 +576,14 @@ void RtpTransportControllerSend::StartProcessPeriodicTasks() {
|
|||||||
void RtpTransportControllerSend::UpdateControllerWithTimeInterval() {
|
void RtpTransportControllerSend::UpdateControllerWithTimeInterval() {
|
||||||
RTC_DCHECK(controller_);
|
RTC_DCHECK(controller_);
|
||||||
ProcessInterval msg;
|
ProcessInterval msg;
|
||||||
msg.at_time = Timestamp::ms(clock_->TimeInMilliseconds());
|
msg.at_time = Timestamp::Millis(clock_->TimeInMilliseconds());
|
||||||
if (add_pacing_to_cwin_)
|
if (add_pacing_to_cwin_)
|
||||||
msg.pacer_queue = pacer()->QueueSizeData();
|
msg.pacer_queue = pacer()->QueueSizeData();
|
||||||
PostUpdates(controller_->OnProcessInterval(msg));
|
PostUpdates(controller_->OnProcessInterval(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtpTransportControllerSend::UpdateStreamsConfig() {
|
void RtpTransportControllerSend::UpdateStreamsConfig() {
|
||||||
streams_config_.at_time = Timestamp::ms(clock_->TimeInMilliseconds());
|
streams_config_.at_time = Timestamp::Millis(clock_->TimeInMilliseconds());
|
||||||
if (controller_)
|
if (controller_)
|
||||||
PostUpdates(controller_->OnStreamsConfig(streams_config_));
|
PostUpdates(controller_->OnStreamsConfig(streams_config_));
|
||||||
}
|
}
|
||||||
@ -637,7 +637,7 @@ void RtpTransportControllerSend::OnReceivedRtcpReceiverReportBlocks(
|
|||||||
|
|
||||||
if (packets_received_delta < 1)
|
if (packets_received_delta < 1)
|
||||||
return;
|
return;
|
||||||
Timestamp now = Timestamp::ms(now_ms);
|
Timestamp now = Timestamp::Millis(now_ms);
|
||||||
TransportLossReport msg;
|
TransportLossReport msg;
|
||||||
msg.packets_lost_delta = total_packets_lost_delta;
|
msg.packets_lost_delta = total_packets_lost_delta;
|
||||||
msg.packets_received_delta = packets_received_delta;
|
msg.packets_received_delta = packets_received_delta;
|
||||||
|
|||||||
@ -116,7 +116,7 @@ class RtpVideoSenderTestFixture {
|
|||||||
int payload_type,
|
int payload_type,
|
||||||
const std::map<uint32_t, RtpPayloadState>& suspended_payload_states,
|
const std::map<uint32_t, RtpPayloadState>& suspended_payload_states,
|
||||||
FrameCountObserver* frame_count_observer)
|
FrameCountObserver* frame_count_observer)
|
||||||
: time_controller_(Timestamp::ms(1000000)),
|
: time_controller_(Timestamp::Millis(1000000)),
|
||||||
config_(CreateVideoSendStreamConfig(&transport_,
|
config_(CreateVideoSendStreamConfig(&transport_,
|
||||||
ssrcs,
|
ssrcs,
|
||||||
rtx_ssrcs,
|
rtx_ssrcs,
|
||||||
@ -433,7 +433,7 @@ TEST(RtpVideoSenderTest, DoesNotRetrasmitAckedPackets) {
|
|||||||
EncodedImageCallback::Result::OK,
|
EncodedImageCallback::Result::OK,
|
||||||
test.router()->OnEncodedImage(encoded_image, nullptr, nullptr).error);
|
test.router()->OnEncodedImage(encoded_image, nullptr, nullptr).error);
|
||||||
|
|
||||||
test.AdvanceTime(TimeDelta::ms(33));
|
test.AdvanceTime(TimeDelta::Millis(33));
|
||||||
|
|
||||||
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
||||||
|
|
||||||
@ -462,7 +462,7 @@ TEST(RtpVideoSenderTest, DoesNotRetrasmitAckedPackets) {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
test.router()->DeliverRtcp(nack_buffer.data(), nack_buffer.size());
|
test.router()->DeliverRtcp(nack_buffer.data(), nack_buffer.size());
|
||||||
test.AdvanceTime(TimeDelta::ms(33));
|
test.AdvanceTime(TimeDelta::Millis(33));
|
||||||
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
||||||
|
|
||||||
// Verify that both packets were retransmitted.
|
// Verify that both packets were retransmitted.
|
||||||
@ -488,7 +488,7 @@ TEST(RtpVideoSenderTest, DoesNotRetrasmitAckedPackets) {
|
|||||||
// the history has been notified of the ack and removed the packet. The
|
// the history has been notified of the ack and removed the packet. The
|
||||||
// second packet, included in the feedback but not marked as received, should
|
// second packet, included in the feedback but not marked as received, should
|
||||||
// still be retransmitted.
|
// still be retransmitted.
|
||||||
test.AdvanceTime(TimeDelta::ms(33));
|
test.AdvanceTime(TimeDelta::Millis(33));
|
||||||
EXPECT_CALL(test.transport(), SendRtp)
|
EXPECT_CALL(test.transport(), SendRtp)
|
||||||
.WillOnce([&event, &lost_packet_feedback](const uint8_t* packet,
|
.WillOnce([&event, &lost_packet_feedback](const uint8_t* packet,
|
||||||
size_t length,
|
size_t length,
|
||||||
@ -504,7 +504,7 @@ TEST(RtpVideoSenderTest, DoesNotRetrasmitAckedPackets) {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
test.router()->DeliverRtcp(nack_buffer.data(), nack_buffer.size());
|
test.router()->DeliverRtcp(nack_buffer.data(), nack_buffer.size());
|
||||||
test.AdvanceTime(TimeDelta::ms(33));
|
test.AdvanceTime(TimeDelta::Millis(33));
|
||||||
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -551,10 +551,10 @@ TEST(RtpVideoSenderTest, RetransmitsOnTransportWideLossInfo) {
|
|||||||
|
|
||||||
// Run for a short duration and reset counters to avoid counting RTX packets
|
// Run for a short duration and reset counters to avoid counting RTX packets
|
||||||
// from initial probing.
|
// from initial probing.
|
||||||
s.RunFor(TimeDelta::seconds(1));
|
s.RunFor(TimeDelta::Seconds(1));
|
||||||
rtx_packets = 0;
|
rtx_packets = 0;
|
||||||
int decoded_baseline = lossy->receive()->GetStats().frames_decoded;
|
int decoded_baseline = lossy->receive()->GetStats().frames_decoded;
|
||||||
s.RunFor(TimeDelta::seconds(1));
|
s.RunFor(TimeDelta::Seconds(1));
|
||||||
// We expect both that RTX packets were sent and that an appropriate number of
|
// We expect both that RTX packets were sent and that an appropriate number of
|
||||||
// frames were received. This is somewhat redundant but reduces the risk of
|
// frames were received. This is somewhat redundant but reduces the risk of
|
||||||
// false positives in future regressions (e.g. RTX is send due to probing).
|
// false positives in future regressions (e.g. RTX is send due to probing).
|
||||||
@ -608,7 +608,7 @@ TEST(RtpVideoSenderTest, EarlyRetransmits) {
|
|||||||
.error,
|
.error,
|
||||||
EncodedImageCallback::Result::OK);
|
EncodedImageCallback::Result::OK);
|
||||||
|
|
||||||
test.AdvanceTime(TimeDelta::ms(33));
|
test.AdvanceTime(TimeDelta::Millis(33));
|
||||||
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
||||||
|
|
||||||
uint16_t frame2_rtp_sequence_number = 0;
|
uint16_t frame2_rtp_sequence_number = 0;
|
||||||
@ -631,7 +631,7 @@ TEST(RtpVideoSenderTest, EarlyRetransmits) {
|
|||||||
->OnEncodedImage(encoded_image, &codec_specific, nullptr)
|
->OnEncodedImage(encoded_image, &codec_specific, nullptr)
|
||||||
.error,
|
.error,
|
||||||
EncodedImageCallback::Result::OK);
|
EncodedImageCallback::Result::OK);
|
||||||
test.AdvanceTime(TimeDelta::ms(33));
|
test.AdvanceTime(TimeDelta::Millis(33));
|
||||||
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
||||||
|
|
||||||
EXPECT_NE(frame1_transport_sequence_number, frame2_transport_sequence_number);
|
EXPECT_NE(frame1_transport_sequence_number, frame2_transport_sequence_number);
|
||||||
@ -669,7 +669,7 @@ TEST(RtpVideoSenderTest, EarlyRetransmits) {
|
|||||||
{first_packet_feedback, second_packet_feedback});
|
{first_packet_feedback, second_packet_feedback});
|
||||||
|
|
||||||
// Wait for pacer to run and send the RTX packet.
|
// Wait for pacer to run and send the RTX packet.
|
||||||
test.AdvanceTime(TimeDelta::ms(33));
|
test.AdvanceTime(TimeDelta::Millis(33));
|
||||||
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
ASSERT_TRUE(event.Wait(kTimeoutMs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace {
|
namespace {
|
||||||
constexpr TimeDelta kDefaultProcessDelay = TimeDelta::Millis<5>();
|
constexpr TimeDelta kDefaultProcessDelay = TimeDelta::Millis(5);
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
CoDelSimulation::CoDelSimulation() = default;
|
CoDelSimulation::CoDelSimulation() = default;
|
||||||
@ -31,9 +31,9 @@ bool CoDelSimulation::DropDequeuedPacket(Timestamp now,
|
|||||||
Timestamp enqueing_time,
|
Timestamp enqueing_time,
|
||||||
DataSize packet_size,
|
DataSize packet_size,
|
||||||
DataSize queue_size) {
|
DataSize queue_size) {
|
||||||
constexpr TimeDelta kWindow = TimeDelta::Millis<100>();
|
constexpr TimeDelta kWindow = TimeDelta::Millis(100);
|
||||||
constexpr TimeDelta kDelayThreshold = TimeDelta::Millis<5>();
|
constexpr TimeDelta kDelayThreshold = TimeDelta::Millis(5);
|
||||||
constexpr TimeDelta kDropCountMemory = TimeDelta::Millis<1600>();
|
constexpr TimeDelta kDropCountMemory = TimeDelta::Millis(1600);
|
||||||
constexpr DataSize kMaxPacketSize = DataSize::Bytes<1500>();
|
constexpr DataSize kMaxPacketSize = DataSize::Bytes<1500>();
|
||||||
|
|
||||||
// Compensates for process interval in simulation; not part of standard CoDel.
|
// Compensates for process interval in simulation; not part of standard CoDel.
|
||||||
@ -191,8 +191,8 @@ void SimulatedNetwork::UpdateCapacityQueue(ConfigState state,
|
|||||||
if (state.config.codel_active_queue_management) {
|
if (state.config.codel_active_queue_management) {
|
||||||
while (!capacity_link_.empty() &&
|
while (!capacity_link_.empty() &&
|
||||||
codel_controller_.DropDequeuedPacket(
|
codel_controller_.DropDequeuedPacket(
|
||||||
Timestamp::us(time_us),
|
Timestamp::Micros(time_us),
|
||||||
Timestamp::us(capacity_link_.front().packet.send_time_us),
|
Timestamp::Micros(capacity_link_.front().packet.send_time_us),
|
||||||
DataSize::bytes(capacity_link_.front().packet.size),
|
DataSize::bytes(capacity_link_.front().packet.size),
|
||||||
DataSize::bytes(queue_size_bytes_))) {
|
DataSize::bytes(queue_size_bytes_))) {
|
||||||
PacketInfo dropped = capacity_link_.front();
|
PacketInfo dropped = capacity_link_.front();
|
||||||
|
|||||||
@ -24,7 +24,7 @@ constexpr int kNotReceived = PacketDeliveryInfo::kNotReceived;
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(SimulatedNetworkTest, CodelDoesNothingAtCapacity) {
|
TEST(SimulatedNetworkTest, CodelDoesNothingAtCapacity) {
|
||||||
const TimeDelta kRuntime = TimeDelta::seconds(30);
|
const TimeDelta kRuntime = TimeDelta::Seconds(30);
|
||||||
|
|
||||||
DataRate link_capacity = DataRate::kbps(1000);
|
DataRate link_capacity = DataRate::kbps(1000);
|
||||||
const DataSize packet_size = DataSize::bytes(1000);
|
const DataSize packet_size = DataSize::bytes(1000);
|
||||||
@ -37,10 +37,10 @@ TEST(SimulatedNetworkTest, CodelDoesNothingAtCapacity) {
|
|||||||
|
|
||||||
// Need to round up here as otherwise we actually will choke.
|
// Need to round up here as otherwise we actually will choke.
|
||||||
const TimeDelta packet_inverval =
|
const TimeDelta packet_inverval =
|
||||||
packet_size / link_capacity + TimeDelta::ms(1);
|
packet_size / link_capacity + TimeDelta::Millis(1);
|
||||||
|
|
||||||
// Send at capacity and see we get no loss.
|
// Send at capacity and see we get no loss.
|
||||||
Timestamp start_time = Timestamp::ms(0);
|
Timestamp start_time = Timestamp::Millis(0);
|
||||||
Timestamp current_time = start_time;
|
Timestamp current_time = start_time;
|
||||||
Timestamp next_packet_time = start_time;
|
Timestamp next_packet_time = start_time;
|
||||||
uint64_t next_id = 0;
|
uint64_t next_id = 0;
|
||||||
@ -56,7 +56,7 @@ TEST(SimulatedNetworkTest, CodelDoesNothingAtCapacity) {
|
|||||||
}
|
}
|
||||||
Timestamp next_delivery = Timestamp::PlusInfinity();
|
Timestamp next_delivery = Timestamp::PlusInfinity();
|
||||||
if (network.NextDeliveryTimeUs())
|
if (network.NextDeliveryTimeUs())
|
||||||
next_delivery = Timestamp::us(*network.NextDeliveryTimeUs());
|
next_delivery = Timestamp::Micros(*network.NextDeliveryTimeUs());
|
||||||
current_time = std::min(next_packet_time, next_delivery);
|
current_time = std::min(next_packet_time, next_delivery);
|
||||||
if (current_time >= next_delivery) {
|
if (current_time >= next_delivery) {
|
||||||
for (PacketDeliveryInfo packet :
|
for (PacketDeliveryInfo packet :
|
||||||
@ -77,8 +77,8 @@ TEST(SimulatedNetworkTest, CodelDoesNothingAtCapacity) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(SimulatedNetworkTest, CodelLimitsDelayAndDropsPacketsOnOverload) {
|
TEST(SimulatedNetworkTest, CodelLimitsDelayAndDropsPacketsOnOverload) {
|
||||||
const TimeDelta kRuntime = TimeDelta::seconds(30);
|
const TimeDelta kRuntime = TimeDelta::Seconds(30);
|
||||||
const TimeDelta kCheckInterval = TimeDelta::ms(2000);
|
const TimeDelta kCheckInterval = TimeDelta::Millis(2000);
|
||||||
|
|
||||||
DataRate link_capacity = DataRate::kbps(1000);
|
DataRate link_capacity = DataRate::kbps(1000);
|
||||||
const DataSize rough_packet_size = DataSize::bytes(1500);
|
const DataSize rough_packet_size = DataSize::bytes(1500);
|
||||||
@ -94,7 +94,7 @@ TEST(SimulatedNetworkTest, CodelLimitsDelayAndDropsPacketsOnOverload) {
|
|||||||
const DataSize packet_size = overload_rate * link_capacity * packet_inverval;
|
const DataSize packet_size = overload_rate * link_capacity * packet_inverval;
|
||||||
// Send above capacity and see delays are still controlled at the cost of
|
// Send above capacity and see delays are still controlled at the cost of
|
||||||
// packet loss.
|
// packet loss.
|
||||||
Timestamp start_time = Timestamp::ms(0);
|
Timestamp start_time = Timestamp::Millis(0);
|
||||||
Timestamp current_time = start_time;
|
Timestamp current_time = start_time;
|
||||||
Timestamp next_packet_time = start_time;
|
Timestamp next_packet_time = start_time;
|
||||||
Timestamp last_check = start_time;
|
Timestamp last_check = start_time;
|
||||||
@ -113,7 +113,7 @@ TEST(SimulatedNetworkTest, CodelLimitsDelayAndDropsPacketsOnOverload) {
|
|||||||
}
|
}
|
||||||
Timestamp next_delivery = Timestamp::PlusInfinity();
|
Timestamp next_delivery = Timestamp::PlusInfinity();
|
||||||
if (network.NextDeliveryTimeUs())
|
if (network.NextDeliveryTimeUs())
|
||||||
next_delivery = Timestamp::us(*network.NextDeliveryTimeUs());
|
next_delivery = Timestamp::Micros(*network.NextDeliveryTimeUs());
|
||||||
current_time = std::min(next_packet_time, next_delivery);
|
current_time = std::min(next_packet_time, next_delivery);
|
||||||
if (current_time >= next_delivery) {
|
if (current_time >= next_delivery) {
|
||||||
for (PacketDeliveryInfo packet :
|
for (PacketDeliveryInfo packet :
|
||||||
@ -130,7 +130,8 @@ TEST(SimulatedNetworkTest, CodelLimitsDelayAndDropsPacketsOnOverload) {
|
|||||||
if (current_time > last_check + kCheckInterval) {
|
if (current_time > last_check + kCheckInterval) {
|
||||||
last_check = current_time;
|
last_check = current_time;
|
||||||
TimeDelta average_delay =
|
TimeDelta average_delay =
|
||||||
TimeDelta::us(absl::c_accumulate(delays_us, 0)) / delays_us.size();
|
TimeDelta::Micros(absl::c_accumulate(delays_us, 0)) /
|
||||||
|
delays_us.size();
|
||||||
double loss_ratio = static_cast<double>(lost) / (lost + delays_us.size());
|
double loss_ratio = static_cast<double>(lost) / (lost + delays_us.size());
|
||||||
EXPECT_LT(average_delay.ms(), 200)
|
EXPECT_LT(average_delay.ms(), 200)
|
||||||
<< "Time " << (current_time - start_time).ms() << "\n";
|
<< "Time " << (current_time - start_time).ms() << "\n";
|
||||||
|
|||||||
@ -26,7 +26,7 @@ constexpr int64_t kClockInitialTime = 123456;
|
|||||||
struct SmoothingFilterStates {
|
struct SmoothingFilterStates {
|
||||||
explicit SmoothingFilterStates(int init_time_ms)
|
explicit SmoothingFilterStates(int init_time_ms)
|
||||||
: smoothing_filter(init_time_ms) {
|
: smoothing_filter(init_time_ms) {
|
||||||
fake_clock.AdvanceTime(TimeDelta::ms(kClockInitialTime));
|
fake_clock.AdvanceTime(TimeDelta::Millis(kClockInitialTime));
|
||||||
}
|
}
|
||||||
rtc::ScopedFakeClock fake_clock;
|
rtc::ScopedFakeClock fake_clock;
|
||||||
SmoothingFilterImpl smoothing_filter;
|
SmoothingFilterImpl smoothing_filter;
|
||||||
@ -42,7 +42,7 @@ void CheckOutput(SmoothingFilterStates* states,
|
|||||||
int advance_time_ms,
|
int advance_time_ms,
|
||||||
float expected_ouput) {
|
float expected_ouput) {
|
||||||
states->smoothing_filter.AddSample(sample);
|
states->smoothing_filter.AddSample(sample);
|
||||||
states->fake_clock.AdvanceTime(TimeDelta::ms(advance_time_ms));
|
states->fake_clock.AdvanceTime(TimeDelta::Millis(advance_time_ms));
|
||||||
auto output = states->smoothing_filter.GetAverage();
|
auto output = states->smoothing_filter.GetAverage();
|
||||||
EXPECT_TRUE(output);
|
EXPECT_TRUE(output);
|
||||||
EXPECT_NEAR(expected_ouput, *output, kMaxAbsError);
|
EXPECT_NEAR(expected_ouput, *output, kMaxAbsError);
|
||||||
@ -142,14 +142,14 @@ TEST(SmoothingFilterTest, CannotChangeTimeConstantDuringInitialization) {
|
|||||||
states.smoothing_filter.AddSample(0.0);
|
states.smoothing_filter.AddSample(0.0);
|
||||||
|
|
||||||
// During initialization, |SetTimeConstantMs| does not take effect.
|
// During initialization, |SetTimeConstantMs| does not take effect.
|
||||||
states.fake_clock.AdvanceTime(TimeDelta::ms(kInitTimeMs - 1));
|
states.fake_clock.AdvanceTime(TimeDelta::Millis(kInitTimeMs - 1));
|
||||||
states.smoothing_filter.AddSample(0.0);
|
states.smoothing_filter.AddSample(0.0);
|
||||||
|
|
||||||
EXPECT_FALSE(states.smoothing_filter.SetTimeConstantMs(kInitTimeMs * 2));
|
EXPECT_FALSE(states.smoothing_filter.SetTimeConstantMs(kInitTimeMs * 2));
|
||||||
EXPECT_NE(std::exp(-1.0f / (kInitTimeMs * 2)),
|
EXPECT_NE(std::exp(-1.0f / (kInitTimeMs * 2)),
|
||||||
states.smoothing_filter.alpha());
|
states.smoothing_filter.alpha());
|
||||||
|
|
||||||
states.fake_clock.AdvanceTime(TimeDelta::ms(1));
|
states.fake_clock.AdvanceTime(TimeDelta::Millis(1));
|
||||||
states.smoothing_filter.AddSample(0.0);
|
states.smoothing_filter.AddSample(0.0);
|
||||||
// When initialization finishes, the time constant should be come
|
// When initialization finishes, the time constant should be come
|
||||||
// |kInitTimeConstantMs|.
|
// |kInitTimeConstantMs|.
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class BitrateAdjusterTest : public ::testing::Test {
|
|||||||
const size_t frame_size_bytes =
|
const size_t frame_size_bytes =
|
||||||
(bitrate_bps * frame_interval_ms) / (8 * 1000);
|
(bitrate_bps * frame_interval_ms) / (8 * 1000);
|
||||||
for (size_t i = 0; i < update_frame_interval; ++i) {
|
for (size_t i = 0; i < update_frame_interval; ++i) {
|
||||||
clock_.AdvanceTime(webrtc::TimeDelta::ms(frame_interval_ms));
|
clock_.AdvanceTime(webrtc::TimeDelta::Millis(frame_interval_ms));
|
||||||
adjuster_.Update(frame_size_bytes);
|
adjuster_.Update(frame_size_bytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ absl::optional<double> FrameRateEstimator::GetAverageFps() const {
|
|||||||
return absl::nullopt;
|
return absl::nullopt;
|
||||||
}
|
}
|
||||||
TimeDelta time_span = frame_times_.back() - frame_times_.front();
|
TimeDelta time_span = frame_times_.back() - frame_times_.front();
|
||||||
if (time_span < TimeDelta::us(1)) {
|
if (time_span < TimeDelta::Micros(1)) {
|
||||||
return absl::nullopt;
|
return absl::nullopt;
|
||||||
}
|
}
|
||||||
TimeDelta avg_frame_interval = time_span / (frame_times_.size() - 1);
|
TimeDelta avg_frame_interval = time_span / (frame_times_.size() - 1);
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace {
|
namespace {
|
||||||
constexpr TimeDelta kDefaultWindow = TimeDelta::Millis<1000>();
|
constexpr TimeDelta kDefaultWindow = TimeDelta::Millis(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
class FrameRateEstimatorTest : public ::testing::Test {
|
class FrameRateEstimatorTest : public ::testing::Test {
|
||||||
@ -32,7 +32,7 @@ TEST_F(FrameRateEstimatorTest, NoEstimateWithLessThanTwoFrames) {
|
|||||||
EXPECT_FALSE(estimator_.GetAverageFps());
|
EXPECT_FALSE(estimator_.GetAverageFps());
|
||||||
estimator_.OnFrame(clock_.CurrentTime());
|
estimator_.OnFrame(clock_.CurrentTime());
|
||||||
EXPECT_FALSE(estimator_.GetAverageFps());
|
EXPECT_FALSE(estimator_.GetAverageFps());
|
||||||
clock_.AdvanceTime(TimeDelta::ms(33));
|
clock_.AdvanceTime(TimeDelta::Millis(33));
|
||||||
EXPECT_FALSE(estimator_.GetAverageFps());
|
EXPECT_FALSE(estimator_.GetAverageFps());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ TEST_F(FrameRateEstimatorTest, NoEstimateWithZeroSpan) {
|
|||||||
TEST_F(FrameRateEstimatorTest, SingleSpanFps) {
|
TEST_F(FrameRateEstimatorTest, SingleSpanFps) {
|
||||||
const double kExpectedFps = 30.0;
|
const double kExpectedFps = 30.0;
|
||||||
estimator_.OnFrame(clock_.CurrentTime());
|
estimator_.OnFrame(clock_.CurrentTime());
|
||||||
clock_.AdvanceTime(TimeDelta::seconds(1) / kExpectedFps);
|
clock_.AdvanceTime(TimeDelta::Seconds(1) / kExpectedFps);
|
||||||
estimator_.OnFrame(clock_.CurrentTime());
|
estimator_.OnFrame(clock_.CurrentTime());
|
||||||
EXPECT_NEAR(*estimator_.GetAverageFps(), kExpectedFps, 0.001);
|
EXPECT_NEAR(*estimator_.GetAverageFps(), kExpectedFps, 0.001);
|
||||||
}
|
}
|
||||||
@ -61,11 +61,11 @@ TEST_F(FrameRateEstimatorTest, AverageFps) {
|
|||||||
const Timestamp start_time = clock_.CurrentTime();
|
const Timestamp start_time = clock_.CurrentTime();
|
||||||
while (clock_.CurrentTime() - start_time < kDefaultWindow / 2) {
|
while (clock_.CurrentTime() - start_time < kDefaultWindow / 2) {
|
||||||
estimator_.OnFrame(clock_.CurrentTime());
|
estimator_.OnFrame(clock_.CurrentTime());
|
||||||
clock_.AdvanceTime(TimeDelta::seconds(1) / kLowFps);
|
clock_.AdvanceTime(TimeDelta::Seconds(1) / kLowFps);
|
||||||
}
|
}
|
||||||
while (clock_.CurrentTime() - start_time < kDefaultWindow) {
|
while (clock_.CurrentTime() - start_time < kDefaultWindow) {
|
||||||
estimator_.OnFrame(clock_.CurrentTime());
|
estimator_.OnFrame(clock_.CurrentTime());
|
||||||
clock_.AdvanceTime(TimeDelta::seconds(1) / kHighFps);
|
clock_.AdvanceTime(TimeDelta::Seconds(1) / kHighFps);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPECT_NEAR(*estimator_.GetAverageFps(), kExpectedFps, 0.001);
|
EXPECT_NEAR(*estimator_.GetAverageFps(), kExpectedFps, 0.001);
|
||||||
@ -81,13 +81,13 @@ TEST_F(FrameRateEstimatorTest, CullsOldFramesFromAveragingWindow) {
|
|||||||
|
|
||||||
// Oldest frame should just be pushed out the window, leaving a single frame
|
// Oldest frame should just be pushed out the window, leaving a single frame
|
||||||
// => no estimate possible.
|
// => no estimate possible.
|
||||||
clock_.AdvanceTime(TimeDelta::us(1));
|
clock_.AdvanceTime(TimeDelta::Micros(1));
|
||||||
EXPECT_FALSE(estimator_.GetAverageFps(clock_.CurrentTime()));
|
EXPECT_FALSE(estimator_.GetAverageFps(clock_.CurrentTime()));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(FrameRateEstimatorTest, Reset) {
|
TEST_F(FrameRateEstimatorTest, Reset) {
|
||||||
estimator_.OnFrame(clock_.CurrentTime());
|
estimator_.OnFrame(clock_.CurrentTime());
|
||||||
clock_.AdvanceTime(TimeDelta::seconds(1) / 30);
|
clock_.AdvanceTime(TimeDelta::Seconds(1) / 30);
|
||||||
estimator_.OnFrame(clock_.CurrentTime());
|
estimator_.OnFrame(clock_.CurrentTime());
|
||||||
EXPECT_TRUE(estimator_.GetAverageFps());
|
EXPECT_TRUE(estimator_.GetAverageFps());
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ TEST_F(FrameRateEstimatorTest, Reset) {
|
|||||||
// new frame.
|
// new frame.
|
||||||
estimator_.Reset();
|
estimator_.Reset();
|
||||||
EXPECT_FALSE(estimator_.GetAverageFps());
|
EXPECT_FALSE(estimator_.GetAverageFps());
|
||||||
clock_.AdvanceTime(TimeDelta::seconds(1) / 30);
|
clock_.AdvanceTime(TimeDelta::Seconds(1) / 30);
|
||||||
estimator_.OnFrame(clock_.CurrentTime());
|
estimator_.OnFrame(clock_.CurrentTime());
|
||||||
EXPECT_FALSE(estimator_.GetAverageFps());
|
EXPECT_FALSE(estimator_.GetAverageFps());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -784,7 +784,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpReceiverReport) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtc::ScopedFakeClock fake_clock;
|
rtc::ScopedFakeClock fake_clock;
|
||||||
fake_clock.SetTime(Timestamp::ms(prng_.Rand<uint32_t>()));
|
fake_clock.SetTime(Timestamp::Millis(prng_.Rand<uint32_t>()));
|
||||||
|
|
||||||
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
||||||
std::vector<rtcp::ReceiverReport> events(event_count_);
|
std::vector<rtcp::ReceiverReport> events(event_count_);
|
||||||
@ -800,7 +800,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpReceiverReport) {
|
|||||||
history_.push_back(
|
history_.push_back(
|
||||||
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
||||||
}
|
}
|
||||||
fake_clock.AdvanceTime(TimeDelta::ms(prng_.Rand(0, 1000)));
|
fake_clock.AdvanceTime(TimeDelta::Millis(prng_.Rand(0, 1000)));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string encoded =
|
std::string encoded =
|
||||||
@ -823,7 +823,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpSenderReport) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtc::ScopedFakeClock fake_clock;
|
rtc::ScopedFakeClock fake_clock;
|
||||||
fake_clock.SetTime(Timestamp::ms(prng_.Rand<uint32_t>()));
|
fake_clock.SetTime(Timestamp::Millis(prng_.Rand<uint32_t>()));
|
||||||
|
|
||||||
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
||||||
std::vector<rtcp::SenderReport> events(event_count_);
|
std::vector<rtcp::SenderReport> events(event_count_);
|
||||||
@ -839,7 +839,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpSenderReport) {
|
|||||||
history_.push_back(
|
history_.push_back(
|
||||||
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
||||||
}
|
}
|
||||||
fake_clock.AdvanceTime(TimeDelta::ms(prng_.Rand(0, 1000)));
|
fake_clock.AdvanceTime(TimeDelta::Millis(prng_.Rand(0, 1000)));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string encoded =
|
std::string encoded =
|
||||||
@ -862,7 +862,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpExtendedReports) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtc::ScopedFakeClock fake_clock;
|
rtc::ScopedFakeClock fake_clock;
|
||||||
fake_clock.SetTime(Timestamp::ms(prng_.Rand<uint32_t>()));
|
fake_clock.SetTime(Timestamp::Millis(prng_.Rand<uint32_t>()));
|
||||||
|
|
||||||
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
||||||
std::vector<rtcp::ExtendedReports> events(event_count_);
|
std::vector<rtcp::ExtendedReports> events(event_count_);
|
||||||
@ -878,7 +878,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpExtendedReports) {
|
|||||||
history_.push_back(
|
history_.push_back(
|
||||||
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
||||||
}
|
}
|
||||||
fake_clock.AdvanceTime(TimeDelta::ms(prng_.Rand(0, 1000)));
|
fake_clock.AdvanceTime(TimeDelta::Millis(prng_.Rand(0, 1000)));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string encoded =
|
std::string encoded =
|
||||||
@ -901,7 +901,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpFir) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtc::ScopedFakeClock fake_clock;
|
rtc::ScopedFakeClock fake_clock;
|
||||||
fake_clock.SetTime(Timestamp::ms(prng_.Rand<uint32_t>()));
|
fake_clock.SetTime(Timestamp::Millis(prng_.Rand<uint32_t>()));
|
||||||
|
|
||||||
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
||||||
std::vector<rtcp::Fir> events(event_count_);
|
std::vector<rtcp::Fir> events(event_count_);
|
||||||
@ -917,7 +917,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpFir) {
|
|||||||
history_.push_back(
|
history_.push_back(
|
||||||
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
||||||
}
|
}
|
||||||
fake_clock.AdvanceTime(TimeDelta::ms(prng_.Rand(0, 1000)));
|
fake_clock.AdvanceTime(TimeDelta::Millis(prng_.Rand(0, 1000)));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string encoded =
|
std::string encoded =
|
||||||
@ -939,7 +939,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpPli) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtc::ScopedFakeClock fake_clock;
|
rtc::ScopedFakeClock fake_clock;
|
||||||
fake_clock.SetTime(Timestamp::ms(prng_.Rand<uint32_t>()));
|
fake_clock.SetTime(Timestamp::Millis(prng_.Rand<uint32_t>()));
|
||||||
|
|
||||||
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
||||||
std::vector<rtcp::Pli> events(event_count_);
|
std::vector<rtcp::Pli> events(event_count_);
|
||||||
@ -955,7 +955,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpPli) {
|
|||||||
history_.push_back(
|
history_.push_back(
|
||||||
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
||||||
}
|
}
|
||||||
fake_clock.AdvanceTime(TimeDelta::ms(prng_.Rand(0, 1000)));
|
fake_clock.AdvanceTime(TimeDelta::Millis(prng_.Rand(0, 1000)));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string encoded =
|
std::string encoded =
|
||||||
@ -977,7 +977,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpNack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtc::ScopedFakeClock fake_clock;
|
rtc::ScopedFakeClock fake_clock;
|
||||||
fake_clock.SetTime(Timestamp::ms(prng_.Rand<uint32_t>()));
|
fake_clock.SetTime(Timestamp::Millis(prng_.Rand<uint32_t>()));
|
||||||
|
|
||||||
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
||||||
std::vector<rtcp::Nack> events(event_count_);
|
std::vector<rtcp::Nack> events(event_count_);
|
||||||
@ -993,7 +993,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpNack) {
|
|||||||
history_.push_back(
|
history_.push_back(
|
||||||
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
||||||
}
|
}
|
||||||
fake_clock.AdvanceTime(TimeDelta::ms(prng_.Rand(0, 1000)));
|
fake_clock.AdvanceTime(TimeDelta::Millis(prng_.Rand(0, 1000)));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string encoded =
|
std::string encoded =
|
||||||
@ -1015,7 +1015,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpRemb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtc::ScopedFakeClock fake_clock;
|
rtc::ScopedFakeClock fake_clock;
|
||||||
fake_clock.SetTime(Timestamp::ms(prng_.Rand<uint32_t>()));
|
fake_clock.SetTime(Timestamp::Millis(prng_.Rand<uint32_t>()));
|
||||||
|
|
||||||
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
||||||
std::vector<rtcp::Remb> events(event_count_);
|
std::vector<rtcp::Remb> events(event_count_);
|
||||||
@ -1031,7 +1031,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpRemb) {
|
|||||||
history_.push_back(
|
history_.push_back(
|
||||||
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
||||||
}
|
}
|
||||||
fake_clock.AdvanceTime(TimeDelta::ms(prng_.Rand(0, 1000)));
|
fake_clock.AdvanceTime(TimeDelta::Millis(prng_.Rand(0, 1000)));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string encoded =
|
std::string encoded =
|
||||||
@ -1053,7 +1053,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpTransportFeedback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtc::ScopedFakeClock fake_clock;
|
rtc::ScopedFakeClock fake_clock;
|
||||||
fake_clock.SetTime(Timestamp::ms(prng_.Rand<uint32_t>()));
|
fake_clock.SetTime(Timestamp::Millis(prng_.Rand<uint32_t>()));
|
||||||
|
|
||||||
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
||||||
std::vector<rtcp::TransportFeedback> events;
|
std::vector<rtcp::TransportFeedback> events;
|
||||||
@ -1070,7 +1070,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpTransportFeedback) {
|
|||||||
history_.push_back(
|
history_.push_back(
|
||||||
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
||||||
}
|
}
|
||||||
fake_clock.AdvanceTime(TimeDelta::ms(prng_.Rand(0, 1000)));
|
fake_clock.AdvanceTime(TimeDelta::Millis(prng_.Rand(0, 1000)));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string encoded =
|
std::string encoded =
|
||||||
@ -1094,7 +1094,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpLossNotification) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtc::ScopedFakeClock fake_clock;
|
rtc::ScopedFakeClock fake_clock;
|
||||||
fake_clock.SetTime(Timestamp::ms(prng_.Rand<uint32_t>()));
|
fake_clock.SetTime(Timestamp::Millis(prng_.Rand<uint32_t>()));
|
||||||
|
|
||||||
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
for (auto direction : {kIncomingPacket, kOutgoingPacket}) {
|
||||||
std::vector<rtcp::LossNotification> events;
|
std::vector<rtcp::LossNotification> events;
|
||||||
@ -1111,7 +1111,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventRtcpLossNotification) {
|
|||||||
history_.push_back(
|
history_.push_back(
|
||||||
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
std::make_unique<RtcEventRtcpPacketOutgoing>(buffer));
|
||||||
}
|
}
|
||||||
fake_clock.AdvanceTime(TimeDelta::ms(prng_.Rand(0, 1000)));
|
fake_clock.AdvanceTime(TimeDelta::Millis(prng_.Rand(0, 1000)));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string encoded =
|
std::string encoded =
|
||||||
|
|||||||
@ -31,7 +31,7 @@ LoggedPacketInfo::LoggedPacketInfo(const LoggedRtpPacket& rtp,
|
|||||||
has_transport_seq_no ? rtp.header.extension.transportSequenceNumber
|
has_transport_seq_no ? rtp.header.extension.transportSequenceNumber
|
||||||
: 0)),
|
: 0)),
|
||||||
capture_time(capture_time),
|
capture_time(capture_time),
|
||||||
log_packet_time(Timestamp::us(rtp.log_time_us())),
|
log_packet_time(Timestamp::Micros(rtp.log_time_us())),
|
||||||
reported_send_time(rtp.header.extension.hasAbsoluteSendTime
|
reported_send_time(rtp.header.extension.hasAbsoluteSendTime
|
||||||
? rtp.header.extension.GetAbsoluteSendTimestamp()
|
? rtp.header.extension.GetAbsoluteSendTimestamp()
|
||||||
: Timestamp::MinusInfinity()) {}
|
: Timestamp::MinusInfinity()) {}
|
||||||
|
|||||||
@ -2034,7 +2034,7 @@ std::vector<InferredRouteChangeEvent> ParsedRtcEventLog::GetRouteChanges()
|
|||||||
if (candidate.type == IceCandidatePairConfigType::kSelected) {
|
if (candidate.type == IceCandidatePairConfigType::kSelected) {
|
||||||
InferredRouteChangeEvent route;
|
InferredRouteChangeEvent route;
|
||||||
route.route_id = candidate.candidate_pair_id;
|
route.route_id = candidate.candidate_pair_id;
|
||||||
route.log_time = Timestamp::ms(candidate.log_time_ms());
|
route.log_time = Timestamp::Millis(candidate.log_time_ms());
|
||||||
|
|
||||||
route.send_overhead = kUdpOverhead + kSrtpOverhead + kIpv4Overhead;
|
route.send_overhead = kUdpOverhead + kSrtpOverhead + kIpv4Overhead;
|
||||||
if (candidate.remote_address_family ==
|
if (candidate.remote_address_family ==
|
||||||
@ -2083,7 +2083,7 @@ std::vector<LoggedPacketInfo> ParsedRtcEventLog::GetPacketInfos(
|
|||||||
// If we have a large time delta, it can be caused by a gap in logging,
|
// If we have a large time delta, it can be caused by a gap in logging,
|
||||||
// therefore we don't want to match up sequence numbers as we might have had
|
// therefore we don't want to match up sequence numbers as we might have had
|
||||||
// a wraparound.
|
// a wraparound.
|
||||||
if (new_log_time - last_log_time > TimeDelta::seconds(30)) {
|
if (new_log_time - last_log_time > TimeDelta::Seconds(30)) {
|
||||||
seq_num_unwrapper = SequenceNumberUnwrapper();
|
seq_num_unwrapper = SequenceNumberUnwrapper();
|
||||||
indices.clear();
|
indices.clear();
|
||||||
}
|
}
|
||||||
@ -2092,7 +2092,7 @@ std::vector<LoggedPacketInfo> ParsedRtcEventLog::GetPacketInfos(
|
|||||||
};
|
};
|
||||||
|
|
||||||
auto rtp_handler = [&](const LoggedRtpPacket& rtp) {
|
auto rtp_handler = [&](const LoggedRtpPacket& rtp) {
|
||||||
advance_time(Timestamp::ms(rtp.log_time_ms()));
|
advance_time(Timestamp::Millis(rtp.log_time_ms()));
|
||||||
MediaStreamInfo* stream = &streams[rtp.header.ssrc];
|
MediaStreamInfo* stream = &streams[rtp.header.ssrc];
|
||||||
Timestamp capture_time = Timestamp::MinusInfinity();
|
Timestamp capture_time = Timestamp::MinusInfinity();
|
||||||
if (!stream->rtx) {
|
if (!stream->rtx) {
|
||||||
@ -2107,7 +2107,7 @@ std::vector<LoggedPacketInfo> ParsedRtcEventLog::GetPacketInfos(
|
|||||||
kStartingCaptureTimeTicks +
|
kStartingCaptureTimeTicks +
|
||||||
stream->unwrap_capture_ticks.Unwrap(rtp.header.timestamp);
|
stream->unwrap_capture_ticks.Unwrap(rtp.header.timestamp);
|
||||||
// TODO(srte): Use logged sample rate when it is added to the format.
|
// TODO(srte): Use logged sample rate when it is added to the format.
|
||||||
capture_time = Timestamp::seconds(
|
capture_time = Timestamp::Seconds(
|
||||||
capture_ticks /
|
capture_ticks /
|
||||||
(stream->media_type == LoggedMediaType::kAudio ? 48000.0 : 90000.0));
|
(stream->media_type == LoggedMediaType::kAudio ? 48000.0 : 90000.0));
|
||||||
}
|
}
|
||||||
@ -2135,7 +2135,7 @@ std::vector<LoggedPacketInfo> ParsedRtcEventLog::GetPacketInfos(
|
|||||||
|
|
||||||
auto feedback_handler =
|
auto feedback_handler =
|
||||||
[&](const LoggedRtcpPacketTransportFeedback& logged_rtcp) {
|
[&](const LoggedRtcpPacketTransportFeedback& logged_rtcp) {
|
||||||
auto log_feedback_time = Timestamp::ms(logged_rtcp.log_time_ms());
|
auto log_feedback_time = Timestamp::Millis(logged_rtcp.log_time_ms());
|
||||||
advance_time(log_feedback_time);
|
advance_time(log_feedback_time);
|
||||||
const auto& feedback = logged_rtcp.transport_feedback;
|
const auto& feedback = logged_rtcp.transport_feedback;
|
||||||
// Add timestamp deltas to a local time base selected on first packet
|
// Add timestamp deltas to a local time base selected on first packet
|
||||||
@ -2144,7 +2144,7 @@ std::vector<LoggedPacketInfo> ParsedRtcEventLog::GetPacketInfos(
|
|||||||
if (!last_feedback_base_time_us) {
|
if (!last_feedback_base_time_us) {
|
||||||
feedback_base_time = log_feedback_time;
|
feedback_base_time = log_feedback_time;
|
||||||
} else {
|
} else {
|
||||||
feedback_base_time += TimeDelta::us(
|
feedback_base_time += TimeDelta::Micros(
|
||||||
feedback.GetBaseDeltaUs(*last_feedback_base_time_us));
|
feedback.GetBaseDeltaUs(*last_feedback_base_time_us));
|
||||||
}
|
}
|
||||||
last_feedback_base_time_us = feedback.GetBaseTimeUs();
|
last_feedback_base_time_us = feedback.GetBaseTimeUs();
|
||||||
@ -2163,15 +2163,16 @@ std::vector<LoggedPacketInfo> ParsedRtcEventLog::GetPacketInfos(
|
|||||||
}
|
}
|
||||||
LoggedPacketInfo* sent = &packets[it->second];
|
LoggedPacketInfo* sent = &packets[it->second];
|
||||||
if (log_feedback_time - sent->log_packet_time >
|
if (log_feedback_time - sent->log_packet_time >
|
||||||
TimeDelta::seconds(60)) {
|
TimeDelta::Seconds(60)) {
|
||||||
RTC_LOG(LS_WARNING)
|
RTC_LOG(LS_WARNING)
|
||||||
<< "Received very late feedback, possibly due to wraparound.";
|
<< "Received very late feedback, possibly due to wraparound.";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (packet.received()) {
|
if (packet.received()) {
|
||||||
receive_timestamp += TimeDelta::us(packet.delta_us());
|
receive_timestamp += TimeDelta::Micros(packet.delta_us());
|
||||||
if (sent->reported_recv_time.IsInfinite()) {
|
if (sent->reported_recv_time.IsInfinite()) {
|
||||||
sent->reported_recv_time = Timestamp::ms(receive_timestamp.ms());
|
sent->reported_recv_time =
|
||||||
|
Timestamp::Millis(receive_timestamp.ms());
|
||||||
sent->log_feedback_time = log_feedback_time;
|
sent->log_feedback_time = log_feedback_time;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -2246,12 +2247,12 @@ std::vector<LoggedIceEvent> ParsedRtcEventLog::GetIceEvents() const {
|
|||||||
std::vector<LoggedIceEvent> log_events;
|
std::vector<LoggedIceEvent> log_events;
|
||||||
auto handle_check = [&](const LoggedIceCandidatePairEvent& check) {
|
auto handle_check = [&](const LoggedIceCandidatePairEvent& check) {
|
||||||
log_events.push_back(LoggedIceEvent{check.candidate_pair_id,
|
log_events.push_back(LoggedIceEvent{check.candidate_pair_id,
|
||||||
Timestamp::ms(check.log_time_ms()),
|
Timestamp::Millis(check.log_time_ms()),
|
||||||
check_map[check.type]});
|
check_map[check.type]});
|
||||||
};
|
};
|
||||||
auto handle_config = [&](const LoggedIceCandidatePairConfig& conf) {
|
auto handle_config = [&](const LoggedIceCandidatePairConfig& conf) {
|
||||||
log_events.push_back(LoggedIceEvent{conf.candidate_pair_id,
|
log_events.push_back(LoggedIceEvent{conf.candidate_pair_id,
|
||||||
Timestamp::ms(conf.log_time_ms()),
|
Timestamp::Millis(conf.log_time_ms()),
|
||||||
config_map[conf.type]});
|
config_map[conf.type]});
|
||||||
};
|
};
|
||||||
RtcEventProcessor process;
|
RtcEventProcessor process;
|
||||||
|
|||||||
@ -113,7 +113,7 @@ class RtcEventLogSession
|
|||||||
encoding_type_(std::get<2>(GetParam())),
|
encoding_type_(std::get<2>(GetParam())),
|
||||||
gen_(seed_ * 880001UL),
|
gen_(seed_ * 880001UL),
|
||||||
verifier_(encoding_type_) {
|
verifier_(encoding_type_) {
|
||||||
clock_.SetTime(Timestamp::us(prng_.Rand<uint32_t>()));
|
clock_.SetTime(Timestamp::Micros(prng_.Rand<uint32_t>()));
|
||||||
// Find the name of the current test, in order to use it as a temporary
|
// Find the name of the current test, in order to use it as a temporary
|
||||||
// filename.
|
// filename.
|
||||||
// TODO(terelius): Use a general utility function to generate a temp file.
|
// TODO(terelius): Use a general utility function to generate a temp file.
|
||||||
@ -217,7 +217,7 @@ void RtcEventLogSession::WriteAudioRecvConfigs(size_t audio_recv_streams,
|
|||||||
RTC_CHECK(event_log != nullptr);
|
RTC_CHECK(event_log != nullptr);
|
||||||
uint32_t ssrc;
|
uint32_t ssrc;
|
||||||
for (size_t i = 0; i < audio_recv_streams; i++) {
|
for (size_t i = 0; i < audio_recv_streams; i++) {
|
||||||
clock_.AdvanceTime(TimeDelta::ms(prng_.Rand(20)));
|
clock_.AdvanceTime(TimeDelta::Millis(prng_.Rand(20)));
|
||||||
do {
|
do {
|
||||||
ssrc = prng_.Rand<uint32_t>();
|
ssrc = prng_.Rand<uint32_t>();
|
||||||
} while (SsrcUsed(ssrc, incoming_extensions_));
|
} while (SsrcUsed(ssrc, incoming_extensions_));
|
||||||
@ -234,7 +234,7 @@ void RtcEventLogSession::WriteAudioSendConfigs(size_t audio_send_streams,
|
|||||||
RTC_CHECK(event_log != nullptr);
|
RTC_CHECK(event_log != nullptr);
|
||||||
uint32_t ssrc;
|
uint32_t ssrc;
|
||||||
for (size_t i = 0; i < audio_send_streams; i++) {
|
for (size_t i = 0; i < audio_send_streams; i++) {
|
||||||
clock_.AdvanceTime(TimeDelta::ms(prng_.Rand(20)));
|
clock_.AdvanceTime(TimeDelta::Millis(prng_.Rand(20)));
|
||||||
do {
|
do {
|
||||||
ssrc = prng_.Rand<uint32_t>();
|
ssrc = prng_.Rand<uint32_t>();
|
||||||
} while (SsrcUsed(ssrc, outgoing_extensions_));
|
} while (SsrcUsed(ssrc, outgoing_extensions_));
|
||||||
@ -256,14 +256,14 @@ void RtcEventLogSession::WriteVideoRecvConfigs(size_t video_recv_streams,
|
|||||||
RtpHeaderExtensionMap all_extensions =
|
RtpHeaderExtensionMap all_extensions =
|
||||||
ParsedRtcEventLog::GetDefaultHeaderExtensionMap();
|
ParsedRtcEventLog::GetDefaultHeaderExtensionMap();
|
||||||
|
|
||||||
clock_.AdvanceTime(TimeDelta::ms(prng_.Rand(20)));
|
clock_.AdvanceTime(TimeDelta::Millis(prng_.Rand(20)));
|
||||||
uint32_t ssrc = prng_.Rand<uint32_t>();
|
uint32_t ssrc = prng_.Rand<uint32_t>();
|
||||||
incoming_extensions_.emplace_back(ssrc, all_extensions);
|
incoming_extensions_.emplace_back(ssrc, all_extensions);
|
||||||
auto event = gen_.NewVideoReceiveStreamConfig(ssrc, all_extensions);
|
auto event = gen_.NewVideoReceiveStreamConfig(ssrc, all_extensions);
|
||||||
event_log->Log(event->Copy());
|
event_log->Log(event->Copy());
|
||||||
video_recv_config_list_.push_back(std::move(event));
|
video_recv_config_list_.push_back(std::move(event));
|
||||||
for (size_t i = 1; i < video_recv_streams; i++) {
|
for (size_t i = 1; i < video_recv_streams; i++) {
|
||||||
clock_.AdvanceTime(TimeDelta::ms(prng_.Rand(20)));
|
clock_.AdvanceTime(TimeDelta::Millis(prng_.Rand(20)));
|
||||||
do {
|
do {
|
||||||
ssrc = prng_.Rand<uint32_t>();
|
ssrc = prng_.Rand<uint32_t>();
|
||||||
} while (SsrcUsed(ssrc, incoming_extensions_));
|
} while (SsrcUsed(ssrc, incoming_extensions_));
|
||||||
@ -285,14 +285,14 @@ void RtcEventLogSession::WriteVideoSendConfigs(size_t video_send_streams,
|
|||||||
RtpHeaderExtensionMap all_extensions =
|
RtpHeaderExtensionMap all_extensions =
|
||||||
ParsedRtcEventLog::GetDefaultHeaderExtensionMap();
|
ParsedRtcEventLog::GetDefaultHeaderExtensionMap();
|
||||||
|
|
||||||
clock_.AdvanceTime(TimeDelta::ms(prng_.Rand(20)));
|
clock_.AdvanceTime(TimeDelta::Millis(prng_.Rand(20)));
|
||||||
uint32_t ssrc = prng_.Rand<uint32_t>();
|
uint32_t ssrc = prng_.Rand<uint32_t>();
|
||||||
outgoing_extensions_.emplace_back(ssrc, all_extensions);
|
outgoing_extensions_.emplace_back(ssrc, all_extensions);
|
||||||
auto event = gen_.NewVideoSendStreamConfig(ssrc, all_extensions);
|
auto event = gen_.NewVideoSendStreamConfig(ssrc, all_extensions);
|
||||||
event_log->Log(event->Copy());
|
event_log->Log(event->Copy());
|
||||||
video_send_config_list_.push_back(std::move(event));
|
video_send_config_list_.push_back(std::move(event));
|
||||||
for (size_t i = 1; i < video_send_streams; i++) {
|
for (size_t i = 1; i < video_send_streams; i++) {
|
||||||
clock_.AdvanceTime(TimeDelta::ms(prng_.Rand(20)));
|
clock_.AdvanceTime(TimeDelta::Millis(prng_.Rand(20)));
|
||||||
do {
|
do {
|
||||||
ssrc = prng_.Rand<uint32_t>();
|
ssrc = prng_.Rand<uint32_t>();
|
||||||
} while (SsrcUsed(ssrc, outgoing_extensions_));
|
} while (SsrcUsed(ssrc, outgoing_extensions_));
|
||||||
@ -329,7 +329,7 @@ void RtcEventLogSession::WriteLog(EventCounts count,
|
|||||||
size_t remaining_events_at_start = remaining_events - num_events_before_start;
|
size_t remaining_events_at_start = remaining_events - num_events_before_start;
|
||||||
for (; remaining_events > 0; remaining_events--) {
|
for (; remaining_events > 0; remaining_events--) {
|
||||||
if (remaining_events == remaining_events_at_start) {
|
if (remaining_events == remaining_events_at_start) {
|
||||||
clock_.AdvanceTime(TimeDelta::ms(prng_.Rand(20)));
|
clock_.AdvanceTime(TimeDelta::Millis(prng_.Rand(20)));
|
||||||
event_log->StartLogging(
|
event_log->StartLogging(
|
||||||
std::make_unique<RtcEventLogOutputFile>(temp_filename_, 10000000),
|
std::make_unique<RtcEventLogOutputFile>(temp_filename_, 10000000),
|
||||||
output_period_ms_);
|
output_period_ms_);
|
||||||
@ -337,7 +337,7 @@ void RtcEventLogSession::WriteLog(EventCounts count,
|
|||||||
utc_start_time_us_ = rtc::TimeUTCMicros();
|
utc_start_time_us_ = rtc::TimeUTCMicros();
|
||||||
}
|
}
|
||||||
|
|
||||||
clock_.AdvanceTime(TimeDelta::ms(prng_.Rand(20)));
|
clock_.AdvanceTime(TimeDelta::Millis(prng_.Rand(20)));
|
||||||
size_t selection = prng_.Rand(remaining_events - 1);
|
size_t selection = prng_.Rand(remaining_events - 1);
|
||||||
first_timestamp_ms_ = std::min(first_timestamp_ms_, rtc::TimeMillis());
|
first_timestamp_ms_ = std::min(first_timestamp_ms_, rtc::TimeMillis());
|
||||||
last_timestamp_ms_ = std::max(last_timestamp_ms_, rtc::TimeMillis());
|
last_timestamp_ms_ = std::max(last_timestamp_ms_, rtc::TimeMillis());
|
||||||
@ -844,7 +844,7 @@ TEST_P(RtcEventLogCircularBufferTest, KeepsMostRecentEvents) {
|
|||||||
|
|
||||||
std::unique_ptr<rtc::ScopedFakeClock> fake_clock =
|
std::unique_ptr<rtc::ScopedFakeClock> fake_clock =
|
||||||
std::make_unique<rtc::ScopedFakeClock>();
|
std::make_unique<rtc::ScopedFakeClock>();
|
||||||
fake_clock->SetTime(Timestamp::seconds(kStartTimeSeconds));
|
fake_clock->SetTime(Timestamp::Seconds(kStartTimeSeconds));
|
||||||
|
|
||||||
auto task_queue_factory = CreateDefaultTaskQueueFactory();
|
auto task_queue_factory = CreateDefaultTaskQueueFactory();
|
||||||
RtcEventLogFactory rtc_event_log_factory(task_queue_factory.get());
|
RtcEventLogFactory rtc_event_log_factory(task_queue_factory.get());
|
||||||
@ -862,14 +862,14 @@ TEST_P(RtcEventLogCircularBufferTest, KeepsMostRecentEvents) {
|
|||||||
// consistency checks when we read back.
|
// consistency checks when we read back.
|
||||||
log_dumper->Log(std::make_unique<RtcEventProbeResultSuccess>(
|
log_dumper->Log(std::make_unique<RtcEventProbeResultSuccess>(
|
||||||
i, kStartBitrate + i * 1000));
|
i, kStartBitrate + i * 1000));
|
||||||
fake_clock->AdvanceTime(TimeDelta::ms(10));
|
fake_clock->AdvanceTime(TimeDelta::Millis(10));
|
||||||
}
|
}
|
||||||
int64_t start_time_us = rtc::TimeMicros();
|
int64_t start_time_us = rtc::TimeMicros();
|
||||||
int64_t utc_start_time_us = rtc::TimeUTCMicros();
|
int64_t utc_start_time_us = rtc::TimeUTCMicros();
|
||||||
log_dumper->StartLogging(
|
log_dumper->StartLogging(
|
||||||
std::make_unique<RtcEventLogOutputFile>(temp_filename, 10000000),
|
std::make_unique<RtcEventLogOutputFile>(temp_filename, 10000000),
|
||||||
RtcEventLog::kImmediateOutput);
|
RtcEventLog::kImmediateOutput);
|
||||||
fake_clock->AdvanceTime(TimeDelta::ms(10));
|
fake_clock->AdvanceTime(TimeDelta::Millis(10));
|
||||||
int64_t stop_time_us = rtc::TimeMicros();
|
int64_t stop_time_us = rtc::TimeMicros();
|
||||||
log_dumper->StopLogging();
|
log_dumper->StopLogging();
|
||||||
|
|
||||||
@ -902,9 +902,9 @@ TEST_P(RtcEventLogCircularBufferTest, KeepsMostRecentEvents) {
|
|||||||
// destroyed before the new one is created, so we have to reset() first.
|
// destroyed before the new one is created, so we have to reset() first.
|
||||||
fake_clock.reset();
|
fake_clock.reset();
|
||||||
fake_clock = std::make_unique<rtc::ScopedFakeClock>();
|
fake_clock = std::make_unique<rtc::ScopedFakeClock>();
|
||||||
fake_clock->SetTime(Timestamp::us(first_timestamp_us));
|
fake_clock->SetTime(Timestamp::Micros(first_timestamp_us));
|
||||||
for (size_t i = 1; i < probe_success_events.size(); i++) {
|
for (size_t i = 1; i < probe_success_events.size(); i++) {
|
||||||
fake_clock->AdvanceTime(TimeDelta::ms(10));
|
fake_clock->AdvanceTime(TimeDelta::Millis(10));
|
||||||
verifier_.VerifyLoggedBweProbeSuccessEvent(
|
verifier_.VerifyLoggedBweProbeSuccessEvent(
|
||||||
RtcEventProbeResultSuccess(first_id + i, first_bitrate_bps + i * 1000),
|
RtcEventProbeResultSuccess(first_id + i, first_bitrate_bps + i * 1000),
|
||||||
probe_success_events[i]);
|
probe_success_events[i]);
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class RtpDataMediaChannelTest : public ::testing::Test {
|
|||||||
receiver_.reset(new FakeDataReceiver());
|
receiver_.reset(new FakeDataReceiver());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetNow(double now) { clock_.SetTime(webrtc::Timestamp::seconds(now)); }
|
void SetNow(double now) { clock_.SetTime(webrtc::Timestamp::Seconds(now)); }
|
||||||
|
|
||||||
cricket::RtpDataEngine* CreateEngine() {
|
cricket::RtpDataEngine* CreateEngine() {
|
||||||
cricket::RtpDataEngine* dme = new cricket::RtpDataEngine();
|
cricket::RtpDataEngine* dme = new cricket::RtpDataEngine();
|
||||||
|
|||||||
@ -251,7 +251,7 @@ class WebRtcVideoEngineTest : public ::testing::Test {
|
|||||||
decoder_factory_)) {
|
decoder_factory_)) {
|
||||||
// Ensure fake clock doesn't return 0, which will cause some initializations
|
// Ensure fake clock doesn't return 0, which will cause some initializations
|
||||||
// fail inside RTP senders.
|
// fail inside RTP senders.
|
||||||
fake_clock_.AdvanceTime(webrtc::TimeDelta::us(1));
|
fake_clock_.AdvanceTime(webrtc::TimeDelta::Micros(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -3870,7 +3870,7 @@ TEST_F(WebRtcVideoChannelTest, EstimatesNtpStartTimeCorrectly) {
|
|||||||
// This timestamp is kInitialTimestamp (-1) + kFrameOffsetMs * 90, which
|
// This timestamp is kInitialTimestamp (-1) + kFrameOffsetMs * 90, which
|
||||||
// triggers a constant-overflow warning, hence we're calculating it explicitly
|
// triggers a constant-overflow warning, hence we're calculating it explicitly
|
||||||
// here.
|
// here.
|
||||||
fake_clock_.AdvanceTime(webrtc::TimeDelta::ms(kFrameOffsetMs));
|
fake_clock_.AdvanceTime(webrtc::TimeDelta::Millis(kFrameOffsetMs));
|
||||||
video_frame.set_timestamp(kFrameOffsetMs * 90 - 1);
|
video_frame.set_timestamp(kFrameOffsetMs * 90 - 1);
|
||||||
video_frame.set_ntp_time_ms(kInitialNtpTimeMs + kFrameOffsetMs);
|
video_frame.set_ntp_time_ms(kInitialNtpTimeMs + kFrameOffsetMs);
|
||||||
stream->InjectFrame(video_frame);
|
stream->InjectFrame(video_frame);
|
||||||
|
|||||||
@ -584,9 +584,10 @@ TEST_F(DtlsTransportTest, TestRetransmissionSchedule) {
|
|||||||
// millisecond before the expected time and verify that no unexpected
|
// millisecond before the expected time and verify that no unexpected
|
||||||
// retransmissions were sent. Then advance it the final millisecond and
|
// retransmissions were sent. Then advance it the final millisecond and
|
||||||
// verify that the expected retransmission was sent.
|
// verify that the expected retransmission was sent.
|
||||||
fake_clock_.AdvanceTime(webrtc::TimeDelta::ms(timeout_schedule_ms[i] - 1));
|
fake_clock_.AdvanceTime(
|
||||||
|
webrtc::TimeDelta::Millis(timeout_schedule_ms[i] - 1));
|
||||||
EXPECT_EQ(expected_hellos, client1_.received_dtls_client_hellos());
|
EXPECT_EQ(expected_hellos, client1_.received_dtls_client_hellos());
|
||||||
fake_clock_.AdvanceTime(webrtc::TimeDelta::ms(1));
|
fake_clock_.AdvanceTime(webrtc::TimeDelta::Millis(1));
|
||||||
EXPECT_EQ(++expected_hellos, client1_.received_dtls_client_hellos());
|
EXPECT_EQ(++expected_hellos, client1_.received_dtls_client_hellos());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3619,7 +3619,7 @@ TEST_F(P2PTransportChannelPingTest, TestReceivingStateChange) {
|
|||||||
Connection* conn1 = WaitForConnectionTo(&ch, "1.1.1.1", 1, &clock);
|
Connection* conn1 = WaitForConnectionTo(&ch, "1.1.1.1", 1, &clock);
|
||||||
ASSERT_TRUE(conn1 != nullptr);
|
ASSERT_TRUE(conn1 != nullptr);
|
||||||
|
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
conn1->ReceivedPing();
|
conn1->ReceivedPing();
|
||||||
conn1->OnReadPacket("ABC", 3, rtc::TimeMicros());
|
conn1->OnReadPacket("ABC", 3, rtc::TimeMicros());
|
||||||
EXPECT_TRUE_SIMULATED_WAIT(ch.receiving(), kShortTimeout, clock);
|
EXPECT_TRUE_SIMULATED_WAIT(ch.receiving(), kShortTimeout, clock);
|
||||||
@ -3854,7 +3854,7 @@ TEST_F(P2PTransportChannelPingTest, TestSelectConnectionBasedOnMediaReceived) {
|
|||||||
TEST_F(P2PTransportChannelPingTest,
|
TEST_F(P2PTransportChannelPingTest,
|
||||||
TestControlledAgentDataReceivingTakesHigherPrecedenceThanPriority) {
|
TestControlledAgentDataReceivingTakesHigherPrecedenceThanPriority) {
|
||||||
rtc::ScopedFakeClock clock;
|
rtc::ScopedFakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
||||||
P2PTransportChannel ch("SwitchSelectedConnection", 1, &pa);
|
P2PTransportChannel ch("SwitchSelectedConnection", 1, &pa);
|
||||||
PrepareChannel(&ch);
|
PrepareChannel(&ch);
|
||||||
@ -3902,7 +3902,7 @@ TEST_F(P2PTransportChannelPingTest,
|
|||||||
TEST_F(P2PTransportChannelPingTest,
|
TEST_F(P2PTransportChannelPingTest,
|
||||||
TestControlledAgentNominationTakesHigherPrecedenceThanDataReceiving) {
|
TestControlledAgentNominationTakesHigherPrecedenceThanDataReceiving) {
|
||||||
rtc::ScopedFakeClock clock;
|
rtc::ScopedFakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
|
|
||||||
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
||||||
P2PTransportChannel ch("SwitchSelectedConnection", 1, &pa);
|
P2PTransportChannel ch("SwitchSelectedConnection", 1, &pa);
|
||||||
@ -3942,7 +3942,7 @@ TEST_F(P2PTransportChannelPingTest,
|
|||||||
TEST_F(P2PTransportChannelPingTest,
|
TEST_F(P2PTransportChannelPingTest,
|
||||||
TestControlledAgentSelectsConnectionWithHigherNomination) {
|
TestControlledAgentSelectsConnectionWithHigherNomination) {
|
||||||
rtc::ScopedFakeClock clock;
|
rtc::ScopedFakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
|
|
||||||
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
||||||
P2PTransportChannel ch("test", 1, &pa);
|
P2PTransportChannel ch("test", 1, &pa);
|
||||||
@ -3989,7 +3989,7 @@ TEST_F(P2PTransportChannelPingTest,
|
|||||||
TEST_F(P2PTransportChannelPingTest,
|
TEST_F(P2PTransportChannelPingTest,
|
||||||
TestControlledAgentIgnoresSmallerNomination) {
|
TestControlledAgentIgnoresSmallerNomination) {
|
||||||
rtc::ScopedFakeClock clock;
|
rtc::ScopedFakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
|
|
||||||
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
||||||
P2PTransportChannel ch("test", 1, &pa);
|
P2PTransportChannel ch("test", 1, &pa);
|
||||||
@ -4089,7 +4089,7 @@ TEST_F(P2PTransportChannelPingTest, TestAddRemoteCandidateWithAddressReuse) {
|
|||||||
// will be pruned. Otherwise, lower-priority connections are kept.
|
// will be pruned. Otherwise, lower-priority connections are kept.
|
||||||
TEST_F(P2PTransportChannelPingTest, TestDontPruneWhenWeak) {
|
TEST_F(P2PTransportChannelPingTest, TestDontPruneWhenWeak) {
|
||||||
rtc::ScopedFakeClock clock;
|
rtc::ScopedFakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
||||||
P2PTransportChannel ch("test channel", 1, &pa);
|
P2PTransportChannel ch("test channel", 1, &pa);
|
||||||
PrepareChannel(&ch);
|
PrepareChannel(&ch);
|
||||||
@ -4149,7 +4149,7 @@ TEST_F(P2PTransportChannelPingTest, TestDontPruneHighPriorityConnections) {
|
|||||||
// Test that GetState returns the state correctly.
|
// Test that GetState returns the state correctly.
|
||||||
TEST_F(P2PTransportChannelPingTest, TestGetState) {
|
TEST_F(P2PTransportChannelPingTest, TestGetState) {
|
||||||
rtc::ScopedFakeClock clock;
|
rtc::ScopedFakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
||||||
P2PTransportChannel ch("test channel", 1, &pa);
|
P2PTransportChannel ch("test channel", 1, &pa);
|
||||||
EXPECT_EQ(webrtc::IceTransportState::kNew, ch.GetIceTransportState());
|
EXPECT_EQ(webrtc::IceTransportState::kNew, ch.GetIceTransportState());
|
||||||
@ -4189,7 +4189,7 @@ TEST_F(P2PTransportChannelPingTest, TestGetState) {
|
|||||||
// right away, and it can become active and be pruned again.
|
// right away, and it can become active and be pruned again.
|
||||||
TEST_F(P2PTransportChannelPingTest, TestConnectionPrunedAgain) {
|
TEST_F(P2PTransportChannelPingTest, TestConnectionPrunedAgain) {
|
||||||
rtc::ScopedFakeClock clock;
|
rtc::ScopedFakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
|
|
||||||
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
||||||
P2PTransportChannel ch("test channel", 1, &pa);
|
P2PTransportChannel ch("test channel", 1, &pa);
|
||||||
@ -4368,7 +4368,7 @@ TEST_F(P2PTransportChannelPingTest, TestPortDestroyedAfterTimeoutAndPruned) {
|
|||||||
// Simulate 2 minutes going by. This should be enough time for the port to
|
// Simulate 2 minutes going by. This should be enough time for the port to
|
||||||
// time out.
|
// time out.
|
||||||
for (int second = 0; second < 120; ++second) {
|
for (int second = 0; second < 120; ++second) {
|
||||||
fake_clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
fake_clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
}
|
}
|
||||||
EXPECT_EQ(nullptr, GetConnectionTo(&ch, "1.1.1.1", 1));
|
EXPECT_EQ(nullptr, GetConnectionTo(&ch, "1.1.1.1", 1));
|
||||||
// Port will not be removed because it is not pruned yet.
|
// Port will not be removed because it is not pruned yet.
|
||||||
@ -5445,7 +5445,7 @@ TEST_F(P2PTransportChannelPingTest, TestInitialSelectDampening0) {
|
|||||||
|
|
||||||
constexpr int kMargin = 10;
|
constexpr int kMargin = 10;
|
||||||
rtc::ScopedFakeClock clock;
|
rtc::ScopedFakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
|
|
||||||
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
||||||
P2PTransportChannel ch("test channel", 1, &pa);
|
P2PTransportChannel ch("test channel", 1, &pa);
|
||||||
@ -5469,7 +5469,7 @@ TEST_F(P2PTransportChannelPingTest, TestInitialSelectDampening) {
|
|||||||
|
|
||||||
constexpr int kMargin = 10;
|
constexpr int kMargin = 10;
|
||||||
rtc::ScopedFakeClock clock;
|
rtc::ScopedFakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
|
|
||||||
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
||||||
P2PTransportChannel ch("test channel", 1, &pa);
|
P2PTransportChannel ch("test channel", 1, &pa);
|
||||||
@ -5493,7 +5493,7 @@ TEST_F(P2PTransportChannelPingTest, TestInitialSelectDampeningPingReceived) {
|
|||||||
|
|
||||||
constexpr int kMargin = 10;
|
constexpr int kMargin = 10;
|
||||||
rtc::ScopedFakeClock clock;
|
rtc::ScopedFakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
|
|
||||||
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
||||||
P2PTransportChannel ch("test channel", 1, &pa);
|
P2PTransportChannel ch("test channel", 1, &pa);
|
||||||
@ -5520,7 +5520,7 @@ TEST_F(P2PTransportChannelPingTest, TestInitialSelectDampeningBoth) {
|
|||||||
|
|
||||||
constexpr int kMargin = 10;
|
constexpr int kMargin = 10;
|
||||||
rtc::ScopedFakeClock clock;
|
rtc::ScopedFakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
|
|
||||||
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
FakePortAllocator pa(rtc::Thread::Current(), nullptr);
|
||||||
P2PTransportChannel ch("test channel", 1, &pa);
|
P2PTransportChannel ch("test channel", 1, &pa);
|
||||||
|
|||||||
@ -255,7 +255,7 @@ static void SendPingAndReceiveResponse(Connection* lconn,
|
|||||||
ASSERT_TRUE(lport->last_stun_buf());
|
ASSERT_TRUE(lport->last_stun_buf());
|
||||||
rconn->OnReadPacket(lport->last_stun_buf()->data<char>(),
|
rconn->OnReadPacket(lport->last_stun_buf()->data<char>(),
|
||||||
lport->last_stun_buf()->size(), /* packet_time_us */ -1);
|
lport->last_stun_buf()->size(), /* packet_time_us */ -1);
|
||||||
clock->AdvanceTime(webrtc::TimeDelta::ms(ms));
|
clock->AdvanceTime(webrtc::TimeDelta::Millis(ms));
|
||||||
ASSERT_TRUE_WAIT(rport->last_stun_msg(), kDefaultTimeout);
|
ASSERT_TRUE_WAIT(rport->last_stun_msg(), kDefaultTimeout);
|
||||||
ASSERT_TRUE(rport->last_stun_buf());
|
ASSERT_TRUE(rport->last_stun_buf());
|
||||||
lconn->OnReadPacket(rport->last_stun_buf()->data<char>(),
|
lconn->OnReadPacket(rport->last_stun_buf()->data<char>(),
|
||||||
|
|||||||
@ -166,7 +166,7 @@ class TurnPortTest : public ::testing::Test,
|
|||||||
// Some code uses "last received time == 0" to represent "nothing received
|
// Some code uses "last received time == 0" to represent "nothing received
|
||||||
// so far", so we need to start the fake clock at a nonzero time...
|
// so far", so we need to start the fake clock at a nonzero time...
|
||||||
// TODO(deadbeef): Fix this.
|
// TODO(deadbeef): Fix this.
|
||||||
fake_clock_.AdvanceTime(webrtc::TimeDelta::seconds(1));
|
fake_clock_.AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnMessage(rtc::Message* msg) {
|
virtual void OnMessage(rtc::Message* msg) {
|
||||||
|
|||||||
@ -1723,7 +1723,7 @@ class FakeClockForTest : public rtc::ScopedFakeClock {
|
|||||||
// Some things use a time of "0" as a special value, so we need to start out
|
// Some things use a time of "0" as a special value, so we need to start out
|
||||||
// the fake clock at a nonzero time.
|
// the fake clock at a nonzero time.
|
||||||
// TODO(deadbeef): Fix this.
|
// TODO(deadbeef): Fix this.
|
||||||
AdvanceTime(webrtc::TimeDelta::seconds(1));
|
AdvanceTime(webrtc::TimeDelta::Seconds(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Explicit handle.
|
// Explicit handle.
|
||||||
|
|||||||
@ -748,7 +748,7 @@ TEST_F(RTCStatsCollectorTest, CachedStatsReports) {
|
|||||||
rtc::scoped_refptr<const RTCStatsReport> c = stats_->GetStatsReport();
|
rtc::scoped_refptr<const RTCStatsReport> c = stats_->GetStatsReport();
|
||||||
EXPECT_NE(b.get(), c.get());
|
EXPECT_NE(b.get(), c.get());
|
||||||
// Invalidate cache by advancing time.
|
// Invalidate cache by advancing time.
|
||||||
fake_clock_.AdvanceTime(TimeDelta::ms(51));
|
fake_clock_.AdvanceTime(TimeDelta::Millis(51));
|
||||||
rtc::scoped_refptr<const RTCStatsReport> d = stats_->GetStatsReport();
|
rtc::scoped_refptr<const RTCStatsReport> d = stats_->GetStatsReport();
|
||||||
EXPECT_TRUE(d);
|
EXPECT_TRUE(d);
|
||||||
EXPECT_NE(c.get(), d.get());
|
EXPECT_NE(c.get(), d.get());
|
||||||
@ -759,7 +759,7 @@ TEST_F(RTCStatsCollectorTest, MultipleCallbacksWithInvalidatedCacheInBetween) {
|
|||||||
stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&a));
|
stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&a));
|
||||||
stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&b));
|
stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&b));
|
||||||
// Cache is invalidated after 50 ms.
|
// Cache is invalidated after 50 ms.
|
||||||
fake_clock_.AdvanceTime(TimeDelta::ms(51));
|
fake_clock_.AdvanceTime(TimeDelta::Millis(51));
|
||||||
stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&c));
|
stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&c));
|
||||||
EXPECT_TRUE_WAIT(a, kGetStatsReportTimeoutMs);
|
EXPECT_TRUE_WAIT(a, kGetStatsReportTimeoutMs);
|
||||||
EXPECT_TRUE_WAIT(b, kGetStatsReportTimeoutMs);
|
EXPECT_TRUE_WAIT(b, kGetStatsReportTimeoutMs);
|
||||||
@ -2582,7 +2582,7 @@ TEST_P(RTCStatsCollectorTestWithParamKind,
|
|||||||
|
|
||||||
// The report block's timestamp cannot be from the future, set the fake clock
|
// The report block's timestamp cannot be from the future, set the fake clock
|
||||||
// to match.
|
// to match.
|
||||||
fake_clock_.SetTime(Timestamp::us(kReportBlockTimestampUtcUs));
|
fake_clock_.SetTime(Timestamp::Micros(kReportBlockTimestampUtcUs));
|
||||||
|
|
||||||
RTCPReportBlock report_block;
|
RTCPReportBlock report_block;
|
||||||
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
|
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
|
||||||
@ -2631,7 +2631,7 @@ TEST_P(RTCStatsCollectorTestWithParamKind,
|
|||||||
TEST_P(RTCStatsCollectorTestWithParamKind,
|
TEST_P(RTCStatsCollectorTestWithParamKind,
|
||||||
RTCRemoteInboundRtpStreamStatsWithTimestampFromReportBlock) {
|
RTCRemoteInboundRtpStreamStatsWithTimestampFromReportBlock) {
|
||||||
const int64_t kReportBlockTimestampUtcUs = 123456789;
|
const int64_t kReportBlockTimestampUtcUs = 123456789;
|
||||||
fake_clock_.SetTime(Timestamp::us(kReportBlockTimestampUtcUs));
|
fake_clock_.SetTime(Timestamp::Micros(kReportBlockTimestampUtcUs));
|
||||||
|
|
||||||
RTCPReportBlock report_block;
|
RTCPReportBlock report_block;
|
||||||
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
|
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
|
||||||
@ -2644,7 +2644,7 @@ TEST_P(RTCStatsCollectorTestWithParamKind,
|
|||||||
absl::nullopt);
|
absl::nullopt);
|
||||||
|
|
||||||
// Advance time, it should be OK to have fresher reports than report blocks.
|
// Advance time, it should be OK to have fresher reports than report blocks.
|
||||||
fake_clock_.AdvanceTime(TimeDelta::us(1234));
|
fake_clock_.AdvanceTime(TimeDelta::Micros(1234));
|
||||||
|
|
||||||
rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
|
rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
|
||||||
|
|
||||||
@ -2663,7 +2663,7 @@ TEST_P(RTCStatsCollectorTestWithParamKind,
|
|||||||
TEST_P(RTCStatsCollectorTestWithParamKind,
|
TEST_P(RTCStatsCollectorTestWithParamKind,
|
||||||
RTCRemoteInboundRtpStreamStatsWithCodecBasedMembers) {
|
RTCRemoteInboundRtpStreamStatsWithCodecBasedMembers) {
|
||||||
const int64_t kReportBlockTimestampUtcUs = 123456789;
|
const int64_t kReportBlockTimestampUtcUs = 123456789;
|
||||||
fake_clock_.SetTime(Timestamp::us(kReportBlockTimestampUtcUs));
|
fake_clock_.SetTime(Timestamp::Micros(kReportBlockTimestampUtcUs));
|
||||||
|
|
||||||
RTCPReportBlock report_block;
|
RTCPReportBlock report_block;
|
||||||
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
|
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
|
||||||
@ -2700,7 +2700,7 @@ TEST_P(RTCStatsCollectorTestWithParamKind,
|
|||||||
TEST_P(RTCStatsCollectorTestWithParamKind,
|
TEST_P(RTCStatsCollectorTestWithParamKind,
|
||||||
RTCRemoteInboundRtpStreamStatsWithRtcpTransport) {
|
RTCRemoteInboundRtpStreamStatsWithRtcpTransport) {
|
||||||
const int64_t kReportBlockTimestampUtcUs = 123456789;
|
const int64_t kReportBlockTimestampUtcUs = 123456789;
|
||||||
fake_clock_.SetTime(Timestamp::us(kReportBlockTimestampUtcUs));
|
fake_clock_.SetTime(Timestamp::Micros(kReportBlockTimestampUtcUs));
|
||||||
|
|
||||||
RTCPReportBlock report_block;
|
RTCPReportBlock report_block;
|
||||||
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
|
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class FakePeriodicVideoSource final
|
|||||||
thread_checker_.Detach();
|
thread_checker_.Detach();
|
||||||
frame_source_.SetRotation(config.rotation);
|
frame_source_.SetRotation(config.rotation);
|
||||||
|
|
||||||
TimeDelta frame_interval = TimeDelta::ms(config.frame_interval_ms);
|
TimeDelta frame_interval = TimeDelta::Millis(config.frame_interval_ms);
|
||||||
RepeatingTaskHandle::Start(task_queue_->Get(), [this, frame_interval] {
|
RepeatingTaskHandle::Start(task_queue_->Get(), [this, frame_interval] {
|
||||||
if (broadcaster_.wants().rotation_applied) {
|
if (broadcaster_.wants().rotation_applied) {
|
||||||
broadcaster_.OnFrame(frame_source_.GetFrameRotationApplied());
|
broadcaster_.OnFrame(frame_source_.GetFrameRotationApplied());
|
||||||
|
|||||||
@ -118,7 +118,7 @@ class TestFrame : public RecordableEncodedFrame {
|
|||||||
EncodedResolution resolution() const override {
|
EncodedResolution resolution() const override {
|
||||||
return EncodedResolution{0, 0};
|
return EncodedResolution{0, 0};
|
||||||
}
|
}
|
||||||
Timestamp render_time() const override { return Timestamp::ms(0); }
|
Timestamp render_time() const override { return Timestamp::Millis(0); }
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(VideoRtpTrackSourceTest, BroadcastsFrames) {
|
TEST(VideoRtpTrackSourceTest, BroadcastsFrames) {
|
||||||
|
|||||||
@ -74,11 +74,11 @@ absl::optional<TimeDelta> ParseTypedParameter<TimeDelta>(std::string str) {
|
|||||||
absl::optional<ValueWithUnit> result = ParseValueWithUnit(str);
|
absl::optional<ValueWithUnit> result = ParseValueWithUnit(str);
|
||||||
if (result) {
|
if (result) {
|
||||||
if (result->unit == "s" || result->unit == "seconds") {
|
if (result->unit == "s" || result->unit == "seconds") {
|
||||||
return TimeDelta::seconds(result->value);
|
return TimeDelta::Seconds(result->value);
|
||||||
} else if (result->unit == "us") {
|
} else if (result->unit == "us") {
|
||||||
return TimeDelta::us(result->value);
|
return TimeDelta::Micros(result->value);
|
||||||
} else if (result->unit.empty() || result->unit == "ms") {
|
} else if (result->unit.empty() || result->unit == "ms") {
|
||||||
return TimeDelta::ms(result->value);
|
return TimeDelta::Millis(result->value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return absl::nullopt;
|
return absl::nullopt;
|
||||||
|
|||||||
@ -21,7 +21,7 @@ struct DummyExperiment {
|
|||||||
FieldTrialParameter<DataRate> target_rate =
|
FieldTrialParameter<DataRate> target_rate =
|
||||||
FieldTrialParameter<DataRate>("t", DataRate::kbps(100));
|
FieldTrialParameter<DataRate>("t", DataRate::kbps(100));
|
||||||
FieldTrialParameter<TimeDelta> period =
|
FieldTrialParameter<TimeDelta> period =
|
||||||
FieldTrialParameter<TimeDelta>("p", TimeDelta::ms(100));
|
FieldTrialParameter<TimeDelta>("p", TimeDelta::Millis(100));
|
||||||
FieldTrialOptional<DataSize> max_buffer =
|
FieldTrialOptional<DataSize> max_buffer =
|
||||||
FieldTrialOptional<DataSize>("b", absl::nullopt);
|
FieldTrialOptional<DataSize>("b", absl::nullopt);
|
||||||
|
|
||||||
@ -35,19 +35,19 @@ TEST(FieldTrialParserUnitsTest, FallsBackToDefaults) {
|
|||||||
DummyExperiment exp("");
|
DummyExperiment exp("");
|
||||||
EXPECT_EQ(exp.target_rate.Get(), DataRate::kbps(100));
|
EXPECT_EQ(exp.target_rate.Get(), DataRate::kbps(100));
|
||||||
EXPECT_FALSE(exp.max_buffer.GetOptional().has_value());
|
EXPECT_FALSE(exp.max_buffer.GetOptional().has_value());
|
||||||
EXPECT_EQ(exp.period.Get(), TimeDelta::ms(100));
|
EXPECT_EQ(exp.period.Get(), TimeDelta::Millis(100));
|
||||||
}
|
}
|
||||||
TEST(FieldTrialParserUnitsTest, ParsesUnitParameters) {
|
TEST(FieldTrialParserUnitsTest, ParsesUnitParameters) {
|
||||||
DummyExperiment exp("t:300kbps,b:5bytes,p:300ms");
|
DummyExperiment exp("t:300kbps,b:5bytes,p:300ms");
|
||||||
EXPECT_EQ(exp.target_rate.Get(), DataRate::kbps(300));
|
EXPECT_EQ(exp.target_rate.Get(), DataRate::kbps(300));
|
||||||
EXPECT_EQ(*exp.max_buffer.GetOptional(), DataSize::bytes(5));
|
EXPECT_EQ(*exp.max_buffer.GetOptional(), DataSize::bytes(5));
|
||||||
EXPECT_EQ(exp.period.Get(), TimeDelta::ms(300));
|
EXPECT_EQ(exp.period.Get(), TimeDelta::Millis(300));
|
||||||
}
|
}
|
||||||
TEST(FieldTrialParserUnitsTest, ParsesDefaultUnitParameters) {
|
TEST(FieldTrialParserUnitsTest, ParsesDefaultUnitParameters) {
|
||||||
DummyExperiment exp("t:300,b:5,p:300");
|
DummyExperiment exp("t:300,b:5,p:300");
|
||||||
EXPECT_EQ(exp.target_rate.Get(), DataRate::kbps(300));
|
EXPECT_EQ(exp.target_rate.Get(), DataRate::kbps(300));
|
||||||
EXPECT_EQ(*exp.max_buffer.GetOptional(), DataSize::bytes(5));
|
EXPECT_EQ(*exp.max_buffer.GetOptional(), DataSize::bytes(5));
|
||||||
EXPECT_EQ(exp.period.Get(), TimeDelta::ms(300));
|
EXPECT_EQ(exp.period.Get(), TimeDelta::Millis(300));
|
||||||
}
|
}
|
||||||
TEST(FieldTrialParserUnitsTest, ParsesInfinityParameter) {
|
TEST(FieldTrialParserUnitsTest, ParsesInfinityParameter) {
|
||||||
DummyExperiment exp("t:inf,p:inf");
|
DummyExperiment exp("t:inf,p:inf");
|
||||||
@ -58,13 +58,14 @@ TEST(FieldTrialParserUnitsTest, ParsesOtherUnitParameters) {
|
|||||||
DummyExperiment exp("t:300bps,p:0.3 seconds,b:8 bytes");
|
DummyExperiment exp("t:300bps,p:0.3 seconds,b:8 bytes");
|
||||||
EXPECT_EQ(exp.target_rate.Get(), DataRate::bps(300));
|
EXPECT_EQ(exp.target_rate.Get(), DataRate::bps(300));
|
||||||
EXPECT_EQ(*exp.max_buffer.GetOptional(), DataSize::bytes(8));
|
EXPECT_EQ(*exp.max_buffer.GetOptional(), DataSize::bytes(8));
|
||||||
EXPECT_EQ(exp.period.Get(), TimeDelta::ms(300));
|
EXPECT_EQ(exp.period.Get(), TimeDelta::Millis(300));
|
||||||
}
|
}
|
||||||
TEST(FieldTrialParserUnitsTest, IgnoresOutOfRange) {
|
TEST(FieldTrialParserUnitsTest, IgnoresOutOfRange) {
|
||||||
FieldTrialConstrained<DataRate> rate("r", DataRate::kbps(30),
|
FieldTrialConstrained<DataRate> rate("r", DataRate::kbps(30),
|
||||||
DataRate::kbps(10), DataRate::kbps(100));
|
DataRate::kbps(10), DataRate::kbps(100));
|
||||||
FieldTrialConstrained<TimeDelta> delta("d", TimeDelta::ms(30),
|
FieldTrialConstrained<TimeDelta> delta("d", TimeDelta::Millis(30),
|
||||||
TimeDelta::ms(10), TimeDelta::ms(100));
|
TimeDelta::Millis(10),
|
||||||
|
TimeDelta::Millis(100));
|
||||||
FieldTrialConstrained<DataSize> size(
|
FieldTrialConstrained<DataSize> size(
|
||||||
"s", DataSize::bytes(30), DataSize::bytes(10), DataSize::bytes(100));
|
"s", DataSize::bytes(30), DataSize::bytes(10), DataSize::bytes(100));
|
||||||
ParseFieldTrial({&rate, &delta, &size}, "r:0,d:0,s:0");
|
ParseFieldTrial({&rate, &delta, &size}, "r:0,d:0,s:0");
|
||||||
|
|||||||
@ -19,7 +19,7 @@ struct DummyConfig {
|
|||||||
unsigned size = 3;
|
unsigned size = 3;
|
||||||
bool ping = 0;
|
bool ping = 0;
|
||||||
absl::optional<TimeDelta> duration;
|
absl::optional<TimeDelta> duration;
|
||||||
absl::optional<TimeDelta> latency = TimeDelta::ms(100);
|
absl::optional<TimeDelta> latency = TimeDelta::Millis(100);
|
||||||
std::unique_ptr<StructParametersParser> Parser();
|
std::unique_ptr<StructParametersParser> Parser();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -21,13 +21,13 @@ TEST(ScopedFakeClockTest, OverridesGlobalClock) {
|
|||||||
ScopedFakeClock scoped;
|
ScopedFakeClock scoped;
|
||||||
EXPECT_EQ(rtc::TimeMicros(), 0);
|
EXPECT_EQ(rtc::TimeMicros(), 0);
|
||||||
|
|
||||||
scoped.AdvanceTime(webrtc::TimeDelta::ms(1));
|
scoped.AdvanceTime(webrtc::TimeDelta::Millis(1));
|
||||||
EXPECT_EQ(rtc::TimeMicros(), 1000);
|
EXPECT_EQ(rtc::TimeMicros(), 1000);
|
||||||
|
|
||||||
scoped.SetTime(webrtc::Timestamp::us(kFixedTimeUs));
|
scoped.SetTime(webrtc::Timestamp::Micros(kFixedTimeUs));
|
||||||
EXPECT_EQ(rtc::TimeMicros(), kFixedTimeUs);
|
EXPECT_EQ(rtc::TimeMicros(), kFixedTimeUs);
|
||||||
|
|
||||||
scoped.AdvanceTime(webrtc::TimeDelta::ms(1));
|
scoped.AdvanceTime(webrtc::TimeDelta::Millis(1));
|
||||||
EXPECT_EQ(rtc::TimeMicros(), kFixedTimeUs + 1000);
|
EXPECT_EQ(rtc::TimeMicros(), kFixedTimeUs + 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -100,7 +100,7 @@
|
|||||||
#define SIMULATED_WAIT(ex, timeout, clock) \
|
#define SIMULATED_WAIT(ex, timeout, clock) \
|
||||||
for (int64_t start = rtc::TimeMillis(); \
|
for (int64_t start = rtc::TimeMillis(); \
|
||||||
!(ex) && rtc::TimeMillis() < start + (timeout);) { \
|
!(ex) && rtc::TimeMillis() < start + (timeout);) { \
|
||||||
(clock).AdvanceTime(webrtc::TimeDelta::ms(1)); \
|
(clock).AdvanceTime(webrtc::TimeDelta::Millis(1)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
// This returns the result of the test in res, so that we don't re-evaluate
|
// This returns the result of the test in res, so that we don't re-evaluate
|
||||||
@ -111,7 +111,7 @@
|
|||||||
int64_t start = rtc::TimeMillis(); \
|
int64_t start = rtc::TimeMillis(); \
|
||||||
res = (ex); \
|
res = (ex); \
|
||||||
while (!res && rtc::TimeMillis() < start + (timeout)) { \
|
while (!res && rtc::TimeMillis() < start + (timeout)) { \
|
||||||
(clock).AdvanceTime(webrtc::TimeDelta::ms(1)); \
|
(clock).AdvanceTime(webrtc::TimeDelta::Millis(1)); \
|
||||||
res = (ex); \
|
res = (ex); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|||||||
@ -59,7 +59,7 @@ void SampleStats<TimeDelta>::AddSample(TimeDelta delta) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SampleStats<TimeDelta>::AddSampleMs(double delta_ms) {
|
void SampleStats<TimeDelta>::AddSampleMs(double delta_ms) {
|
||||||
AddSample(TimeDelta::ms(delta_ms));
|
AddSample(TimeDelta::Millis(delta_ms));
|
||||||
}
|
}
|
||||||
void SampleStats<TimeDelta>::AddSamples(const SampleStats<TimeDelta>& other) {
|
void SampleStats<TimeDelta>::AddSamples(const SampleStats<TimeDelta>& other) {
|
||||||
stats_.AddSamples(other.stats_);
|
stats_.AddSamples(other.stats_);
|
||||||
@ -70,11 +70,11 @@ bool SampleStats<TimeDelta>::IsEmpty() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TimeDelta SampleStats<TimeDelta>::Max() {
|
TimeDelta SampleStats<TimeDelta>::Max() {
|
||||||
return TimeDelta::seconds(stats_.Max());
|
return TimeDelta::Seconds(stats_.Max());
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeDelta SampleStats<TimeDelta>::Mean() {
|
TimeDelta SampleStats<TimeDelta>::Mean() {
|
||||||
return TimeDelta::seconds(stats_.Mean());
|
return TimeDelta::Seconds(stats_.Mean());
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeDelta SampleStats<TimeDelta>::Median() {
|
TimeDelta SampleStats<TimeDelta>::Median() {
|
||||||
@ -82,19 +82,19 @@ TimeDelta SampleStats<TimeDelta>::Median() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TimeDelta SampleStats<TimeDelta>::Quantile(double quantile) {
|
TimeDelta SampleStats<TimeDelta>::Quantile(double quantile) {
|
||||||
return TimeDelta::seconds(stats_.Quantile(quantile));
|
return TimeDelta::Seconds(stats_.Quantile(quantile));
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeDelta SampleStats<TimeDelta>::Min() {
|
TimeDelta SampleStats<TimeDelta>::Min() {
|
||||||
return TimeDelta::seconds(stats_.Min());
|
return TimeDelta::Seconds(stats_.Min());
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeDelta SampleStats<TimeDelta>::Variance() {
|
TimeDelta SampleStats<TimeDelta>::Variance() {
|
||||||
return TimeDelta::seconds(stats_.Variance());
|
return TimeDelta::Seconds(stats_.Variance());
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeDelta SampleStats<TimeDelta>::StandardDeviation() {
|
TimeDelta SampleStats<TimeDelta>::StandardDeviation() {
|
||||||
return TimeDelta::seconds(stats_.StandardDeviation());
|
return TimeDelta::Seconds(stats_.StandardDeviation());
|
||||||
}
|
}
|
||||||
|
|
||||||
int SampleStats<TimeDelta>::Count() {
|
int SampleStats<TimeDelta>::Count() {
|
||||||
|
|||||||
@ -27,7 +27,7 @@ SamplesStatsCounter& SamplesStatsCounter::operator=(SamplesStatsCounter&&) =
|
|||||||
default;
|
default;
|
||||||
|
|
||||||
void SamplesStatsCounter::AddSample(double value) {
|
void SamplesStatsCounter::AddSample(double value) {
|
||||||
AddSample(StatsSample{value, Timestamp::us(rtc::TimeMicros())});
|
AddSample(StatsSample{value, Timestamp::Micros(rtc::TimeMicros())});
|
||||||
}
|
}
|
||||||
|
|
||||||
void SamplesStatsCounter::AddSample(StatsSample sample) {
|
void SamplesStatsCounter::AddSample(StatsSample sample) {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ namespace webrtc_repeating_task_impl {
|
|||||||
RepeatingTaskBase::RepeatingTaskBase(TaskQueueBase* task_queue,
|
RepeatingTaskBase::RepeatingTaskBase(TaskQueueBase* task_queue,
|
||||||
TimeDelta first_delay)
|
TimeDelta first_delay)
|
||||||
: task_queue_(task_queue),
|
: task_queue_(task_queue),
|
||||||
next_run_time_(Timestamp::us(rtc::TimeMicros()) + first_delay) {}
|
next_run_time_(Timestamp::Micros(rtc::TimeMicros()) + first_delay) {}
|
||||||
|
|
||||||
RepeatingTaskBase::~RepeatingTaskBase() = default;
|
RepeatingTaskBase::~RepeatingTaskBase() = default;
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ bool RepeatingTaskBase::Run() {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
RTC_DCHECK(delay.IsFinite());
|
RTC_DCHECK(delay.IsFinite());
|
||||||
TimeDelta lost_time = Timestamp::us(rtc::TimeMicros()) - next_run_time_;
|
TimeDelta lost_time = Timestamp::Micros(rtc::TimeMicros()) - next_run_time_;
|
||||||
next_run_time_ += delay;
|
next_run_time_ += delay;
|
||||||
delay -= lost_time;
|
delay -= lost_time;
|
||||||
delay = std::max(delay, TimeDelta::Zero());
|
delay = std::max(delay, TimeDelta::Zero());
|
||||||
|
|||||||
@ -30,7 +30,7 @@ using ::testing::MockFunction;
|
|||||||
using ::testing::NiceMock;
|
using ::testing::NiceMock;
|
||||||
using ::testing::Return;
|
using ::testing::Return;
|
||||||
|
|
||||||
constexpr TimeDelta kTimeout = TimeDelta::Millis<1000>();
|
constexpr TimeDelta kTimeout = TimeDelta::Millis(1000);
|
||||||
|
|
||||||
void Sleep(TimeDelta time_delta) {
|
void Sleep(TimeDelta time_delta) {
|
||||||
// Note that Chromium style guide prohibits use of <thread> and <chrono> in
|
// Note that Chromium style guide prohibits use of <thread> and <chrono> in
|
||||||
@ -63,8 +63,8 @@ class MoveOnlyClosure {
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TEST(RepeatingTaskTest, TaskIsStoppedOnStop) {
|
TEST(RepeatingTaskTest, TaskIsStoppedOnStop) {
|
||||||
const TimeDelta kShortInterval = TimeDelta::ms(50);
|
const TimeDelta kShortInterval = TimeDelta::Millis(50);
|
||||||
const TimeDelta kLongInterval = TimeDelta::ms(200);
|
const TimeDelta kLongInterval = TimeDelta::Millis(200);
|
||||||
const int kShortIntervalCount = 4;
|
const int kShortIntervalCount = 4;
|
||||||
const int kMargin = 1;
|
const int kMargin = 1;
|
||||||
|
|
||||||
@ -90,10 +90,10 @@ TEST(RepeatingTaskTest, TaskIsStoppedOnStop) {
|
|||||||
TEST(RepeatingTaskTest, CompensatesForLongRunTime) {
|
TEST(RepeatingTaskTest, CompensatesForLongRunTime) {
|
||||||
const int kTargetCount = 20;
|
const int kTargetCount = 20;
|
||||||
const int kTargetCountMargin = 2;
|
const int kTargetCountMargin = 2;
|
||||||
const TimeDelta kRepeatInterval = TimeDelta::ms(2);
|
const TimeDelta kRepeatInterval = TimeDelta::Millis(2);
|
||||||
// Sleeping inside the task for longer than the repeat interval once, should
|
// Sleeping inside the task for longer than the repeat interval once, should
|
||||||
// be compensated for by repeating the task faster to catch up.
|
// be compensated for by repeating the task faster to catch up.
|
||||||
const TimeDelta kSleepDuration = TimeDelta::ms(20);
|
const TimeDelta kSleepDuration = TimeDelta::Millis(20);
|
||||||
const int kSleepAtCount = 3;
|
const int kSleepAtCount = 3;
|
||||||
|
|
||||||
std::atomic_int counter(0);
|
std::atomic_int counter(0);
|
||||||
@ -115,10 +115,10 @@ TEST(RepeatingTaskTest, CompensatesForShortRunTime) {
|
|||||||
RepeatingTaskHandle::Start(task_queue.Get(), [&] {
|
RepeatingTaskHandle::Start(task_queue.Get(), [&] {
|
||||||
++counter;
|
++counter;
|
||||||
// Sleeping for the 100 ms should be compensated.
|
// Sleeping for the 100 ms should be compensated.
|
||||||
Sleep(TimeDelta::ms(100));
|
Sleep(TimeDelta::Millis(100));
|
||||||
return TimeDelta::ms(300);
|
return TimeDelta::Millis(300);
|
||||||
});
|
});
|
||||||
Sleep(TimeDelta::ms(400));
|
Sleep(TimeDelta::Millis(400));
|
||||||
|
|
||||||
// We expect that the task have been called twice, once directly at Start and
|
// We expect that the task have been called twice, once directly at Start and
|
||||||
// once after 300 ms has passed.
|
// once after 300 ms has passed.
|
||||||
@ -132,7 +132,7 @@ TEST(RepeatingTaskTest, CancelDelayedTaskBeforeItRuns) {
|
|||||||
EXPECT_CALL(mock, Delete).WillOnce(Invoke([&done] { done.Set(); }));
|
EXPECT_CALL(mock, Delete).WillOnce(Invoke([&done] { done.Set(); }));
|
||||||
TaskQueueForTest task_queue("queue");
|
TaskQueueForTest task_queue("queue");
|
||||||
auto handle = RepeatingTaskHandle::DelayedStart(
|
auto handle = RepeatingTaskHandle::DelayedStart(
|
||||||
task_queue.Get(), TimeDelta::ms(100), MoveOnlyClosure(&mock));
|
task_queue.Get(), TimeDelta::Millis(100), MoveOnlyClosure(&mock));
|
||||||
task_queue.PostTask(
|
task_queue.PostTask(
|
||||||
[handle = std::move(handle)]() mutable { handle.Stop(); });
|
[handle = std::move(handle)]() mutable { handle.Stop(); });
|
||||||
EXPECT_TRUE(done.Wait(kTimeout.ms()));
|
EXPECT_TRUE(done.Wait(kTimeout.ms()));
|
||||||
@ -141,7 +141,7 @@ TEST(RepeatingTaskTest, CancelDelayedTaskBeforeItRuns) {
|
|||||||
TEST(RepeatingTaskTest, CancelTaskAfterItRuns) {
|
TEST(RepeatingTaskTest, CancelTaskAfterItRuns) {
|
||||||
rtc::Event done;
|
rtc::Event done;
|
||||||
MockClosure mock;
|
MockClosure mock;
|
||||||
EXPECT_CALL(mock, Call).WillOnce(Return(TimeDelta::ms(100)));
|
EXPECT_CALL(mock, Call).WillOnce(Return(TimeDelta::Millis(100)));
|
||||||
EXPECT_CALL(mock, Delete).WillOnce(Invoke([&done] { done.Set(); }));
|
EXPECT_CALL(mock, Delete).WillOnce(Invoke([&done] { done.Set(); }));
|
||||||
TaskQueueForTest task_queue("queue");
|
TaskQueueForTest task_queue("queue");
|
||||||
auto handle =
|
auto handle =
|
||||||
@ -159,10 +159,10 @@ TEST(RepeatingTaskTest, TaskCanStopItself) {
|
|||||||
handle = RepeatingTaskHandle::Start(task_queue.Get(), [&] {
|
handle = RepeatingTaskHandle::Start(task_queue.Get(), [&] {
|
||||||
++counter;
|
++counter;
|
||||||
handle.Stop();
|
handle.Stop();
|
||||||
return TimeDelta::ms(2);
|
return TimeDelta::Millis(2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Sleep(TimeDelta::ms(10));
|
Sleep(TimeDelta::Millis(10));
|
||||||
EXPECT_EQ(counter.load(), 1);
|
EXPECT_EQ(counter.load(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,8 +184,8 @@ TEST(RepeatingTaskTest, StartPeriodicTask) {
|
|||||||
MockFunction<TimeDelta()> closure;
|
MockFunction<TimeDelta()> closure;
|
||||||
rtc::Event done;
|
rtc::Event done;
|
||||||
EXPECT_CALL(closure, Call())
|
EXPECT_CALL(closure, Call())
|
||||||
.WillOnce(Return(TimeDelta::ms(20)))
|
.WillOnce(Return(TimeDelta::Millis(20)))
|
||||||
.WillOnce(Return(TimeDelta::ms(20)))
|
.WillOnce(Return(TimeDelta::Millis(20)))
|
||||||
.WillOnce(Invoke([&done] {
|
.WillOnce(Invoke([&done] {
|
||||||
done.Set();
|
done.Set();
|
||||||
return kTimeout;
|
return kTimeout;
|
||||||
@ -199,7 +199,7 @@ TEST(RepeatingTaskTest, Example) {
|
|||||||
class ObjectOnTaskQueue {
|
class ObjectOnTaskQueue {
|
||||||
public:
|
public:
|
||||||
void DoPeriodicTask() {}
|
void DoPeriodicTask() {}
|
||||||
TimeDelta TimeUntilNextRun() { return TimeDelta::ms(100); }
|
TimeDelta TimeUntilNextRun() { return TimeDelta::Millis(100); }
|
||||||
void StartPeriodicTask(RepeatingTaskHandle* handle,
|
void StartPeriodicTask(RepeatingTaskHandle* handle,
|
||||||
TaskQueueBase* task_queue) {
|
TaskQueueBase* task_queue) {
|
||||||
*handle = RepeatingTaskHandle::Start(task_queue, [this] {
|
*handle = RepeatingTaskHandle::Start(task_queue, [this] {
|
||||||
|
|||||||
@ -1134,7 +1134,7 @@ TEST(ThreadPostDelayedTaskTest, InvokesInDelayOrder) {
|
|||||||
// All tasks have been posted before the first one is unblocked.
|
// All tasks have been posted before the first one is unblocked.
|
||||||
first.Set();
|
first.Set();
|
||||||
// Only if the chain is invoked in delay order will the last event be set.
|
// Only if the chain is invoked in delay order will the last event be set.
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::ms(11));
|
clock.AdvanceTime(webrtc::TimeDelta::Millis(11));
|
||||||
EXPECT_TRUE(fourth.Wait(0));
|
EXPECT_TRUE(fourth.Wait(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -218,7 +218,7 @@ TEST(FakeClock, TimeFunctionsUseFakeClock) {
|
|||||||
FakeClock clock;
|
FakeClock clock;
|
||||||
SetClockForTesting(&clock);
|
SetClockForTesting(&clock);
|
||||||
|
|
||||||
clock.SetTime(webrtc::Timestamp::us(987654));
|
clock.SetTime(webrtc::Timestamp::Micros(987654));
|
||||||
EXPECT_EQ(987u, Time32());
|
EXPECT_EQ(987u, Time32());
|
||||||
EXPECT_EQ(987, TimeMillis());
|
EXPECT_EQ(987, TimeMillis());
|
||||||
EXPECT_EQ(987654, TimeMicros());
|
EXPECT_EQ(987654, TimeMicros());
|
||||||
@ -237,21 +237,21 @@ TEST(FakeClock, InitialTime) {
|
|||||||
|
|
||||||
TEST(FakeClock, SetTime) {
|
TEST(FakeClock, SetTime) {
|
||||||
FakeClock clock;
|
FakeClock clock;
|
||||||
clock.SetTime(webrtc::Timestamp::us(123));
|
clock.SetTime(webrtc::Timestamp::Micros(123));
|
||||||
EXPECT_EQ(123000, clock.TimeNanos());
|
EXPECT_EQ(123000, clock.TimeNanos());
|
||||||
clock.SetTime(webrtc::Timestamp::us(456));
|
clock.SetTime(webrtc::Timestamp::Micros(456));
|
||||||
EXPECT_EQ(456000, clock.TimeNanos());
|
EXPECT_EQ(456000, clock.TimeNanos());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(FakeClock, AdvanceTime) {
|
TEST(FakeClock, AdvanceTime) {
|
||||||
FakeClock clock;
|
FakeClock clock;
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::us(1u));
|
clock.AdvanceTime(webrtc::TimeDelta::Micros(1u));
|
||||||
EXPECT_EQ(1000, clock.TimeNanos());
|
EXPECT_EQ(1000, clock.TimeNanos());
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::us(2222u));
|
clock.AdvanceTime(webrtc::TimeDelta::Micros(2222u));
|
||||||
EXPECT_EQ(2223000, clock.TimeNanos());
|
EXPECT_EQ(2223000, clock.TimeNanos());
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::ms(3333u));
|
clock.AdvanceTime(webrtc::TimeDelta::Millis(3333u));
|
||||||
EXPECT_EQ(3335223000, clock.TimeNanos());
|
EXPECT_EQ(3335223000, clock.TimeNanos());
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(4444u));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(4444u));
|
||||||
EXPECT_EQ(4447335223000, clock.TimeNanos());
|
EXPECT_EQ(4447335223000, clock.TimeNanos());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,7 +282,7 @@ TEST(FakeClock, SettingTimeWakesThreads) {
|
|||||||
|
|
||||||
// Advance the fake clock, expecting the worker thread to wake up
|
// Advance the fake clock, expecting the worker thread to wake up
|
||||||
// and dispatch the message instantly.
|
// and dispatch the message instantly.
|
||||||
clock.AdvanceTime(webrtc::TimeDelta::seconds(60u));
|
clock.AdvanceTime(webrtc::TimeDelta::Seconds(60u));
|
||||||
EXPECT_TRUE(message_handler_dispatched.Wait(0));
|
EXPECT_TRUE(message_handler_dispatched.Wait(0));
|
||||||
worker->Stop();
|
worker->Stop();
|
||||||
|
|
||||||
|
|||||||
@ -637,7 +637,7 @@ bool VirtualSocketServer::ProcessMessagesUntilIdle() {
|
|||||||
if (fake_clock_) {
|
if (fake_clock_) {
|
||||||
// If using a fake clock, advance it in millisecond increments until the
|
// If using a fake clock, advance it in millisecond increments until the
|
||||||
// queue is empty.
|
// queue is empty.
|
||||||
fake_clock_->AdvanceTime(webrtc::TimeDelta::ms(1));
|
fake_clock_->AdvanceTime(webrtc::TimeDelta::Millis(1));
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, run a normal message loop.
|
// Otherwise, run a normal message loop.
|
||||||
Message msg;
|
Message msg;
|
||||||
|
|||||||
@ -1228,7 +1228,7 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) {
|
|||||||
// TODO(holmer): Log the call config and use that here instead.
|
// TODO(holmer): Log the call config and use that here instead.
|
||||||
static const uint32_t kDefaultStartBitrateBps = 300000;
|
static const uint32_t kDefaultStartBitrateBps = 300000;
|
||||||
NetworkControllerConfig cc_config;
|
NetworkControllerConfig cc_config;
|
||||||
cc_config.constraints.at_time = Timestamp::us(clock.TimeInMicroseconds());
|
cc_config.constraints.at_time = Timestamp::Micros(clock.TimeInMicroseconds());
|
||||||
cc_config.constraints.starting_rate = DataRate::bps(kDefaultStartBitrateBps);
|
cc_config.constraints.starting_rate = DataRate::bps(kDefaultStartBitrateBps);
|
||||||
cc_config.event_log = &null_event_log;
|
cc_config.event_log = &null_event_log;
|
||||||
auto goog_cc = factory.Create(cc_config);
|
auto goog_cc = factory.Create(cc_config);
|
||||||
@ -1298,7 +1298,7 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) {
|
|||||||
transport_feedback.AddPacket(
|
transport_feedback.AddPacket(
|
||||||
packet_info,
|
packet_info,
|
||||||
0u, // Per packet overhead bytes.
|
0u, // Per packet overhead bytes.
|
||||||
Timestamp::us(rtp_packet.rtp.log_time_us()));
|
Timestamp::Micros(rtp_packet.rtp.log_time_us()));
|
||||||
rtc::SentPacket sent_packet(
|
rtc::SentPacket sent_packet(
|
||||||
rtp_packet.rtp.header.extension.transportSequenceNumber,
|
rtp_packet.rtp.header.extension.transportSequenceNumber,
|
||||||
rtp_packet.rtp.log_time_us() / 1000);
|
rtp_packet.rtp.log_time_us() / 1000);
|
||||||
@ -1313,7 +1313,7 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) {
|
|||||||
|
|
||||||
auto feedback_msg = transport_feedback.ProcessTransportFeedback(
|
auto feedback_msg = transport_feedback.ProcessTransportFeedback(
|
||||||
rtcp_iterator->transport_feedback,
|
rtcp_iterator->transport_feedback,
|
||||||
Timestamp::ms(clock.TimeInMilliseconds()));
|
Timestamp::Millis(clock.TimeInMilliseconds()));
|
||||||
absl::optional<uint32_t> bitrate_bps;
|
absl::optional<uint32_t> bitrate_bps;
|
||||||
if (feedback_msg) {
|
if (feedback_msg) {
|
||||||
observer.Update(goog_cc->OnTransportPacketsFeedback(*feedback_msg));
|
observer.Update(goog_cc->OnTransportPacketsFeedback(*feedback_msg));
|
||||||
@ -1345,7 +1345,7 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) {
|
|||||||
if (clock.TimeInMicroseconds() >= NextProcessTime()) {
|
if (clock.TimeInMicroseconds() >= NextProcessTime()) {
|
||||||
RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextProcessTime());
|
RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextProcessTime());
|
||||||
ProcessInterval msg;
|
ProcessInterval msg;
|
||||||
msg.at_time = Timestamp::us(clock.TimeInMicroseconds());
|
msg.at_time = Timestamp::Micros(clock.TimeInMicroseconds());
|
||||||
observer.Update(goog_cc->OnProcessInterval(msg));
|
observer.Update(goog_cc->OnProcessInterval(msg));
|
||||||
next_process_time_us_ += process_interval.us();
|
next_process_time_us_ += process_interval.us();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@ void LogBasedNetworkControllerSimulation::ProcessUntil(Timestamp to_time) {
|
|||||||
controller_ = factory_->Create(config);
|
controller_ = factory_->Create(config);
|
||||||
}
|
}
|
||||||
if (last_process_.IsInfinite() ||
|
if (last_process_.IsInfinite() ||
|
||||||
to_time - last_process_ > TimeDelta::seconds(1)) {
|
to_time - last_process_ > TimeDelta::Seconds(1)) {
|
||||||
last_process_ = to_time;
|
last_process_ = to_time;
|
||||||
current_time_ = to_time;
|
current_time_ = to_time;
|
||||||
ProcessInterval msg;
|
ProcessInterval msg;
|
||||||
@ -107,7 +107,7 @@ void LogBasedNetworkControllerSimulation::OnPacketSent(
|
|||||||
|
|
||||||
void LogBasedNetworkControllerSimulation::OnFeedback(
|
void LogBasedNetworkControllerSimulation::OnFeedback(
|
||||||
const LoggedRtcpPacketTransportFeedback& feedback) {
|
const LoggedRtcpPacketTransportFeedback& feedback) {
|
||||||
auto feedback_time = Timestamp::ms(feedback.log_time_ms());
|
auto feedback_time = Timestamp::Millis(feedback.log_time_ms());
|
||||||
ProcessUntil(feedback_time);
|
ProcessUntil(feedback_time);
|
||||||
auto msg = transport_feedback_.ProcessTransportFeedback(
|
auto msg = transport_feedback_.ProcessTransportFeedback(
|
||||||
feedback.transport_feedback, feedback_time);
|
feedback.transport_feedback, feedback_time);
|
||||||
@ -119,7 +119,7 @@ void LogBasedNetworkControllerSimulation::OnReceiverReport(
|
|||||||
const LoggedRtcpPacketReceiverReport& report) {
|
const LoggedRtcpPacketReceiverReport& report) {
|
||||||
if (report.rr.report_blocks().empty())
|
if (report.rr.report_blocks().empty())
|
||||||
return;
|
return;
|
||||||
auto report_time = Timestamp::ms(report.log_time_ms());
|
auto report_time = Timestamp::Millis(report.log_time_ms());
|
||||||
ProcessUntil(report_time);
|
ProcessUntil(report_time);
|
||||||
int packets_delta = 0;
|
int packets_delta = 0;
|
||||||
int lost_delta = 0;
|
int lost_delta = 0;
|
||||||
@ -150,7 +150,7 @@ void LogBasedNetworkControllerSimulation::OnReceiverReport(
|
|||||||
CompactNtp(TimeMicrosToNtp(report.log_time_us()));
|
CompactNtp(TimeMicrosToNtp(report.log_time_us()));
|
||||||
uint32_t rtt_ntp =
|
uint32_t rtt_ntp =
|
||||||
receive_time_ntp - rb.delay_since_last_sr() - rb.last_sr();
|
receive_time_ntp - rb.delay_since_last_sr() - rb.last_sr();
|
||||||
rtt = std::min(rtt, TimeDelta::ms(CompactNtpRttToMs(rtt_ntp)));
|
rtt = std::min(rtt, TimeDelta::Millis(CompactNtpRttToMs(rtt_ntp)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rtt.IsFinite()) {
|
if (rtt.IsFinite()) {
|
||||||
@ -164,7 +164,7 @@ void LogBasedNetworkControllerSimulation::OnReceiverReport(
|
|||||||
void LogBasedNetworkControllerSimulation::OnIceConfig(
|
void LogBasedNetworkControllerSimulation::OnIceConfig(
|
||||||
const LoggedIceCandidatePairConfig& candidate) {
|
const LoggedIceCandidatePairConfig& candidate) {
|
||||||
if (candidate.type == IceCandidatePairConfigType::kSelected) {
|
if (candidate.type == IceCandidatePairConfigType::kSelected) {
|
||||||
auto log_time = Timestamp::us(candidate.log_time_us());
|
auto log_time = Timestamp::Micros(candidate.log_time_us());
|
||||||
ProcessUntil(log_time);
|
ProcessUntil(log_time);
|
||||||
NetworkRouteChange msg;
|
NetworkRouteChange msg;
|
||||||
msg.at_time = log_time;
|
msg.at_time = log_time;
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class Clock {
|
|||||||
virtual ~Clock() {}
|
virtual ~Clock() {}
|
||||||
// Return a timestamp relative to an unspecified epoch.
|
// Return a timestamp relative to an unspecified epoch.
|
||||||
virtual Timestamp CurrentTime() {
|
virtual Timestamp CurrentTime() {
|
||||||
return Timestamp::us(TimeInMicroseconds());
|
return Timestamp::Micros(TimeInMicroseconds());
|
||||||
}
|
}
|
||||||
virtual int64_t TimeInMilliseconds() { return CurrentTime().ms(); }
|
virtual int64_t TimeInMilliseconds() { return CurrentTime().ms(); }
|
||||||
virtual int64_t TimeInMicroseconds() { return CurrentTime().us(); }
|
virtual int64_t TimeInMicroseconds() { return CurrentTime().us(); }
|
||||||
|
|||||||
@ -32,7 +32,9 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
class RealTimeClock : public Clock {
|
class RealTimeClock : public Clock {
|
||||||
Timestamp CurrentTime() override { return Timestamp::us(rtc::TimeMicros()); }
|
Timestamp CurrentTime() override {
|
||||||
|
return Timestamp::Micros(rtc::TimeMicros());
|
||||||
|
}
|
||||||
// Return a timestamp in milliseconds relative to some arbitrary source; the
|
// Return a timestamp in milliseconds relative to some arbitrary source; the
|
||||||
// source is fixed for this clock.
|
// source is fixed for this clock.
|
||||||
int64_t TimeInMilliseconds() override { return rtc::TimeMillis(); }
|
int64_t TimeInMilliseconds() override { return rtc::TimeMillis(); }
|
||||||
@ -237,7 +239,7 @@ Clock* Clock::GetRealTimeClock() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SimulatedClock::SimulatedClock(int64_t initial_time_us)
|
SimulatedClock::SimulatedClock(int64_t initial_time_us)
|
||||||
: SimulatedClock(Timestamp::us(initial_time_us)) {}
|
: SimulatedClock(Timestamp::Micros(initial_time_us)) {}
|
||||||
|
|
||||||
SimulatedClock::SimulatedClock(Timestamp initial_time)
|
SimulatedClock::SimulatedClock(Timestamp initial_time)
|
||||||
: time_(initial_time), lock_(RWLockWrapper::CreateRWLock()) {}
|
: time_(initial_time), lock_(RWLockWrapper::CreateRWLock()) {}
|
||||||
@ -262,11 +264,11 @@ int64_t SimulatedClock::CurrentNtpInMilliseconds() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SimulatedClock::AdvanceTimeMilliseconds(int64_t milliseconds) {
|
void SimulatedClock::AdvanceTimeMilliseconds(int64_t milliseconds) {
|
||||||
AdvanceTime(TimeDelta::ms(milliseconds));
|
AdvanceTime(TimeDelta::Millis(milliseconds));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimulatedClock::AdvanceTimeMicroseconds(int64_t microseconds) {
|
void SimulatedClock::AdvanceTimeMicroseconds(int64_t microseconds) {
|
||||||
AdvanceTime(TimeDelta::us(microseconds));
|
AdvanceTime(TimeDelta::Micros(microseconds));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimulatedClock::AdvanceTime(TimeDelta delta) {
|
void SimulatedClock::AdvanceTime(TimeDelta delta) {
|
||||||
|
|||||||
@ -108,10 +108,10 @@ void DirectTransport::ProcessPackets() {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
next_process_task_ = RepeatingTaskHandle::DelayedStart(
|
next_process_task_ = RepeatingTaskHandle::DelayedStart(
|
||||||
task_queue_, TimeDelta::ms(*initial_delay_ms), [this] {
|
task_queue_, TimeDelta::Millis(*initial_delay_ms), [this] {
|
||||||
fake_network_->Process();
|
fake_network_->Process();
|
||||||
if (auto delay_ms = fake_network_->TimeUntilNextProcess())
|
if (auto delay_ms = fake_network_->TimeUntilNextProcess())
|
||||||
return TimeDelta::ms(*delay_ms);
|
return TimeDelta::Millis(*delay_ms);
|
||||||
// Otherwise stop the task.
|
// Otherwise stop the task.
|
||||||
rtc::CritScope cs(&process_lock_);
|
rtc::CritScope cs(&process_lock_);
|
||||||
next_process_task_.Stop();
|
next_process_task_.Stop();
|
||||||
|
|||||||
@ -167,9 +167,9 @@ bool FrameGeneratorCapturer::Init() {
|
|||||||
|
|
||||||
frame_task_ = RepeatingTaskHandle::DelayedStart(
|
frame_task_ = RepeatingTaskHandle::DelayedStart(
|
||||||
task_queue_.Get(),
|
task_queue_.Get(),
|
||||||
TimeDelta::seconds(1) / GetCurrentConfiguredFramerate(), [this] {
|
TimeDelta::Seconds(1) / GetCurrentConfiguredFramerate(), [this] {
|
||||||
InsertFrame();
|
InsertFrame();
|
||||||
return TimeDelta::seconds(1) / GetCurrentConfiguredFramerate();
|
return TimeDelta::Seconds(1) / GetCurrentConfiguredFramerate();
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ void FrameGeneratorCapturer::Start() {
|
|||||||
if (!frame_task_.Running()) {
|
if (!frame_task_.Running()) {
|
||||||
frame_task_ = RepeatingTaskHandle::Start(task_queue_.Get(), [this] {
|
frame_task_ = RepeatingTaskHandle::Start(task_queue_.Get(), [this] {
|
||||||
InsertFrame();
|
InsertFrame();
|
||||||
return TimeDelta::seconds(1) / GetCurrentConfiguredFramerate();
|
return TimeDelta::Seconds(1) / GetCurrentConfiguredFramerate();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,7 @@ struct FrameGeneratorCapturerConfig {
|
|||||||
|
|
||||||
struct SquareSlides {
|
struct SquareSlides {
|
||||||
int framerate = 30;
|
int framerate = 30;
|
||||||
TimeDelta change_interval = TimeDelta::seconds(10);
|
TimeDelta change_interval = TimeDelta::Seconds(10);
|
||||||
int width = 1600;
|
int width = 1600;
|
||||||
int height = 1200;
|
int height = 1200;
|
||||||
};
|
};
|
||||||
@ -63,9 +63,9 @@ struct FrameGeneratorCapturerConfig {
|
|||||||
|
|
||||||
struct ImageSlides {
|
struct ImageSlides {
|
||||||
int framerate = 30;
|
int framerate = 30;
|
||||||
TimeDelta change_interval = TimeDelta::seconds(10);
|
TimeDelta change_interval = TimeDelta::Seconds(10);
|
||||||
struct Crop {
|
struct Crop {
|
||||||
TimeDelta scroll_duration = TimeDelta::seconds(0);
|
TimeDelta scroll_duration = TimeDelta::Seconds(0);
|
||||||
absl::optional<int> width;
|
absl::optional<int> width;
|
||||||
absl::optional<int> height;
|
absl::optional<int> height;
|
||||||
} crop;
|
} crop;
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class MockVideoSinkInterfaceVideoFrame
|
|||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
TEST(FrameGeneratorCapturerTest, CreateFromConfig) {
|
TEST(FrameGeneratorCapturerTest, CreateFromConfig) {
|
||||||
GlobalSimulatedTimeController time(Timestamp::seconds(1000));
|
GlobalSimulatedTimeController time(Timestamp::Seconds(1000));
|
||||||
FrameGeneratorCapturerConfig config;
|
FrameGeneratorCapturerConfig config;
|
||||||
config.squares_video->width = 300;
|
config.squares_video->width = 300;
|
||||||
config.squares_video->height = 200;
|
config.squares_video->height = 200;
|
||||||
@ -39,7 +39,7 @@ TEST(FrameGeneratorCapturerTest, CreateFromConfig) {
|
|||||||
capturer->Start();
|
capturer->Start();
|
||||||
EXPECT_CALL(mock_sink, OnFrame(Property(&VideoFrame::width, Eq(300))))
|
EXPECT_CALL(mock_sink, OnFrame(Property(&VideoFrame::width, Eq(300))))
|
||||||
.Times(21);
|
.Times(21);
|
||||||
time.AdvanceTime(TimeDelta::seconds(1));
|
time.AdvanceTime(TimeDelta::Seconds(1));
|
||||||
}
|
}
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -64,7 +64,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DataReader reader(data, size);
|
DataReader reader(data, size);
|
||||||
GlobalSimulatedTimeController time_controller(Timestamp::seconds(0));
|
GlobalSimulatedTimeController time_controller(Timestamp::Seconds(0));
|
||||||
rtc::TaskQueue task_queue(
|
rtc::TaskQueue task_queue(
|
||||||
time_controller.GetTaskQueueFactory()->CreateTaskQueue(
|
time_controller.GetTaskQueueFactory()->CreateTaskQueue(
|
||||||
"time_tq", TaskQueueFactory::Priority::NORMAL));
|
"time_tq", TaskQueueFactory::Priority::NORMAL));
|
||||||
@ -106,7 +106,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
time_controller.AdvanceTime(TimeDelta::ms(reader.GetNum<uint8_t>()));
|
time_controller.AdvanceTime(TimeDelta::Millis(reader.GetNum<uint8_t>()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ void RtpReplayer::Replay(
|
|||||||
// Work around: webrtc calls webrtc::Random(clock.TimeInMicroseconds())
|
// Work around: webrtc calls webrtc::Random(clock.TimeInMicroseconds())
|
||||||
// everywhere and Random expects non-zero seed. Let's set the clock non-zero
|
// everywhere and Random expects non-zero seed. Let's set the clock non-zero
|
||||||
// to make them happy.
|
// to make them happy.
|
||||||
fake_clock.SetTime(webrtc::Timestamp::ms(1));
|
fake_clock.SetTime(webrtc::Timestamp::Millis(1));
|
||||||
|
|
||||||
// Attempt to create an RtpReader from the input file.
|
// Attempt to create an RtpReader from the input file.
|
||||||
auto rtp_reader = CreateRtpReader(rtp_dump_data, rtp_dump_size);
|
auto rtp_reader = CreateRtpReader(rtp_dump_data, rtp_dump_size);
|
||||||
@ -155,7 +155,7 @@ void RtpReplayer::ReplayPackets(rtc::FakeClock* clock,
|
|||||||
if (deliver_in_ms > 0) {
|
if (deliver_in_ms > 0) {
|
||||||
// StatsCounter::ReportMetricToAggregatedCounter is O(elapsed time).
|
// StatsCounter::ReportMetricToAggregatedCounter is O(elapsed time).
|
||||||
// Set an upper limit to prevent waste time.
|
// Set an upper limit to prevent waste time.
|
||||||
clock->AdvanceTime(webrtc::TimeDelta::ms(
|
clock->AdvanceTime(webrtc::TimeDelta::Millis(
|
||||||
std::min(deliver_in_ms, static_cast<int64_t>(100))));
|
std::min(deliver_in_ms, static_cast<int64_t>(100))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -207,7 +207,7 @@ void TcpMessageRouteImpl::HandleLoss(Timestamp at_time) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TcpMessageRouteImpl::SendPackets(Timestamp at_time) {
|
void TcpMessageRouteImpl::SendPackets(Timestamp at_time) {
|
||||||
const TimeDelta kPacketTimeout = TimeDelta::seconds(1);
|
const TimeDelta kPacketTimeout = TimeDelta::Seconds(1);
|
||||||
int cwnd = std::ceil(cwnd_);
|
int cwnd = std::ceil(cwnd_);
|
||||||
int packets_to_send = std::max(cwnd - static_cast<int>(in_flight_.size()), 0);
|
int packets_to_send = std::max(cwnd - static_cast<int>(in_flight_.size()), 0);
|
||||||
while (packets_to_send-- > 0 && !pending_.empty()) {
|
while (packets_to_send-- > 0 && !pending_.empty()) {
|
||||||
|
|||||||
@ -31,8 +31,8 @@ struct RandomWalkConfig {
|
|||||||
int random_seed = 1;
|
int random_seed = 1;
|
||||||
DataRate peak_rate = DataRate::kbps(100);
|
DataRate peak_rate = DataRate::kbps(100);
|
||||||
DataSize min_packet_size = DataSize::bytes(200);
|
DataSize min_packet_size = DataSize::bytes(200);
|
||||||
TimeDelta min_packet_interval = TimeDelta::ms(1);
|
TimeDelta min_packet_interval = TimeDelta::Millis(1);
|
||||||
TimeDelta update_interval = TimeDelta::ms(200);
|
TimeDelta update_interval = TimeDelta::Millis(200);
|
||||||
double variance = 0.6;
|
double variance = 0.6;
|
||||||
double bias = -0.1;
|
double bias = -0.1;
|
||||||
};
|
};
|
||||||
@ -65,9 +65,9 @@ class RandomWalkCrossTraffic {
|
|||||||
struct PulsedPeaksConfig {
|
struct PulsedPeaksConfig {
|
||||||
DataRate peak_rate = DataRate::kbps(100);
|
DataRate peak_rate = DataRate::kbps(100);
|
||||||
DataSize min_packet_size = DataSize::bytes(200);
|
DataSize min_packet_size = DataSize::bytes(200);
|
||||||
TimeDelta min_packet_interval = TimeDelta::ms(1);
|
TimeDelta min_packet_interval = TimeDelta::Millis(1);
|
||||||
TimeDelta send_duration = TimeDelta::ms(100);
|
TimeDelta send_duration = TimeDelta::Millis(100);
|
||||||
TimeDelta hold_duration = TimeDelta::ms(2000);
|
TimeDelta hold_duration = TimeDelta::Millis(2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
class PulsedPeaksCrossTraffic {
|
class PulsedPeaksCrossTraffic {
|
||||||
@ -152,8 +152,8 @@ class TcpMessageRouteImpl final : public TcpMessageRoute {
|
|||||||
struct FakeTcpConfig {
|
struct FakeTcpConfig {
|
||||||
DataSize packet_size = DataSize::bytes(1200);
|
DataSize packet_size = DataSize::bytes(1200);
|
||||||
DataSize send_limit = DataSize::PlusInfinity();
|
DataSize send_limit = DataSize::PlusInfinity();
|
||||||
TimeDelta process_interval = TimeDelta::ms(200);
|
TimeDelta process_interval = TimeDelta::Millis(200);
|
||||||
TimeDelta packet_timeout = TimeDelta::seconds(1);
|
TimeDelta packet_timeout = TimeDelta::Seconds(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
class FakeTcpCrossTraffic
|
class FakeTcpCrossTraffic
|
||||||
|
|||||||
@ -72,13 +72,13 @@ TEST(CrossTrafficTest, PulsedPeaksCrossTraffic) {
|
|||||||
PulsedPeaksConfig config;
|
PulsedPeaksConfig config;
|
||||||
config.peak_rate = DataRate::kbps(1000);
|
config.peak_rate = DataRate::kbps(1000);
|
||||||
config.min_packet_size = DataSize::bytes(1);
|
config.min_packet_size = DataSize::bytes(1);
|
||||||
config.min_packet_interval = TimeDelta::ms(25);
|
config.min_packet_interval = TimeDelta::Millis(25);
|
||||||
config.send_duration = TimeDelta::ms(500);
|
config.send_duration = TimeDelta::Millis(500);
|
||||||
config.hold_duration = TimeDelta::ms(250);
|
config.hold_duration = TimeDelta::Millis(250);
|
||||||
PulsedPeaksCrossTraffic pulsed_peaks(config, &traffic);
|
PulsedPeaksCrossTraffic pulsed_peaks(config, &traffic);
|
||||||
const auto kRunTime = TimeDelta::seconds(1);
|
const auto kRunTime = TimeDelta::Seconds(1);
|
||||||
while (fixture.clock.TimeInMilliseconds() < kRunTime.ms()) {
|
while (fixture.clock.TimeInMilliseconds() < kRunTime.ms()) {
|
||||||
pulsed_peaks.Process(Timestamp::ms(fixture.clock.TimeInMilliseconds()));
|
pulsed_peaks.Process(Timestamp::Millis(fixture.clock.TimeInMilliseconds()));
|
||||||
fixture.clock.AdvanceTimeMilliseconds(1);
|
fixture.clock.AdvanceTimeMilliseconds(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,15 +97,15 @@ TEST(CrossTrafficTest, RandomWalkCrossTraffic) {
|
|||||||
RandomWalkConfig config;
|
RandomWalkConfig config;
|
||||||
config.peak_rate = DataRate::kbps(1000);
|
config.peak_rate = DataRate::kbps(1000);
|
||||||
config.min_packet_size = DataSize::bytes(1);
|
config.min_packet_size = DataSize::bytes(1);
|
||||||
config.min_packet_interval = TimeDelta::ms(25);
|
config.min_packet_interval = TimeDelta::Millis(25);
|
||||||
config.update_interval = TimeDelta::ms(500);
|
config.update_interval = TimeDelta::Millis(500);
|
||||||
config.variance = 0.0;
|
config.variance = 0.0;
|
||||||
config.bias = 1.0;
|
config.bias = 1.0;
|
||||||
|
|
||||||
RandomWalkCrossTraffic random_walk(config, &traffic);
|
RandomWalkCrossTraffic random_walk(config, &traffic);
|
||||||
const auto kRunTime = TimeDelta::seconds(1);
|
const auto kRunTime = TimeDelta::Seconds(1);
|
||||||
while (fixture.clock.TimeInMilliseconds() < kRunTime.ms()) {
|
while (fixture.clock.TimeInMilliseconds() < kRunTime.ms()) {
|
||||||
random_walk.Process(Timestamp::ms(fixture.clock.TimeInMilliseconds()));
|
random_walk.Process(Timestamp::Millis(fixture.clock.TimeInMilliseconds()));
|
||||||
fixture.clock.AdvanceTimeMilliseconds(1);
|
fixture.clock.AdvanceTimeMilliseconds(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,10 +144,10 @@ TEST(TcpMessageRouteTest, DeliveredOnLossyNetwork) {
|
|||||||
|
|
||||||
// If there was no loss, we would have delivered the message in ca 1 second,
|
// If there was no loss, we would have delivered the message in ca 1 second,
|
||||||
// with 50% it should take much longer.
|
// with 50% it should take much longer.
|
||||||
net.time_controller()->AdvanceTime(TimeDelta::seconds(5));
|
net.time_controller()->AdvanceTime(TimeDelta::Seconds(5));
|
||||||
ASSERT_EQ(deliver_count, 0);
|
ASSERT_EQ(deliver_count, 0);
|
||||||
// But given enough time the messsage will be delivered, but only once.
|
// But given enough time the messsage will be delivered, but only once.
|
||||||
net.time_controller()->AdvanceTime(TimeDelta::seconds(60));
|
net.time_controller()->AdvanceTime(TimeDelta::Seconds(60));
|
||||||
EXPECT_EQ(deliver_count, 1);
|
EXPECT_EQ(deliver_count, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ TEST(FeedbackGeneratorTest, ReportsFeedbackForSentPackets) {
|
|||||||
auto gen = CreateFeedbackGenerator(FeedbackGenerator::Config());
|
auto gen = CreateFeedbackGenerator(FeedbackGenerator::Config());
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
gen->SendPacket(kPacketSize);
|
gen->SendPacket(kPacketSize);
|
||||||
gen->Sleep(TimeDelta::ms(50));
|
gen->Sleep(TimeDelta::Millis(50));
|
||||||
}
|
}
|
||||||
auto feedback_list = gen->PopFeedback();
|
auto feedback_list = gen->PopFeedback();
|
||||||
EXPECT_GT(feedback_list.size(), 0u);
|
EXPECT_GT(feedback_list.size(), 0u);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ void LinkEmulation::OnPacketReceived(EmulatedIpPacket packet) {
|
|||||||
process_task_ = RepeatingTaskHandle::DelayedStart(
|
process_task_ = RepeatingTaskHandle::DelayedStart(
|
||||||
task_queue_->Get(),
|
task_queue_->Get(),
|
||||||
std::max(TimeDelta::Zero(),
|
std::max(TimeDelta::Zero(),
|
||||||
Timestamp::us(*next_time_us) - current_time),
|
Timestamp::Micros(*next_time_us) - current_time),
|
||||||
[this]() {
|
[this]() {
|
||||||
RTC_DCHECK_RUN_ON(task_queue_);
|
RTC_DCHECK_RUN_ON(task_queue_);
|
||||||
Timestamp current_time = clock_->CurrentTime();
|
Timestamp current_time = clock_->CurrentTime();
|
||||||
@ -52,7 +52,7 @@ void LinkEmulation::OnPacketReceived(EmulatedIpPacket packet) {
|
|||||||
return TimeDelta::Zero(); // This is ignored.
|
return TimeDelta::Zero(); // This is ignored.
|
||||||
}
|
}
|
||||||
RTC_DCHECK_GE(*next_time_us, current_time.us());
|
RTC_DCHECK_GE(*next_time_us, current_time.us());
|
||||||
return Timestamp::us(*next_time_us) - current_time;
|
return Timestamp::Micros(*next_time_us) - current_time;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ void LinkEmulation::Process(Timestamp at_time) {
|
|||||||
|
|
||||||
if (delivery_info.receive_time_us != PacketDeliveryInfo::kNotReceived) {
|
if (delivery_info.receive_time_us != PacketDeliveryInfo::kNotReceived) {
|
||||||
packet->packet.arrival_time =
|
packet->packet.arrival_time =
|
||||||
Timestamp::us(delivery_info.receive_time_us);
|
Timestamp::Micros(delivery_info.receive_time_us);
|
||||||
receiver_->OnPacketReceived(std::move(packet->packet));
|
receiver_->OnPacketReceived(std::move(packet->packet));
|
||||||
}
|
}
|
||||||
while (!packets_.empty() && packets_.front().removed) {
|
while (!packets_.empty() && packets_.front().removed) {
|
||||||
|
|||||||
@ -36,7 +36,7 @@ std::unique_ptr<TimeController> CreateTimeController(TimeMode mode) {
|
|||||||
case TimeMode::kSimulated:
|
case TimeMode::kSimulated:
|
||||||
// Using an offset of 100000 to get nice fixed width and readable
|
// Using an offset of 100000 to get nice fixed width and readable
|
||||||
// timestamps in typical test scenarios.
|
// timestamps in typical test scenarios.
|
||||||
const Timestamp kSimulatedStartTime = Timestamp::seconds(100000);
|
const Timestamp kSimulatedStartTime = Timestamp::Seconds(100000);
|
||||||
return std::make_unique<GlobalSimulatedTimeController>(
|
return std::make_unique<GlobalSimulatedTimeController>(
|
||||||
kSimulatedStartTime);
|
kSimulatedStartTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,8 +28,8 @@ namespace webrtc {
|
|||||||
namespace test {
|
namespace test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr TimeDelta kNetworkPacketWaitTimeout = TimeDelta::Millis<100>();
|
constexpr TimeDelta kNetworkPacketWaitTimeout = TimeDelta::Millis(100);
|
||||||
constexpr TimeDelta kStatsWaitTimeout = TimeDelta::Seconds<1>();
|
constexpr TimeDelta kStatsWaitTimeout = TimeDelta::Seconds(1);
|
||||||
constexpr int kOverheadIpv4Udp = 20 + 8;
|
constexpr int kOverheadIpv4Udp = 20 + 8;
|
||||||
|
|
||||||
class SocketReader : public sigslot::has_slots<> {
|
class SocketReader : public sigslot::has_slots<> {
|
||||||
@ -233,7 +233,7 @@ TEST(NetworkEmulationManagerTest, Run) {
|
|||||||
[&]() { s2->Send(data.data(), data.size()); });
|
[&]() { s2->Send(data.data(), data.size()); });
|
||||||
}
|
}
|
||||||
|
|
||||||
network_manager.time_controller()->AdvanceTime(TimeDelta::seconds(1));
|
network_manager.time_controller()->AdvanceTime(TimeDelta::Seconds(1));
|
||||||
|
|
||||||
EXPECT_EQ(r1.ReceivedCount(), 1000);
|
EXPECT_EQ(r1.ReceivedCount(), 1000);
|
||||||
EXPECT_EQ(r2.ReceivedCount(), 1000);
|
EXPECT_EQ(r2.ReceivedCount(), 1000);
|
||||||
@ -315,7 +315,7 @@ TEST(NetworkEmulationManagerTest, ThroughputStats) {
|
|||||||
|
|
||||||
// Send 11 packets, totalizing 1 second between the first and the last.
|
// Send 11 packets, totalizing 1 second between the first and the last.
|
||||||
const int kNumPacketsSent = 11;
|
const int kNumPacketsSent = 11;
|
||||||
const TimeDelta kDelay = TimeDelta::ms(100);
|
const TimeDelta kDelay = TimeDelta::Millis(100);
|
||||||
for (int i = 0; i < kNumPacketsSent; i++) {
|
for (int i = 0; i < kNumPacketsSent; i++) {
|
||||||
t1->PostTask(RTC_FROM_HERE, [&]() { s1->Send(data.data(), data.size()); });
|
t1->PostTask(RTC_FROM_HERE, [&]() { s1->Send(data.data(), data.size()); });
|
||||||
t2->PostTask(RTC_FROM_HERE, [&]() { s2->Send(data.data(), data.size()); });
|
t2->PostTask(RTC_FROM_HERE, [&]() { s2->Send(data.data(), data.size()); });
|
||||||
|
|||||||
@ -208,7 +208,7 @@ void DefaultVideoQualityAnalyzer::OnFramePreDecode(
|
|||||||
return a.receive_time_ms() < b.receive_time_ms();
|
return a.receive_time_ms() < b.receive_time_ms();
|
||||||
})
|
})
|
||||||
->receive_time_ms();
|
->receive_time_ms();
|
||||||
it->second.received_time = Timestamp::ms(last_receive_time);
|
it->second.received_time = Timestamp::Millis(last_receive_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultVideoQualityAnalyzer::OnFrameDecoded(
|
void DefaultVideoQualityAnalyzer::OnFrameDecoded(
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class PeerConnectionE2EQualityTestSmokeTest : public ::testing::Test {
|
|||||||
auto fixture = CreatePeerConnectionE2EQualityTestFixture(
|
auto fixture = CreatePeerConnectionE2EQualityTestFixture(
|
||||||
test_case_name, /*audio_quality_analyzer=*/nullptr,
|
test_case_name, /*audio_quality_analyzer=*/nullptr,
|
||||||
std::move(video_quality_analyzer));
|
std::move(video_quality_analyzer));
|
||||||
fixture->ExecuteAt(TimeDelta::seconds(2),
|
fixture->ExecuteAt(TimeDelta::Seconds(2),
|
||||||
[alice_network_behavior_ptr](TimeDelta) {
|
[alice_network_behavior_ptr](TimeDelta) {
|
||||||
BuiltInNetworkBehaviorConfig config;
|
BuiltInNetworkBehaviorConfig config;
|
||||||
config.loss_percent = 5;
|
config.loss_percent = 5;
|
||||||
@ -134,7 +134,7 @@ class PeerConnectionE2EQualityTestSmokeTest : public ::testing::Test {
|
|||||||
#define MAYBE_Smoke Smoke
|
#define MAYBE_Smoke Smoke
|
||||||
#endif
|
#endif
|
||||||
TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) {
|
TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) {
|
||||||
RunParams run_params(TimeDelta::seconds(7));
|
RunParams run_params(TimeDelta::Seconds(7));
|
||||||
run_params.video_codecs = {
|
run_params.video_codecs = {
|
||||||
VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})};
|
VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})};
|
||||||
run_params.use_flex_fec = true;
|
run_params.use_flex_fec = true;
|
||||||
@ -167,9 +167,9 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) {
|
|||||||
VideoConfig screenshare(640, 360, 30);
|
VideoConfig screenshare(640, 360, 30);
|
||||||
screenshare.stream_label = "bob-screenshare";
|
screenshare.stream_label = "bob-screenshare";
|
||||||
screenshare.screen_share_config =
|
screenshare.screen_share_config =
|
||||||
ScreenShareConfig(TimeDelta::seconds(2));
|
ScreenShareConfig(TimeDelta::Seconds(2));
|
||||||
screenshare.screen_share_config->scrolling_params = ScrollingParams(
|
screenshare.screen_share_config->scrolling_params = ScrollingParams(
|
||||||
TimeDelta::ms(1800), kDefaultSlidesWidth, kDefaultSlidesHeight);
|
TimeDelta::Millis(1800), kDefaultSlidesWidth, kDefaultSlidesHeight);
|
||||||
bob->AddVideoConfig(screenshare);
|
bob->AddVideoConfig(screenshare);
|
||||||
|
|
||||||
AudioConfig audio;
|
AudioConfig audio;
|
||||||
@ -188,7 +188,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) {
|
|||||||
#define MAYBE_Echo Echo
|
#define MAYBE_Echo Echo
|
||||||
#endif
|
#endif
|
||||||
TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Echo) {
|
TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Echo) {
|
||||||
RunParams run_params(TimeDelta::seconds(7));
|
RunParams run_params(TimeDelta::Seconds(7));
|
||||||
run_params.echo_emulation_config = EchoEmulationConfig();
|
run_params.echo_emulation_config = EchoEmulationConfig();
|
||||||
RunTest(
|
RunTest(
|
||||||
"smoke", run_params,
|
"smoke", run_params,
|
||||||
@ -218,7 +218,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Echo) {
|
|||||||
#define MAYBE_Simulcast Simulcast
|
#define MAYBE_Simulcast Simulcast
|
||||||
#endif
|
#endif
|
||||||
TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Simulcast) {
|
TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Simulcast) {
|
||||||
RunParams run_params(TimeDelta::seconds(7));
|
RunParams run_params(TimeDelta::Seconds(7));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
RunTest(
|
RunTest(
|
||||||
"simulcast", run_params,
|
"simulcast", run_params,
|
||||||
@ -256,7 +256,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Simulcast) {
|
|||||||
#define MAYBE_Svc Svc
|
#define MAYBE_Svc Svc
|
||||||
#endif
|
#endif
|
||||||
TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Svc) {
|
TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Svc) {
|
||||||
RunParams run_params(TimeDelta::seconds(7));
|
RunParams run_params(TimeDelta::Seconds(7));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp9CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp9CodecName)};
|
||||||
RunTest(
|
RunTest(
|
||||||
"simulcast", run_params,
|
"simulcast", run_params,
|
||||||
@ -296,7 +296,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Svc) {
|
|||||||
#define MAYBE_HighBitrate HighBitrate
|
#define MAYBE_HighBitrate HighBitrate
|
||||||
#endif
|
#endif
|
||||||
TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_HighBitrate) {
|
TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_HighBitrate) {
|
||||||
RunParams run_params(TimeDelta::seconds(7));
|
RunParams run_params(TimeDelta::Seconds(7));
|
||||||
run_params.video_codecs = {
|
run_params.video_codecs = {
|
||||||
VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})};
|
VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})};
|
||||||
|
|
||||||
|
|||||||
@ -55,9 +55,9 @@ constexpr int kPeerConnectionUsedThreads = 7;
|
|||||||
constexpr int kFrameworkUsedThreads = 2;
|
constexpr int kFrameworkUsedThreads = 2;
|
||||||
constexpr int kMaxVideoAnalyzerThreads = 8;
|
constexpr int kMaxVideoAnalyzerThreads = 8;
|
||||||
|
|
||||||
constexpr TimeDelta kStatsUpdateInterval = TimeDelta::Seconds<1>();
|
constexpr TimeDelta kStatsUpdateInterval = TimeDelta::Seconds(1);
|
||||||
|
|
||||||
constexpr TimeDelta kAliveMessageLogInterval = TimeDelta::Seconds<30>();
|
constexpr TimeDelta kAliveMessageLogInterval = TimeDelta::Seconds(30);
|
||||||
|
|
||||||
constexpr int kQuickTestModeRunDurationMs = 100;
|
constexpr int kQuickTestModeRunDurationMs = 100;
|
||||||
|
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class PeerScenario {
|
|||||||
|
|
||||||
// Waits on |event| while processing messages on the signaling thread.
|
// Waits on |event| while processing messages on the signaling thread.
|
||||||
bool WaitAndProcess(std::atomic<bool>* event,
|
bool WaitAndProcess(std::atomic<bool>* event,
|
||||||
TimeDelta max_duration = TimeDelta::seconds(5));
|
TimeDelta max_duration = TimeDelta::Seconds(5));
|
||||||
|
|
||||||
// Process messages on the signaling thread for the given duration.
|
// Process messages on the signaling thread for the given duration.
|
||||||
void ProcessMessages(TimeDelta duration);
|
void ProcessMessages(TimeDelta duration);
|
||||||
|
|||||||
@ -27,7 +27,7 @@ TEST(PeerScenarioQualityTest, PsnrIsCollected) {
|
|||||||
s.AttachVideoQualityAnalyzer(&analyzer, video.track, callee);
|
s.AttachVideoQualityAnalyzer(&analyzer, video.track, callee);
|
||||||
s.SimpleConnection(caller, callee, {link_builder.Build().node},
|
s.SimpleConnection(caller, callee, {link_builder.Build().node},
|
||||||
{link_builder.Build().node});
|
{link_builder.Build().node});
|
||||||
s.ProcessMessages(TimeDelta::seconds(2));
|
s.ProcessMessages(TimeDelta::Seconds(2));
|
||||||
// Exit scope to ensure that there's no pending tasks reporting to analyzer.
|
// Exit scope to ensure that there's no pending tasks reporting to analyzer.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ SendAudioStream::SendAudioStream(
|
|||||||
SdpAudioFormat::Parameters sdp_params;
|
SdpAudioFormat::Parameters sdp_params;
|
||||||
if (config.source.channels == 2)
|
if (config.source.channels == 2)
|
||||||
sdp_params["stereo"] = "1";
|
sdp_params["stereo"] = "1";
|
||||||
if (config.encoder.initial_frame_length != TimeDelta::ms(20))
|
if (config.encoder.initial_frame_length != TimeDelta::Millis(20))
|
||||||
sdp_params["ptime"] =
|
sdp_params["ptime"] =
|
||||||
std::to_string(config.encoder.initial_frame_length.ms());
|
std::to_string(config.encoder.initial_frame_length.ms());
|
||||||
if (config.encoder.enable_dtx)
|
if (config.encoder.enable_dtx)
|
||||||
|
|||||||
@ -17,10 +17,10 @@ namespace test {
|
|||||||
TEST(EventRateCounter, ReturnsCorrectTotalDuration) {
|
TEST(EventRateCounter, ReturnsCorrectTotalDuration) {
|
||||||
EventRateCounter event_rate_counter;
|
EventRateCounter event_rate_counter;
|
||||||
EXPECT_EQ(event_rate_counter.TotalDuration(), TimeDelta::Zero());
|
EXPECT_EQ(event_rate_counter.TotalDuration(), TimeDelta::Zero());
|
||||||
event_rate_counter.AddEvent(Timestamp::seconds(1));
|
event_rate_counter.AddEvent(Timestamp::Seconds(1));
|
||||||
EXPECT_EQ(event_rate_counter.TotalDuration(), TimeDelta::Zero());
|
EXPECT_EQ(event_rate_counter.TotalDuration(), TimeDelta::Zero());
|
||||||
event_rate_counter.AddEvent(Timestamp::seconds(2));
|
event_rate_counter.AddEvent(Timestamp::Seconds(2));
|
||||||
EXPECT_EQ(event_rate_counter.TotalDuration(), TimeDelta::seconds(1));
|
EXPECT_EQ(event_rate_counter.TotalDuration(), TimeDelta::Seconds(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
|
|||||||
@ -47,7 +47,7 @@ struct TransportControllerConfig {
|
|||||||
DataRate start_rate = DataRate::kbps(300);
|
DataRate start_rate = DataRate::kbps(300);
|
||||||
} rates;
|
} rates;
|
||||||
NetworkControllerFactoryInterface* cc_factory = nullptr;
|
NetworkControllerFactoryInterface* cc_factory = nullptr;
|
||||||
TimeDelta state_log_interval = TimeDelta::ms(100);
|
TimeDelta state_log_interval = TimeDelta::Millis(100);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CallClientConfig {
|
struct CallClientConfig {
|
||||||
@ -78,14 +78,14 @@ struct VideoStreamConfig {
|
|||||||
// Support for explicit frame triggers should be added here if needed.
|
// Support for explicit frame triggers should be added here if needed.
|
||||||
} capture = Capture::kGenerator;
|
} capture = Capture::kGenerator;
|
||||||
struct Slides {
|
struct Slides {
|
||||||
TimeDelta change_interval = TimeDelta::seconds(10);
|
TimeDelta change_interval = TimeDelta::Seconds(10);
|
||||||
struct Generator {
|
struct Generator {
|
||||||
int width = 1600;
|
int width = 1600;
|
||||||
int height = 1200;
|
int height = 1200;
|
||||||
} generator;
|
} generator;
|
||||||
struct Images {
|
struct Images {
|
||||||
struct Crop {
|
struct Crop {
|
||||||
TimeDelta scroll_duration = TimeDelta::seconds(0);
|
TimeDelta scroll_duration = TimeDelta::Seconds(0);
|
||||||
absl::optional<int> width;
|
absl::optional<int> width;
|
||||||
absl::optional<int> height;
|
absl::optional<int> height;
|
||||||
} crop;
|
} crop;
|
||||||
@ -158,7 +158,7 @@ struct VideoStreamConfig {
|
|||||||
bool packet_feedback = true;
|
bool packet_feedback = true;
|
||||||
bool use_rtx = true;
|
bool use_rtx = true;
|
||||||
DataRate pad_to_rate = DataRate::Zero();
|
DataRate pad_to_rate = DataRate::Zero();
|
||||||
TimeDelta nack_history_time = TimeDelta::ms(1000);
|
TimeDelta nack_history_time = TimeDelta::Millis(1000);
|
||||||
bool use_flexfec = false;
|
bool use_flexfec = false;
|
||||||
bool use_ulpfec = false;
|
bool use_ulpfec = false;
|
||||||
FecControllerFactoryInterface* fec_controller_factory = nullptr;
|
FecControllerFactoryInterface* fec_controller_factory = nullptr;
|
||||||
@ -200,7 +200,7 @@ struct AudioStreamConfig {
|
|||||||
absl::optional<DataRate> fixed_rate;
|
absl::optional<DataRate> fixed_rate;
|
||||||
absl::optional<DataRate> min_rate;
|
absl::optional<DataRate> min_rate;
|
||||||
absl::optional<DataRate> max_rate;
|
absl::optional<DataRate> max_rate;
|
||||||
TimeDelta initial_frame_length = TimeDelta::ms(20);
|
TimeDelta initial_frame_length = TimeDelta::Millis(20);
|
||||||
} encoder;
|
} encoder;
|
||||||
struct Stream {
|
struct Stream {
|
||||||
Stream();
|
Stream();
|
||||||
|
|||||||
@ -41,7 +41,7 @@ struct CallTestConfig {
|
|||||||
: random_seed("rs", 1),
|
: random_seed("rs", 1),
|
||||||
return_traffic("ret"),
|
return_traffic("ret"),
|
||||||
capacity("bw", DataRate::kbps(300)),
|
capacity("bw", DataRate::kbps(300)),
|
||||||
propagation_delay("dl", TimeDelta::ms(100)),
|
propagation_delay("dl", TimeDelta::Millis(100)),
|
||||||
cross_traffic("ct", DataRate::Zero()),
|
cross_traffic("ct", DataRate::Zero()),
|
||||||
delay_noise("dn", TimeDelta::Zero()),
|
delay_noise("dn", TimeDelta::Zero()),
|
||||||
loss_rate("pl", 0) {}
|
loss_rate("pl", 0) {}
|
||||||
@ -196,7 +196,7 @@ TEST_P(BbrScenarioTest, ReceivesVideo) {
|
|||||||
auto* cross_traffic = s.net()->CreateRandomWalkCrossTraffic(
|
auto* cross_traffic = s.net()->CreateRandomWalkCrossTraffic(
|
||||||
s.net()->CreateTrafficRoute({send_net->node()}), cross_config);
|
s.net()->CreateTrafficRoute({send_net->node()}), cross_config);
|
||||||
|
|
||||||
s.CreatePrinter("send.stats.txt", TimeDelta::ms(100),
|
s.CreatePrinter("send.stats.txt", TimeDelta::Millis(100),
|
||||||
{alice->StatsPrinter(), alice_video->send()->StatsPrinter(),
|
{alice->StatsPrinter(), alice_video->send()->StatsPrinter(),
|
||||||
cross_traffic->StatsPrinter(), send_net->ConfigPrinter()});
|
cross_traffic->StatsPrinter(), send_net->ConfigPrinter()});
|
||||||
|
|
||||||
@ -205,9 +205,9 @@ TEST_P(BbrScenarioTest, ReceivesVideo) {
|
|||||||
ret_net->ConfigPrinter()};
|
ret_net->ConfigPrinter()};
|
||||||
if (bob_video)
|
if (bob_video)
|
||||||
return_printers.push_back(bob_video->send()->StatsPrinter());
|
return_printers.push_back(bob_video->send()->StatsPrinter());
|
||||||
s.CreatePrinter("return.stats.txt", TimeDelta::ms(100), return_printers);
|
s.CreatePrinter("return.stats.txt", TimeDelta::Millis(100), return_printers);
|
||||||
|
|
||||||
s.RunFor(TimeDelta::ms(kRunTimeMs));
|
s.RunFor(TimeDelta::Millis(kRunTimeMs));
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_SUITE_P(Selected,
|
INSTANTIATE_TEST_SUITE_P(Selected,
|
||||||
|
|||||||
@ -48,12 +48,12 @@ TEST(ScenarioTest, StartsAndStopsWithoutErrors) {
|
|||||||
|
|
||||||
s.NetworkDelayedAction({alice_net, bob_net}, 100,
|
s.NetworkDelayedAction({alice_net, bob_net}, 100,
|
||||||
[&packet_received] { packet_received = true; });
|
[&packet_received] { packet_received = true; });
|
||||||
s.Every(TimeDelta::ms(10), [alice, bob, &bitrate_changed] {
|
s.Every(TimeDelta::Millis(10), [alice, bob, &bitrate_changed] {
|
||||||
if (alice->GetStats().send_bandwidth_bps != 300000 &&
|
if (alice->GetStats().send_bandwidth_bps != 300000 &&
|
||||||
bob->GetStats().send_bandwidth_bps != 300000)
|
bob->GetStats().send_bandwidth_bps != 300000)
|
||||||
bitrate_changed = true;
|
bitrate_changed = true;
|
||||||
});
|
});
|
||||||
s.RunUntil(TimeDelta::seconds(2), TimeDelta::ms(5),
|
s.RunUntil(TimeDelta::Seconds(2), TimeDelta::Millis(5),
|
||||||
[&bitrate_changed, &packet_received] {
|
[&bitrate_changed, &packet_received] {
|
||||||
return packet_received && bitrate_changed;
|
return packet_received && bitrate_changed;
|
||||||
});
|
});
|
||||||
@ -67,7 +67,7 @@ void SetupVideoCall(Scenario& s, VideoQualityAnalyzer* analyzer) {
|
|||||||
auto* bob = s.CreateClient("bob", call_config);
|
auto* bob = s.CreateClient("bob", call_config);
|
||||||
NetworkSimulationConfig network_config;
|
NetworkSimulationConfig network_config;
|
||||||
network_config.bandwidth = DataRate::kbps(1000);
|
network_config.bandwidth = DataRate::kbps(1000);
|
||||||
network_config.delay = TimeDelta::ms(50);
|
network_config.delay = TimeDelta::Millis(50);
|
||||||
auto alice_net = s.CreateSimulationNode(network_config);
|
auto alice_net = s.CreateSimulationNode(network_config);
|
||||||
auto bob_net = s.CreateSimulationNode(network_config);
|
auto bob_net = s.CreateSimulationNode(network_config);
|
||||||
auto route = s.CreateRoutes(alice, {alice_net}, bob, {bob_net});
|
auto route = s.CreateRoutes(alice, {alice_net}, bob, {bob_net});
|
||||||
@ -101,7 +101,7 @@ TEST(ScenarioTest, MAYBE_SimTimeEncoding) {
|
|||||||
{
|
{
|
||||||
Scenario s("scenario/encode_sim", false);
|
Scenario s("scenario/encode_sim", false);
|
||||||
SetupVideoCall(s, &analyzer);
|
SetupVideoCall(s, &analyzer);
|
||||||
s.RunFor(TimeDelta::seconds(60));
|
s.RunFor(TimeDelta::Seconds(60));
|
||||||
}
|
}
|
||||||
// Regression tests based on previous runs.
|
// Regression tests based on previous runs.
|
||||||
EXPECT_EQ(analyzer.stats().lost_count, 0);
|
EXPECT_EQ(analyzer.stats().lost_count, 0);
|
||||||
@ -121,7 +121,7 @@ TEST(ScenarioTest, MAYBE_RealTimeEncoding) {
|
|||||||
{
|
{
|
||||||
Scenario s("scenario/encode_real", true);
|
Scenario s("scenario/encode_real", true);
|
||||||
SetupVideoCall(s, &analyzer);
|
SetupVideoCall(s, &analyzer);
|
||||||
s.RunFor(TimeDelta::seconds(10));
|
s.RunFor(TimeDelta::Seconds(10));
|
||||||
}
|
}
|
||||||
// Regression tests based on previous runs.
|
// Regression tests based on previous runs.
|
||||||
EXPECT_LT(analyzer.stats().lost_count, 2);
|
EXPECT_LT(analyzer.stats().lost_count, 2);
|
||||||
@ -131,7 +131,7 @@ TEST(ScenarioTest, MAYBE_RealTimeEncoding) {
|
|||||||
TEST(ScenarioTest, SimTimeFakeing) {
|
TEST(ScenarioTest, SimTimeFakeing) {
|
||||||
Scenario s("scenario/encode_sim", false);
|
Scenario s("scenario/encode_sim", false);
|
||||||
SetupVideoCall(s, nullptr);
|
SetupVideoCall(s, nullptr);
|
||||||
s.RunFor(TimeDelta::seconds(10));
|
s.RunFor(TimeDelta::Seconds(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(ScenarioTest, WritesToRtcEventLog) {
|
TEST(ScenarioTest, WritesToRtcEventLog) {
|
||||||
@ -139,7 +139,7 @@ TEST(ScenarioTest, WritesToRtcEventLog) {
|
|||||||
{
|
{
|
||||||
Scenario s(storage.CreateFactory(), false);
|
Scenario s(storage.CreateFactory(), false);
|
||||||
SetupVideoCall(s, nullptr);
|
SetupVideoCall(s, nullptr);
|
||||||
s.RunFor(TimeDelta::seconds(1));
|
s.RunFor(TimeDelta::Seconds(1));
|
||||||
}
|
}
|
||||||
auto logs = storage.logs();
|
auto logs = storage.logs();
|
||||||
// We expect that a rtc event log has been created and that it has some data.
|
// We expect that a rtc event log has been created and that it has some data.
|
||||||
|
|||||||
@ -122,7 +122,7 @@ void VideoLayerAnalyzer::HandleRenderedFrame(const VideoFramePair& sample) {
|
|||||||
RTC_DCHECK(sample.render_time.IsFinite());
|
RTC_DCHECK(sample.render_time.IsFinite());
|
||||||
TimeDelta render_interval = sample.render_time - last_render_time_;
|
TimeDelta render_interval = sample.render_time - last_render_time_;
|
||||||
TimeDelta mean_interval = stats_.render.frames.interval().Mean();
|
TimeDelta mean_interval = stats_.render.frames.interval().Mean();
|
||||||
if (render_interval > TimeDelta::ms(150) + mean_interval ||
|
if (render_interval > TimeDelta::Millis(150) + mean_interval ||
|
||||||
render_interval > 3 * mean_interval) {
|
render_interval > 3 * mean_interval) {
|
||||||
stats_.freeze_duration.AddSample(render_interval);
|
stats_.freeze_duration.AddSample(render_interval);
|
||||||
stats_.time_between_freezes.AddSample(last_render_time_ -
|
stats_.time_between_freezes.AddSample(last_render_time_ -
|
||||||
@ -137,9 +137,9 @@ void CallStatsCollector::AddStats(Call::Stats sample) {
|
|||||||
if (sample.send_bandwidth_bps > 0)
|
if (sample.send_bandwidth_bps > 0)
|
||||||
stats_.target_rate.AddSampleBps(sample.send_bandwidth_bps);
|
stats_.target_rate.AddSampleBps(sample.send_bandwidth_bps);
|
||||||
if (sample.pacer_delay_ms > 0)
|
if (sample.pacer_delay_ms > 0)
|
||||||
stats_.pacer_delay.AddSample(TimeDelta::ms(sample.pacer_delay_ms));
|
stats_.pacer_delay.AddSample(TimeDelta::Millis(sample.pacer_delay_ms));
|
||||||
if (sample.rtt_ms > 0)
|
if (sample.rtt_ms > 0)
|
||||||
stats_.round_trip_time.AddSample(TimeDelta::ms(sample.rtt_ms));
|
stats_.round_trip_time.AddSample(TimeDelta::Millis(sample.rtt_ms));
|
||||||
stats_.memory_usage.AddSample(rtc::GetProcessResidentSizeBytes());
|
stats_.memory_usage.AddSample(rtc::GetProcessResidentSizeBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ void CreateAnalyzedStream(Scenario* s,
|
|||||||
{s->CreateSimulationNode(NetworkSimulationConfig())});
|
{s->CreateSimulationNode(NetworkSimulationConfig())});
|
||||||
auto* video = s->CreateVideoStream(route->forward(), config);
|
auto* video = s->CreateVideoStream(route->forward(), config);
|
||||||
auto* audio = s->CreateAudioStream(route->forward(), AudioStreamConfig());
|
auto* audio = s->CreateAudioStream(route->forward(), AudioStreamConfig());
|
||||||
s->Every(TimeDelta::seconds(1), [=] {
|
s->Every(TimeDelta::Seconds(1), [=] {
|
||||||
collectors->call.AddStats(caller->GetStats());
|
collectors->call.AddStats(caller->GetStats());
|
||||||
collectors->audio_receive.AddStats(audio->receive()->GetStats());
|
collectors->audio_receive.AddStats(audio->receive()->GetStats());
|
||||||
collectors->video_send.AddStats(video->send()->GetStats(), s->Now());
|
collectors->video_send.AddStats(video->send()->GetStats(), s->Now());
|
||||||
@ -48,7 +48,7 @@ TEST(ScenarioAnalyzerTest, PsnrIsHighWhenNetworkIsGood) {
|
|||||||
NetworkSimulationConfig good_network;
|
NetworkSimulationConfig good_network;
|
||||||
good_network.bandwidth = DataRate::kbps(1000);
|
good_network.bandwidth = DataRate::kbps(1000);
|
||||||
CreateAnalyzedStream(&s, good_network, &analyzer, &stats);
|
CreateAnalyzedStream(&s, good_network, &analyzer, &stats);
|
||||||
s.RunFor(TimeDelta::seconds(3));
|
s.RunFor(TimeDelta::Seconds(3));
|
||||||
}
|
}
|
||||||
// This is a change detecting test, the targets are based on previous runs and
|
// This is a change detecting test, the targets are based on previous runs and
|
||||||
// might change due to changes in configuration and encoder etc. The main
|
// might change due to changes in configuration and encoder etc. The main
|
||||||
@ -70,7 +70,7 @@ TEST(ScenarioAnalyzerTest, PsnrIsLowWhenNetworkIsBad) {
|
|||||||
bad_network.bandwidth = DataRate::kbps(100);
|
bad_network.bandwidth = DataRate::kbps(100);
|
||||||
bad_network.loss_rate = 0.02;
|
bad_network.loss_rate = 0.02;
|
||||||
CreateAnalyzedStream(&s, bad_network, &analyzer, &stats);
|
CreateAnalyzedStream(&s, bad_network, &analyzer, &stats);
|
||||||
s.RunFor(TimeDelta::seconds(3));
|
s.RunFor(TimeDelta::Seconds(3));
|
||||||
}
|
}
|
||||||
// This is a change detecting test, the targets are based on previous runs and
|
// This is a change detecting test, the targets are based on previous runs and
|
||||||
// might change due to changes in configuration and encoder etc.
|
// might change due to changes in configuration and encoder etc.
|
||||||
@ -87,10 +87,10 @@ TEST(ScenarioAnalyzerTest, CountsCapturedButNotRendered) {
|
|||||||
{
|
{
|
||||||
Scenario s;
|
Scenario s;
|
||||||
NetworkSimulationConfig long_delays;
|
NetworkSimulationConfig long_delays;
|
||||||
long_delays.delay = TimeDelta::seconds(5);
|
long_delays.delay = TimeDelta::Seconds(5);
|
||||||
CreateAnalyzedStream(&s, long_delays, &analyzer, &stats);
|
CreateAnalyzedStream(&s, long_delays, &analyzer, &stats);
|
||||||
// Enough time to send frames but not enough to deliver.
|
// Enough time to send frames but not enough to deliver.
|
||||||
s.RunFor(TimeDelta::ms(100));
|
s.RunFor(TimeDelta::Millis(100));
|
||||||
}
|
}
|
||||||
EXPECT_GE(analyzer.stats().capture.count, 1);
|
EXPECT_GE(analyzer.stats().capture.count, 1);
|
||||||
EXPECT_EQ(analyzer.stats().render.count, 0);
|
EXPECT_EQ(analyzer.stats().render.count, 0);
|
||||||
|
|||||||
@ -180,7 +180,7 @@ DecodedFrameTap::DecodedFrameTap(Clock* clock,
|
|||||||
|
|
||||||
void DecodedFrameTap::OnFrame(const VideoFrame& frame) {
|
void DecodedFrameTap::OnFrame(const VideoFrame& frame) {
|
||||||
matcher_->OnDecodedFrame(frame, layer_id_,
|
matcher_->OnDecodedFrame(frame, layer_id_,
|
||||||
Timestamp::ms(frame.render_time_ms()),
|
Timestamp::Millis(frame.render_time_ms()),
|
||||||
clock_->CurrentTime());
|
clock_->CurrentTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@ using CodecImpl = VideoStreamConfig::Encoder::Implementation;
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TEST(VideoStreamTest, ReceivesFramesFromFileBasedStreams) {
|
TEST(VideoStreamTest, ReceivesFramesFromFileBasedStreams) {
|
||||||
TimeDelta kRunTime = TimeDelta::ms(500);
|
TimeDelta kRunTime = TimeDelta::Millis(500);
|
||||||
std::vector<int> kFrameRates = {15, 30};
|
std::vector<int> kFrameRates = {15, 30};
|
||||||
std::deque<std::atomic<int>> frame_counts(2);
|
std::deque<std::atomic<int>> frame_counts(2);
|
||||||
frame_counts[0] = 0;
|
frame_counts[0] = 0;
|
||||||
@ -68,7 +68,7 @@ TEST(VideoStreamTest, ReceivesFramesFromFileBasedStreams) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(VideoStreamTest, RecievesVp8SimulcastFrames) {
|
TEST(VideoStreamTest, RecievesVp8SimulcastFrames) {
|
||||||
TimeDelta kRunTime = TimeDelta::ms(500);
|
TimeDelta kRunTime = TimeDelta::Millis(500);
|
||||||
int kFrameRate = 30;
|
int kFrameRate = 30;
|
||||||
|
|
||||||
std::deque<std::atomic<int>> frame_counts(3);
|
std::deque<std::atomic<int>> frame_counts(3);
|
||||||
@ -125,7 +125,7 @@ TEST(VideoStreamTest, SendsNacksOnLoss) {
|
|||||||
{s.CreateSimulationNode(NetworkSimulationConfig())});
|
{s.CreateSimulationNode(NetworkSimulationConfig())});
|
||||||
// NACK retransmissions are enabled by default.
|
// NACK retransmissions are enabled by default.
|
||||||
auto video = s.CreateVideoStream(route->forward(), VideoStreamConfig());
|
auto video = s.CreateVideoStream(route->forward(), VideoStreamConfig());
|
||||||
s.RunFor(TimeDelta::seconds(1));
|
s.RunFor(TimeDelta::Seconds(1));
|
||||||
int retransmit_packets = 0;
|
int retransmit_packets = 0;
|
||||||
for (const auto& substream : video->send()->GetStats().substreams) {
|
for (const auto& substream : video->send()->GetStats().substreams) {
|
||||||
retransmit_packets += substream.second.rtp_stats.retransmitted.packets;
|
retransmit_packets += substream.second.rtp_stats.retransmitted.packets;
|
||||||
@ -139,7 +139,7 @@ TEST(VideoStreamTest, SendsFecWithUlpFec) {
|
|||||||
s.CreateRoutes(s.CreateClient("caller", CallClientConfig()),
|
s.CreateRoutes(s.CreateClient("caller", CallClientConfig()),
|
||||||
{s.CreateSimulationNode([](NetworkSimulationConfig* c) {
|
{s.CreateSimulationNode([](NetworkSimulationConfig* c) {
|
||||||
c->loss_rate = 0.1;
|
c->loss_rate = 0.1;
|
||||||
c->delay = TimeDelta::ms(100);
|
c->delay = TimeDelta::Millis(100);
|
||||||
})},
|
})},
|
||||||
s.CreateClient("callee", CallClientConfig()),
|
s.CreateClient("callee", CallClientConfig()),
|
||||||
{s.CreateSimulationNode(NetworkSimulationConfig())});
|
{s.CreateSimulationNode(NetworkSimulationConfig())});
|
||||||
@ -148,7 +148,7 @@ TEST(VideoStreamTest, SendsFecWithUlpFec) {
|
|||||||
c->encoder.codec = VideoStreamConfig::Encoder::Codec::kVideoCodecVP8;
|
c->encoder.codec = VideoStreamConfig::Encoder::Codec::kVideoCodecVP8;
|
||||||
c->stream.use_ulpfec = true;
|
c->stream.use_ulpfec = true;
|
||||||
});
|
});
|
||||||
s.RunFor(TimeDelta::seconds(5));
|
s.RunFor(TimeDelta::Seconds(5));
|
||||||
VideoSendStream::Stats video_stats = video->send()->GetStats();
|
VideoSendStream::Stats video_stats = video->send()->GetStats();
|
||||||
EXPECT_GT(video_stats.substreams.begin()->second.rtp_stats.fec.packets, 0u);
|
EXPECT_GT(video_stats.substreams.begin()->second.rtp_stats.fec.packets, 0u);
|
||||||
}
|
}
|
||||||
@ -158,14 +158,14 @@ TEST(VideoStreamTest, SendsFecWithFlexFec) {
|
|||||||
s.CreateRoutes(s.CreateClient("caller", CallClientConfig()),
|
s.CreateRoutes(s.CreateClient("caller", CallClientConfig()),
|
||||||
{s.CreateSimulationNode([](NetworkSimulationConfig* c) {
|
{s.CreateSimulationNode([](NetworkSimulationConfig* c) {
|
||||||
c->loss_rate = 0.1;
|
c->loss_rate = 0.1;
|
||||||
c->delay = TimeDelta::ms(100);
|
c->delay = TimeDelta::Millis(100);
|
||||||
})},
|
})},
|
||||||
s.CreateClient("callee", CallClientConfig()),
|
s.CreateClient("callee", CallClientConfig()),
|
||||||
{s.CreateSimulationNode(NetworkSimulationConfig())});
|
{s.CreateSimulationNode(NetworkSimulationConfig())});
|
||||||
auto video = s.CreateVideoStream(route->forward(), [&](VideoStreamConfig* c) {
|
auto video = s.CreateVideoStream(route->forward(), [&](VideoStreamConfig* c) {
|
||||||
c->stream.use_flexfec = true;
|
c->stream.use_flexfec = true;
|
||||||
});
|
});
|
||||||
s.RunFor(TimeDelta::seconds(5));
|
s.RunFor(TimeDelta::Seconds(5));
|
||||||
VideoSendStream::Stats video_stats = video->send()->GetStats();
|
VideoSendStream::Stats video_stats = video->send()->GetStats();
|
||||||
EXPECT_GT(video_stats.substreams.begin()->second.rtp_stats.fec.packets, 0u);
|
EXPECT_GT(video_stats.substreams.begin()->second.rtp_stats.fec.packets, 0u);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ using ::testing::Invoke;
|
|||||||
using ::testing::MockFunction;
|
using ::testing::MockFunction;
|
||||||
using ::testing::NiceMock;
|
using ::testing::NiceMock;
|
||||||
using ::testing::Return;
|
using ::testing::Return;
|
||||||
constexpr Timestamp kStartTime = Timestamp::Seconds<1000>();
|
constexpr Timestamp kStartTime = Timestamp::Seconds(1000);
|
||||||
|
|
||||||
class FakeAlarm : public ControlledAlarmClock {
|
class FakeAlarm : public ControlledAlarmClock {
|
||||||
public:
|
public:
|
||||||
@ -82,8 +82,8 @@ void FakeAlarm::Sleep(TimeDelta duration) {
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TEST(ExternalTimeControllerTest, TaskIsStoppedOnStop) {
|
TEST(ExternalTimeControllerTest, TaskIsStoppedOnStop) {
|
||||||
const TimeDelta kShortInterval = TimeDelta::ms(5);
|
const TimeDelta kShortInterval = TimeDelta::Millis(5);
|
||||||
const TimeDelta kLongInterval = TimeDelta::ms(20);
|
const TimeDelta kLongInterval = TimeDelta::Millis(20);
|
||||||
const int kShortIntervalCount = 4;
|
const int kShortIntervalCount = 4;
|
||||||
const int kMargin = 1;
|
const int kMargin = 1;
|
||||||
FakeAlarm alarm(kStartTime);
|
FakeAlarm alarm(kStartTime);
|
||||||
@ -123,10 +123,10 @@ TEST(ExternalTimeControllerTest, TaskCanStopItself) {
|
|||||||
handle = RepeatingTaskHandle::Start(task_queue.Get(), [&] {
|
handle = RepeatingTaskHandle::Start(task_queue.Get(), [&] {
|
||||||
++counter;
|
++counter;
|
||||||
handle.Stop();
|
handle.Stop();
|
||||||
return TimeDelta::ms(2);
|
return TimeDelta::Millis(2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
time_simulation.AdvanceTime(TimeDelta::ms(10));
|
time_simulation.AdvanceTime(TimeDelta::Millis(10));
|
||||||
EXPECT_EQ(counter.load(), 1);
|
EXPECT_EQ(counter.load(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ TEST(ExternalTimeControllerTest, TasksYieldToEachOther) {
|
|||||||
EXPECT_TRUE(event.Wait(200));
|
EXPECT_TRUE(event.Wait(200));
|
||||||
});
|
});
|
||||||
|
|
||||||
time_simulation.AdvanceTime(TimeDelta::ms(300));
|
time_simulation.AdvanceTime(TimeDelta::Millis(300));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(ExternalTimeControllerTest, CurrentTaskQueue) {
|
TEST(ExternalTimeControllerTest, CurrentTaskQueue) {
|
||||||
@ -173,7 +173,7 @@ TEST(ExternalTimeControllerTest, CurrentTaskQueue) {
|
|||||||
|
|
||||||
task_queue.PostTask([&] { EXPECT_TRUE(task_queue.IsCurrent()); });
|
task_queue.PostTask([&] { EXPECT_TRUE(task_queue.IsCurrent()); });
|
||||||
|
|
||||||
time_simulation.AdvanceTime(TimeDelta::ms(10));
|
time_simulation.AdvanceTime(TimeDelta::Millis(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -163,7 +163,7 @@ void SimulatedProcessThread::PostTask(std::unique_ptr<QueuedTask> task) {
|
|||||||
Timestamp SimulatedProcessThread::GetNextTime(Module* module,
|
Timestamp SimulatedProcessThread::GetNextTime(Module* module,
|
||||||
Timestamp at_time) {
|
Timestamp at_time) {
|
||||||
CurrentTaskQueueSetter set_current(this);
|
CurrentTaskQueueSetter set_current(this);
|
||||||
return at_time + TimeDelta::ms(module->TimeUntilNextProcess());
|
return at_time + TimeDelta::Millis(module->TimeUntilNextProcess());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -73,7 +73,8 @@ void SimulatedTaskQueue::PostTask(std::unique_ptr<QueuedTask> task) {
|
|||||||
void SimulatedTaskQueue::PostDelayedTask(std::unique_ptr<QueuedTask> task,
|
void SimulatedTaskQueue::PostDelayedTask(std::unique_ptr<QueuedTask> task,
|
||||||
uint32_t milliseconds) {
|
uint32_t milliseconds) {
|
||||||
rtc::CritScope lock(&lock_);
|
rtc::CritScope lock(&lock_);
|
||||||
Timestamp target_time = handler_->CurrentTime() + TimeDelta::ms(milliseconds);
|
Timestamp target_time =
|
||||||
|
handler_->CurrentTime() + TimeDelta::Millis(milliseconds);
|
||||||
delayed_tasks_[target_time].push_back(std::move(task));
|
delayed_tasks_[target_time].push_back(std::move(task));
|
||||||
next_run_time_ = std::min(next_run_time_, target_time);
|
next_run_time_ = std::min(next_run_time_, target_time);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,7 +63,7 @@ void SimulatedThread::RunReady(Timestamp at_time) {
|
|||||||
if (delay_ms == kForever) {
|
if (delay_ms == kForever) {
|
||||||
next_run_time_ = Timestamp::PlusInfinity();
|
next_run_time_ = Timestamp::PlusInfinity();
|
||||||
} else {
|
} else {
|
||||||
next_run_time_ = at_time + TimeDelta::ms(delay_ms);
|
next_run_time_ = at_time + TimeDelta::Millis(delay_ms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ void SimulatedThread::PostDelayed(const rtc::Location& posted_from,
|
|||||||
rtc::Thread::PostDelayed(posted_from, delay_ms, phandler, id, pdata);
|
rtc::Thread::PostDelayed(posted_from, delay_ms, phandler, id, pdata);
|
||||||
rtc::CritScope lock(&lock_);
|
rtc::CritScope lock(&lock_);
|
||||||
next_run_time_ =
|
next_run_time_ =
|
||||||
std::min(next_run_time_, Timestamp::ms(rtc::TimeMillis() + delay_ms));
|
std::min(next_run_time_, Timestamp::Millis(rtc::TimeMillis() + delay_ms));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimulatedThread::PostAt(const rtc::Location& posted_from,
|
void SimulatedThread::PostAt(const rtc::Location& posted_from,
|
||||||
@ -117,7 +117,7 @@ void SimulatedThread::PostAt(const rtc::Location& posted_from,
|
|||||||
rtc::MessageData* pdata) {
|
rtc::MessageData* pdata) {
|
||||||
rtc::Thread::PostAt(posted_from, target_time_ms, phandler, id, pdata);
|
rtc::Thread::PostAt(posted_from, target_time_ms, phandler, id, pdata);
|
||||||
rtc::CritScope lock(&lock_);
|
rtc::CritScope lock(&lock_);
|
||||||
next_run_time_ = std::min(next_run_time_, Timestamp::ms(target_time_ms));
|
next_run_time_ = std::min(next_run_time_, Timestamp::Millis(target_time_ms));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimulatedThread::Stop() {
|
void SimulatedThread::Stop() {
|
||||||
|
|||||||
@ -29,12 +29,12 @@ using ::testing::Invoke;
|
|||||||
using ::testing::MockFunction;
|
using ::testing::MockFunction;
|
||||||
using ::testing::NiceMock;
|
using ::testing::NiceMock;
|
||||||
using ::testing::Return;
|
using ::testing::Return;
|
||||||
constexpr Timestamp kStartTime = Timestamp::Seconds<1000>();
|
constexpr Timestamp kStartTime = Timestamp::Seconds(1000);
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TEST(SimulatedTimeControllerTest, TaskIsStoppedOnStop) {
|
TEST(SimulatedTimeControllerTest, TaskIsStoppedOnStop) {
|
||||||
const TimeDelta kShortInterval = TimeDelta::ms(5);
|
const TimeDelta kShortInterval = TimeDelta::Millis(5);
|
||||||
const TimeDelta kLongInterval = TimeDelta::ms(20);
|
const TimeDelta kLongInterval = TimeDelta::Millis(20);
|
||||||
const int kShortIntervalCount = 4;
|
const int kShortIntervalCount = 4;
|
||||||
const int kMargin = 1;
|
const int kMargin = 1;
|
||||||
GlobalSimulatedTimeController time_simulation(kStartTime);
|
GlobalSimulatedTimeController time_simulation(kStartTime);
|
||||||
@ -72,10 +72,10 @@ TEST(SimulatedTimeControllerTest, TaskCanStopItself) {
|
|||||||
handle = RepeatingTaskHandle::Start(task_queue.Get(), [&] {
|
handle = RepeatingTaskHandle::Start(task_queue.Get(), [&] {
|
||||||
++counter;
|
++counter;
|
||||||
handle.Stop();
|
handle.Stop();
|
||||||
return TimeDelta::ms(2);
|
return TimeDelta::Millis(2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
time_simulation.AdvanceTime(TimeDelta::ms(10));
|
time_simulation.AdvanceTime(TimeDelta::Millis(10));
|
||||||
EXPECT_EQ(counter.load(), 1);
|
EXPECT_EQ(counter.load(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ TEST(SimulatedTimeControllerTest, Example) {
|
|||||||
class ObjectOnTaskQueue {
|
class ObjectOnTaskQueue {
|
||||||
public:
|
public:
|
||||||
void DoPeriodicTask() {}
|
void DoPeriodicTask() {}
|
||||||
TimeDelta TimeUntilNextRun() { return TimeDelta::ms(100); }
|
TimeDelta TimeUntilNextRun() { return TimeDelta::Millis(100); }
|
||||||
void StartPeriodicTask(RepeatingTaskHandle* handle,
|
void StartPeriodicTask(RepeatingTaskHandle* handle,
|
||||||
rtc::TaskQueue* task_queue) {
|
rtc::TaskQueue* task_queue) {
|
||||||
*handle = RepeatingTaskHandle::Start(task_queue->Get(), [this] {
|
*handle = RepeatingTaskHandle::Start(task_queue->Get(), [this] {
|
||||||
@ -123,7 +123,7 @@ TEST(SimulatedTimeControllerTest, DelayTaskRunOnTime) {
|
|||||||
bool delay_task_executed = false;
|
bool delay_task_executed = false;
|
||||||
task_queue.PostDelayedTask([&] { delay_task_executed = true; }, 10);
|
task_queue.PostDelayedTask([&] { delay_task_executed = true; }, 10);
|
||||||
|
|
||||||
time_simulation.AdvanceTime(TimeDelta::ms(10));
|
time_simulation.AdvanceTime(TimeDelta::Millis(10));
|
||||||
EXPECT_TRUE(delay_task_executed);
|
EXPECT_TRUE(delay_task_executed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ TEST(SimulatedTimeControllerTest, ThreadYeildsOnInvoke) {
|
|||||||
// Since we are doing an invoke from the main thread, we don't expect the main
|
// Since we are doing an invoke from the main thread, we don't expect the main
|
||||||
// thread message loop to be processed.
|
// thread message loop to be processed.
|
||||||
EXPECT_FALSE(task_has_run);
|
EXPECT_FALSE(task_has_run);
|
||||||
sim.AdvanceTime(TimeDelta::seconds(1));
|
sim.AdvanceTime(TimeDelta::Seconds(1));
|
||||||
ASSERT_TRUE(task_has_run);
|
ASSERT_TRUE(task_has_run);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -106,7 +106,7 @@ class EncoderBitrateAdjusterTest : public ::testing::Test {
|
|||||||
const int64_t start_us = rtc::TimeMicros();
|
const int64_t start_us = rtc::TimeMicros();
|
||||||
while (rtc::TimeMicros() <
|
while (rtc::TimeMicros() <
|
||||||
start_us + (duration_ms * rtc::kNumMicrosecsPerMillisec)) {
|
start_us + (duration_ms * rtc::kNumMicrosecsPerMillisec)) {
|
||||||
clock_.AdvanceTime(TimeDelta::seconds(1) / target_framerate_fps_);
|
clock_.AdvanceTime(TimeDelta::Seconds(1) / target_framerate_fps_);
|
||||||
for (size_t si = 0; si < NumSpatialLayers(); ++si) {
|
for (size_t si = 0; si < NumSpatialLayers(); ++si) {
|
||||||
const std::vector<int>& tl_pattern =
|
const std::vector<int>& tl_pattern =
|
||||||
kTlPatterns[NumTemporalLayers(si) - 1];
|
kTlPatterns[NumTemporalLayers(si) - 1];
|
||||||
|
|||||||
@ -40,14 +40,14 @@ class EncoderOvershootDetectorTest : public ::testing::Test {
|
|||||||
if (rtc::TimeMillis() == 0) {
|
if (rtc::TimeMillis() == 0) {
|
||||||
// Encode a first frame which by definition has no overuse factor.
|
// Encode a first frame which by definition has no overuse factor.
|
||||||
detector_.OnEncodedFrame(frame_size_bytes, rtc::TimeMillis());
|
detector_.OnEncodedFrame(frame_size_bytes, rtc::TimeMillis());
|
||||||
clock_.AdvanceTime(TimeDelta::seconds(1) / target_framerate_fps_);
|
clock_.AdvanceTime(TimeDelta::Seconds(1) / target_framerate_fps_);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t runtime_us = 0;
|
int64_t runtime_us = 0;
|
||||||
while (runtime_us < test_duration_ms * 1000) {
|
while (runtime_us < test_duration_ms * 1000) {
|
||||||
detector_.OnEncodedFrame(frame_size_bytes, rtc::TimeMillis());
|
detector_.OnEncodedFrame(frame_size_bytes, rtc::TimeMillis());
|
||||||
runtime_us += rtc::kNumMicrosecsPerSec / target_framerate_fps_;
|
runtime_us += rtc::kNumMicrosecsPerSec / target_framerate_fps_;
|
||||||
clock_.AdvanceTime(TimeDelta::seconds(1) / target_framerate_fps_);
|
clock_.AdvanceTime(TimeDelta::Seconds(1) / target_framerate_fps_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// At constant utilization, both network and media utilization should be
|
// At constant utilization, both network and media utilization should be
|
||||||
@ -81,7 +81,7 @@ TEST_F(EncoderOvershootDetectorTest, NoUtilizationIfNoRate) {
|
|||||||
detector_.GetNetworkRateUtilizationFactor(rtc::TimeMillis()).has_value());
|
detector_.GetNetworkRateUtilizationFactor(rtc::TimeMillis()).has_value());
|
||||||
|
|
||||||
detector_.OnEncodedFrame(frame_size_bytes, rtc::TimeMillis());
|
detector_.OnEncodedFrame(frame_size_bytes, rtc::TimeMillis());
|
||||||
clock_.AdvanceTime(TimeDelta::ms(time_interval_ms));
|
clock_.AdvanceTime(TimeDelta::Millis(time_interval_ms));
|
||||||
EXPECT_TRUE(
|
EXPECT_TRUE(
|
||||||
detector_.GetNetworkRateUtilizationFactor(rtc::TimeMillis()).has_value());
|
detector_.GetNetworkRateUtilizationFactor(rtc::TimeMillis()).has_value());
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ TEST_F(EncoderOvershootDetectorTest, PartialOvershoot) {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
while (runtime_us < kWindowSizeMs * rtc::kNumMicrosecsPerMillisec) {
|
while (runtime_us < kWindowSizeMs * rtc::kNumMicrosecsPerMillisec) {
|
||||||
runtime_us += rtc::kNumMicrosecsPerSec / target_framerate_fps_;
|
runtime_us += rtc::kNumMicrosecsPerSec / target_framerate_fps_;
|
||||||
clock_.AdvanceTime(TimeDelta::seconds(1) / target_framerate_fps_);
|
clock_.AdvanceTime(TimeDelta::Seconds(1) / target_framerate_fps_);
|
||||||
int frame_size_bytes = (i++ % 4 < 2) ? (ideal_frame_size_bytes * 120) / 100
|
int frame_size_bytes = (i++ % 4 < 2) ? (ideal_frame_size_bytes * 120) / 100
|
||||||
: (ideal_frame_size_bytes * 80) / 100;
|
: (ideal_frame_size_bytes * 80) / 100;
|
||||||
detector_.OnEncodedFrame(frame_size_bytes, rtc::TimeMillis());
|
detector_.OnEncodedFrame(frame_size_bytes, rtc::TimeMillis());
|
||||||
|
|||||||
@ -549,10 +549,10 @@ void OveruseFrameDetector::StartCheckForOveruse(
|
|||||||
|
|
||||||
SetOptions(options);
|
SetOptions(options);
|
||||||
check_overuse_task_ = RepeatingTaskHandle::DelayedStart(
|
check_overuse_task_ = RepeatingTaskHandle::DelayedStart(
|
||||||
task_queue_base, TimeDelta::ms(kTimeToFirstCheckForOveruseMs),
|
task_queue_base, TimeDelta::Millis(kTimeToFirstCheckForOveruseMs),
|
||||||
[this, overuse_observer] {
|
[this, overuse_observer] {
|
||||||
CheckForOveruse(overuse_observer);
|
CheckForOveruse(overuse_observer);
|
||||||
return TimeDelta::ms(kCheckForOveruseIntervalMs);
|
return TimeDelta::Millis(kCheckForOveruseIntervalMs);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void OveruseFrameDetector::StopCheckForOveruse() {
|
void OveruseFrameDetector::StopCheckForOveruse() {
|
||||||
|
|||||||
@ -109,10 +109,10 @@ class OveruseFrameDetectorTest : public ::testing::Test,
|
|||||||
frame.set_timestamp(timestamp);
|
frame.set_timestamp(timestamp);
|
||||||
int64_t capture_time_us = rtc::TimeMicros();
|
int64_t capture_time_us = rtc::TimeMicros();
|
||||||
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
||||||
clock_.AdvanceTime(TimeDelta::us(delay_us));
|
clock_.AdvanceTime(TimeDelta::Micros(delay_us));
|
||||||
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(),
|
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(),
|
||||||
capture_time_us, delay_us);
|
capture_time_us, delay_us);
|
||||||
clock_.AdvanceTime(TimeDelta::us(interval_us - delay_us));
|
clock_.AdvanceTime(TimeDelta::Micros(interval_us - delay_us));
|
||||||
timestamp += interval_us * 90 / 1000;
|
timestamp += interval_us * 90 / 1000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -138,7 +138,7 @@ class OveruseFrameDetectorTest : public ::testing::Test,
|
|||||||
int max_delay_us = 0;
|
int max_delay_us = 0;
|
||||||
for (int delay_us : delays_us) {
|
for (int delay_us : delays_us) {
|
||||||
if (delay_us > max_delay_us) {
|
if (delay_us > max_delay_us) {
|
||||||
clock_.AdvanceTime(TimeDelta::us(delay_us - max_delay_us));
|
clock_.AdvanceTime(TimeDelta::Micros(delay_us - max_delay_us));
|
||||||
max_delay_us = delay_us;
|
max_delay_us = delay_us;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ class OveruseFrameDetectorTest : public ::testing::Test,
|
|||||||
capture_time_us, delay_us);
|
capture_time_us, delay_us);
|
||||||
}
|
}
|
||||||
overuse_detector_->CheckForOveruse(observer_);
|
overuse_detector_->CheckForOveruse(observer_);
|
||||||
clock_.AdvanceTime(TimeDelta::us(interval_us - max_delay_us));
|
clock_.AdvanceTime(TimeDelta::Micros(interval_us - max_delay_us));
|
||||||
timestamp += interval_us * 90 / 1000;
|
timestamp += interval_us * 90 / 1000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -171,7 +171,7 @@ class OveruseFrameDetectorTest : public ::testing::Test,
|
|||||||
int interval_us = random.Rand(min_interval_us, max_interval_us);
|
int interval_us = random.Rand(min_interval_us, max_interval_us);
|
||||||
int64_t capture_time_us = rtc::TimeMicros();
|
int64_t capture_time_us = rtc::TimeMicros();
|
||||||
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
||||||
clock_.AdvanceTime(TimeDelta::us(delay_us));
|
clock_.AdvanceTime(TimeDelta::Micros(delay_us));
|
||||||
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(),
|
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(),
|
||||||
capture_time_us,
|
capture_time_us,
|
||||||
absl::optional<int>(delay_us));
|
absl::optional<int>(delay_us));
|
||||||
@ -179,7 +179,7 @@ class OveruseFrameDetectorTest : public ::testing::Test,
|
|||||||
overuse_detector_->CheckForOveruse(observer_);
|
overuse_detector_->CheckForOveruse(observer_);
|
||||||
// Avoid turning clock backwards.
|
// Avoid turning clock backwards.
|
||||||
if (interval_us > delay_us)
|
if (interval_us > delay_us)
|
||||||
clock_.AdvanceTime(TimeDelta::us(interval_us - delay_us));
|
clock_.AdvanceTime(TimeDelta::Micros(interval_us - delay_us));
|
||||||
|
|
||||||
timestamp += interval_us * 90 / 1000;
|
timestamp += interval_us * 90 / 1000;
|
||||||
}
|
}
|
||||||
@ -276,7 +276,7 @@ TEST_F(OveruseFrameDetectorTest, TriggerUnderuseWithMinProcessCount) {
|
|||||||
kProcessTimeUs);
|
kProcessTimeUs);
|
||||||
overuse_detector_->CheckForOveruse(&overuse_observer);
|
overuse_detector_->CheckForOveruse(&overuse_observer);
|
||||||
EXPECT_EQ(0, overuse_observer.normaluse_);
|
EXPECT_EQ(0, overuse_observer.normaluse_);
|
||||||
clock_.AdvanceTime(TimeDelta::us(kProcessIntervalUs));
|
clock_.AdvanceTime(TimeDelta::Micros(kProcessIntervalUs));
|
||||||
overuse_detector_->CheckForOveruse(&overuse_observer);
|
overuse_detector_->CheckForOveruse(&overuse_observer);
|
||||||
EXPECT_EQ(1, overuse_observer.normaluse_);
|
EXPECT_EQ(1, overuse_observer.normaluse_);
|
||||||
}
|
}
|
||||||
@ -352,14 +352,14 @@ TEST_F(OveruseFrameDetectorTest, MinFrameSamplesBeforeUpdating) {
|
|||||||
kProcessTimeUs);
|
kProcessTimeUs);
|
||||||
EXPECT_EQ(InitialUsage(), UsagePercent());
|
EXPECT_EQ(InitialUsage(), UsagePercent());
|
||||||
// Pass time far enough to digest all previous samples.
|
// Pass time far enough to digest all previous samples.
|
||||||
clock_.AdvanceTime(TimeDelta::seconds(1));
|
clock_.AdvanceTime(TimeDelta::Seconds(1));
|
||||||
InsertAndSendFramesWithInterval(1, kFrameIntervalUs, kWidth, kHeight,
|
InsertAndSendFramesWithInterval(1, kFrameIntervalUs, kWidth, kHeight,
|
||||||
kProcessTimeUs);
|
kProcessTimeUs);
|
||||||
// The last sample has not been processed here.
|
// The last sample has not been processed here.
|
||||||
EXPECT_EQ(InitialUsage(), UsagePercent());
|
EXPECT_EQ(InitialUsage(), UsagePercent());
|
||||||
|
|
||||||
// Pass time far enough to digest all previous samples, 41 in total.
|
// Pass time far enough to digest all previous samples, 41 in total.
|
||||||
clock_.AdvanceTime(TimeDelta::seconds(1));
|
clock_.AdvanceTime(TimeDelta::Seconds(1));
|
||||||
InsertAndSendFramesWithInterval(1, kFrameIntervalUs, kWidth, kHeight,
|
InsertAndSendFramesWithInterval(1, kFrameIntervalUs, kWidth, kHeight,
|
||||||
kProcessTimeUs);
|
kProcessTimeUs);
|
||||||
EXPECT_NE(InitialUsage(), UsagePercent());
|
EXPECT_NE(InitialUsage(), UsagePercent());
|
||||||
@ -387,7 +387,7 @@ TEST_F(OveruseFrameDetectorTest, MeasuresMultipleConcurrentSamples) {
|
|||||||
frame.set_timestamp(static_cast<uint32_t>(i));
|
frame.set_timestamp(static_cast<uint32_t>(i));
|
||||||
int64_t capture_time_us = rtc::TimeMicros();
|
int64_t capture_time_us = rtc::TimeMicros();
|
||||||
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
||||||
clock_.AdvanceTime(TimeDelta::us(kIntervalUs));
|
clock_.AdvanceTime(TimeDelta::Micros(kIntervalUs));
|
||||||
if (i > kNumFramesEncodingDelay) {
|
if (i > kNumFramesEncodingDelay) {
|
||||||
overuse_detector_->FrameSent(
|
overuse_detector_->FrameSent(
|
||||||
static_cast<uint32_t>(i - kNumFramesEncodingDelay), rtc::TimeMicros(),
|
static_cast<uint32_t>(i - kNumFramesEncodingDelay), rtc::TimeMicros(),
|
||||||
@ -415,14 +415,14 @@ TEST_F(OveruseFrameDetectorTest, UpdatesExistingSamples) {
|
|||||||
int64_t capture_time_us = rtc::TimeMicros();
|
int64_t capture_time_us = rtc::TimeMicros();
|
||||||
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
||||||
// Encode and send first parts almost instantly.
|
// Encode and send first parts almost instantly.
|
||||||
clock_.AdvanceTime(TimeDelta::ms(1));
|
clock_.AdvanceTime(TimeDelta::Millis(1));
|
||||||
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(), capture_time_us,
|
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(), capture_time_us,
|
||||||
rtc::kNumMicrosecsPerMillisec);
|
rtc::kNumMicrosecsPerMillisec);
|
||||||
// Encode heavier part, resulting in >85% usage total.
|
// Encode heavier part, resulting in >85% usage total.
|
||||||
clock_.AdvanceTime(TimeDelta::us(kDelayUs) - TimeDelta::ms(1));
|
clock_.AdvanceTime(TimeDelta::Micros(kDelayUs) - TimeDelta::Millis(1));
|
||||||
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(), capture_time_us,
|
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(), capture_time_us,
|
||||||
kDelayUs);
|
kDelayUs);
|
||||||
clock_.AdvanceTime(TimeDelta::us(kIntervalUs - kDelayUs));
|
clock_.AdvanceTime(TimeDelta::Micros(kIntervalUs - kDelayUs));
|
||||||
timestamp += kIntervalUs * 90 / 1000;
|
timestamp += kIntervalUs * 90 / 1000;
|
||||||
overuse_detector_->CheckForOveruse(observer_);
|
overuse_detector_->CheckForOveruse(observer_);
|
||||||
}
|
}
|
||||||
@ -681,7 +681,7 @@ class OveruseFrameDetectorTest2 : public OveruseFrameDetectorTest {
|
|||||||
overuse_detector_->FrameSent(0 /* ignored timestamp */,
|
overuse_detector_->FrameSent(0 /* ignored timestamp */,
|
||||||
0 /* ignored send_time_us */,
|
0 /* ignored send_time_us */,
|
||||||
capture_time_us, delay_us);
|
capture_time_us, delay_us);
|
||||||
clock_.AdvanceTime(TimeDelta::us(interval_us));
|
clock_.AdvanceTime(TimeDelta::Micros(interval_us));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -708,7 +708,7 @@ class OveruseFrameDetectorTest2 : public OveruseFrameDetectorTest {
|
|||||||
capture_time_us, delay_us);
|
capture_time_us, delay_us);
|
||||||
|
|
||||||
overuse_detector_->CheckForOveruse(observer_);
|
overuse_detector_->CheckForOveruse(observer_);
|
||||||
clock_.AdvanceTime(TimeDelta::us(interval_us));
|
clock_.AdvanceTime(TimeDelta::Micros(interval_us));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -758,7 +758,7 @@ TEST_F(OveruseFrameDetectorTest2, TriggerUnderuseWithMinProcessCount) {
|
|||||||
kProcessTimeUs);
|
kProcessTimeUs);
|
||||||
overuse_detector_->CheckForOveruse(&overuse_observer);
|
overuse_detector_->CheckForOveruse(&overuse_observer);
|
||||||
EXPECT_EQ(0, overuse_observer.normaluse_);
|
EXPECT_EQ(0, overuse_observer.normaluse_);
|
||||||
clock_.AdvanceTime(TimeDelta::us(kProcessIntervalUs));
|
clock_.AdvanceTime(TimeDelta::Micros(kProcessIntervalUs));
|
||||||
overuse_detector_->CheckForOveruse(&overuse_observer);
|
overuse_detector_->CheckForOveruse(&overuse_observer);
|
||||||
EXPECT_EQ(1, overuse_observer.normaluse_);
|
EXPECT_EQ(1, overuse_observer.normaluse_);
|
||||||
}
|
}
|
||||||
@ -869,7 +869,7 @@ TEST_F(OveruseFrameDetectorTest2, MeasuresMultipleConcurrentSamples) {
|
|||||||
frame.set_timestamp(static_cast<uint32_t>(i));
|
frame.set_timestamp(static_cast<uint32_t>(i));
|
||||||
int64_t capture_time_us = rtc::TimeMicros();
|
int64_t capture_time_us = rtc::TimeMicros();
|
||||||
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
||||||
clock_.AdvanceTime(TimeDelta::us(kIntervalUs));
|
clock_.AdvanceTime(TimeDelta::Micros(kIntervalUs));
|
||||||
if (i > kNumFramesEncodingDelay) {
|
if (i > kNumFramesEncodingDelay) {
|
||||||
overuse_detector_->FrameSent(
|
overuse_detector_->FrameSent(
|
||||||
static_cast<uint32_t>(i - kNumFramesEncodingDelay), rtc::TimeMicros(),
|
static_cast<uint32_t>(i - kNumFramesEncodingDelay), rtc::TimeMicros(),
|
||||||
@ -897,14 +897,14 @@ TEST_F(OveruseFrameDetectorTest2, UpdatesExistingSamples) {
|
|||||||
int64_t capture_time_us = rtc::TimeMicros();
|
int64_t capture_time_us = rtc::TimeMicros();
|
||||||
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
overuse_detector_->FrameCaptured(frame, capture_time_us);
|
||||||
// Encode and send first parts almost instantly.
|
// Encode and send first parts almost instantly.
|
||||||
clock_.AdvanceTime(TimeDelta::ms(1));
|
clock_.AdvanceTime(TimeDelta::Millis(1));
|
||||||
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(), capture_time_us,
|
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(), capture_time_us,
|
||||||
rtc::kNumMicrosecsPerMillisec);
|
rtc::kNumMicrosecsPerMillisec);
|
||||||
// Encode heavier part, resulting in >85% usage total.
|
// Encode heavier part, resulting in >85% usage total.
|
||||||
clock_.AdvanceTime(TimeDelta::us(kDelayUs) - TimeDelta::ms(1));
|
clock_.AdvanceTime(TimeDelta::Micros(kDelayUs) - TimeDelta::Millis(1));
|
||||||
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(), capture_time_us,
|
overuse_detector_->FrameSent(timestamp, rtc::TimeMicros(), capture_time_us,
|
||||||
kDelayUs);
|
kDelayUs);
|
||||||
clock_.AdvanceTime(TimeDelta::us(kIntervalUs - kDelayUs));
|
clock_.AdvanceTime(TimeDelta::Micros(kIntervalUs - kDelayUs));
|
||||||
timestamp += kIntervalUs * 90 / 1000;
|
timestamp += kIntervalUs * 90 / 1000;
|
||||||
overuse_detector_->CheckForOveruse(observer_);
|
overuse_detector_->CheckForOveruse(observer_);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,7 +138,7 @@ TEST(PCFullStackTest, ForemanCifWithoutPacketLossVp9) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(
|
run_params.video_codecs = {VideoCodecConfig(
|
||||||
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
||||||
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
||||||
@ -163,7 +163,7 @@ TEST_P(PCGenericDescriptorTest, ForemanCifPlr5Vp9) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(
|
run_params.video_codecs = {VideoCodecConfig(
|
||||||
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
||||||
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
||||||
@ -196,7 +196,7 @@ TEST(PCFullStackTest, MAYBE_GeneratorWithoutPacketLossVp9Profile2) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(
|
run_params.video_codecs = {VideoCodecConfig(
|
||||||
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
||||||
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile2)}})};
|
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile2)}})};
|
||||||
@ -251,7 +251,7 @@ TEST(PCFullStackTest, ParisQcifWithoutPacketLoss) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -272,7 +272,7 @@ TEST_P(PCGenericDescriptorTest, ForemanCifWithoutPacketLoss) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -299,7 +299,7 @@ TEST_P(PCGenericDescriptorTest, ForemanCif30kbpsWithoutPacketLoss) {
|
|||||||
alice->SetBitrateParameters(bitrate_params);
|
alice->SetBitrateParameters(bitrate_params);
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -331,7 +331,7 @@ TEST_P(PCGenericDescriptorTest,
|
|||||||
alice->SetBitrateParameters(bitrate_params);
|
alice->SetBitrateParameters(bitrate_params);
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -354,7 +354,7 @@ TEST(PCFullStackTest, ForemanCifLink150kbpsWithoutPacketLoss) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -378,7 +378,7 @@ TEST(PCFullStackTest, ForemanCifLink130kbps100msDelay1PercentPacketLossUlpfec) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = true;
|
run_params.use_ulp_fec = true;
|
||||||
@ -402,7 +402,7 @@ TEST(PCFullStackTest, ForemanCifLink50kbps100msDelay1PercentPacketLossUlpfec) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = true;
|
run_params.use_ulp_fec = true;
|
||||||
@ -427,7 +427,7 @@ TEST(PCFullStackTest, ForemanCifLink150kbpsBadRateController) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -457,7 +457,7 @@ TEST(PCFullStackTest, ForemanCifMediaCapacitySmallLossAndQueue) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -481,7 +481,7 @@ TEST_P(PCGenericDescriptorTest, ForemanCifPlr5) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -504,7 +504,7 @@ TEST_P(PCGenericDescriptorTest, ForemanCifPlr5Ulpfec) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = true;
|
run_params.use_ulp_fec = true;
|
||||||
@ -527,7 +527,7 @@ TEST(PCFullStackTest, ForemanCifPlr5Flexfec) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = true;
|
run_params.use_flex_fec = true;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -551,7 +551,7 @@ TEST(PCFullStackTest, ForemanCif500kbpsPlr3Flexfec) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = true;
|
run_params.use_flex_fec = true;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -575,7 +575,7 @@ TEST(PCFullStackTest, ForemanCif500kbpsPlr3Ulpfec) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = true;
|
run_params.use_ulp_fec = true;
|
||||||
@ -597,7 +597,7 @@ TEST(PCFullStackTest, ForemanCifWithoutPacketlossH264) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -624,7 +624,7 @@ TEST(PCFullStackTest, ForemanCif30kbpsWithoutPacketlossH264) {
|
|||||||
alice->SetBitrateParameters(bitrate_params);
|
alice->SetBitrateParameters(bitrate_params);
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -647,7 +647,7 @@ TEST_P(PCGenericDescriptorTest, ForemanCifPlr5H264) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -673,7 +673,7 @@ TEST(PCFullStackTest, ForemanCifPlr5H264SpsPpsIdrIsKeyframe) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -696,7 +696,7 @@ TEST(PCFullStackTest, ForemanCifPlr5H264Flexfec) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
||||||
run_params.use_flex_fec = true;
|
run_params.use_flex_fec = true;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -721,7 +721,7 @@ TEST(PCFullStackTest, DISABLED_ForemanCifPlr5H264Ulpfec) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = true;
|
run_params.use_ulp_fec = true;
|
||||||
@ -746,7 +746,7 @@ TEST(PCFullStackTest, ForemanCif500kbps) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -770,7 +770,7 @@ TEST(PCFullStackTest, ForemanCif500kbpsLimitedQueue) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -794,7 +794,7 @@ TEST(PCFullStackTest, ForemanCif500kbps100ms) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -818,7 +818,7 @@ TEST_P(PCGenericDescriptorTest, ForemanCif500kbps100msLimitedQueue) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -863,7 +863,7 @@ TEST(PCFullStackTest, ForemanCif1000kbps100msLimitedQueue) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -889,7 +889,7 @@ TEST(PCFullStackTest, ConferenceMotionHd2000kbps100msLimitedQueue) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -918,7 +918,7 @@ TEST(PCFullStackTest, ConferenceMotionHd1TLModerateLimitsWhitelistVp8) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -1070,7 +1070,7 @@ TEST(PCFullStackTest, ConferenceMotionHd2000kbps100msLimitedQueueVP9) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(
|
run_params.video_codecs = {VideoCodecConfig(
|
||||||
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
||||||
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
||||||
@ -1089,12 +1089,12 @@ TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_NoConferenceMode) {
|
|||||||
BuiltInNetworkBehaviorConfig()),
|
BuiltInNetworkBehaviorConfig()),
|
||||||
[](PeerConfigurer* alice) {
|
[](PeerConfigurer* alice) {
|
||||||
VideoConfig video(1850, 1110, 5);
|
VideoConfig video(1850, 1110, 5);
|
||||||
video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
|
video.screen_share_config = ScreenShareConfig(TimeDelta::Seconds(10));
|
||||||
video.stream_label = "alice-video";
|
video.stream_label = "alice-video";
|
||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -1110,12 +1110,12 @@ TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL) {
|
|||||||
BuiltInNetworkBehaviorConfig()),
|
BuiltInNetworkBehaviorConfig()),
|
||||||
[](PeerConfigurer* alice) {
|
[](PeerConfigurer* alice) {
|
||||||
VideoConfig video(1850, 1110, 5);
|
VideoConfig video(1850, 1110, 5);
|
||||||
video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
|
video.screen_share_config = ScreenShareConfig(TimeDelta::Seconds(10));
|
||||||
video.stream_label = "alice-video";
|
video.stream_label = "alice-video";
|
||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -1134,14 +1134,14 @@ TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Simulcast_NoConferenceMode) {
|
|||||||
BuiltInNetworkBehaviorConfig()),
|
BuiltInNetworkBehaviorConfig()),
|
||||||
[](PeerConfigurer* alice) {
|
[](PeerConfigurer* alice) {
|
||||||
VideoConfig video(1850, 1110, 30);
|
VideoConfig video(1850, 1110, 30);
|
||||||
video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
|
video.screen_share_config = ScreenShareConfig(TimeDelta::Seconds(10));
|
||||||
video.simulcast_config = VideoSimulcastConfig(2, 1);
|
video.simulcast_config = VideoSimulcastConfig(2, 1);
|
||||||
video.temporal_layers_count = 2;
|
video.temporal_layers_count = 2;
|
||||||
video.stream_label = "alice-video";
|
video.stream_label = "alice-video";
|
||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -1157,14 +1157,14 @@ TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Simulcast) {
|
|||||||
BuiltInNetworkBehaviorConfig()),
|
BuiltInNetworkBehaviorConfig()),
|
||||||
[](PeerConfigurer* alice) {
|
[](PeerConfigurer* alice) {
|
||||||
VideoConfig video(1850, 1110, 30);
|
VideoConfig video(1850, 1110, 30);
|
||||||
video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
|
video.screen_share_config = ScreenShareConfig(TimeDelta::Seconds(10));
|
||||||
video.simulcast_config = VideoSimulcastConfig(2, 1);
|
video.simulcast_config = VideoSimulcastConfig(2, 1);
|
||||||
video.temporal_layers_count = 2;
|
video.temporal_layers_count = 2;
|
||||||
video.stream_label = "alice-video";
|
video.stream_label = "alice-video";
|
||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -1397,12 +1397,12 @@ TEST(PCFullStackTest, ScreenshareSlidesVP9_3SL_High_Fps) {
|
|||||||
[](PeerConfigurer* alice) {
|
[](PeerConfigurer* alice) {
|
||||||
VideoConfig video(1850, 1110, 30);
|
VideoConfig video(1850, 1110, 30);
|
||||||
video.stream_label = "alice-video";
|
video.stream_label = "alice-video";
|
||||||
video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
|
video.screen_share_config = ScreenShareConfig(TimeDelta::Seconds(10));
|
||||||
video.simulcast_config = VideoSimulcastConfig(3, 2);
|
video.simulcast_config = VideoSimulcastConfig(3, 2);
|
||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(
|
run_params.video_codecs = {VideoCodecConfig(
|
||||||
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
||||||
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
||||||
@ -1427,12 +1427,12 @@ TEST(PCFullStackTest, ScreenshareSlidesVP9_3SL_Variable_Fps) {
|
|||||||
[](PeerConfigurer* alice) {
|
[](PeerConfigurer* alice) {
|
||||||
VideoConfig video(1850, 1110, 30);
|
VideoConfig video(1850, 1110, 30);
|
||||||
video.stream_label = "alice-video";
|
video.stream_label = "alice-video";
|
||||||
video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
|
video.screen_share_config = ScreenShareConfig(TimeDelta::Seconds(10));
|
||||||
video.simulcast_config = VideoSimulcastConfig(3, 2);
|
video.simulcast_config = VideoSimulcastConfig(3, 2);
|
||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(
|
run_params.video_codecs = {VideoCodecConfig(
|
||||||
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
||||||
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
||||||
@ -1461,7 +1461,7 @@ TEST(PCFullStackTest, VP9SVC_3SL_High) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(
|
run_params.video_codecs = {VideoCodecConfig(
|
||||||
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
||||||
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
||||||
@ -1490,7 +1490,7 @@ TEST(PCFullStackTest, VP9SVC_3SL_Medium) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(
|
run_params.video_codecs = {VideoCodecConfig(
|
||||||
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
||||||
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
||||||
@ -1519,7 +1519,7 @@ TEST(PCFullStackTest, VP9SVC_3SL_Low) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(
|
run_params.video_codecs = {VideoCodecConfig(
|
||||||
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
/*name=*/cricket::kVp9CodecName, /*required_params=*/{
|
||||||
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})};
|
||||||
@ -1648,7 +1648,7 @@ TEST(PCFullStackTest, MAYBE_SimulcastFullHdOveruse) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -1673,7 +1673,7 @@ TEST(PCFullStackTest, SimulcastVP8_3SL_High) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -1698,7 +1698,7 @@ TEST(PCFullStackTest, SimulcastVP8_3SL_Medium) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
@ -1723,7 +1723,7 @@ TEST(PCFullStackTest, SimulcastVP8_3SL_Low) {
|
|||||||
alice->AddVideoConfig(std::move(video));
|
alice->AddVideoConfig(std::move(video));
|
||||||
},
|
},
|
||||||
[](PeerConfigurer* bob) {});
|
[](PeerConfigurer* bob) {});
|
||||||
RunParams run_params(TimeDelta::seconds(kTestDurationSec));
|
RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
|
||||||
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)};
|
||||||
run_params.use_flex_fec = false;
|
run_params.use_flex_fec = false;
|
||||||
run_params.use_ulp_fec = false;
|
run_params.use_ulp_fec = false;
|
||||||
|
|||||||
@ -189,9 +189,9 @@ TEST_F(ReceiveStatisticsProxyTest, ReportsContentType) {
|
|||||||
|
|
||||||
TEST_F(ReceiveStatisticsProxyTest, ReportsMaxTotalInterFrameDelay) {
|
TEST_F(ReceiveStatisticsProxyTest, ReportsMaxTotalInterFrameDelay) {
|
||||||
webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight);
|
webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight);
|
||||||
const TimeDelta kInterFrameDelay1 = TimeDelta::ms(100);
|
const TimeDelta kInterFrameDelay1 = TimeDelta::Millis(100);
|
||||||
const TimeDelta kInterFrameDelay2 = TimeDelta::ms(200);
|
const TimeDelta kInterFrameDelay2 = TimeDelta::Millis(200);
|
||||||
const TimeDelta kInterFrameDelay3 = TimeDelta::ms(300);
|
const TimeDelta kInterFrameDelay3 = TimeDelta::Millis(300);
|
||||||
double expected_total_inter_frame_delay = 0;
|
double expected_total_inter_frame_delay = 0;
|
||||||
double expected_total_squared_inter_frame_delay = 0;
|
double expected_total_squared_inter_frame_delay = 0;
|
||||||
EXPECT_EQ(expected_total_inter_frame_delay,
|
EXPECT_EQ(expected_total_inter_frame_delay,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user