Index: webrtc/examples/objc/AppRTCMobile/ARDBitrateAllocationStrategy.mm |
diff --git a/webrtc/examples/objc/AppRTCMobile/ARDBitrateAllocationStrategy.mm b/webrtc/examples/objc/AppRTCMobile/ARDBitrateAllocationStrategy.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4b7bde1db08aba7b5193a5a6ffb5c0447043cced |
--- /dev/null |
+++ b/webrtc/examples/objc/AppRTCMobile/ARDBitrateAllocationStrategy.mm |
@@ -0,0 +1,31 @@ |
+/* |
+ * 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 "webrtc/base/bitrateallocationstrategy.h" |
+ |
+constexpr uint32_t kSufficientAudioBitrate=16000; |
+ |
+@implementation ARDBitrateAllocationStrategy |
+ |
++ (void) setAudioPriorityStrategy: (RTCPeerConnection*) peerConnection |
+ audioTrackId:(NSString *) audioTrackId { |
+ [peerConnection setBitrateAllocationStrategy: |
+ [[RTCBitrateAllocationStrategy alloc] initWith: |
+ new rtc::AudioPriorityBitrateAllocationStrategy( |
+ std::string(audioTrackId.UTF8String), |
+ kSufficientAudioBitrate) |
+ ] |
+ ]; |
+} |
+ |
+@end |