Revert ObjC API changes for BWE allocation strategy
The ObjC API (the files in sdk/objc/Framework/Headers/WebRTC/) needs to be pure ObjC. The changes that are reverted here introduced C++ which turns it into ObjC++. We don't have a test protectcing this right now, but it's probably something we should add to catch changes like this in the future. TBR=alexnarest@webrtc.org,deadbeef@webrtc.org Bug: webrtc:8243 Change-Id: Idea688f4014cd44c27cf2cb2a5ec8a9ea7da3c00 Reviewed-on: https://webrtc-review.googlesource.com/16429 Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Reviewed-by: Magnus Jedvert <magjed@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20463}
This commit is contained in:
committed by
Commit Bot
parent
b0576ecc71
commit
293158b707
@ -176,7 +176,6 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
|
|||||||
if (is_ios) {
|
if (is_ios) {
|
||||||
deps = [
|
deps = [
|
||||||
":AppRTCMobile_ios_frameworks",
|
":AppRTCMobile_ios_frameworks",
|
||||||
"../rtc_base:rtc_base",
|
|
||||||
]
|
]
|
||||||
} else {
|
} else {
|
||||||
deps = [
|
deps = [
|
||||||
@ -207,8 +206,6 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
|
|||||||
"objc/AppRTCMobile/ARDAppClient.m",
|
"objc/AppRTCMobile/ARDAppClient.m",
|
||||||
"objc/AppRTCMobile/ARDAppEngineClient.h",
|
"objc/AppRTCMobile/ARDAppEngineClient.h",
|
||||||
"objc/AppRTCMobile/ARDAppEngineClient.m",
|
"objc/AppRTCMobile/ARDAppEngineClient.m",
|
||||||
"objc/AppRTCMobile/ARDBitrateAllocationStrategy.h",
|
|
||||||
"objc/AppRTCMobile/ARDBitrateAllocationStrategy.mm",
|
|
||||||
"objc/AppRTCMobile/ARDBitrateTracker.h",
|
"objc/AppRTCMobile/ARDBitrateTracker.h",
|
||||||
"objc/AppRTCMobile/ARDBitrateTracker.m",
|
"objc/AppRTCMobile/ARDBitrateTracker.m",
|
||||||
"objc/AppRTCMobile/ARDCaptureController.h",
|
"objc/AppRTCMobile/ARDCaptureController.h",
|
||||||
@ -252,7 +249,6 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
|
|||||||
deps = [
|
deps = [
|
||||||
":apprtc_common",
|
":apprtc_common",
|
||||||
":socketrocket",
|
":socketrocket",
|
||||||
"../rtc_base:rtc_base",
|
|
||||||
]
|
]
|
||||||
if (is_ios) {
|
if (is_ios) {
|
||||||
deps += [ ":AppRTCMobile_ios_frameworks" ]
|
deps += [ ":AppRTCMobile_ios_frameworks" ]
|
||||||
|
|||||||
@ -25,7 +25,6 @@
|
|||||||
#import "WebRTC/RTCVideoTrack.h"
|
#import "WebRTC/RTCVideoTrack.h"
|
||||||
|
|
||||||
#import "ARDAppEngineClient.h"
|
#import "ARDAppEngineClient.h"
|
||||||
#import "ARDBitrateAllocationStrategy.h"
|
|
||||||
#import "ARDJoinResponse.h"
|
#import "ARDJoinResponse.h"
|
||||||
#import "ARDMessageResponse.h"
|
#import "ARDMessageResponse.h"
|
||||||
#import "ARDSettingsModel.h"
|
#import "ARDSettingsModel.h"
|
||||||
@ -51,7 +50,6 @@ static NSString * const kARDMediaStreamId = @"ARDAMS";
|
|||||||
static NSString * const kARDAudioTrackId = @"ARDAMSa0";
|
static NSString * const kARDAudioTrackId = @"ARDAMSa0";
|
||||||
static NSString * const kARDVideoTrackId = @"ARDAMSv0";
|
static NSString * const kARDVideoTrackId = @"ARDAMSv0";
|
||||||
static NSString * const kARDVideoTrackKind = @"video";
|
static NSString * const kARDVideoTrackKind = @"video";
|
||||||
static uint32_t const kSufficientAudioBitrate = 16000;
|
|
||||||
|
|
||||||
// TODO(tkchin): Add these as UI options.
|
// TODO(tkchin): Add these as UI options.
|
||||||
static BOOL const kARDAppClientEnableTracing = NO;
|
static BOOL const kARDAppClientEnableTracing = NO;
|
||||||
@ -106,7 +104,6 @@ static int const kKbpsMultiplier = 1000;
|
|||||||
ARDTimerProxy *_statsTimer;
|
ARDTimerProxy *_statsTimer;
|
||||||
ARDSettingsModel *_settings;
|
ARDSettingsModel *_settings;
|
||||||
RTCVideoTrack *_localVideoTrack;
|
RTCVideoTrack *_localVideoTrack;
|
||||||
ARDBitrateAllocationStrategy *_bitrateAllocationStrategy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@synthesize shouldGetStats = _shouldGetStats;
|
@synthesize shouldGetStats = _shouldGetStats;
|
||||||
@ -309,14 +306,12 @@ static int const kKbpsMultiplier = 1000;
|
|||||||
_hasReceivedSdp = NO;
|
_hasReceivedSdp = NO;
|
||||||
_messageQueue = [NSMutableArray array];
|
_messageQueue = [NSMutableArray array];
|
||||||
_localVideoTrack = nil;
|
_localVideoTrack = nil;
|
||||||
|
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
[_factory stopAecDump];
|
[_factory stopAecDump];
|
||||||
[_peerConnection stopRtcEventLog];
|
[_peerConnection stopRtcEventLog];
|
||||||
#endif
|
#endif
|
||||||
[_peerConnection close];
|
[_peerConnection close];
|
||||||
_peerConnection = nil;
|
_peerConnection = nil;
|
||||||
_bitrateAllocationStrategy = nil;
|
|
||||||
self.state = kARDAppClientStateDisconnected;
|
self.state = kARDAppClientStateDisconnected;
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
if (kARDAppClientEnableTracing) {
|
if (kARDAppClientEnableTracing) {
|
||||||
@ -538,14 +533,8 @@ static int const kKbpsMultiplier = 1000;
|
|||||||
_peerConnection = [_factory peerConnectionWithConfiguration:config
|
_peerConnection = [_factory peerConnectionWithConfiguration:config
|
||||||
constraints:constraints
|
constraints:constraints
|
||||||
delegate:self];
|
delegate:self];
|
||||||
_bitrateAllocationStrategy = [ARDBitrateAllocationStrategy
|
|
||||||
createAudioPriorityBitrateAllocationStrategyForPeerConnection:_peerConnection
|
|
||||||
withAudioTrack:kARDAudioTrackId
|
|
||||||
sufficientAudioBitrate:kSufficientAudioBitrate];
|
|
||||||
|
|
||||||
// Create AV senders.
|
// Create AV senders.
|
||||||
[self createMediaSenders];
|
[self createMediaSenders];
|
||||||
|
|
||||||
if (_isInitiator) {
|
if (_isInitiator) {
|
||||||
// Send offer.
|
// Send offer.
|
||||||
__weak ARDAppClient *weakSelf = self;
|
__weak ARDAppClient *weakSelf = self;
|
||||||
|
|||||||
@ -1,23 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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 <Foundation/Foundation.h>
|
|
||||||
#import "WebRTC/RTCPeerConnection.h"
|
|
||||||
|
|
||||||
@interface ARDBitrateAllocationStrategy : NSObject
|
|
||||||
|
|
||||||
+ (ARDBitrateAllocationStrategy*)
|
|
||||||
createAudioPriorityBitrateAllocationStrategyForPeerConnection:(RTCPeerConnection*)peerConnection
|
|
||||||
withAudioTrack:(NSString*)audioTrackID
|
|
||||||
sufficientAudioBitrate:(uint32_t)sufficientAudioBitrate;
|
|
||||||
|
|
||||||
- (instancetype)init NS_UNAVAILABLE;
|
|
||||||
|
|
||||||
@end
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
|
|
||||||
@ -26,8 +26,7 @@
|
|||||||
- (BOOL)application:(UIApplication *)application
|
- (BOOL)application:(UIApplication *)application
|
||||||
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||||
NSDictionary *fieldTrials = @{
|
NSDictionary *fieldTrials = @{
|
||||||
kRTCFieldTrialH264HighProfileKey : kRTCFieldTrialEnabledValue,
|
kRTCFieldTrialH264HighProfileKey: kRTCFieldTrialEnabledValue,
|
||||||
kRTCFieldTrialAudioSendSideBweKey : kRTCFieldTrialEnabledValue
|
|
||||||
};
|
};
|
||||||
RTCInitFieldTrialDictionary(fieldTrials);
|
RTCInitFieldTrialDictionary(fieldTrials);
|
||||||
RTCInitializeSSL();
|
RTCInitializeSSL();
|
||||||
|
|||||||
@ -390,7 +390,6 @@ if (is_ios || is_mac) {
|
|||||||
"objc/Framework/Classes/PeerConnection/RTCAudioSource.mm",
|
"objc/Framework/Classes/PeerConnection/RTCAudioSource.mm",
|
||||||
"objc/Framework/Classes/PeerConnection/RTCAudioTrack+Private.h",
|
"objc/Framework/Classes/PeerConnection/RTCAudioTrack+Private.h",
|
||||||
"objc/Framework/Classes/PeerConnection/RTCAudioTrack.mm",
|
"objc/Framework/Classes/PeerConnection/RTCAudioTrack.mm",
|
||||||
"objc/Framework/Classes/PeerConnection/RTCBitrateAllocationStrategy.mm",
|
|
||||||
"objc/Framework/Classes/PeerConnection/RTCConfiguration+Private.h",
|
"objc/Framework/Classes/PeerConnection/RTCConfiguration+Private.h",
|
||||||
"objc/Framework/Classes/PeerConnection/RTCConfiguration.mm",
|
"objc/Framework/Classes/PeerConnection/RTCConfiguration.mm",
|
||||||
"objc/Framework/Classes/PeerConnection/RTCDataChannel+Private.h",
|
"objc/Framework/Classes/PeerConnection/RTCDataChannel+Private.h",
|
||||||
@ -458,7 +457,6 @@ if (is_ios || is_mac) {
|
|||||||
"objc/Framework/Headers/WebRTC/RTCAVFoundationVideoSource.h",
|
"objc/Framework/Headers/WebRTC/RTCAVFoundationVideoSource.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCAudioSource.h",
|
"objc/Framework/Headers/WebRTC/RTCAudioSource.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCAudioTrack.h",
|
"objc/Framework/Headers/WebRTC/RTCAudioTrack.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCBitrateAllocationStrategy.h",
|
|
||||||
"objc/Framework/Headers/WebRTC/RTCConfiguration.h",
|
"objc/Framework/Headers/WebRTC/RTCConfiguration.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCDataChannel.h",
|
"objc/Framework/Headers/WebRTC/RTCDataChannel.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h",
|
"objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h",
|
||||||
|
|||||||
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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 "WebRTC/RTCBitrateAllocationStrategy.h"
|
|
||||||
|
|
||||||
#include "rtc_base/bitrateallocationstrategy.h"
|
|
||||||
#include "rtc_base/checks.h"
|
|
||||||
|
|
||||||
@implementation RTCBitrateAllocationStrategy
|
|
||||||
|
|
||||||
@synthesize strategy = _strategy;
|
|
||||||
|
|
||||||
- (instancetype)initWith:(rtc::BitrateAllocationStrategy*)strategy {
|
|
||||||
RTC_DCHECK(strategy);
|
|
||||||
if (self = [super init]) {
|
|
||||||
_strategy = strategy;
|
|
||||||
}
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
@ -21,7 +21,6 @@
|
|||||||
#import "RTCRtpReceiver+Private.h"
|
#import "RTCRtpReceiver+Private.h"
|
||||||
#import "RTCRtpSender+Private.h"
|
#import "RTCRtpSender+Private.h"
|
||||||
#import "RTCSessionDescription+Private.h"
|
#import "RTCSessionDescription+Private.h"
|
||||||
#import "WebRTC/RTCBitrateAllocationStrategy.h"
|
|
||||||
#import "WebRTC/RTCLogging.h"
|
#import "WebRTC/RTCLogging.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -386,15 +385,6 @@ void PeerConnectionDelegateAdapter::OnIceCandidatesRemoved(
|
|||||||
return _peerConnection->SetBitrate(params).ok();
|
return _peerConnection->SetBitrate(params).ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setBitrateAllocationStrategy:
|
|
||||||
(RTCBitrateAllocationStrategy *_Nullable)bitrateAllocationStrategy {
|
|
||||||
if (bitrateAllocationStrategy)
|
|
||||||
_peerConnection->SetBitrateAllocationStrategy(
|
|
||||||
std::unique_ptr<rtc::BitrateAllocationStrategy>(bitrateAllocationStrategy.strategy));
|
|
||||||
else
|
|
||||||
_peerConnection->SetBitrateAllocationStrategy(nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath
|
- (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath
|
||||||
maxSizeInBytes:(int64_t)maxSizeInBytes {
|
maxSizeInBytes:(int64_t)maxSizeInBytes {
|
||||||
RTC_DCHECK(filePath.length);
|
RTC_DCHECK(filePath.length);
|
||||||
|
|||||||
@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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 <WebRTC/RTCMacros.h>
|
|
||||||
#import <WebRTC/RTCMediaStreamTrack.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
namespace rtc {
|
|
||||||
|
|
||||||
class BitrateAllocationStrategy;
|
|
||||||
}
|
|
||||||
|
|
||||||
RTC_EXPORT
|
|
||||||
@interface RTCBitrateAllocationStrategy : NSObject
|
|
||||||
|
|
||||||
- (instancetype)init NS_UNAVAILABLE;
|
|
||||||
- (instancetype)initWith:(rtc::BitrateAllocationStrategy*)strategy;
|
|
||||||
|
|
||||||
/** Native bitrate allocation strategy. */
|
|
||||||
@property(nonatomic, readonly) rtc::BitrateAllocationStrategy* strategy;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
||||||
@ -24,7 +24,6 @@
|
|||||||
@class RTCRtpSender;
|
@class RTCRtpSender;
|
||||||
@class RTCSessionDescription;
|
@class RTCSessionDescription;
|
||||||
@class RTCLegacyStatsReport;
|
@class RTCLegacyStatsReport;
|
||||||
@class RTCBitrateAllocationStrategy;
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@ -194,13 +193,6 @@ RTC_EXPORT
|
|||||||
currentBitrateBps:(nullable NSNumber *)currentBitrateBps
|
currentBitrateBps:(nullable NSNumber *)currentBitrateBps
|
||||||
maxBitrateBps:(nullable NSNumber *)maxBitrateBps;
|
maxBitrateBps:(nullable NSNumber *)maxBitrateBps;
|
||||||
|
|
||||||
/** Sets current strategy. If not set default WebRTC allocator will be used.
|
|
||||||
* May be changed during an active session. The strategy
|
|
||||||
* ownership is passed with std::unique_ptr
|
|
||||||
*/
|
|
||||||
- (void)setBitrateAllocationStrategy:
|
|
||||||
(RTCBitrateAllocationStrategy *_Nullable)bitrateAllocationStrategy;
|
|
||||||
|
|
||||||
/** Start or stop recording an Rtc EventLog. */
|
/** Start or stop recording an Rtc EventLog. */
|
||||||
- (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath
|
- (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath
|
||||||
maxSizeInBytes:(int64_t)maxSizeInBytes;
|
maxSizeInBytes:(int64_t)maxSizeInBytes;
|
||||||
|
|||||||
Reference in New Issue
Block a user