blob: 84c5f020b503f26bf6e5ac996f876d89ac654496 [file] [log] [blame]
Jon Hjelleda99da82016-01-20 13:40:30 -08001/*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei317a1f02019-09-17 17:06:18 +020011#include <memory>
12
magjedb8853ca2017-08-29 03:57:22 -070013#import "RTCPeerConnectionFactory+Native.h"
tkchin9eeb6242016-04-27 01:54:20 -070014#import "RTCPeerConnectionFactory+Private.h"
Yura Yaroshevichbf567122018-01-02 13:33:16 +030015#import "RTCPeerConnectionFactoryOptions+Private.h"
Jon Hjelleda99da82016-01-20 13:40:30 -080016
tkchind4bfbfc2016-08-30 11:56:05 -070017#import "RTCAudioSource+Private.h"
tkchin9eeb6242016-04-27 01:54:20 -070018#import "RTCAudioTrack+Private.h"
tkchind4bfbfc2016-08-30 11:56:05 -070019#import "RTCMediaConstraints+Private.h"
tkchin9eeb6242016-04-27 01:54:20 -070020#import "RTCMediaStream+Private.h"
21#import "RTCPeerConnection+Private.h"
22#import "RTCVideoSource+Private.h"
23#import "RTCVideoTrack+Private.h"
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020024#import "base/RTCLogging.h"
25#import "base/RTCVideoDecoderFactory.h"
26#import "base/RTCVideoEncoderFactory.h"
Artem Titov63ee39d2022-05-13 14:46:42 +000027#import "helpers/NSString+StdString.h"
Byoungchan Lee32c4ecb2021-10-28 15:49:46 +090028#include "rtc_base/checks.h"
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -070029#include "sdk/objc/native/api/network_monitor_factory.h"
Yury Yaroshevich19a6e942022-03-11 09:22:08 +010030#include "sdk/objc/native/api/ssl_certificate_verifier.h"
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -070031#include "system_wrappers/include/field_trial.h"
32
Mirko Bonadei2fdf2222022-06-24 10:00:49 +020033#include "api/audio_codecs/builtin_audio_decoder_factory.h"
34#include "api/audio_codecs/builtin_audio_encoder_factory.h"
Danil Chapovalov4ba04b72019-06-26 15:49:47 +020035#include "api/rtc_event_log/rtc_event_log_factory.h"
Danil Chapovalovaaa11432019-05-17 13:20:14 +020036#include "api/task_queue/default_task_queue_factory.h"
Erik Språngceb44952020-09-22 11:36:35 +020037#include "api/transport/field_trial_based_config.h"
Mirko Bonadei2fdf2222022-06-24 10:00:49 +020038#import "components/video_codec/RTCVideoDecoderFactoryH264.h"
39#import "components/video_codec/RTCVideoEncoderFactoryH264.h"
40#include "media/engine/webrtc_media_engine.h"
41#include "modules/audio_device/include/audio_device.h"
42#include "modules/audio_processing/include/audio_processing.h"
Anders Carlsson3ff50fb2018-02-01 15:47:05 +010043
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020044#include "sdk/objc/native/api/video_decoder_factory.h"
45#include "sdk/objc/native/api/video_encoder_factory.h"
46#include "sdk/objc/native/src/objc_video_decoder_factory.h"
47#include "sdk/objc/native/src/objc_video_encoder_factory.h"
kwibergbfefb032016-05-01 14:53:46 -070048
Peter Hanspers8d95e3b2018-05-15 10:22:36 +020049#if defined(WEBRTC_IOS)
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020050#import "sdk/objc/native/api/audio_device_module.h"
Peter Hanspers8d95e3b2018-05-15 10:22:36 +020051#endif
52
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020053@implementation RTC_OBJC_TYPE (RTCPeerConnectionFactory) {
danilchape9021a32016-05-17 01:52:02 -070054 std::unique_ptr<rtc::Thread> _networkThread;
kwibergbfefb032016-05-01 14:53:46 -070055 std::unique_ptr<rtc::Thread> _workerThread;
danilchape9021a32016-05-17 01:52:02 -070056 std::unique_ptr<rtc::Thread> _signalingThread;
tkchinfce0e2c2016-08-30 12:58:11 -070057 BOOL _hasStartedAecDump;
Jon Hjelleda99da82016-01-20 13:40:30 -080058}
59
60@synthesize nativeFactory = _nativeFactory;
61
Peter Hanspers8d95e3b2018-05-15 10:22:36 +020062- (rtc::scoped_refptr<webrtc::AudioDeviceModule>)audioDeviceModule {
63#if defined(WEBRTC_IOS)
64 return webrtc::CreateAudioDeviceModule();
65#else
66 return nullptr;
67#endif
68}
69
Jon Hjelleda99da82016-01-20 13:40:30 -080070- (instancetype)init {
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020071 return [self
72 initWithNativeAudioEncoderFactory:webrtc::CreateBuiltinAudioEncoderFactory()
73 nativeAudioDecoderFactory:webrtc::CreateBuiltinAudioDecoderFactory()
74 nativeVideoEncoderFactory:webrtc::ObjCToNativeVideoEncoderFactory([[RTC_OBJC_TYPE(
75 RTCVideoEncoderFactoryH264) alloc] init])
76 nativeVideoDecoderFactory:webrtc::ObjCToNativeVideoDecoderFactory([[RTC_OBJC_TYPE(
77 RTCVideoDecoderFactoryH264) alloc] init])
Niels Möller03486fc2022-04-25 10:46:59 +020078 audioDeviceModule:[self audioDeviceModule].get()
Niels Möller938bc332020-06-10 17:36:17 +020079 audioProcessingModule:nullptr];
kthelgasonfb143122017-07-25 07:55:58 -070080}
81
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020082- (instancetype)
83 initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
Niels Möller938bc332020-06-10 17:36:17 +020084 decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory {
Anders Carlsson7e042812017-10-05 16:55:38 +020085 std::unique_ptr<webrtc::VideoEncoderFactory> native_encoder_factory;
86 std::unique_ptr<webrtc::VideoDecoderFactory> native_decoder_factory;
87 if (encoderFactory) {
Anders Carlsson3ff50fb2018-02-01 15:47:05 +010088 native_encoder_factory = webrtc::ObjCToNativeVideoEncoderFactory(encoderFactory);
Anders Carlsson7e042812017-10-05 16:55:38 +020089 }
90 if (decoderFactory) {
Anders Carlsson3ff50fb2018-02-01 15:47:05 +010091 native_decoder_factory = webrtc::ObjCToNativeVideoDecoderFactory(decoderFactory);
Anders Carlsson7e042812017-10-05 16:55:38 +020092 }
magjedb8853ca2017-08-29 03:57:22 -070093 return [self initWithNativeAudioEncoderFactory:webrtc::CreateBuiltinAudioEncoderFactory()
94 nativeAudioDecoderFactory:webrtc::CreateBuiltinAudioDecoderFactory()
Anders Carlsson7e042812017-10-05 16:55:38 +020095 nativeVideoEncoderFactory:std::move(native_encoder_factory)
Sean Rosenbaume5c42652017-10-30 07:50:17 -070096 nativeVideoDecoderFactory:std::move(native_decoder_factory)
Niels Möller03486fc2022-04-25 10:46:59 +020097 audioDeviceModule:[self audioDeviceModule].get()
Niels Möller938bc332020-06-10 17:36:17 +020098 audioProcessingModule:nullptr];
magjedb8853ca2017-08-29 03:57:22 -070099}
Anders Carlsson7e042812017-10-05 16:55:38 +0200100- (instancetype)initNative {
kthelgasonfb143122017-07-25 07:55:58 -0700101 if (self = [super init]) {
danilchape9021a32016-05-17 01:52:02 -0700102 _networkThread = rtc::Thread::CreateWithSocketServer();
Yura Yaroshevichcef06502018-05-01 00:58:43 +0300103 _networkThread->SetName("network_thread", _networkThread.get());
danilchape9021a32016-05-17 01:52:02 -0700104 BOOL result = _networkThread->Start();
Byoungchan Lee32c4ecb2021-10-28 15:49:46 +0900105 RTC_DCHECK(result) << "Failed to start network thread.";
danilchape9021a32016-05-17 01:52:02 -0700106
107 _workerThread = rtc::Thread::Create();
Yura Yaroshevichcef06502018-05-01 00:58:43 +0300108 _workerThread->SetName("worker_thread", _workerThread.get());
Jon Hjelleda99da82016-01-20 13:40:30 -0800109 result = _workerThread->Start();
Byoungchan Lee32c4ecb2021-10-28 15:49:46 +0900110 RTC_DCHECK(result) << "Failed to start worker thread.";
Jon Hjelleda99da82016-01-20 13:40:30 -0800111
danilchape9021a32016-05-17 01:52:02 -0700112 _signalingThread = rtc::Thread::Create();
Yura Yaroshevichcef06502018-05-01 00:58:43 +0300113 _signalingThread->SetName("signaling_thread", _signalingThread.get());
danilchape9021a32016-05-17 01:52:02 -0700114 result = _signalingThread->Start();
Byoungchan Lee32c4ecb2021-10-28 15:49:46 +0900115 RTC_DCHECK(result) << "Failed to start signaling thread.";
Anders Carlsson7e042812017-10-05 16:55:38 +0200116 }
117 return self;
118}
119
120- (instancetype)initWithNoMedia {
121 if (self = [self initNative]) {
Danil Chapovalovaaa11432019-05-17 13:20:14 +0200122 webrtc::PeerConnectionFactoryDependencies dependencies;
123 dependencies.network_thread = _networkThread.get();
124 dependencies.worker_thread = _workerThread.get();
125 dependencies.signaling_thread = _signalingThread.get();
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -0700126 if (webrtc::field_trial::IsEnabled("WebRTC-Network-UseNWPathMonitor")) {
127 dependencies.network_monitor_factory = webrtc::CreateNetworkMonitorFactory();
128 }
Danil Chapovalovaaa11432019-05-17 13:20:14 +0200129 _nativeFactory = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
Anders Carlsson7e042812017-10-05 16:55:38 +0200130 NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
131 }
132 return self;
133}
134
135- (instancetype)initWithNativeAudioEncoderFactory:
136 (rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
137 nativeAudioDecoderFactory:
138 (rtc::scoped_refptr<webrtc::AudioDecoderFactory>)audioDecoderFactory
139 nativeVideoEncoderFactory:
140 (std::unique_ptr<webrtc::VideoEncoderFactory>)videoEncoderFactory
141 nativeVideoDecoderFactory:
Sean Rosenbaume5c42652017-10-30 07:50:17 -0700142 (std::unique_ptr<webrtc::VideoDecoderFactory>)videoDecoderFactory
Sebastian Jansson77c0a622019-04-23 10:24:03 +0200143 audioDeviceModule:(webrtc::AudioDeviceModule *)audioDeviceModule
Sam Zackrisson6124aac2017-11-13 14:56:02 +0100144 audioProcessingModule:
145 (rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule {
Piotr (Peter) Slatalae0c2e972018-10-08 09:43:21 -0700146 return [self initWithNativeAudioEncoderFactory:audioEncoderFactory
147 nativeAudioDecoderFactory:audioDecoderFactory
148 nativeVideoEncoderFactory:std::move(videoEncoderFactory)
149 nativeVideoDecoderFactory:std::move(videoDecoderFactory)
150 audioDeviceModule:audioDeviceModule
151 audioProcessingModule:audioProcessingModule
Niels Möller938bc332020-06-10 17:36:17 +0200152 networkControllerFactory:nullptr];
Sebastian Jansson77c0a622019-04-23 10:24:03 +0200153}
154- (instancetype)initWithNativeAudioEncoderFactory:
155 (rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
156 nativeAudioDecoderFactory:
157 (rtc::scoped_refptr<webrtc::AudioDecoderFactory>)audioDecoderFactory
158 nativeVideoEncoderFactory:
159 (std::unique_ptr<webrtc::VideoEncoderFactory>)videoEncoderFactory
160 nativeVideoDecoderFactory:
161 (std::unique_ptr<webrtc::VideoDecoderFactory>)videoDecoderFactory
162 audioDeviceModule:(webrtc::AudioDeviceModule *)audioDeviceModule
163 audioProcessingModule:
164 (rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule
165 networkControllerFactory:
166 (std::unique_ptr<webrtc::NetworkControllerFactoryInterface>)
Niels Möller938bc332020-06-10 17:36:17 +0200167 networkControllerFactory {
Anders Carlsson7e042812017-10-05 16:55:38 +0200168 if (self = [self initNative]) {
Piotr (Peter) Slatalae0c2e972018-10-08 09:43:21 -0700169 webrtc::PeerConnectionFactoryDependencies dependencies;
170 dependencies.network_thread = _networkThread.get();
171 dependencies.worker_thread = _workerThread.get();
172 dependencies.signaling_thread = _signalingThread.get();
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -0700173 if (webrtc::field_trial::IsEnabled("WebRTC-Network-UseNWPathMonitor")) {
174 dependencies.network_monitor_factory = webrtc::CreateNetworkMonitorFactory();
175 }
Danil Chapovalovaaa11432019-05-17 13:20:14 +0200176 dependencies.task_queue_factory = webrtc::CreateDefaultTaskQueueFactory();
Erik Språngceb44952020-09-22 11:36:35 +0200177 dependencies.trials = std::make_unique<webrtc::FieldTrialBasedConfig>();
Danil Chapovalovaaa11432019-05-17 13:20:14 +0200178 cricket::MediaEngineDependencies media_deps;
179 media_deps.adm = std::move(audioDeviceModule);
180 media_deps.task_queue_factory = dependencies.task_queue_factory.get();
181 media_deps.audio_encoder_factory = std::move(audioEncoderFactory);
182 media_deps.audio_decoder_factory = std::move(audioDecoderFactory);
183 media_deps.video_encoder_factory = std::move(videoEncoderFactory);
184 media_deps.video_decoder_factory = std::move(videoDecoderFactory);
185 if (audioProcessingModule) {
186 media_deps.audio_processing = std::move(audioProcessingModule);
187 } else {
188 media_deps.audio_processing = webrtc::AudioProcessingBuilder().Create();
189 }
Erik Språngceb44952020-09-22 11:36:35 +0200190 media_deps.trials = dependencies.trials.get();
Danil Chapovalovaaa11432019-05-17 13:20:14 +0200191 dependencies.media_engine = cricket::CreateMediaEngine(std::move(media_deps));
192 dependencies.call_factory = webrtc::CreateCallFactory();
193 dependencies.event_log_factory =
Mirko Bonadei317a1f02019-09-17 17:06:18 +0200194 std::make_unique<webrtc::RtcEventLogFactory>(dependencies.task_queue_factory.get());
Sebastian Jansson77c0a622019-04-23 10:24:03 +0200195 dependencies.network_controller_factory = std::move(networkControllerFactory);
Piotr (Peter) Slatalae0c2e972018-10-08 09:43:21 -0700196 _nativeFactory = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
Anders Carlsson7e042812017-10-05 16:55:38 +0200197 NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
198 }
199 return self;
Anders Carlsson7e042812017-10-05 16:55:38 +0200200}
201
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200202- (RTC_OBJC_TYPE(RTCAudioSource) *)audioSourceWithConstraints:
203 (nullable RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints {
tkchind4bfbfc2016-08-30 11:56:05 -0700204 std::unique_ptr<webrtc::MediaConstraints> nativeConstraints;
205 if (constraints) {
206 nativeConstraints = constraints.nativeConstraints;
207 }
Niels Möller2d02e082018-05-21 11:23:35 +0200208 cricket::AudioOptions options;
209 CopyConstraintsIntoAudioOptions(nativeConstraints.get(), &options);
210
tkchind4bfbfc2016-08-30 11:56:05 -0700211 rtc::scoped_refptr<webrtc::AudioSourceInterface> source =
Niels Möller2d02e082018-05-21 11:23:35 +0200212 _nativeFactory->CreateAudioSource(options);
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200213 return [[RTC_OBJC_TYPE(RTCAudioSource) alloc] initWithFactory:self nativeAudioSource:source];
tkchind4bfbfc2016-08-30 11:56:05 -0700214}
215
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200216- (RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrackWithTrackId:(NSString *)trackId {
217 RTC_OBJC_TYPE(RTCAudioSource) *audioSource = [self audioSourceWithConstraints:nil];
tkchind4bfbfc2016-08-30 11:56:05 -0700218 return [self audioTrackWithSource:audioSource trackId:trackId];
219}
220
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200221- (RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrackWithSource:(RTC_OBJC_TYPE(RTCAudioSource) *)source
222 trackId:(NSString *)trackId {
223 return [[RTC_OBJC_TYPE(RTCAudioTrack) alloc] initWithFactory:self source:source trackId:trackId];
tkchind4bfbfc2016-08-30 11:56:05 -0700224}
225
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200226- (RTC_OBJC_TYPE(RTCVideoSource) *)videoSource {
227 return [[RTC_OBJC_TYPE(RTCVideoSource) alloc] initWithFactory:self
228 signalingThread:_signalingThread.get()
229 workerThread:_workerThread.get()];
magjedabb84b82017-03-28 01:56:41 -0700230}
231
Saúl Ibarra Corretgé4d0760e2021-08-06 16:17:12 +0200232- (RTC_OBJC_TYPE(RTCVideoSource) *)videoSourceForScreenCast:(BOOL)forScreenCast {
233 return [[RTC_OBJC_TYPE(RTCVideoSource) alloc] initWithFactory:self
234 signalingThread:_signalingThread.get()
235 workerThread:_workerThread.get()
236 isScreenCast:forScreenCast];
237}
238
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200239- (RTC_OBJC_TYPE(RTCVideoTrack) *)videoTrackWithSource:(RTC_OBJC_TYPE(RTCVideoSource) *)source
240 trackId:(NSString *)trackId {
241 return [[RTC_OBJC_TYPE(RTCVideoTrack) alloc] initWithFactory:self source:source trackId:trackId];
Tze Kwang Chinf3cb49f2016-03-22 10:57:40 -0700242}
243
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200244- (RTC_OBJC_TYPE(RTCMediaStream) *)mediaStreamWithStreamId:(NSString *)streamId {
245 return [[RTC_OBJC_TYPE(RTCMediaStream) alloc] initWithFactory:self streamId:streamId];
Tze Kwang Chinf3cb49f2016-03-22 10:57:40 -0700246}
247
Yura Yaroshevichd140c8f2021-03-02 23:25:10 +0300248- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200249 peerConnectionWithConfiguration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
250 constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
251 delegate:
252 (nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate {
253 return [[RTC_OBJC_TYPE(RTCPeerConnection) alloc] initWithFactory:self
254 configuration:configuration
255 constraints:constraints
Yury Yaroshevich19a6e942022-03-11 09:22:08 +0100256 certificateVerifier:nil
257 delegate:delegate];
258}
259
260- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
261 peerConnectionWithConfiguration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
262 constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
263 certificateVerifier:
264 (id<RTC_OBJC_TYPE(RTCSSLCertificateVerifier)>)certificateVerifier
265 delegate:
266 (nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate {
267 return [[RTC_OBJC_TYPE(RTCPeerConnection) alloc] initWithFactory:self
268 configuration:configuration
269 constraints:constraints
270 certificateVerifier:certificateVerifier
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200271 delegate:delegate];
Tze Kwang Chinf3cb49f2016-03-22 10:57:40 -0700272}
273
Yura Yaroshevichd140c8f2021-03-02 23:25:10 +0300274- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200275 peerConnectionWithDependencies:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
276 constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
Jonas Oreland285f83d2020-02-07 10:30:08 +0100277 dependencies:(std::unique_ptr<webrtc::PeerConnectionDependencies>)dependencies
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200278 delegate:(id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate {
279 return [[RTC_OBJC_TYPE(RTCPeerConnection) alloc] initWithDependencies:self
280 configuration:configuration
281 constraints:constraints
282 dependencies:std::move(dependencies)
283 delegate:delegate];
Jonas Oreland285f83d2020-02-07 10:30:08 +0100284}
285
Mirko Bonadeia81e9c82020-05-04 16:14:32 +0200286- (void)setOptions:(nonnull RTC_OBJC_TYPE(RTCPeerConnectionFactoryOptions) *)options {
Yura Yaroshevichbf567122018-01-02 13:33:16 +0300287 RTC_DCHECK(options != nil);
288 _nativeFactory->SetOptions(options.nativeOptions);
289}
290
Magnus Jedvertf83dc8b2017-08-29 09:49:43 +0000291- (BOOL)startAecDumpWithFilePath:(NSString *)filePath
292 maxSizeInBytes:(int64_t)maxSizeInBytes {
tkchinfce0e2c2016-08-30 12:58:11 -0700293 RTC_DCHECK(filePath.length);
294 RTC_DCHECK_GT(maxSizeInBytes, 0);
295
296 if (_hasStartedAecDump) {
297 RTCLogError(@"Aec dump already started.");
298 return NO;
299 }
Niels Möllere4ac7232019-06-24 09:39:56 +0200300 FILE *f = fopen(filePath.UTF8String, "wb");
301 if (!f) {
302 RTCLogError(@"Error opening file: %@. Error: %s", filePath, strerror(errno));
tkchinfce0e2c2016-08-30 12:58:11 -0700303 return NO;
304 }
Niels Möllere4ac7232019-06-24 09:39:56 +0200305 _hasStartedAecDump = _nativeFactory->StartAecDump(f, maxSizeInBytes);
tkchinfce0e2c2016-08-30 12:58:11 -0700306 return _hasStartedAecDump;
307}
308
309- (void)stopAecDump {
310 _nativeFactory->StopAecDump();
311 _hasStartedAecDump = NO;
312}
313
Byoungchan Lee2b46a582022-06-21 09:19:34 +0900314- (rtc::Thread *)signalingThread {
315 return _signalingThread.get();
316}
317
318- (rtc::Thread *)workerThread {
319 return _workerThread.get();
320}
321
Jon Hjelleda99da82016-01-20 13:40:30 -0800322@end