Adds audio DTX and mute support to scenario tests.

Bug: webrtc:9510
Change-Id: I50a12c319141dd505309830afdc169c6811c5eca
Reviewed-on: https://webrtc-review.googlesource.com/c/117920
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26288}
This commit is contained in:
Sebastian Jansson
2019-01-16 17:21:28 +01:00
committed by Commit Bot
parent 62f55321cf
commit ad8719442b
3 changed files with 8 additions and 0 deletions

View File

@ -79,6 +79,8 @@ SendAudioStream::SendAudioStream(
if (config.encoder.initial_frame_length != TimeDelta::ms(20))
sdp_params["ptime"] =
std::to_string(config.encoder.initial_frame_length.ms());
if (config.encoder.enable_dtx)
sdp_params["usedtx"] = "1";
// SdpAudioFormat::num_channels indicates that the encoder is capable of
// stereo, but the actual channel count used is based on the "stereo"
@ -156,6 +158,10 @@ void SendAudioStream::Start() {
sender_->call_->SignalChannelNetworkState(MediaType::AUDIO, kNetworkUp);
}
void SendAudioStream::SetMuted(bool mute) {
send_stream_->SetMuted(mute);
}
ColumnPrinter SendAudioStream::StatsPrinter() {
return ColumnPrinter::Lambda(
"audio_target_rate",

View File

@ -29,6 +29,7 @@ class SendAudioStream {
RTC_DISALLOW_COPY_AND_ASSIGN(SendAudioStream);
~SendAudioStream();
void Start();
void SetMuted(bool mute);
ColumnPrinter StatsPrinter();
private:

View File

@ -169,6 +169,7 @@ struct AudioStreamConfig {
Encoder(const Encoder&);
~Encoder();
bool allocate_bitrate = false;
bool enable_dtx = false;
absl::optional<DataRate> fixed_rate;
absl::optional<DataRate> min_rate;
absl::optional<DataRate> max_rate;