Add AudioProcessing parameter to RTCPeerConnectionFactory native constructor

This allows Objective C(++) users to supply their own implementations of the webrtc::AudioProcessing module.

Bug: webrtc:8163
Change-Id: I2302610c9b45b2f483146d6fe7d82be419b33ee2
Reviewed-on: https://webrtc-review.googlesource.com/18180
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20668}
This commit is contained in:
Sam Zackrisson
2017-11-13 14:56:02 +01:00
committed by Commit Bot
parent 8962b54a43
commit 6124aacd98
2 changed files with 10 additions and 5 deletions

View File

@ -19,6 +19,7 @@ class AudioEncoderFactory;
class AudioDecoderFactory;
class VideoEncoderFactory;
class VideoDecoderFactory;
class AudioProcessing;
} // namespace webrtc
@ -51,7 +52,9 @@ NS_ASSUME_NONNULL_BEGIN
nativeVideoDecoderFactory:
(std::unique_ptr<webrtc::VideoDecoderFactory>)videoDecoderFactory
audioDeviceModule:
(nullable webrtc::AudioDeviceModule *)audioDeviceModule;
(nullable webrtc::AudioDeviceModule *)audioDeviceModule
audioProcessingModule:
(rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule;
/* Initialize object with legacy injectable native audio/video encoder/decoder factories
TODO(andersc): Remove this when backwards compatiblity is no longer needed.

View File

@ -84,7 +84,8 @@
nativeAudioDecoderFactory:webrtc::CreateBuiltinAudioDecoderFactory()
nativeVideoEncoderFactory:std::move(native_encoder_factory)
nativeVideoDecoderFactory:std::move(native_decoder_factory)
audioDeviceModule:nullptr];
audioDeviceModule:nullptr
audioProcessingModule:nullptr];
#endif
}
@ -128,7 +129,9 @@
nativeVideoDecoderFactory:
(std::unique_ptr<webrtc::VideoDecoderFactory>)videoDecoderFactory
audioDeviceModule:
(nullable webrtc::AudioDeviceModule *)audioDeviceModule {
(nullable webrtc::AudioDeviceModule *)audioDeviceModule
audioProcessingModule:
(rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule {
#ifdef HAVE_NO_MEDIA
return [self initWithNoMedia];
#else
@ -142,8 +145,7 @@
std::move(videoEncoderFactory),
std::move(videoDecoderFactory),
nullptr, // audio mixer
nullptr // audio processing
);
audioProcessingModule);
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
}
return self;