Enable experiments with audio bitrate priority.
This CL makes it possible to configure the priority of audio streams in bitrate allocations using field trials. It also adds the option to forcibly ignore any injected audio allocation strategy, so that experimentation with allocation won't be blocked on the work to remove the strategy injection. Bug: webrtc:10603 Change-Id: Ic36ceee6c15eb0fad275866f77e2a121066e516c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135467 Reviewed-by: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27881}
This commit is contained in:
@ -804,7 +804,9 @@ void AudioSendStream::ConfigureBitrateObserver() {
|
||||
MediaStreamAllocationConfig{
|
||||
constraints.min.bps<uint32_t>(), constraints.max.bps<uint32_t>(), 0,
|
||||
allocation_settings_.DefaultPriorityBitrate().bps(), true,
|
||||
config_.track_id, config_.bitrate_priority});
|
||||
config_.track_id,
|
||||
allocation_settings_.BitratePriority().value_or(
|
||||
config_.bitrate_priority)});
|
||||
}
|
||||
|
||||
void AudioSendStream::RemoveBitrateObserver() {
|
||||
|
@ -67,7 +67,9 @@ BitrateAllocator::BitrateAllocator(Clock* clock, LimitObserver* limit_observer)
|
||||
total_requested_max_bitrate_(0),
|
||||
bitrate_allocation_strategy_(nullptr),
|
||||
transmission_max_bitrate_multiplier_(
|
||||
GetTransmissionMaxBitrateMultiplier()) {
|
||||
GetTransmissionMaxBitrateMultiplier()),
|
||||
ignore_injected_strategy_(
|
||||
field_trial::IsEnabled("WebRTC-IgnoreInjectedAllocationStrategy")) {
|
||||
sequenced_checker_.Detach();
|
||||
}
|
||||
|
||||
@ -315,7 +317,7 @@ BitrateAllocator::ObserverAllocation BitrateAllocator::AllocateBitrates(
|
||||
if (bitrate_observer_configs_.empty())
|
||||
return ObserverAllocation();
|
||||
|
||||
if (bitrate_allocation_strategy_ != nullptr) {
|
||||
if (!ignore_injected_strategy_ && bitrate_allocation_strategy_ != nullptr) {
|
||||
// Note: This intentionally causes slicing, we only copy the fields in
|
||||
// ObserverConfig that are inherited from TrackConfig.
|
||||
std::vector<rtc::BitrateAllocationStrategy::TrackConfig> track_configs(
|
||||
|
@ -246,6 +246,7 @@ class BitrateAllocator : public BitrateAllocatorInterface {
|
||||
std::unique_ptr<rtc::BitrateAllocationStrategy> bitrate_allocation_strategy_
|
||||
RTC_GUARDED_BY(&sequenced_checker_);
|
||||
const uint8_t transmission_max_bitrate_multiplier_;
|
||||
const bool ignore_injected_strategy_;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -8,6 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
#include "rtc_base/experiments/audio_allocation_settings.h"
|
||||
|
||||
#include "system_wrappers/include/field_trial.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -22,7 +23,8 @@ AudioAllocationSettings::AudioAllocationSettings()
|
||||
send_side_bwe_with_overhead_("Enabled"),
|
||||
min_bitrate_("min"),
|
||||
max_bitrate_("max"),
|
||||
priority_bitrate_("prio", DataRate::Zero()) {
|
||||
priority_bitrate_("prio_rate", DataRate::Zero()),
|
||||
bitrate_priority_("rate_prio") {
|
||||
ParseFieldTrial({&audio_send_side_bwe_},
|
||||
field_trial::FindFullName("WebRTC-Audio-SendSideBwe"));
|
||||
ParseFieldTrial({&allocate_audio_without_feedback_},
|
||||
@ -32,8 +34,9 @@ AudioAllocationSettings::AudioAllocationSettings()
|
||||
|
||||
ParseFieldTrial({&send_side_bwe_with_overhead_},
|
||||
field_trial::FindFullName("WebRTC-SendSideBwe-WithOverhead"));
|
||||
ParseFieldTrial({&min_bitrate_, &max_bitrate_, &priority_bitrate_},
|
||||
field_trial::FindFullName("WebRTC-Audio-Allocation"));
|
||||
ParseFieldTrial(
|
||||
{&min_bitrate_, &max_bitrate_, &priority_bitrate_, &bitrate_priority_},
|
||||
field_trial::FindFullName("WebRTC-Audio-Allocation"));
|
||||
|
||||
// TODO(mflodman): Keep testing this and set proper values.
|
||||
// Note: This is an early experiment currently only supported by Opus.
|
||||
@ -114,5 +117,8 @@ DataRate AudioAllocationSettings::DefaultPriorityBitrate() const {
|
||||
}
|
||||
return priority_bitrate_.Get() + max_overhead;
|
||||
}
|
||||
absl::optional<double> AudioAllocationSettings::BitratePriority() const {
|
||||
return bitrate_priority_.GetOptional();
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -72,6 +72,10 @@ class AudioAllocationSettings {
|
||||
// divide bitrate evently between audio and video above this bitrate.
|
||||
DataRate DefaultPriorityBitrate() const;
|
||||
|
||||
// The bitrate priority is used to determine how much of the available bitrate
|
||||
// beyond the min or priority bitrate audio streams should receive.
|
||||
absl::optional<double> BitratePriority() const;
|
||||
|
||||
private:
|
||||
FieldTrialFlag audio_send_side_bwe_;
|
||||
FieldTrialFlag allocate_audio_without_feedback_;
|
||||
@ -83,6 +87,7 @@ class AudioAllocationSettings {
|
||||
FieldTrialOptional<DataRate> min_bitrate_;
|
||||
FieldTrialOptional<DataRate> max_bitrate_;
|
||||
FieldTrialParameter<DataRate> priority_bitrate_;
|
||||
FieldTrialOptional<double> bitrate_priority_;
|
||||
};
|
||||
} // namespace webrtc
|
||||
|
||||
|
Reference in New Issue
Block a user