Move more calls to webrtc::field_trial::FindFullName into ctor, thereby minimizing the non-trivial cost of repeated string comparisons.
BUG=webrtc:7059 Review-Url: https://codereview.webrtc.org/2657863002 Cr-Commit-Position: refs/heads/master@{#16378}
This commit is contained in:
@ -174,7 +174,9 @@ AudioEncoderOpus::AudioEncoderOpus(
|
||||
const Config& config,
|
||||
AudioNetworkAdaptorCreator&& audio_network_adaptor_creator,
|
||||
std::unique_ptr<SmoothingFilter> bitrate_smoother)
|
||||
: packet_loss_rate_(0.0),
|
||||
: send_side_bwe_with_overhead_(webrtc::field_trial::FindFullName(
|
||||
"WebRTC-SendSideBwe-WithOverhead") == "Enabled"),
|
||||
packet_loss_rate_(0.0),
|
||||
inst_(nullptr),
|
||||
packet_loss_fraction_smoother_(new PacketLossFractionSmoother(
|
||||
config.clock)),
|
||||
@ -314,8 +316,7 @@ void AudioEncoderOpus::OnReceivedUplinkBandwidth(
|
||||
bitrate_smoother_->AddSample(target_audio_bitrate_bps);
|
||||
|
||||
ApplyAudioNetworkAdaptor();
|
||||
} else if (webrtc::field_trial::FindFullName(
|
||||
"WebRTC-SendSideBwe-WithOverhead") == "Enabled") {
|
||||
} else if (send_side_bwe_with_overhead_) {
|
||||
if (!overhead_bytes_per_packet_) {
|
||||
LOG(LS_INFO)
|
||||
<< "AudioEncoderOpus: Overhead unknown, target audio bitrate "
|
||||
|
||||
@ -161,6 +161,7 @@ class AudioEncoderOpus final : public AudioEncoder {
|
||||
void MaybeUpdateUplinkBandwidth();
|
||||
|
||||
Config config_;
|
||||
const bool send_side_bwe_with_overhead_;
|
||||
float packet_loss_rate_;
|
||||
std::vector<int16_t> input_buffer_;
|
||||
OpusEncInst* inst_;
|
||||
|
||||
Reference in New Issue
Block a user