Allows audio bitrate allocation in video calls without enabling TWCC (Transport Wide Congestion Control as defined at https://tools.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01.html) for audio stream.
This will allow experimenting with audio bitrate allocation in video calls without increasing transport overhead. Bug: webrtc:8243 Change-Id: If961780921d53bdce95b68c26641df6875509c1f Reviewed-on: https://webrtc-review.googlesource.com/84501 Commit-Queue: Alex Narest <alexnarest@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23755}
This commit is contained in:
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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_;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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_
|
||||
|
||||
@ -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));
|
||||
|
||||
@ -48,7 +48,11 @@ void AcknowledgedBitrateEstimator::IncomingPacketFeedbackVector(
|
||||
}
|
||||
|
||||
absl::optional<uint32_t> 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_) {
|
||||
|
||||
@ -33,11 +33,13 @@ class AcknowledgedBitrateEstimator {
|
||||
const std::vector<PacketFeedback>& packet_feedback_vector);
|
||||
absl::optional<uint32_t> 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<int64_t> alr_ended_time_ms_;
|
||||
std::unique_ptr<BitrateEstimator> bitrate_estimator_;
|
||||
absl::optional<uint32_t> allocated_bitrate_without_feedback_bps_;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -120,6 +120,8 @@ class SendSideCongestionController
|
||||
|
||||
void SetPacingFactor(float pacing_factor) override;
|
||||
|
||||
void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) override;
|
||||
|
||||
private:
|
||||
void MaybeTriggerOnNetworkChanged();
|
||||
|
||||
|
||||
@ -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);
|
||||
};
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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_);
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user