diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc index d2e26cdc95..9fdf5f6295 100644 --- a/audio/audio_send_stream.cc +++ b/audio/audio_send_stream.cc @@ -294,7 +294,8 @@ void AudioSendStream::Start() { !webrtc::field_trial::IsEnabled("WebRTC-Audio-ForceNoTWCC"); if (config_.min_bitrate_bps != -1 && config_.max_bitrate_bps != -1 && (has_transport_sequence_number || - !webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe"))) { + !webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe") || + webrtc::field_trial::IsEnabled("WebRTC-Audio-ABWENoTWCC"))) { // Audio BWE is enabled. transport_->packet_sender()->SetAccountForAudioPackets(true); ConfigureBitrateObserver(config_.min_bitrate_bps, config_.max_bitrate_bps, @@ -409,6 +410,12 @@ uint32_t AudioSendStream::OnBitrateUpdated(uint32_t bitrate_bps, uint8_t fraction_loss, int64_t rtt, int64_t bwe_period_ms) { + // Audio transport feedback will not be reported in this mode, instead update + // acknowledged bitrate estimator with the bitrate allocated for audio. + if (webrtc::field_trial::IsEnabled("WebRTC-Audio-ABWENoTWCC")) { + transport_->SetAllocatedBitrateWithoutFeedback(bitrate_bps); + } + // A send stream may be allocated a bitrate of zero if the allocator decides // to disable it. For now we ignore this decision and keep sending on min // bitrate. diff --git a/call/rtp_transport_controller_send.cc b/call/rtp_transport_controller_send.cc index a0e47b5dc1..92215d1f98 100644 --- a/call/rtp_transport_controller_send.cc +++ b/call/rtp_transport_controller_send.cc @@ -264,4 +264,9 @@ void RtpTransportControllerSend::SetClientBitratePreferences( << "nothing to update"; } } + +void RtpTransportControllerSend::SetAllocatedBitrateWithoutFeedback( + uint32_t bitrate_bps) { + send_side_cc_->SetAllocatedBitrateWithoutFeedback(bitrate_bps); +} } // namespace webrtc diff --git a/call/rtp_transport_controller_send.h b/call/rtp_transport_controller_send.h index 0027696f20..d9a4e18369 100644 --- a/call/rtp_transport_controller_send.h +++ b/call/rtp_transport_controller_send.h @@ -85,6 +85,8 @@ class RtpTransportControllerSend final void SetSdpBitrateParameters(const BitrateConstraints& constraints) override; void SetClientBitratePreferences(const BitrateSettings& preferences) override; + void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) override; + private: const Clock* const clock_; PacketRouter packet_router_; diff --git a/call/rtp_transport_controller_send_interface.h b/call/rtp_transport_controller_send_interface.h index 65b9d7d840..c3a56ad4ce 100644 --- a/call/rtp_transport_controller_send_interface.h +++ b/call/rtp_transport_controller_send_interface.h @@ -110,6 +110,8 @@ class RtpTransportControllerSendInterface { const BitrateConstraints& constraints) = 0; virtual void SetClientBitratePreferences( const BitrateSettings& preferences) = 0; + + virtual void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) = 0; }; } // namespace webrtc diff --git a/call/test/mock_rtp_transport_controller_send.h b/call/test/mock_rtp_transport_controller_send.h index e7c27d6f43..419ad77103 100644 --- a/call/test/mock_rtp_transport_controller_send.h +++ b/call/test/mock_rtp_transport_controller_send.h @@ -51,6 +51,7 @@ class MockRtpTransportControllerSend MOCK_METHOD1(OnSentPacket, void(const rtc::SentPacket&)); MOCK_METHOD1(SetSdpBitrateParameters, void(const BitrateConstraints&)); MOCK_METHOD1(SetClientBitratePreferences, void(const BitrateSettings&)); + MOCK_METHOD1(SetAllocatedBitrateWithoutFeedback, void(uint32_t)); }; } // namespace webrtc #endif // CALL_TEST_MOCK_RTP_TRANSPORT_CONTROLLER_SEND_H_ diff --git a/media/engine/webrtcvoiceengine.cc b/media/engine/webrtcvoiceengine.cc index 8367f028cd..aca853f805 100644 --- a/media/engine/webrtcvoiceengine.cc +++ b/media/engine/webrtcvoiceengine.cc @@ -596,7 +596,8 @@ RtpCapabilities WebRtcVoiceEngine::GetCapabilities() const { capabilities.header_extensions.push_back( webrtc::RtpExtension(webrtc::RtpExtension::kAudioLevelUri, webrtc::RtpExtension::kAudioLevelDefaultId)); - if (webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe")) { + if (webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe") && + !webrtc::field_trial::IsEnabled("WebRTC-Audio-ABWENoTWCC")) { capabilities.header_extensions.push_back(webrtc::RtpExtension( webrtc::RtpExtension::kTransportSequenceNumberUri, webrtc::RtpExtension::kTransportSequenceNumberDefaultId)); diff --git a/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.cc b/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.cc index c5d42890c6..70318c4418 100644 --- a/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.cc +++ b/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.cc @@ -48,7 +48,11 @@ void AcknowledgedBitrateEstimator::IncomingPacketFeedbackVector( } absl::optional AcknowledgedBitrateEstimator::bitrate_bps() const { - return bitrate_estimator_->bitrate_bps(); + auto estimated_bitrate = bitrate_estimator_->bitrate_bps(); + return estimated_bitrate + ? *estimated_bitrate + + allocated_bitrate_without_feedback_bps_.value_or(0) + : estimated_bitrate; } void AcknowledgedBitrateEstimator::SetAlrEndedTimeMs( @@ -56,6 +60,11 @@ void AcknowledgedBitrateEstimator::SetAlrEndedTimeMs( alr_ended_time_ms_.emplace(alr_ended_time_ms); } +void AcknowledgedBitrateEstimator::SetAllocatedBitrateWithoutFeedback( + uint32_t bitrate_bps) { + allocated_bitrate_without_feedback_bps_.emplace(bitrate_bps); +} + void AcknowledgedBitrateEstimator::MaybeExpectFastRateChange( int64_t packet_send_time_ms) { if (alr_ended_time_ms_ && packet_send_time_ms > *alr_ended_time_ms_) { diff --git a/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.h b/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.h index faa6b4840f..ccb9718b25 100644 --- a/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.h +++ b/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.h @@ -33,11 +33,13 @@ class AcknowledgedBitrateEstimator { const std::vector& packet_feedback_vector); absl::optional bitrate_bps() const; void SetAlrEndedTimeMs(int64_t alr_ended_time_ms); + void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps); private: void MaybeExpectFastRateChange(int64_t packet_arrival_time_ms); absl::optional alr_ended_time_ms_; std::unique_ptr bitrate_estimator_; + absl::optional allocated_bitrate_without_feedback_bps_; }; } // namespace webrtc diff --git a/modules/congestion_controller/include/send_side_congestion_controller.h b/modules/congestion_controller/include/send_side_congestion_controller.h index e19a5c579e..53ad7bdd23 100644 --- a/modules/congestion_controller/include/send_side_congestion_controller.h +++ b/modules/congestion_controller/include/send_side_congestion_controller.h @@ -120,6 +120,8 @@ class SendSideCongestionController void SetPacingFactor(float pacing_factor) override; + void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) override; + private: void MaybeTriggerOnNetworkChanged(); diff --git a/modules/congestion_controller/include/send_side_congestion_controller_interface.h b/modules/congestion_controller/include/send_side_congestion_controller_interface.h index 0f00255bda..91866fc648 100644 --- a/modules/congestion_controller/include/send_side_congestion_controller_interface.h +++ b/modules/congestion_controller/include/send_side_congestion_controller_interface.h @@ -64,6 +64,7 @@ class SendSideCongestionControllerInterface : public CallStatsObserver, virtual void EnablePeriodicAlrProbing(bool enable) = 0; virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; virtual void SetPacingFactor(float pacing_factor) = 0; + virtual void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) = 0; RTC_DISALLOW_COPY_AND_ASSIGN(SendSideCongestionControllerInterface); }; diff --git a/modules/congestion_controller/rtp/include/send_side_congestion_controller.h b/modules/congestion_controller/rtp/include/send_side_congestion_controller.h index 7d41e27a30..9ab19ae447 100644 --- a/modules/congestion_controller/rtp/include/send_side_congestion_controller.h +++ b/modules/congestion_controller/rtp/include/send_side_congestion_controller.h @@ -139,6 +139,8 @@ class SendSideCongestionController void SetPacingFactor(float pacing_factor) override; + void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) override; + protected: // TODO(srte): The tests should be rewritten to not depend on internals and // these functions should be removed. diff --git a/modules/congestion_controller/rtp/send_side_congestion_controller.cc b/modules/congestion_controller/rtp/send_side_congestion_controller.cc index 6e0af24ff0..78a9b940c5 100644 --- a/modules/congestion_controller/rtp/send_side_congestion_controller.cc +++ b/modules/congestion_controller/rtp/send_side_congestion_controller.cc @@ -773,6 +773,9 @@ void SendSideCongestionController::SetPacingFactor(float pacing_factor) { }); } +void SendSideCongestionController::SetAllocatedBitrateWithoutFeedback( + uint32_t bitrate_bps) {} + void SendSideCongestionController::DisablePeriodicTasks() { task_queue_->PostTask([this]() { RTC_DCHECK_RUN_ON(task_queue_); diff --git a/modules/congestion_controller/send_side_congestion_controller.cc b/modules/congestion_controller/send_side_congestion_controller.cc index 480b7418c0..3065c8b25b 100644 --- a/modules/congestion_controller/send_side_congestion_controller.cc +++ b/modules/congestion_controller/send_side_congestion_controller.cc @@ -415,6 +415,12 @@ void SendSideCongestionController::SetPacingFactor(float pacing_factor) { pacer_->SetPacingFactor(pacing_factor); } +void SendSideCongestionController::SetAllocatedBitrateWithoutFeedback( + uint32_t bitrate_bps) { + acknowledged_bitrate_estimator_->SetAllocatedBitrateWithoutFeedback( + bitrate_bps); +} + void SendSideCongestionController::MaybeTriggerOnNetworkChanged() { uint32_t bitrate_bps; uint8_t fraction_loss;