Make RTCAudioSession accessible to Swift.

This is done by:
1. removing the <vector> include from RTCAudioSession+Private,
2. creating a audio_session_objc package that excludes the RTCNativeAudioSessionDelegateAdapter class.

Bug: webrtc:11237
Change-Id: I36c86542a19e3244456fd164d908563b1435de29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163900
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Chuck Hays <haysc@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30177}
This commit is contained in:
Joe Chen
2019-12-26 23:01:42 -08:00
committed by Commit Bot
parent 0c20213e2a
commit 0b3a6e383e
5 changed files with 45 additions and 11 deletions

View File

@ -10,8 +10,6 @@
#import "RTCAudioSession.h"
#include <vector>
NS_ASSUME_NONNULL_BEGIN
@class RTCAudioSessionConfiguration;
@ -77,8 +75,6 @@ NS_ASSUME_NONNULL_BEGIN
- (NSError *)configurationErrorWithDescription:(NSString *)description;
// Properties and methods for tests.
@property(nonatomic, readonly) std::vector<__weak id<RTCAudioSessionDelegate> > delegates;
- (void)notifyDidBeginInterruption;
- (void)notifyDidEndInterruptionWithShouldResumeSession:(BOOL)shouldResumeSession;
- (void)notifyDidChangeRouteWithReason:(AVAudioSessionRouteChangeReason)reason

View File

@ -12,6 +12,8 @@
#import <UIKit/UIKit.h>
#include <vector>
#include "rtc_base/atomic_ops.h"
#include "rtc_base/checks.h"
#include "rtc_base/critical_section.h"
@ -25,6 +27,10 @@ NSInteger const kRTCAudioSessionErrorLockRequired = -1;
NSInteger const kRTCAudioSessionErrorConfiguration = -2;
NSString * const kRTCAudioSessionOutputVolumeSelector = @"outputVolume";
@interface RTCAudioSession ()
@property(nonatomic, readonly) std::vector<__weak id<RTCAudioSessionDelegate> > delegates;
@end
// This class needs to be thread-safe because it is accessed from many threads.
// TODO(tkchin): Consider more granular locking. We're not expecting a lot of
// lock contention so coarse locks should be fine for now.