Revert "Moving iOS Audio Device to sdk."
This reverts commit a167212657f8450296ac518162ef0b28ba4214c5. Reason for revert: Breaks Chromium build. Log: https://ci.chromium.org/buildbot/chromium.webrtc.fyi/ios-device/ Writing """\ additional_target_cpus = [ "arm64" ] goma_dir = "/b/c/goma_client" ios_enable_code_signing = false is_component_build = false is_debug = false target_cpu = "arm" target_os = "ios" use_goma = true """ to /b/c/b/ios_device/src/out/Release-iphoneos/args.gn. /b/c/b/ios_device/src/buildtools/mac/gn gen //out/Release-iphoneos --check -> returned 1 ERROR at //third_party/webrtc/sdk/BUILD.gn:108:9: Can't load input file. "../../rtc_base:checks", ^---------------------- Unable to load: /b/c/b/ios_device/src/third_party/rtc_base/BUILD.gn I also checked in the secondary tree for: /b/c/b/ios_device/src/build/secondary/third_party/rtc_base/BUILD.gn Original change's description: > Moving iOS Audio Device to sdk. > > This change forks the existing iOS audio device module and audio device > from modules/audio_device/ into sdk/objc/Framework. It also updates > RTCPeerConnectionFactory to use the forked implementation. > > The unit tests are re-implemented as XCTests. > > Bug: webrtc:9120 > Change-Id: Ie60cafae796efbd7966d21ff6877c92cbe850fb7 > Reviewed-on: https://webrtc-review.googlesource.com/67300 > Reviewed-by: Kári Helgason <kthelgason@webrtc.org> > Commit-Queue: Peter Hanspers <peterhanspers@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23163} TBR=andersc@webrtc.org,kthelgason@webrtc.org,peterhanspers@webrtc.org Change-Id: Iebe52e9775409a3bdd6d5e44f4f985d56b859cbe No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9120 Reviewed-on: https://webrtc-review.googlesource.com/75220 Reviewed-by: Max Morin <maxmorin@webrtc.org> Commit-Queue: Max Morin <maxmorin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23166}
This commit is contained in:
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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 "sdk/objc/Framework/Headers/WebRTC/RTCAudioSession.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
namespace webrtc {
|
||||
class AudioSessionObserver;
|
||||
}
|
||||
|
||||
/** Adapter that forwards RTCAudioSessionDelegate calls to the appropriate
|
||||
* methods on the AudioSessionObserver.
|
||||
*/
|
||||
@interface RTCNativeAudioSessionDelegateAdapter : NSObject <RTCAudioSessionDelegate>
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/** |observer| is a raw pointer and should be kept alive
|
||||
* for this object's lifetime.
|
||||
*/
|
||||
- (instancetype)initWithObserver:(webrtc::AudioSessionObserver *)observer
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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 "RTCNativeAudioSessionDelegateAdapter.h"
|
||||
|
||||
#include "sdk/objc/Framework/Native/src/audio/audio_session_observer.h"
|
||||
|
||||
#import "WebRTC/RTCLogging.h"
|
||||
|
||||
@implementation RTCNativeAudioSessionDelegateAdapter {
|
||||
webrtc::AudioSessionObserver *_observer;
|
||||
}
|
||||
|
||||
- (instancetype)initWithObserver:(webrtc::AudioSessionObserver *)observer {
|
||||
RTC_DCHECK(observer);
|
||||
if (self = [super init]) {
|
||||
_observer = observer;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - RTCAudioSessionDelegate
|
||||
|
||||
- (void)audioSessionDidBeginInterruption:(RTCAudioSession *)session {
|
||||
_observer->OnInterruptionBegin();
|
||||
}
|
||||
|
||||
- (void)audioSessionDidEndInterruption:(RTCAudioSession *)session
|
||||
shouldResumeSession:(BOOL)shouldResumeSession {
|
||||
_observer->OnInterruptionEnd();
|
||||
}
|
||||
|
||||
- (void)audioSessionDidChangeRoute:(RTCAudioSession *)session
|
||||
reason:(AVAudioSessionRouteChangeReason)reason
|
||||
previousRoute:(AVAudioSessionRouteDescription *)previousRoute {
|
||||
switch (reason) {
|
||||
case AVAudioSessionRouteChangeReasonUnknown:
|
||||
case AVAudioSessionRouteChangeReasonNewDeviceAvailable:
|
||||
case AVAudioSessionRouteChangeReasonOldDeviceUnavailable:
|
||||
case AVAudioSessionRouteChangeReasonCategoryChange:
|
||||
// It turns out that we see a category change (at least in iOS 9.2)
|
||||
// when making a switch from a BT device to e.g. Speaker using the
|
||||
// iOS Control Center and that we therefore must check if the sample
|
||||
// rate has changed. And if so is the case, restart the audio unit.
|
||||
case AVAudioSessionRouteChangeReasonOverride:
|
||||
case AVAudioSessionRouteChangeReasonWakeFromSleep:
|
||||
case AVAudioSessionRouteChangeReasonNoSuitableRouteForCategory:
|
||||
_observer->OnValidRouteChange();
|
||||
break;
|
||||
case AVAudioSessionRouteChangeReasonRouteConfigurationChange:
|
||||
// The set of input and output ports has not changed, but their
|
||||
// configuration has, e.g., a port’s selected data source has
|
||||
// changed. Ignore this type of route change since we are focusing
|
||||
// on detecting headset changes.
|
||||
RTCLog(@"Ignoring RouteConfigurationChange");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)audioSessionMediaServerTerminated:(RTCAudioSession *)session {
|
||||
}
|
||||
|
||||
- (void)audioSessionMediaServerReset:(RTCAudioSession *)session {
|
||||
}
|
||||
|
||||
- (void)audioSession:(RTCAudioSession *)session
|
||||
didChangeCanPlayOrRecord:(BOOL)canPlayOrRecord {
|
||||
_observer->OnCanPlayOrRecordChange(canPlayOrRecord);
|
||||
}
|
||||
|
||||
- (void)audioSessionDidStartPlayOrRecord:(RTCAudioSession *)session {
|
||||
}
|
||||
|
||||
- (void)audioSessionDidStopPlayOrRecord:(RTCAudioSession *)session {
|
||||
}
|
||||
|
||||
- (void)audioSession:(RTCAudioSession *)audioSession
|
||||
didChangeOutputVolume:(float)outputVolume {
|
||||
_observer->OnChangedOutputVolume();
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user