Simplifies audio priority rate config in scenario tests.
Bug: webrtc:9510 Change-Id: Iecd2caa8d4353c64ec351969f999c8ed59c3a07d Reviewed-on: https://webrtc-review.googlesource.com/c/110614 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25606}
This commit is contained in:

committed by
Commit Bot

parent
aee8380894
commit
2b101d2c9e
@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "test/scenario/audio_stream.h"
|
#include "test/scenario/audio_stream.h"
|
||||||
|
|
||||||
|
#include "rtc_base/bitrateallocationstrategy.h"
|
||||||
#include "test/call_test.h"
|
#include "test/call_test.h"
|
||||||
|
|
||||||
#if WEBRTC_ENABLE_PROTOBUF
|
#if WEBRTC_ENABLE_PROTOBUF
|
||||||
@ -131,8 +132,12 @@ SendAudioStream::SendAudioStream(
|
|||||||
{RtpExtension::kTransportSequenceNumberUri, 8}};
|
{RtpExtension::kTransportSequenceNumberUri, 8}};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.stream.rate_allocation_priority) {
|
if (config.encoder.priority_rate) {
|
||||||
send_config.track_id = sender->GetNextPriorityId();
|
send_config.track_id = sender->GetNextPriorityId();
|
||||||
|
sender_->call_->SetBitrateAllocationStrategy(
|
||||||
|
absl::make_unique<rtc::AudioPriorityBitrateAllocationStrategy>(
|
||||||
|
send_config.track_id,
|
||||||
|
config.encoder.priority_rate->bps<uint32_t>()));
|
||||||
}
|
}
|
||||||
send_stream_ = sender_->call_->CreateAudioSendStream(send_config);
|
send_stream_ = sender_->call_->CreateAudioSendStream(send_config);
|
||||||
if (field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")) {
|
if (field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")) {
|
||||||
|
@ -147,12 +147,6 @@ CallClient::CallClient(Clock* clock,
|
|||||||
fake_audio_setup_.audio_state)),
|
fake_audio_setup_.audio_state)),
|
||||||
transport_(clock_, call_.get()),
|
transport_(clock_, call_.get()),
|
||||||
header_parser_(RtpHeaderParser::Create()) {
|
header_parser_(RtpHeaderParser::Create()) {
|
||||||
if (!config.priority_target_rate.IsZero() &&
|
|
||||||
config.priority_target_rate.IsFinite()) {
|
|
||||||
call_->SetBitrateAllocationStrategy(
|
|
||||||
absl::make_unique<rtc::AudioPriorityBitrateAllocationStrategy>(
|
|
||||||
kPriorityStreamId, config.priority_target_rate.bps()));
|
|
||||||
}
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
|
|
||||||
CallClient::~CallClient() {
|
CallClient::~CallClient() {
|
||||||
|
@ -51,7 +51,6 @@ struct TransportControllerConfig {
|
|||||||
|
|
||||||
struct CallClientConfig {
|
struct CallClientConfig {
|
||||||
TransportControllerConfig transport;
|
TransportControllerConfig transport;
|
||||||
DataRate priority_target_rate = DataRate::Zero();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SimulatedTimeClientConfig {
|
struct SimulatedTimeClientConfig {
|
||||||
@ -155,6 +154,7 @@ struct AudioStreamConfig {
|
|||||||
absl::optional<DataRate> fixed_rate;
|
absl::optional<DataRate> fixed_rate;
|
||||||
absl::optional<DataRate> min_rate;
|
absl::optional<DataRate> min_rate;
|
||||||
absl::optional<DataRate> max_rate;
|
absl::optional<DataRate> max_rate;
|
||||||
|
absl::optional<DataRate> priority_rate;
|
||||||
TimeDelta initial_frame_length = TimeDelta::ms(20);
|
TimeDelta initial_frame_length = TimeDelta::ms(20);
|
||||||
} encoder;
|
} encoder;
|
||||||
struct Stream {
|
struct Stream {
|
||||||
@ -162,7 +162,6 @@ struct AudioStreamConfig {
|
|||||||
Stream(const Stream&);
|
Stream(const Stream&);
|
||||||
~Stream();
|
~Stream();
|
||||||
bool in_bandwidth_estimation = false;
|
bool in_bandwidth_estimation = false;
|
||||||
bool rate_allocation_priority = false;
|
|
||||||
} stream;
|
} stream;
|
||||||
struct Render {
|
struct Render {
|
||||||
std::string sync_group;
|
std::string sync_group;
|
||||||
|
Reference in New Issue
Block a user