-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mac] Allow audio device selection #21
Merged
Merged
Changes from 12 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
3c17eff
first attempt
hiroshihorie 42029a7
remove unused dep
hiroshihorie 4c929eb
init playout / recording
hiroshihorie efc3c32
use AudioDeviceID as guid
hiroshihorie a5042dc
switch device method
hiroshihorie dfd4ace
equality
hiroshihorie eda19e1
default device
hiroshihorie 507913c
`isDefault` property
hiroshihorie c08e4cf
dont format default device name
hiroshihorie e063d93
type param
hiroshihorie aba2227
bypass
hiroshihorie 149c99f
refactor
hiroshihorie a00a74c
fix
hiroshihorie e5410c8
append Audio to thread labels
hiroshihorie c4f1305
ref
hiroshihorie a35ce56
lk headers
hiroshihorie bdf5e7e
low level apis
hiroshihorie 9de0e4d
Merge branch 'm97_release' into expose-audio-device-module
hiroshihorie bda204c
fix thread checks
hiroshihorie e25aa38
switch to default device when removed
hiroshihorie d30b2e5
close mixerManager if didn't switch to default device
hiroshihorie 1e0ef35
default audio device switched
hiroshihorie 6a99ab3
expose devices update handler
hiroshihorie ccf95cf
fix ios compile
hiroshihorie 633c52d
fix bug: don't always recreate RTCAudioDeviceModule
hiroshihorie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2016 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 "RTCMacros.h" | ||
#import "RTCIODevice.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
RTC_OBJC_EXPORT | ||
@interface RTC_OBJC_TYPE(RTCAudioDevice) : RTC_OBJC_TYPE(RTCIODevice) | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright 2016 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 "RTCAudioDevice.h" | ||
|
||
@implementation RTCAudioDevice | ||
|
||
@end |
22 changes: 22 additions & 0 deletions
22
sdk/objc/api/peerconnection/RTCAudioDeviceModule+Private.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright 2016 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 "RTCAudioDeviceModule.h" | ||
#import "sdk/objc/native/api/audio_device_module.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface RTCAudioDeviceModule () | ||
|
||
- (instancetype)initWithNativeModule:(rtc::scoped_refptr<webrtc::AudioDeviceModule> )module; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright 2016 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 <CoreMedia/CoreMedia.h> | ||
#import <Foundation/Foundation.h> | ||
|
||
#import "RTCMacros.h" | ||
#import "RTCAudioDevice.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
RTC_OBJC_EXPORT | ||
@interface RTC_OBJC_TYPE (RTCAudioDeviceModule) : NSObject | ||
|
||
- (void)captureSampleBuffer:(CMSampleBufferRef)sampleBuffer; | ||
|
||
@property(nonatomic, readonly) NSArray<RTC_OBJC_TYPE(RTCAudioDevice) *> *playoutDevices; | ||
@property(nonatomic, readonly) NSArray<RTC_OBJC_TYPE(RTCAudioDevice) *> *recordingDevices; | ||
|
||
@property(nonatomic, readonly) BOOL playing; | ||
@property(nonatomic, readonly) BOOL recording; | ||
|
||
// Executes low-level API's in sequence to switch the device | ||
- (BOOL)switchPlayoutDevice: (nullable RTCAudioDevice *)device; | ||
- (BOOL)switchRecordingDevice: (nullable RTCAudioDevice *)device; | ||
|
||
// Low-level APIs | ||
- (BOOL)setPlayoutDevice:(uint16_t) index; | ||
- (BOOL)startPlayout; | ||
- (BOOL)stopPlayout; | ||
- (BOOL)initPlayout; | ||
|
||
// Low-level APIs | ||
- (BOOL)setRecordingDevice:(uint16_t) index; | ||
- (BOOL)startRecording; | ||
- (BOOL)stopRecording; | ||
- (BOOL)initRecording; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can anything else call this function and pass in NULL for
RecordingDeviceName
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RecordingDeviceName
is supposed to populatename
andguid
of the device,but populating
guid
was not implemented in their code.So I implemented to return the
AudioDeviceID
which is not technicallyguid
butit works for identifying the device.