
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}
41 lines
1.8 KiB
Plaintext
41 lines
1.8 KiB
Plaintext
/*
|
|
* Copyright 2017 The WebRTC Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#import "ARDBitrateAllocationStrategy.h"
|
|
#import "WebRTC/RTCBitrateAllocationStrategy.h"
|
|
|
|
#include "rtc_base/bitrateallocationstrategy.h"
|
|
|
|
@implementation ARDBitrateAllocationStrategy
|
|
|
|
+ (ARDBitrateAllocationStrategy*)
|
|
createAudioPriorityBitrateAllocationStrategyForPeerConnection:(RTCPeerConnection*)peerConnection
|
|
withAudioTrack:(NSString*)audioTrackID
|
|
sufficientAudioBitrate:(uint32_t)sufficientAudioBitrate {
|
|
return [[ARDBitrateAllocationStrategy alloc] initWithPeerCoonnection:peerConnection
|
|
withAudioTrack:audioTrackID
|
|
sufficientAudioBitrate:sufficientAudioBitrate];
|
|
}
|
|
|
|
- (instancetype)initWithPeerCoonnection:(RTCPeerConnection*)peerConnection
|
|
withAudioTrack:(NSString*)audioTrackID
|
|
sufficientAudioBitrate:(uint32_t)sufficientAudioBitrate {
|
|
if (self = [super init]) {
|
|
[peerConnection
|
|
setBitrateAllocationStrategy:[[RTCBitrateAllocationStrategy alloc]
|
|
initWith:new rtc::AudioPriorityBitrateAllocationStrategy(
|
|
std::string(audioTrackID.UTF8String),
|
|
sufficientAudioBitrate)]];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
@end
|