mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Enables feature to account for unacknowledged data.
By enabling this trial, we can also remove reporting of packet feedback status from send streams that was used before. Bug: webrtc:9718 Change-Id: I3e7c4656b0ac6592a834617e044f23a072454181 Reviewed-on: https://webrtc-review.googlesource.com/c/118281 Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26363}
This commit is contained in:
parent
7e4341db60
commit
79f0d4d0c7
20 changed files with 36 additions and 170 deletions
|
@ -36,8 +36,6 @@ struct StreamsConfig {
|
||||||
absl::optional<DataRate> min_pacing_rate;
|
absl::optional<DataRate> min_pacing_rate;
|
||||||
absl::optional<DataRate> max_padding_rate;
|
absl::optional<DataRate> max_padding_rate;
|
||||||
absl::optional<DataRate> max_total_allocated_bitrate;
|
absl::optional<DataRate> max_total_allocated_bitrate;
|
||||||
// The send rate of traffic for which feedback is not received.
|
|
||||||
DataRate unacknowledged_rate_allocation = DataRate::Zero();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TargetRateConstraints {
|
struct TargetRateConstraints {
|
||||||
|
|
|
@ -320,8 +320,7 @@ void AudioSendStream::Start() {
|
||||||
rtp_transport_->packet_sender()->SetAccountForAudioPackets(true);
|
rtp_transport_->packet_sender()->SetAccountForAudioPackets(true);
|
||||||
rtp_rtcp_module_->SetAsPartOfAllocation(true);
|
rtp_rtcp_module_->SetAsPartOfAllocation(true);
|
||||||
ConfigureBitrateObserver(config_.min_bitrate_bps, config_.max_bitrate_bps,
|
ConfigureBitrateObserver(config_.min_bitrate_bps, config_.max_bitrate_bps,
|
||||||
config_.bitrate_priority,
|
config_.bitrate_priority);
|
||||||
has_transport_sequence_number);
|
|
||||||
} else {
|
} else {
|
||||||
rtp_rtcp_module_->SetAsPartOfAllocation(false);
|
rtp_rtcp_module_->SetAsPartOfAllocation(false);
|
||||||
}
|
}
|
||||||
|
@ -729,10 +728,10 @@ void AudioSendStream::ReconfigureBitrateObserver(
|
||||||
(has_transport_sequence_number ||
|
(has_transport_sequence_number ||
|
||||||
!webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe"))) {
|
!webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe"))) {
|
||||||
stream->rtp_transport_->packet_sender()->SetAccountForAudioPackets(true);
|
stream->rtp_transport_->packet_sender()->SetAccountForAudioPackets(true);
|
||||||
stream->ConfigureBitrateObserver(
|
|
||||||
new_config.min_bitrate_bps, new_config.max_bitrate_bps,
|
|
||||||
new_config.bitrate_priority, has_transport_sequence_number);
|
|
||||||
stream->rtp_rtcp_module_->SetAsPartOfAllocation(true);
|
stream->rtp_rtcp_module_->SetAsPartOfAllocation(true);
|
||||||
|
stream->ConfigureBitrateObserver(new_config.min_bitrate_bps,
|
||||||
|
new_config.max_bitrate_bps,
|
||||||
|
new_config.bitrate_priority);
|
||||||
} else {
|
} else {
|
||||||
stream->rtp_transport_->packet_sender()->SetAccountForAudioPackets(false);
|
stream->rtp_transport_->packet_sender()->SetAccountForAudioPackets(false);
|
||||||
stream->RemoveBitrateObserver();
|
stream->RemoveBitrateObserver();
|
||||||
|
@ -742,8 +741,7 @@ void AudioSendStream::ReconfigureBitrateObserver(
|
||||||
|
|
||||||
void AudioSendStream::ConfigureBitrateObserver(int min_bitrate_bps,
|
void AudioSendStream::ConfigureBitrateObserver(int min_bitrate_bps,
|
||||||
int max_bitrate_bps,
|
int max_bitrate_bps,
|
||||||
double bitrate_priority,
|
double bitrate_priority) {
|
||||||
bool has_packet_feedback) {
|
|
||||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||||
RTC_DCHECK_GE(max_bitrate_bps, min_bitrate_bps);
|
RTC_DCHECK_GE(max_bitrate_bps, min_bitrate_bps);
|
||||||
rtc::Event thread_sync_event;
|
rtc::Event thread_sync_event;
|
||||||
|
@ -755,10 +753,10 @@ void AudioSendStream::ConfigureBitrateObserver(int min_bitrate_bps,
|
||||||
config_.bitrate_priority = bitrate_priority;
|
config_.bitrate_priority = bitrate_priority;
|
||||||
// This either updates the current observer or adds a new observer.
|
// This either updates the current observer or adds a new observer.
|
||||||
bitrate_allocator_->AddObserver(
|
bitrate_allocator_->AddObserver(
|
||||||
this, MediaStreamAllocationConfig{
|
this,
|
||||||
static_cast<uint32_t>(min_bitrate_bps),
|
MediaStreamAllocationConfig{static_cast<uint32_t>(min_bitrate_bps),
|
||||||
static_cast<uint32_t>(max_bitrate_bps), 0, true,
|
static_cast<uint32_t>(max_bitrate_bps), 0,
|
||||||
config_.track_id, bitrate_priority, has_packet_feedback});
|
true, config_.track_id, bitrate_priority});
|
||||||
thread_sync_event.Set();
|
thread_sync_event.Set();
|
||||||
});
|
});
|
||||||
thread_sync_event.Wait(rtc::Event::kForever);
|
thread_sync_event.Wait(rtc::Event::kForever);
|
||||||
|
|
|
@ -112,8 +112,7 @@ class AudioSendStream final : public webrtc::AudioSendStream,
|
||||||
|
|
||||||
void ConfigureBitrateObserver(int min_bitrate_bps,
|
void ConfigureBitrateObserver(int min_bitrate_bps,
|
||||||
int max_bitrate_bps,
|
int max_bitrate_bps,
|
||||||
double bitrate_priority,
|
double bitrate_priority);
|
||||||
bool has_packet_feedback);
|
|
||||||
void RemoveBitrateObserver();
|
void RemoveBitrateObserver();
|
||||||
|
|
||||||
void RegisterCngPayloadType(int payload_type, int clockrate_hz);
|
void RegisterCngPayloadType(int payload_type, int clockrate_hz);
|
||||||
|
|
|
@ -72,12 +72,10 @@ const AudioCodecSpec kCodecSpecs[] = {
|
||||||
|
|
||||||
class MockLimitObserver : public BitrateAllocator::LimitObserver {
|
class MockLimitObserver : public BitrateAllocator::LimitObserver {
|
||||||
public:
|
public:
|
||||||
MOCK_METHOD5(OnAllocationLimitsChanged,
|
MOCK_METHOD3(OnAllocationLimitsChanged,
|
||||||
void(uint32_t min_send_bitrate_bps,
|
void(uint32_t min_send_bitrate_bps,
|
||||||
uint32_t max_padding_bitrate_bps,
|
uint32_t max_padding_bitrate_bps,
|
||||||
uint32_t total_bitrate_bps,
|
uint32_t total_bitrate_bps));
|
||||||
uint32_t allocated_without_feedback_bps,
|
|
||||||
bool has_packet_feedback));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<MockAudioEncoder> SetupAudioEncoderMock(
|
std::unique_ptr<MockAudioEncoder> SetupAudioEncoderMock(
|
||||||
|
|
|
@ -64,8 +64,6 @@ BitrateAllocator::BitrateAllocator(LimitObserver* limit_observer)
|
||||||
total_requested_padding_bitrate_(0),
|
total_requested_padding_bitrate_(0),
|
||||||
total_requested_min_bitrate_(0),
|
total_requested_min_bitrate_(0),
|
||||||
total_requested_max_bitrate_(0),
|
total_requested_max_bitrate_(0),
|
||||||
allocated_without_feedback_(0),
|
|
||||||
has_packet_feedback_(false),
|
|
||||||
bitrate_allocation_strategy_(nullptr),
|
bitrate_allocation_strategy_(nullptr),
|
||||||
transmission_max_bitrate_multiplier_(
|
transmission_max_bitrate_multiplier_(
|
||||||
GetTransmissionMaxBitrateMultiplier()) {
|
GetTransmissionMaxBitrateMultiplier()) {
|
||||||
|
@ -175,10 +173,10 @@ void BitrateAllocator::AddObserver(BitrateAllocatorObserver* observer,
|
||||||
it->enforce_min_bitrate = config.enforce_min_bitrate;
|
it->enforce_min_bitrate = config.enforce_min_bitrate;
|
||||||
it->bitrate_priority = config.bitrate_priority;
|
it->bitrate_priority = config.bitrate_priority;
|
||||||
} else {
|
} else {
|
||||||
bitrate_observer_configs_.push_back(ObserverConfig(
|
bitrate_observer_configs_.push_back(
|
||||||
observer, config.min_bitrate_bps, config.max_bitrate_bps,
|
ObserverConfig(observer, config.min_bitrate_bps, config.max_bitrate_bps,
|
||||||
config.pad_up_bitrate_bps, config.enforce_min_bitrate, config.track_id,
|
config.pad_up_bitrate_bps, config.enforce_min_bitrate,
|
||||||
config.bitrate_priority, config.has_packet_feedback));
|
config.track_id, config.bitrate_priority));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last_target_bps_ > 0) {
|
if (last_target_bps_ > 0) {
|
||||||
|
@ -221,8 +219,6 @@ void BitrateAllocator::UpdateAllocationLimits() {
|
||||||
uint32_t total_requested_padding_bitrate = 0;
|
uint32_t total_requested_padding_bitrate = 0;
|
||||||
uint32_t total_requested_min_bitrate = 0;
|
uint32_t total_requested_min_bitrate = 0;
|
||||||
uint32_t total_requested_max_bitrate = 0;
|
uint32_t total_requested_max_bitrate = 0;
|
||||||
bool has_packet_feedback = false;
|
|
||||||
uint32_t allocated_without_feedback = 0;
|
|
||||||
for (const auto& config : bitrate_observer_configs_) {
|
for (const auto& config : bitrate_observer_configs_) {
|
||||||
uint32_t stream_padding = config.pad_up_bitrate_bps;
|
uint32_t stream_padding = config.pad_up_bitrate_bps;
|
||||||
if (config.enforce_min_bitrate) {
|
if (config.enforce_min_bitrate) {
|
||||||
|
@ -240,27 +236,17 @@ void BitrateAllocator::UpdateAllocationLimits() {
|
||||||
max_bitrate_bps *= 2;
|
max_bitrate_bps *= 2;
|
||||||
}
|
}
|
||||||
total_requested_max_bitrate += max_bitrate_bps;
|
total_requested_max_bitrate += max_bitrate_bps;
|
||||||
if (config.allocated_bitrate_bps > 0 && config.has_packet_feedback)
|
|
||||||
has_packet_feedback = true;
|
|
||||||
// TODO(srte): Remove field trial check.
|
|
||||||
if (!config.has_packet_feedback &&
|
|
||||||
field_trial::IsEnabled("WebRTC-Audio-ABWENoTWCC"))
|
|
||||||
allocated_without_feedback += config.allocated_bitrate_bps;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (total_requested_padding_bitrate == total_requested_padding_bitrate_ &&
|
if (total_requested_padding_bitrate == total_requested_padding_bitrate_ &&
|
||||||
total_requested_min_bitrate == total_requested_min_bitrate_ &&
|
total_requested_min_bitrate == total_requested_min_bitrate_ &&
|
||||||
total_requested_max_bitrate == total_requested_max_bitrate_ &&
|
total_requested_max_bitrate == total_requested_max_bitrate_) {
|
||||||
allocated_without_feedback == allocated_without_feedback_ &&
|
|
||||||
has_packet_feedback == has_packet_feedback_) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
total_requested_min_bitrate_ = total_requested_min_bitrate;
|
total_requested_min_bitrate_ = total_requested_min_bitrate;
|
||||||
total_requested_padding_bitrate_ = total_requested_padding_bitrate;
|
total_requested_padding_bitrate_ = total_requested_padding_bitrate;
|
||||||
total_requested_max_bitrate_ = total_requested_max_bitrate;
|
total_requested_max_bitrate_ = total_requested_max_bitrate;
|
||||||
allocated_without_feedback_ = allocated_without_feedback;
|
|
||||||
has_packet_feedback_ = has_packet_feedback;
|
|
||||||
|
|
||||||
RTC_LOG(LS_INFO) << "UpdateAllocationLimits : total_requested_min_bitrate: "
|
RTC_LOG(LS_INFO) << "UpdateAllocationLimits : total_requested_min_bitrate: "
|
||||||
<< total_requested_min_bitrate
|
<< total_requested_min_bitrate
|
||||||
|
@ -268,10 +254,9 @@ void BitrateAllocator::UpdateAllocationLimits() {
|
||||||
<< total_requested_padding_bitrate
|
<< total_requested_padding_bitrate
|
||||||
<< "bps, total_requested_max_bitrate: "
|
<< "bps, total_requested_max_bitrate: "
|
||||||
<< total_requested_max_bitrate << "bps";
|
<< total_requested_max_bitrate << "bps";
|
||||||
limit_observer_->OnAllocationLimitsChanged(
|
limit_observer_->OnAllocationLimitsChanged(total_requested_min_bitrate,
|
||||||
total_requested_min_bitrate, total_requested_padding_bitrate,
|
total_requested_padding_bitrate,
|
||||||
total_requested_max_bitrate, allocated_without_feedback,
|
total_requested_max_bitrate);
|
||||||
has_packet_feedback);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitrateAllocator::RemoveObserver(BitrateAllocatorObserver* observer) {
|
void BitrateAllocator::RemoveObserver(BitrateAllocatorObserver* observer) {
|
||||||
|
|
|
@ -47,11 +47,7 @@ class BitrateAllocatorObserver {
|
||||||
// |enforce_min_bitrate| = 'true' will allocate at least |min_bitrate_bps| for
|
// |enforce_min_bitrate| = 'true' will allocate at least |min_bitrate_bps| for
|
||||||
// this observer, even if the BWE is too low, 'false' will allocate 0 to
|
// this observer, even if the BWE is too low, 'false' will allocate 0 to
|
||||||
// the observer if BWE doesn't allow |min_bitrate_bps|.
|
// the observer if BWE doesn't allow |min_bitrate_bps|.
|
||||||
// |has_packet_feedback| indicates whether the data produced by the
|
// Note that |observer|->OnBitrateUpdated() will be called
|
||||||
// corresponding media stream will receive per packet feedback. This is
|
|
||||||
// tracked here to communicate to limit observers whether packet feedback can
|
|
||||||
// be expected, which is true if any of the active observers has packet
|
|
||||||
// feedback enabled. Note that |observer|->OnBitrateUpdated() will be called
|
|
||||||
// within the scope of this method with the current rtt, fraction_loss and
|
// within the scope of this method with the current rtt, fraction_loss and
|
||||||
// available bitrate and that the bitrate in OnBitrateUpdated will be zero if
|
// available bitrate and that the bitrate in OnBitrateUpdated will be zero if
|
||||||
// the |observer| is currently not allowed to send data.
|
// the |observer| is currently not allowed to send data.
|
||||||
|
@ -62,7 +58,6 @@ struct MediaStreamAllocationConfig {
|
||||||
bool enforce_min_bitrate;
|
bool enforce_min_bitrate;
|
||||||
std::string track_id;
|
std::string track_id;
|
||||||
double bitrate_priority;
|
double bitrate_priority;
|
||||||
bool has_packet_feedback;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Interface used for mocking
|
// Interface used for mocking
|
||||||
|
@ -86,12 +81,9 @@ class BitrateAllocator : public BitrateAllocatorInterface {
|
||||||
// bitrate and max padding bitrate is changed.
|
// bitrate and max padding bitrate is changed.
|
||||||
class LimitObserver {
|
class LimitObserver {
|
||||||
public:
|
public:
|
||||||
virtual void OnAllocationLimitsChanged(
|
virtual void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps,
|
||||||
uint32_t min_send_bitrate_bps,
|
uint32_t max_padding_bitrate_bps,
|
||||||
uint32_t max_padding_bitrate_bps,
|
uint32_t total_bitrate_bps) = 0;
|
||||||
uint32_t total_bitrate_bps,
|
|
||||||
uint32_t allocated_without_feedback_bps,
|
|
||||||
bool has_packet_feedback) = 0;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~LimitObserver() = default;
|
virtual ~LimitObserver() = default;
|
||||||
|
@ -138,8 +130,7 @@ class BitrateAllocator : public BitrateAllocatorInterface {
|
||||||
uint32_t pad_up_bitrate_bps,
|
uint32_t pad_up_bitrate_bps,
|
||||||
bool enforce_min_bitrate,
|
bool enforce_min_bitrate,
|
||||||
std::string track_id,
|
std::string track_id,
|
||||||
double bitrate_priority,
|
double bitrate_priority)
|
||||||
bool has_packet_feedback)
|
|
||||||
: TrackConfig(min_bitrate_bps,
|
: TrackConfig(min_bitrate_bps,
|
||||||
max_bitrate_bps,
|
max_bitrate_bps,
|
||||||
enforce_min_bitrate,
|
enforce_min_bitrate,
|
||||||
|
@ -148,8 +139,7 @@ class BitrateAllocator : public BitrateAllocatorInterface {
|
||||||
pad_up_bitrate_bps(pad_up_bitrate_bps),
|
pad_up_bitrate_bps(pad_up_bitrate_bps),
|
||||||
allocated_bitrate_bps(-1),
|
allocated_bitrate_bps(-1),
|
||||||
media_ratio(1.0),
|
media_ratio(1.0),
|
||||||
bitrate_priority(bitrate_priority),
|
bitrate_priority(bitrate_priority) {}
|
||||||
has_packet_feedback(has_packet_feedback) {}
|
|
||||||
|
|
||||||
BitrateAllocatorObserver* observer;
|
BitrateAllocatorObserver* observer;
|
||||||
uint32_t pad_up_bitrate_bps;
|
uint32_t pad_up_bitrate_bps;
|
||||||
|
@ -159,7 +149,6 @@ class BitrateAllocator : public BitrateAllocatorInterface {
|
||||||
// observers. If an observer has twice the bitrate_priority of other
|
// observers. If an observer has twice the bitrate_priority of other
|
||||||
// observers, it should be allocated twice the bitrate above its min.
|
// observers, it should be allocated twice the bitrate above its min.
|
||||||
double bitrate_priority;
|
double bitrate_priority;
|
||||||
bool has_packet_feedback;
|
|
||||||
|
|
||||||
uint32_t LastAllocatedBitrate() const;
|
uint32_t LastAllocatedBitrate() const;
|
||||||
// The minimum bitrate required by this observer, including
|
// The minimum bitrate required by this observer, including
|
||||||
|
@ -250,8 +239,6 @@ class BitrateAllocator : public BitrateAllocatorInterface {
|
||||||
uint32_t total_requested_padding_bitrate_ RTC_GUARDED_BY(&sequenced_checker_);
|
uint32_t total_requested_padding_bitrate_ RTC_GUARDED_BY(&sequenced_checker_);
|
||||||
uint32_t total_requested_min_bitrate_ RTC_GUARDED_BY(&sequenced_checker_);
|
uint32_t total_requested_min_bitrate_ RTC_GUARDED_BY(&sequenced_checker_);
|
||||||
uint32_t total_requested_max_bitrate_ RTC_GUARDED_BY(&sequenced_checker_);
|
uint32_t total_requested_max_bitrate_ RTC_GUARDED_BY(&sequenced_checker_);
|
||||||
uint32_t allocated_without_feedback_ RTC_GUARDED_BY(&sequenced_checker_);
|
|
||||||
bool has_packet_feedback_ RTC_GUARDED_BY(&sequenced_checker_);
|
|
||||||
std::unique_ptr<rtc::BitrateAllocationStrategy> bitrate_allocation_strategy_
|
std::unique_ptr<rtc::BitrateAllocationStrategy> bitrate_allocation_strategy_
|
||||||
RTC_GUARDED_BY(&sequenced_checker_);
|
RTC_GUARDED_BY(&sequenced_checker_);
|
||||||
const uint8_t transmission_max_bitrate_multiplier_;
|
const uint8_t transmission_max_bitrate_multiplier_;
|
||||||
|
|
|
@ -25,14 +25,6 @@ namespace webrtc {
|
||||||
// TODO(srte): Update tests to reflect new interface.
|
// TODO(srte): Update tests to reflect new interface.
|
||||||
class LimitObserverWrapper : public BitrateAllocator::LimitObserver {
|
class LimitObserverWrapper : public BitrateAllocator::LimitObserver {
|
||||||
public:
|
public:
|
||||||
void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps,
|
|
||||||
uint32_t max_padding_bitrate_bps,
|
|
||||||
uint32_t total_bitrate_bps,
|
|
||||||
uint32_t allocated_without_feedback_bps,
|
|
||||||
bool has_packet_feedback) override {
|
|
||||||
OnAllocationLimitsChanged(min_send_bitrate_bps, max_padding_bitrate_bps,
|
|
||||||
total_bitrate_bps);
|
|
||||||
}
|
|
||||||
virtual void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps,
|
virtual void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps,
|
||||||
uint32_t max_padding_bitrate_bps,
|
uint32_t max_padding_bitrate_bps,
|
||||||
uint32_t total_bitrate_bps) = 0;
|
uint32_t total_bitrate_bps) = 0;
|
||||||
|
@ -107,7 +99,7 @@ class BitrateAllocatorTest : public ::testing::Test {
|
||||||
double bitrate_priority) {
|
double bitrate_priority) {
|
||||||
allocator_->AddObserver(
|
allocator_->AddObserver(
|
||||||
observer, {min_bitrate_bps, max_bitrate_bps, pad_up_bitrate_bps,
|
observer, {min_bitrate_bps, max_bitrate_bps, pad_up_bitrate_bps,
|
||||||
enforce_min_bitrate, track_id, bitrate_priority, false});
|
enforce_min_bitrate, track_id, bitrate_priority});
|
||||||
}
|
}
|
||||||
|
|
||||||
NiceMock<MockLimitObserver> limit_observer_;
|
NiceMock<MockLimitObserver> limit_observer_;
|
||||||
|
@ -240,7 +232,7 @@ class BitrateAllocatorTestNoEnforceMin : public ::testing::Test {
|
||||||
double bitrate_priority) {
|
double bitrate_priority) {
|
||||||
allocator_->AddObserver(
|
allocator_->AddObserver(
|
||||||
observer, {min_bitrate_bps, max_bitrate_bps, pad_up_bitrate_bps,
|
observer, {min_bitrate_bps, max_bitrate_bps, pad_up_bitrate_bps,
|
||||||
enforce_min_bitrate, track_id, bitrate_priority, false});
|
enforce_min_bitrate, track_id, bitrate_priority});
|
||||||
}
|
}
|
||||||
NiceMock<MockLimitObserver> limit_observer_;
|
NiceMock<MockLimitObserver> limit_observer_;
|
||||||
std::unique_ptr<BitrateAllocatorForTest> allocator_;
|
std::unique_ptr<BitrateAllocatorForTest> allocator_;
|
||||||
|
|
11
call/call.cc
11
call/call.cc
|
@ -220,9 +220,7 @@ class Call final : public webrtc::Call,
|
||||||
// Implements BitrateAllocator::LimitObserver.
|
// Implements BitrateAllocator::LimitObserver.
|
||||||
void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps,
|
void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps,
|
||||||
uint32_t max_padding_bitrate_bps,
|
uint32_t max_padding_bitrate_bps,
|
||||||
uint32_t total_bitrate_bps,
|
uint32_t total_bitrate_bps) override;
|
||||||
uint32_t allocated_without_feedback_bps,
|
|
||||||
bool has_packet_feedback) override;
|
|
||||||
|
|
||||||
// This method is invoked when the media transport is created and when the
|
// This method is invoked when the media transport is created and when the
|
||||||
// media transport is being destructed.
|
// media transport is being destructed.
|
||||||
|
@ -1178,14 +1176,9 @@ void Call::OnTargetTransferRate(TargetTransferRate msg) {
|
||||||
|
|
||||||
void Call::OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps,
|
void Call::OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps,
|
||||||
uint32_t max_padding_bitrate_bps,
|
uint32_t max_padding_bitrate_bps,
|
||||||
uint32_t total_bitrate_bps,
|
uint32_t total_bitrate_bps) {
|
||||||
uint32_t allocated_without_feedback_bps,
|
|
||||||
bool has_packet_feedback) {
|
|
||||||
transport_send_ptr_->SetAllocatedSendBitrateLimits(
|
transport_send_ptr_->SetAllocatedSendBitrateLimits(
|
||||||
min_send_bitrate_bps, max_padding_bitrate_bps, total_bitrate_bps);
|
min_send_bitrate_bps, max_padding_bitrate_bps, total_bitrate_bps);
|
||||||
transport_send_ptr_->SetPerPacketFeedbackAvailable(has_packet_feedback);
|
|
||||||
transport_send_ptr_->SetAllocatedBitrateWithoutFeedback(
|
|
||||||
allocated_without_feedback_bps);
|
|
||||||
|
|
||||||
rtc::CritScope lock(&bitrate_crit_);
|
rtc::CritScope lock(&bitrate_crit_);
|
||||||
min_allocated_send_bitrate_bps_ = min_send_bitrate_bps;
|
min_allocated_send_bitrate_bps_ = min_send_bitrate_bps;
|
||||||
|
|
|
@ -78,7 +78,6 @@ RtpTransportControllerSend::RtpTransportControllerSend(
|
||||||
field_trial::IsEnabled("WebRTC-AddPacingToCongestionWindowPushback")),
|
field_trial::IsEnabled("WebRTC-AddPacingToCongestionWindowPushback")),
|
||||||
transport_overhead_bytes_per_packet_(0),
|
transport_overhead_bytes_per_packet_(0),
|
||||||
network_available_(false),
|
network_available_(false),
|
||||||
packet_feedback_available_(false),
|
|
||||||
retransmission_rate_limiter_(clock, kRetransmitWindowSizeMs),
|
retransmission_rate_limiter_(clock, kRetransmitWindowSizeMs),
|
||||||
task_queue_("rtp_send_controller") {
|
task_queue_("rtp_send_controller") {
|
||||||
initial_config_.constraints = ConvertConstraints(bitrate_config, clock_);
|
initial_config_.constraints = ConvertConstraints(bitrate_config, clock_);
|
||||||
|
@ -303,12 +302,6 @@ int64_t RtpTransportControllerSend::GetPacerQueuingDelayMs() const {
|
||||||
int64_t RtpTransportControllerSend::GetFirstPacketTimeMs() const {
|
int64_t RtpTransportControllerSend::GetFirstPacketTimeMs() const {
|
||||||
return pacer_.FirstSentPacketTimeMs();
|
return pacer_.FirstSentPacketTimeMs();
|
||||||
}
|
}
|
||||||
void RtpTransportControllerSend::SetPerPacketFeedbackAvailable(bool available) {
|
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_);
|
|
||||||
packet_feedback_available_ = available;
|
|
||||||
if (!controller_)
|
|
||||||
MaybeCreateControllers();
|
|
||||||
}
|
|
||||||
void RtpTransportControllerSend::EnablePeriodicAlrProbing(bool enable) {
|
void RtpTransportControllerSend::EnablePeriodicAlrProbing(bool enable) {
|
||||||
task_queue_.PostTask([this, enable]() {
|
task_queue_.PostTask([this, enable]() {
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_);
|
RTC_DCHECK_RUN_ON(&task_queue_);
|
||||||
|
@ -373,22 +366,6 @@ void RtpTransportControllerSend::SetClientBitratePreferences(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtpTransportControllerSend::SetAllocatedBitrateWithoutFeedback(
|
|
||||||
uint32_t bitrate_bps) {
|
|
||||||
// Audio transport feedback will not be reported in this mode, instead update
|
|
||||||
// acknowledged bitrate estimator with the bitrate allocated for audio.
|
|
||||||
if (field_trial::IsEnabled("WebRTC-Audio-ABWENoTWCC")) {
|
|
||||||
// TODO(srte): Make sure it's safe to always report this and remove the
|
|
||||||
// field trial check.
|
|
||||||
task_queue_.PostTask([this, bitrate_bps]() {
|
|
||||||
RTC_DCHECK_RUN_ON(&task_queue_);
|
|
||||||
streams_config_.unacknowledged_rate_allocation =
|
|
||||||
DataRate::bps(bitrate_bps);
|
|
||||||
UpdateStreamsConfig();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void RtpTransportControllerSend::OnTransportOverheadChanged(
|
void RtpTransportControllerSend::OnTransportOverheadChanged(
|
||||||
size_t transport_overhead_bytes_per_packet) {
|
size_t transport_overhead_bytes_per_packet) {
|
||||||
if (transport_overhead_bytes_per_packet >= kMaxOverheadBytes) {
|
if (transport_overhead_bytes_per_packet >= kMaxOverheadBytes) {
|
||||||
|
|
|
@ -94,15 +94,12 @@ class RtpTransportControllerSend final
|
||||||
RtcpBandwidthObserver* GetBandwidthObserver() override;
|
RtcpBandwidthObserver* GetBandwidthObserver() override;
|
||||||
int64_t GetPacerQueuingDelayMs() const override;
|
int64_t GetPacerQueuingDelayMs() const override;
|
||||||
int64_t GetFirstPacketTimeMs() const override;
|
int64_t GetFirstPacketTimeMs() const override;
|
||||||
void SetPerPacketFeedbackAvailable(bool available) override;
|
|
||||||
void EnablePeriodicAlrProbing(bool enable) override;
|
void EnablePeriodicAlrProbing(bool enable) override;
|
||||||
void OnSentPacket(const rtc::SentPacket& sent_packet) override;
|
void OnSentPacket(const rtc::SentPacket& sent_packet) override;
|
||||||
|
|
||||||
void SetSdpBitrateParameters(const BitrateConstraints& constraints) override;
|
void SetSdpBitrateParameters(const BitrateConstraints& constraints) override;
|
||||||
void SetClientBitratePreferences(const BitrateSettings& preferences) override;
|
void SetClientBitratePreferences(const BitrateSettings& preferences) override;
|
||||||
|
|
||||||
void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) override;
|
|
||||||
|
|
||||||
void OnTransportOverheadChanged(
|
void OnTransportOverheadChanged(
|
||||||
size_t transport_overhead_per_packet) override;
|
size_t transport_overhead_per_packet) override;
|
||||||
|
|
||||||
|
@ -178,7 +175,6 @@ class RtpTransportControllerSend final
|
||||||
// TODO(srte): Remove atomic when feedback adapter runs on task queue.
|
// TODO(srte): Remove atomic when feedback adapter runs on task queue.
|
||||||
std::atomic<size_t> transport_overhead_bytes_per_packet_;
|
std::atomic<size_t> transport_overhead_bytes_per_packet_;
|
||||||
bool network_available_ RTC_GUARDED_BY(task_queue_);
|
bool network_available_ RTC_GUARDED_BY(task_queue_);
|
||||||
bool packet_feedback_available_ RTC_GUARDED_BY(task_queue_);
|
|
||||||
RepeatingTaskHandle pacer_queue_update_task_ RTC_GUARDED_BY(task_queue_);
|
RepeatingTaskHandle pacer_queue_update_task_ RTC_GUARDED_BY(task_queue_);
|
||||||
RepeatingTaskHandle controller_task_ RTC_GUARDED_BY(task_queue_);
|
RepeatingTaskHandle controller_task_ RTC_GUARDED_BY(task_queue_);
|
||||||
// Protects access to last_packet_feedback_vector_ in feedback adapter.
|
// Protects access to last_packet_feedback_vector_ in feedback adapter.
|
||||||
|
|
|
@ -151,15 +151,12 @@ class RtpTransportControllerSendInterface {
|
||||||
virtual int64_t GetFirstPacketTimeMs() const = 0;
|
virtual int64_t GetFirstPacketTimeMs() const = 0;
|
||||||
virtual void EnablePeriodicAlrProbing(bool enable) = 0;
|
virtual void EnablePeriodicAlrProbing(bool enable) = 0;
|
||||||
virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0;
|
virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0;
|
||||||
virtual void SetPerPacketFeedbackAvailable(bool available) = 0;
|
|
||||||
|
|
||||||
virtual void SetSdpBitrateParameters(
|
virtual void SetSdpBitrateParameters(
|
||||||
const BitrateConstraints& constraints) = 0;
|
const BitrateConstraints& constraints) = 0;
|
||||||
virtual void SetClientBitratePreferences(
|
virtual void SetClientBitratePreferences(
|
||||||
const BitrateSettings& preferences) = 0;
|
const BitrateSettings& preferences) = 0;
|
||||||
|
|
||||||
virtual void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) = 0;
|
|
||||||
|
|
||||||
virtual void OnTransportOverheadChanged(
|
virtual void OnTransportOverheadChanged(
|
||||||
size_t transport_overhead_per_packet) = 0;
|
size_t transport_overhead_per_packet) = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -63,12 +63,10 @@ class MockRtpTransportControllerSend
|
||||||
MOCK_METHOD0(GetBandwidthObserver, RtcpBandwidthObserver*());
|
MOCK_METHOD0(GetBandwidthObserver, RtcpBandwidthObserver*());
|
||||||
MOCK_CONST_METHOD0(GetPacerQueuingDelayMs, int64_t());
|
MOCK_CONST_METHOD0(GetPacerQueuingDelayMs, int64_t());
|
||||||
MOCK_CONST_METHOD0(GetFirstPacketTimeMs, int64_t());
|
MOCK_CONST_METHOD0(GetFirstPacketTimeMs, int64_t());
|
||||||
MOCK_METHOD1(SetPerPacketFeedbackAvailable, void(bool));
|
|
||||||
MOCK_METHOD1(EnablePeriodicAlrProbing, void(bool));
|
MOCK_METHOD1(EnablePeriodicAlrProbing, void(bool));
|
||||||
MOCK_METHOD1(OnSentPacket, void(const rtc::SentPacket&));
|
MOCK_METHOD1(OnSentPacket, void(const rtc::SentPacket&));
|
||||||
MOCK_METHOD1(SetSdpBitrateParameters, void(const BitrateConstraints&));
|
MOCK_METHOD1(SetSdpBitrateParameters, void(const BitrateConstraints&));
|
||||||
MOCK_METHOD1(SetClientBitratePreferences, void(const BitrateSettings&));
|
MOCK_METHOD1(SetClientBitratePreferences, void(const BitrateSettings&));
|
||||||
MOCK_METHOD1(SetAllocatedBitrateWithoutFeedback, void(uint32_t));
|
|
||||||
MOCK_METHOD1(OnTransportOverheadChanged, void(size_t));
|
MOCK_METHOD1(OnTransportOverheadChanged, void(size_t));
|
||||||
};
|
};
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
|
@ -323,8 +323,6 @@ NetworkControlUpdate BbrNetworkController::OnProcessInterval(
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkControlUpdate BbrNetworkController::OnStreamsConfig(StreamsConfig msg) {
|
NetworkControlUpdate BbrNetworkController::OnStreamsConfig(StreamsConfig msg) {
|
||||||
// TODO(srte): Handle unacknowledged rate allocation.
|
|
||||||
RTC_DCHECK(msg.unacknowledged_rate_allocation.IsZero());
|
|
||||||
return NetworkControlUpdate();
|
return NetworkControlUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,10 +38,7 @@ AcknowledgedBitrateEstimator::~AcknowledgedBitrateEstimator() {}
|
||||||
AcknowledgedBitrateEstimator::AcknowledgedBitrateEstimator(
|
AcknowledgedBitrateEstimator::AcknowledgedBitrateEstimator(
|
||||||
const WebRtcKeyValueConfig* key_value_config,
|
const WebRtcKeyValueConfig* key_value_config,
|
||||||
std::unique_ptr<BitrateEstimator> bitrate_estimator)
|
std::unique_ptr<BitrateEstimator> bitrate_estimator)
|
||||||
: account_for_unacknowledged_traffic_(
|
: bitrate_estimator_(std::move(bitrate_estimator)) {}
|
||||||
key_value_config->Lookup("WebRTC-Bwe-AccountForUnacked")
|
|
||||||
.find("Enabled") == 0),
|
|
||||||
bitrate_estimator_(std::move(bitrate_estimator)) {}
|
|
||||||
|
|
||||||
void AcknowledgedBitrateEstimator::IncomingPacketFeedbackVector(
|
void AcknowledgedBitrateEstimator::IncomingPacketFeedbackVector(
|
||||||
const std::vector<PacketFeedback>& packet_feedback_vector) {
|
const std::vector<PacketFeedback>& packet_feedback_vector) {
|
||||||
|
@ -52,24 +49,14 @@ void AcknowledgedBitrateEstimator::IncomingPacketFeedbackVector(
|
||||||
if (IsInSendTimeHistory(packet)) {
|
if (IsInSendTimeHistory(packet)) {
|
||||||
MaybeExpectFastRateChange(packet.send_time_ms);
|
MaybeExpectFastRateChange(packet.send_time_ms);
|
||||||
int acknowledged_estimate = rtc::dchecked_cast<int>(packet.payload_size);
|
int acknowledged_estimate = rtc::dchecked_cast<int>(packet.payload_size);
|
||||||
if (account_for_unacknowledged_traffic_)
|
acknowledged_estimate += packet.unacknowledged_data;
|
||||||
acknowledged_estimate += packet.unacknowledged_data;
|
|
||||||
bitrate_estimator_->Update(packet.arrival_time_ms, acknowledged_estimate);
|
bitrate_estimator_->Update(packet.arrival_time_ms, acknowledged_estimate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
absl::optional<uint32_t> AcknowledgedBitrateEstimator::bitrate_bps() const {
|
absl::optional<uint32_t> AcknowledgedBitrateEstimator::bitrate_bps() const {
|
||||||
auto estimated_bitrate = bitrate_estimator_->bitrate_bps();
|
return bitrate_estimator_->bitrate_bps();
|
||||||
// If we account for unacknowledged traffic, we should not add the allocated
|
|
||||||
// bitrate for unallocated stream as we expect it to be included already.
|
|
||||||
if (account_for_unacknowledged_traffic_) {
|
|
||||||
return estimated_bitrate;
|
|
||||||
} else {
|
|
||||||
return estimated_bitrate
|
|
||||||
? *estimated_bitrate + allocated_bitrate_without_feedback_bps_
|
|
||||||
: estimated_bitrate;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
absl::optional<uint32_t> AcknowledgedBitrateEstimator::PeekBps() const {
|
absl::optional<uint32_t> AcknowledgedBitrateEstimator::PeekBps() const {
|
||||||
|
@ -93,11 +80,6 @@ void AcknowledgedBitrateEstimator::SetAlrEndedTimeMs(
|
||||||
alr_ended_time_ms_.emplace(alr_ended_time_ms);
|
alr_ended_time_ms_.emplace(alr_ended_time_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AcknowledgedBitrateEstimator::SetAllocatedBitrateWithoutFeedback(
|
|
||||||
uint32_t bitrate_bps) {
|
|
||||||
allocated_bitrate_without_feedback_bps_ = bitrate_bps;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AcknowledgedBitrateEstimator::MaybeExpectFastRateChange(
|
void AcknowledgedBitrateEstimator::MaybeExpectFastRateChange(
|
||||||
int64_t packet_send_time_ms) {
|
int64_t packet_send_time_ms) {
|
||||||
if (alr_ended_time_ms_ && packet_send_time_ms > *alr_ended_time_ms_) {
|
if (alr_ended_time_ms_ && packet_send_time_ms > *alr_ended_time_ms_) {
|
||||||
|
|
|
@ -40,14 +40,11 @@ class AcknowledgedBitrateEstimator {
|
||||||
absl::optional<DataRate> bitrate() const;
|
absl::optional<DataRate> bitrate() const;
|
||||||
absl::optional<DataRate> PeekRate() const;
|
absl::optional<DataRate> PeekRate() const;
|
||||||
void SetAlrEndedTimeMs(int64_t alr_ended_time_ms);
|
void SetAlrEndedTimeMs(int64_t alr_ended_time_ms);
|
||||||
void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void MaybeExpectFastRateChange(int64_t packet_arrival_time_ms);
|
void MaybeExpectFastRateChange(int64_t packet_arrival_time_ms);
|
||||||
const bool account_for_unacknowledged_traffic_;
|
|
||||||
absl::optional<int64_t> alr_ended_time_ms_;
|
absl::optional<int64_t> alr_ended_time_ms_;
|
||||||
std::unique_ptr<BitrateEstimator> bitrate_estimator_;
|
std::unique_ptr<BitrateEstimator> bitrate_estimator_;
|
||||||
uint32_t allocated_bitrate_without_feedback_bps_ = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
|
@ -333,8 +333,6 @@ NetworkControlUpdate GoogCcNetworkController::OnStreamsConfig(
|
||||||
max_padding_rate_ = *msg.max_padding_rate;
|
max_padding_rate_ = *msg.max_padding_rate;
|
||||||
pacing_changed = true;
|
pacing_changed = true;
|
||||||
}
|
}
|
||||||
acknowledged_bitrate_estimator_->SetAllocatedBitrateWithoutFeedback(
|
|
||||||
msg.unacknowledged_rate_allocation.bps());
|
|
||||||
|
|
||||||
if (pacing_changed)
|
if (pacing_changed)
|
||||||
update.pacer_config = GetPacingRates(msg.at_time);
|
update.pacer_config = GetPacingRates(msg.at_time);
|
||||||
|
|
|
@ -373,8 +373,6 @@ NetworkControlUpdate PccNetworkController::OnTransportLossReport(
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkControlUpdate PccNetworkController::OnStreamsConfig(StreamsConfig msg) {
|
NetworkControlUpdate PccNetworkController::OnStreamsConfig(StreamsConfig msg) {
|
||||||
// TODO(srte): Handle unacknowledged rate allocation.
|
|
||||||
RTC_DCHECK(msg.unacknowledged_rate_allocation.IsZero());
|
|
||||||
return NetworkControlUpdate();
|
return NetworkControlUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -475,8 +475,6 @@ void DEPRECATED_SendSideCongestionController::SetPacingFactor(
|
||||||
|
|
||||||
void DEPRECATED_SendSideCongestionController::
|
void DEPRECATED_SendSideCongestionController::
|
||||||
SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) {
|
SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) {
|
||||||
acknowledged_bitrate_estimator_->SetAllocatedBitrateWithoutFeedback(
|
|
||||||
bitrate_bps);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DEPRECATED_SendSideCongestionController::MaybeTriggerOnNetworkChanged() {
|
void DEPRECATED_SendSideCongestionController::MaybeTriggerOnNetworkChanged() {
|
||||||
|
|
|
@ -375,7 +375,7 @@ void VideoSendStreamImpl::StartupVideoSendStream() {
|
||||||
static_cast<uint32_t>(encoder_min_bitrate_bps_),
|
static_cast<uint32_t>(encoder_min_bitrate_bps_),
|
||||||
encoder_max_bitrate_bps_, static_cast<uint32_t>(max_padding_bitrate_),
|
encoder_max_bitrate_bps_, static_cast<uint32_t>(max_padding_bitrate_),
|
||||||
!config_->suspend_below_min_bitrate, config_->track_id,
|
!config_->suspend_below_min_bitrate, config_->track_id,
|
||||||
encoder_bitrate_priority_, has_packet_feedback_});
|
encoder_bitrate_priority_});
|
||||||
// Start monitoring encoder activity.
|
// Start monitoring encoder activity.
|
||||||
{
|
{
|
||||||
RTC_DCHECK(!check_encoder_activity_task_.Running());
|
RTC_DCHECK(!check_encoder_activity_task_.Running());
|
||||||
|
@ -488,7 +488,7 @@ void VideoSendStreamImpl::SignalEncoderActive() {
|
||||||
static_cast<uint32_t>(encoder_min_bitrate_bps_),
|
static_cast<uint32_t>(encoder_min_bitrate_bps_),
|
||||||
encoder_max_bitrate_bps_, static_cast<uint32_t>(max_padding_bitrate_),
|
encoder_max_bitrate_bps_, static_cast<uint32_t>(max_padding_bitrate_),
|
||||||
!config_->suspend_below_min_bitrate, config_->track_id,
|
!config_->suspend_below_min_bitrate, config_->track_id,
|
||||||
encoder_bitrate_priority_, has_packet_feedback_});
|
encoder_bitrate_priority_});
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoSendStreamImpl::OnEncoderConfigurationChanged(
|
void VideoSendStreamImpl::OnEncoderConfigurationChanged(
|
||||||
|
@ -557,7 +557,7 @@ void VideoSendStreamImpl::OnEncoderConfigurationChanged(
|
||||||
encoder_max_bitrate_bps_,
|
encoder_max_bitrate_bps_,
|
||||||
static_cast<uint32_t>(max_padding_bitrate_),
|
static_cast<uint32_t>(max_padding_bitrate_),
|
||||||
!config_->suspend_below_min_bitrate, config_->track_id,
|
!config_->suspend_below_min_bitrate, config_->track_id,
|
||||||
encoder_bitrate_priority_, has_packet_feedback_});
|
encoder_bitrate_priority_});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,6 @@ TEST_F(VideoSendStreamImplTest, RegistersAsBitrateObserverOnStart) {
|
||||||
EXPECT_EQ(config.enforce_min_bitrate, !kSuspend);
|
EXPECT_EQ(config.enforce_min_bitrate, !kSuspend);
|
||||||
EXPECT_EQ(config.track_id, "test");
|
EXPECT_EQ(config.track_id, "test");
|
||||||
EXPECT_EQ(config.bitrate_priority, kDefaultBitratePriority);
|
EXPECT_EQ(config.bitrate_priority, kDefaultBitratePriority);
|
||||||
EXPECT_EQ(config.has_packet_feedback, false);
|
|
||||||
}));
|
}));
|
||||||
vss_impl->Start();
|
vss_impl->Start();
|
||||||
EXPECT_CALL(bitrate_allocator_, RemoveObserver(vss_impl.get())).Times(1);
|
EXPECT_CALL(bitrate_allocator_, RemoveObserver(vss_impl.get())).Times(1);
|
||||||
|
@ -224,7 +223,6 @@ TEST_F(VideoSendStreamImplTest, UpdatesObserverOnConfigurationChange) {
|
||||||
static_cast<uint32_t>(qvga_stream.target_bitrate_bps +
|
static_cast<uint32_t>(qvga_stream.target_bitrate_bps +
|
||||||
vga_stream.min_bitrate_bps));
|
vga_stream.min_bitrate_bps));
|
||||||
EXPECT_EQ(config.enforce_min_bitrate, !kSuspend);
|
EXPECT_EQ(config.enforce_min_bitrate, !kSuspend);
|
||||||
EXPECT_EQ(config.has_packet_feedback, true);
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
static_cast<VideoStreamEncoderInterface::EncoderSink*>(vss_impl.get())
|
static_cast<VideoStreamEncoderInterface::EncoderSink*>(vss_impl.get())
|
||||||
|
@ -289,7 +287,6 @@ TEST_F(VideoSendStreamImplTest, UpdatesObserverOnConfigurationChangeWithAlr) {
|
||||||
EXPECT_EQ(config.pad_up_bitrate_bps,
|
EXPECT_EQ(config.pad_up_bitrate_bps,
|
||||||
static_cast<uint32_t>(min_transmit_bitrate_bps));
|
static_cast<uint32_t>(min_transmit_bitrate_bps));
|
||||||
EXPECT_EQ(config.enforce_min_bitrate, !kSuspend);
|
EXPECT_EQ(config.enforce_min_bitrate, !kSuspend);
|
||||||
EXPECT_EQ(config.has_packet_feedback, true);
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
static_cast<VideoStreamEncoderInterface::EncoderSink*>(vss_impl.get())
|
static_cast<VideoStreamEncoderInterface::EncoderSink*>(vss_impl.get())
|
||||||
|
@ -300,26 +297,6 @@ TEST_F(VideoSendStreamImplTest, UpdatesObserverOnConfigurationChangeWithAlr) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(VideoSendStreamImplTest, ReportFeedbackAvailability) {
|
|
||||||
test_queue_.SendTask([this] {
|
|
||||||
config_.rtp.extensions.emplace_back(
|
|
||||||
RtpExtension::kTransportSequenceNumberUri,
|
|
||||||
RtpExtension::kTransportSequenceNumberDefaultId);
|
|
||||||
|
|
||||||
auto vss_impl = CreateVideoSendStreamImpl(
|
|
||||||
kDefaultInitialBitrateBps, kDefaultBitratePriority,
|
|
||||||
VideoEncoderConfig::ContentType::kRealtimeVideo);
|
|
||||||
EXPECT_CALL(bitrate_allocator_, AddObserver(vss_impl.get(), _))
|
|
||||||
.WillOnce(Invoke(
|
|
||||||
[&](BitrateAllocatorObserver*, MediaStreamAllocationConfig config) {
|
|
||||||
EXPECT_EQ(config.has_packet_feedback, true);
|
|
||||||
}));
|
|
||||||
vss_impl->Start();
|
|
||||||
EXPECT_CALL(bitrate_allocator_, RemoveObserver(vss_impl.get())).Times(1);
|
|
||||||
vss_impl->Stop();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(VideoSendStreamImplTest, SetsScreensharePacingFactorWithFeedback) {
|
TEST_F(VideoSendStreamImplTest, SetsScreensharePacingFactorWithFeedback) {
|
||||||
test::ScopedFieldTrials alr_experiment(GetAlrProbingExperimentString());
|
test::ScopedFieldTrials alr_experiment(GetAlrProbingExperimentString());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue