Reland of BWE allocation strategy
TBR=stefan@webrtc.org,alexnarest@webrtc.org Bug: webrtc:8243 Change-Id: Ie68e4f414b2ac32ba4e64877cb250fabcb089a07 Reviewed-on: https://webrtc-review.googlesource.com/13940 Commit-Queue: Alex Narest <alexnarest@webrtc.org> Reviewed-by: Alex Narest <alexnarest@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20369}
This commit is contained in:
22
call/call.cc
22
call/call.cc
@ -214,6 +214,10 @@ class Call : public webrtc::Call,
|
||||
void SetBitrateConfigMask(
|
||||
const webrtc::Call::Config::BitrateConfigMask& bitrate_config) override;
|
||||
|
||||
void SetBitrateAllocationStrategy(
|
||||
std::unique_ptr<rtc::BitrateAllocationStrategy>
|
||||
bitrate_allocation_strategy) override;
|
||||
|
||||
void SignalChannelNetworkState(MediaType media, NetworkState state) override;
|
||||
|
||||
void OnTransportOverheadChanged(MediaType media,
|
||||
@ -1007,6 +1011,24 @@ void Call::UpdateCurrentBitrateConfig(const rtc::Optional<int>& new_start) {
|
||||
config_.bitrate_config = updated;
|
||||
}
|
||||
|
||||
void Call::SetBitrateAllocationStrategy(
|
||||
std::unique_ptr<rtc::BitrateAllocationStrategy>
|
||||
bitrate_allocation_strategy) {
|
||||
if (!worker_queue_.IsCurrent()) {
|
||||
rtc::BitrateAllocationStrategy* strategy_raw =
|
||||
bitrate_allocation_strategy.release();
|
||||
auto functor = [this, strategy_raw]() {
|
||||
SetBitrateAllocationStrategy(
|
||||
rtc::WrapUnique<rtc::BitrateAllocationStrategy>(strategy_raw));
|
||||
};
|
||||
worker_queue_.PostTask([functor] { functor(); });
|
||||
return;
|
||||
}
|
||||
RTC_DCHECK_RUN_ON(&worker_queue_);
|
||||
bitrate_allocator_->SetBitrateAllocationStrategy(
|
||||
std::move(bitrate_allocation_strategy));
|
||||
}
|
||||
|
||||
void Call::SignalChannelNetworkState(MediaType media, NetworkState state) {
|
||||
RTC_DCHECK_CALLED_SEQUENTIALLY(&configuration_sequence_checker_);
|
||||
switch (media) {
|
||||
|
||||
Reference in New Issue
Block a user