BWE allocation strategy allows controlling of bitrate allocation with WEBRTC external logic.
This CL implements the main logic and IOS appRTC integration. Unit tests and Android appRTC will be in separate CL. Bug: webrtc:8243 Change-Id: If8e5195294046a47316e9fade1b0dfec211155e1 Reviewed-on: https://webrtc-review.googlesource.com/4860 Commit-Queue: Alex Narest <alexnarest@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20329}
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