blob: 81f09d9b7c64abec040a1e6b88228ed37efadc36 [file] [log] [blame]
tkchin9eeb6242016-04-27 01:54:20 -07001# Copyright 2016 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
kthelgasonebc34e72016-09-15 04:30:18 -070010if (is_ios) {
oprypin45197522017-06-22 01:47:20 -070011 import("//build/config/ios/ios_sdk.gni")
Mirko Bonadei2ff3f492018-11-22 09:00:13 +010012 import("//build/config/ios/rules.gni")
kthelgasonebc34e72016-09-15 04:30:18 -070013}
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020014if (is_mac) {
15 import("//build/config/mac/rules.gni")
kthelgason2f088792017-05-30 01:48:47 -070016}
17
kjellander6ceab082016-10-28 05:44:03 -070018group("sdk") {
Henrik Kjellandera7d0df72017-06-27 08:56:46 +020019 public_deps = []
20 if (!build_with_chromium) {
21 if (is_android) {
22 public_deps += [ "android" ]
23 }
24 if (is_ios) {
kthelgason36d658d2017-08-24 05:43:45 -070025 public_deps += [ ":framework_objc" ]
Henrik Kjellandera7d0df72017-06-27 08:56:46 +020026 }
kjellander6ceab082016-10-28 05:44:03 -070027 }
28}
29
Mirko Bonadei86d053c2019-10-17 21:32:04 +020030rtc_library("media_constraints") {
Niels Möllerdac03d92019-02-13 08:52:27 +010031 sources = [
32 "media_constraints.cc",
33 "media_constraints.h",
34 ]
35 deps = [
36 "../api:audio_options_api",
37 "../api:libjingle_peerconnection_api",
Niels Möllerdac03d92019-02-13 08:52:27 +010038 ]
Mirko Bonadei2dcf3482020-06-05 14:30:41 +020039 absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
Niels Möllerdac03d92019-02-13 08:52:27 +010040}
41
Mirko Bonadei86d053c2019-10-17 21:32:04 +020042rtc_library("sdk_tests") {
Niels Möllerdac03d92019-02-13 08:52:27 +010043 testonly = true
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +010044 sources = [ "media_constraints_unittest.cc" ]
Niels Möllerdac03d92019-02-13 08:52:27 +010045 deps = [
46 ":media_constraints",
47 "../test:test_support",
48 ]
49}
50
kthelgasoncc2d1c62016-11-09 07:44:27 -080051if (is_ios || is_mac) {
kthelgason36d658d2017-08-24 05:43:45 -070052 config("common_config_objc") {
kjellander080a1e32016-05-25 11:37:11 -070053 include_dirs = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020054 "objc",
55
56 # This is needed so that framework headers can include base headers
57 # without pathname (so it works from within the framework module).
58 "objc/base",
kjellander080a1e32016-05-25 11:37:11 -070059 ]
Kári Tristan Helgason47d3a012017-10-24 15:28:51 +020060 cflags = [
Jiawei Ou4aeb35b2018-11-09 13:55:45 -080061 "-Wimplicit-retain-self",
Kári Tristan Helgason47d3a012017-10-24 15:28:51 +020062 "-Wstrict-overflow",
63 "-Wmissing-field-initializers",
64 ]
Artem Titarenko17ad64e2018-09-19 17:53:59 +020065
66 if (use_clang_coverage) {
67 configs = [ "//build/config/coverage:default_coverage" ]
68 }
kjellander080a1e32016-05-25 11:37:11 -070069 }
70
Anders Carlsson358f2e02018-06-04 10:24:37 +020071 config("used_from_extension") {
72 if (is_ios && rtc_apprtcmobile_broadcast_extension) {
73 cflags = [ "-fapplication-extension" ]
74 }
75 }
76
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020077 # TODO(bugs.webrtc.org/9627): Remove this when unused. Targets should depend on base_objc
78 # or helpers_objc directly instead.
Mirko Bonadei86d053c2019-10-17 21:32:04 +020079 rtc_library("common_objc") {
Mirko Bonadei2ad8c432018-08-09 10:54:40 +020080 visibility = [ "*" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020081
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +010082 sources = [ "objc/helpers/noop.mm" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020083
84 public_configs = [ ":common_config_objc" ]
85
86 deps = [
87 ":base_objc",
88 ":helpers_objc",
89 ]
90 }
91
Mirko Bonadei86d053c2019-10-17 21:32:04 +020092 rtc_library("base_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020093 visibility = [ "*" ]
94 sources = [
95 "objc/base/RTCCodecSpecificInfo.h",
96 "objc/base/RTCEncodedImage.h",
97 "objc/base/RTCEncodedImage.m",
98 "objc/base/RTCI420Buffer.h",
99 "objc/base/RTCLogging.h",
100 "objc/base/RTCLogging.mm",
101 "objc/base/RTCMacros.h",
102 "objc/base/RTCMutableI420Buffer.h",
103 "objc/base/RTCMutableYUVPlanarBuffer.h",
Yury Yaroshevich19a6e942022-03-11 09:22:08 +0100104 "objc/base/RTCSSLCertificateVerifier.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200105 "objc/base/RTCVideoCapturer.h",
106 "objc/base/RTCVideoCapturer.m",
107 "objc/base/RTCVideoCodecInfo.h",
108 "objc/base/RTCVideoCodecInfo.m",
109 "objc/base/RTCVideoDecoder.h",
110 "objc/base/RTCVideoDecoderFactory.h",
111 "objc/base/RTCVideoEncoder.h",
112 "objc/base/RTCVideoEncoderFactory.h",
113 "objc/base/RTCVideoEncoderQpThresholds.h",
114 "objc/base/RTCVideoEncoderQpThresholds.m",
115 "objc/base/RTCVideoEncoderSettings.h",
116 "objc/base/RTCVideoEncoderSettings.m",
117 "objc/base/RTCVideoFrame.h",
118 "objc/base/RTCVideoFrame.mm",
119 "objc/base/RTCVideoFrameBuffer.h",
120 "objc/base/RTCVideoRenderer.h",
121 "objc/base/RTCYUVPlanarBuffer.h",
tkchin9eeb6242016-04-27 01:54:20 -0700122 ]
denicijad2088152017-04-28 02:14:54 -0700123
mbonadei1e060c62017-04-21 00:02:02 -0700124 deps = [
Artem Titov94b57c02019-03-21 13:35:10 +0100125 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100126 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200127 "../rtc_base:logging",
mbonadei1e060c62017-04-21 00:02:02 -0700128 ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200129 configs += [
130 "..:common_objc",
131 ":used_from_extension",
132 ]
kthelgasonc0977102017-04-24 00:57:16 -0700133
kthelgason36d658d2017-08-24 05:43:45 -0700134 public_configs = [ ":common_config_objc" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200135 }
136
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200137 rtc_library("helpers_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200138 sources = [
139 "objc/helpers/AVCaptureSession+DevicePosition.h",
140 "objc/helpers/AVCaptureSession+DevicePosition.mm",
141 "objc/helpers/NSString+StdString.h",
142 "objc/helpers/NSString+StdString.mm",
143 "objc/helpers/RTCDispatcher+Private.h",
144 "objc/helpers/RTCDispatcher.h",
145 "objc/helpers/RTCDispatcher.m",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200146 "objc/helpers/scoped_cftyperef.h",
147 ]
148
149 deps = [
150 ":base_objc",
151 "../rtc_base:checks",
152 ]
153
Ali Tofigh6364d082022-03-14 13:32:04 +0100154 absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
155
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200156 frameworks = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200157 "AVFoundation.framework",
158 "CoreMedia.framework",
159 ]
160
161 configs += [
162 "..:common_objc",
163 ":used_from_extension",
164 ]
165
166 public_configs = [ ":common_config_objc" ]
denicijad2088152017-04-28 02:14:54 -0700167
kjellander3bcedd32016-06-08 01:14:15 -0700168 if (is_ios) {
169 sources += [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200170 "objc/helpers/RTCCameraPreviewView.h",
171 "objc/helpers/RTCCameraPreviewView.m",
172 "objc/helpers/UIDevice+RTCDevice.h",
173 "objc/helpers/UIDevice+RTCDevice.mm",
174 ]
175 }
176 }
177
178 if (!build_with_chromium) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200179 rtc_library("callback_logger_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200180 sources = [
181 "objc/api/logging/RTCCallbackLogger.h",
182 "objc/api/logging/RTCCallbackLogger.mm",
183 ]
184
185 deps = [
186 ":base_objc",
Ali Tofigh6364d082022-03-14 13:32:04 +0100187 ":helpers_objc",
Artem Titov94b57c02019-03-21 13:35:10 +0100188 "../rtc_base",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200189 "../rtc_base:checks",
190 "../rtc_base:logging",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200191 ]
192
193 configs += [
194 "..:common_objc",
195 ":used_from_extension",
kjellander3bcedd32016-06-08 01:14:15 -0700196 ]
Ali Tofigh6364d082022-03-14 13:32:04 +0100197
198 absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
denicijad2088152017-04-28 02:14:54 -0700199 }
200
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200201 rtc_library("file_logger_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200202 sources = [
203 "objc/api/peerconnection/RTCFileLogger.h",
204 "objc/api/peerconnection/RTCFileLogger.mm",
205 ]
206
207 deps = [
208 ":base_objc",
Artem Titov94b57c02019-03-21 13:35:10 +0100209 "../rtc_base",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200210 "../rtc_base:checks",
211 "../rtc_base:logging",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200212 ]
213
214 configs += [
215 "..:common_objc",
216 ":used_from_extension",
kthelgason2f088792017-05-30 01:48:47 -0700217 ]
218 }
219 }
220
mbonadei2c8ac1b2017-05-31 05:14:26 -0700221 if (!build_with_chromium) {
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100222 if (is_ios) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200223 rtc_library("native_api_audio_device_module") {
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200224 visibility = [ "*" ]
225
226 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200227 "objc/native/api/audio_device_module.h",
228 "objc/native/api/audio_device_module.mm",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200229 ]
230
231 deps = [
232 ":audio_device",
233 "../modules/audio_device:audio_device_api",
234 "../modules/audio_device:audio_device_generic",
235 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200236 "../rtc_base:logging",
Florent Castellif86f6f92022-04-05 02:54:12 +0200237 "../rtc_base:refcount",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200238 "../rtc_base:rtc_base_approved",
239 "../system_wrappers",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200240 ]
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200241 }
242
243 rtc_source_set("audio_session_observer") {
244 visibility = [ ":*" ]
245
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +0100246 sources = [ "objc/native/src/audio/audio_session_observer.h" ]
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200247
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100248 deps = [
249 "../rtc_base",
250 "../rtc_base:threading",
251 ]
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200252 }
253
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200254 rtc_library("audio_device") {
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200255 visibility = [ "*" ]
256
257 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200258 "objc/native/src/audio/audio_device_ios.h",
259 "objc/native/src/audio/audio_device_ios.mm",
260 "objc/native/src/audio/audio_device_module_ios.h",
261 "objc/native/src/audio/audio_device_module_ios.mm",
262 "objc/native/src/audio/helpers.h",
263 "objc/native/src/audio/helpers.mm",
264 "objc/native/src/audio/voice_processing_audio_unit.h",
265 "objc/native/src/audio/voice_processing_audio_unit.mm",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200266 ]
267
268 deps = [
269 ":audio_objc",
270 ":audio_session_observer",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200271 ":base_objc",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200272 "../api:array_view",
Danil Chapovalova6cb1502019-06-27 15:16:34 +0200273 "../api/task_queue",
274 "../api/task_queue:default_task_queue_factory",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200275 "../modules/audio_device:audio_device_api",
276 "../modules/audio_device:audio_device_buffer",
277 "../modules/audio_device:audio_device_generic",
Artem Titov94b57c02019-03-21 13:35:10 +0100278 "../rtc_base",
Florent Castellibddfe022022-04-04 15:03:10 +0200279 "../rtc_base:atomicops",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200280 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200281 "../rtc_base:logging",
Florent Castelli4467ad72022-04-04 15:18:46 +0200282 "../rtc_base:macromagic",
Florent Castellif86f6f92022-04-05 02:54:12 +0200283 "../rtc_base:refcount",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100284 "../rtc_base:threading",
Kári Tristan Helgasonf49429d2019-03-28 11:03:27 +0100285 "../system_wrappers:field_trial",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200286 "../system_wrappers:metrics",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200287 ]
Mirko Bonadei2dcf3482020-06-05 14:30:41 +0200288 absl_deps = [ "//third_party/abseil-cpp/absl/base:core_headers" ]
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200289
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200290 frameworks = [ "AudioToolbox.framework" ]
Peter Hanspers8d95e3b2018-05-15 10:22:36 +0200291 }
292
Joe Chen0b3a6e32019-12-26 23:01:42 -0800293 # This target exists to expose :audio_session_objc and
294 # :audio_session_delegate_adapter_objc for backward compatibility,
295 # and should be deprecated.
296 group("audio_objc") {
297 public_deps = [ # no-presubmit-check TODO(webrtc:11238)
298 ":audio_session_delegate_adapter_objc",
299 ":audio_session_objc",
300 ]
301 }
302
303 rtc_library("audio_session_delegate_adapter_objc") {
304 sources = [
305 "objc/components/audio/RTCNativeAudioSessionDelegateAdapter.h",
306 "objc/components/audio/RTCNativeAudioSessionDelegateAdapter.mm",
307 ]
308
309 configs += [
310 "..:common_objc",
311 ":used_from_extension",
312 ]
313
314 public_configs = [ ":common_config_objc" ]
315
316 deps = [
317 ":audio_session_objc",
318 ":audio_session_observer",
319 ":base_objc",
320 ]
321 }
322
323 rtc_library("audio_session_objc") {
Joe Chen3b19b272020-01-09 08:31:06 -0800324 visibility = [ "*" ]
325
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100326 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200327 "objc/components/audio/RTCAudioSession+Configuration.mm",
328 "objc/components/audio/RTCAudioSession+Private.h",
329 "objc/components/audio/RTCAudioSession.h",
330 "objc/components/audio/RTCAudioSession.mm",
331 "objc/components/audio/RTCAudioSessionConfiguration.h",
332 "objc/components/audio/RTCAudioSessionConfiguration.m",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100333 ]
Joe Chen0b3a6e32019-12-26 23:01:42 -0800334
Anders Carlsson358f2e02018-06-04 10:24:37 +0200335 configs += [
336 "..:common_objc",
337 ":used_from_extension",
338 ]
denicija59ee91b2017-06-05 05:48:47 -0700339
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100340 public_configs = [ ":common_config_objc" ]
Anders Carlsson8ecfd802017-09-15 14:07:30 +0200341
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200342 frameworks = [ "AVFoundation.framework" ]
Jiawei Ouc9e6b962018-10-09 12:33:06 -0700343
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100344 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200345 ":base_objc",
346 ":helpers_objc",
Artem Titov94b57c02019-03-21 13:35:10 +0100347 "../rtc_base",
Florent Castellibddfe022022-04-04 15:03:10 +0200348 "../rtc_base:atomicops",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100349 "../rtc_base:checks",
350 "../rtc_base:rtc_base_approved",
Niels Möller072c0082021-02-15 16:30:44 +0100351 "../rtc_base/synchronization:mutex",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100352 ]
Byoungchan Lee0a54e7a2021-09-06 22:32:52 +0900353
354 absl_deps = [ "//third_party/abseil-cpp/absl/base:core_headers" ]
denicija59ee91b2017-06-05 05:48:47 -0700355 }
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -0700356
357 rtc_source_set("network_monitor_observer") {
358 visibility = [ ":*" ]
359
360 sources = [ "objc/native/src/network_monitor_observer.h" ]
361
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100362 deps = [
363 "../rtc_base",
364 "../rtc_base:network_constants",
Florent Castelli57aa81b2022-04-04 17:14:02 +0200365 "../rtc_base:stringutils",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100366 "../rtc_base:threading",
367 ]
Ali Tofigh7fa90572022-03-17 15:47:49 +0100368
369 absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -0700370 }
371
372 rtc_library("network_monitor_objc") {
373 visibility = [ "*" ]
374
375 sources = [
376 "objc/components/network/RTCNetworkMonitor+Private.h",
377 "objc/components/network/RTCNetworkMonitor.h",
378 "objc/components/network/RTCNetworkMonitor.mm",
379 ]
380
381 configs += [ ":used_from_extension" ]
382
383 frameworks = [ "Network.framework" ]
384
385 deps = [
386 ":base_objc",
387 ":helpers_objc",
388 ":network_monitor_observer",
Ali Tofigh7fa90572022-03-17 15:47:49 +0100389 "../rtc_base:stringutils",
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -0700390 "../rtc_base/system:gcd_helpers",
391 ]
392 }
denicija59ee91b2017-06-05 05:48:47 -0700393 }
zhihuanga4c113a2017-06-28 14:05:44 -0700394
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200395 rtc_library("videosource_objc") {
zhihuanga4c113a2017-06-28 14:05:44 -0700396 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200397 "objc/api/peerconnection/RTCVideoSource+Private.h",
398 "objc/api/peerconnection/RTCVideoSource.h",
399 "objc/api/peerconnection/RTCVideoSource.mm",
zhihuanga4c113a2017-06-28 14:05:44 -0700400 ]
401
402 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200403 ":base_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100404 ":mediasource_objc",
405 ":native_video",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100406 ":videoframebuffer_objc",
zhihuanga4c113a2017-06-28 14:05:44 -0700407 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200408 "../api:media_stream_interface",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200409 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200410 "../api/video:video_rtp_headers",
zhihuanga4c113a2017-06-28 14:05:44 -0700411 "../common_video",
412 "../media:rtc_media_base",
Harald Alvestrande5a73f52022-03-28 12:06:34 +0000413 "../pc:video_track_source_proxy",
Artem Titov94b57c02019-03-21 13:35:10 +0100414 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100415 "../rtc_base:checks",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100416 "../rtc_base:threading",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100417 "//third_party/libyuv",
zhihuanga4c113a2017-06-28 14:05:44 -0700418 ]
419
Anders Carlsson358f2e02018-06-04 10:24:37 +0200420 configs += [
421 "..:common_objc",
422 ":used_from_extension",
423 ]
zhihuanga4c113a2017-06-28 14:05:44 -0700424 }
425
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200426 rtc_library("videoframebuffer_objc") {
Mirko Bonadei2ad8c432018-08-09 10:54:40 +0200427 visibility = [ "*" ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100428 sources = [
Anders Carlsson4e5af962018-09-03 14:44:50 +0200429 "objc/api/video_frame_buffer/RTCNativeI420Buffer+Private.h",
430 "objc/api/video_frame_buffer/RTCNativeI420Buffer.h",
431 "objc/api/video_frame_buffer/RTCNativeI420Buffer.mm",
432 "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.h",
433 "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200434 "objc/components/video_frame_buffer/RTCCVPixelBuffer.h",
435 "objc/components/video_frame_buffer/RTCCVPixelBuffer.mm",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100436 ]
437 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200438 ":base_objc",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200439 "../rtc_base:logging",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200440 "//api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200441 "//api/video:video_rtp_headers",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100442 "//common_video",
443 "//rtc_base:checks",
444 "//rtc_base:rtc_base_approved",
445 "//third_party/libyuv",
446 ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200447 configs += [
448 "..:common_objc",
449 ":used_from_extension",
450 ]
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200451 frameworks = [
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100452 "VideoToolbox.framework",
Oleh Prypinb3f78de2019-07-18 22:25:48 +0200453 "CoreGraphics.framework",
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100454 "CoreVideo.framework",
455 ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100456 }
457
Jordan Rose53d3fc92021-07-06 12:16:41 -0700458 rtc_library("opengl_objc") {
kthelgason2f088792017-05-30 01:48:47 -0700459 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200460 "objc/components/renderer/opengl/RTCDefaultShader.h",
461 "objc/components/renderer/opengl/RTCDefaultShader.mm",
462 "objc/components/renderer/opengl/RTCI420TextureCache.h",
463 "objc/components/renderer/opengl/RTCI420TextureCache.mm",
464 "objc/components/renderer/opengl/RTCOpenGLDefines.h",
465 "objc/components/renderer/opengl/RTCShader.h",
466 "objc/components/renderer/opengl/RTCShader.mm",
467 "objc/components/renderer/opengl/RTCVideoViewShading.h",
kthelgason2f088792017-05-30 01:48:47 -0700468 ]
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200469 frameworks = [ "CoreVideo.framework" ]
denicijad2088152017-04-28 02:14:54 -0700470 if (is_ios) {
denicija070d5e32017-02-26 11:44:13 -0800471 sources += [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200472 "objc/components/renderer/opengl/RTCNV12TextureCache.h",
473 "objc/components/renderer/opengl/RTCNV12TextureCache.m",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700474 ]
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200475 frameworks += [
mbonadei2c8ac1b2017-05-31 05:14:26 -0700476 "GLKit.framework",
477 "OpenGLES.framework",
478 "QuartzCore.framework",
479 ]
480 } else if (is_mac) {
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200481 frameworks += [
mbonadei2c8ac1b2017-05-31 05:14:26 -0700482 "CoreMedia.framework",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700483 "OpenGL.framework",
denicija070d5e32017-02-26 11:44:13 -0800484 ]
485 }
Mirko Bonadei6b09c452021-07-05 16:47:49 +0200486
487 # TODO(bugs.webrtc.org/12937): Remove OpenGL deprecation warning
488 # workaround.
Björn Terelius02768ae2021-07-02 16:19:32 +0200489 defines = [ "GLES_SILENCE_DEPRECATION" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700490
kthelgason2f088792017-05-30 01:48:47 -0700491 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200492 ":base_objc",
493 ":helpers_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100494 ":mediaconstraints_objc",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +0100495 ":native_video",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100496 ":videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100497 ":videosource_objc",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700498 "../api:libjingle_peerconnection_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200499 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200500 "../api/video:video_rtp_headers",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700501 "../common_video",
502 "../media:rtc_media_base",
Artem Titov94b57c02019-03-21 13:35:10 +0100503 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100504 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200505 "../rtc_base:logging",
tkchin9eeb6242016-04-27 01:54:20 -0700506 ]
Mirko Bonadei2dcf3482020-06-05 14:30:41 +0200507 absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700508
Anders Carlsson358f2e02018-06-04 10:24:37 +0200509 configs += [
510 "..:common_objc",
511 ":used_from_extension",
512 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800513 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800514
Jordan Rose53d3fc92021-07-06 12:16:41 -0700515 rtc_library("opengl_ui_objc") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000516 visibility = [ "*" ]
Jake Brombergfb7fd242021-06-14 13:44:25 -0700517 allow_poison = [
518 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
519 "default_task_queue",
520 ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700521 if (is_ios) {
522 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200523 "objc/components/renderer/opengl/RTCDisplayLinkTimer.h",
524 "objc/components/renderer/opengl/RTCDisplayLinkTimer.m",
525 "objc/components/renderer/opengl/RTCEAGLVideoView.h",
526 "objc/components/renderer/opengl/RTCEAGLVideoView.m",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700527 ]
Mirko Bonadei6b09c452021-07-05 16:47:49 +0200528
529 # TODO(bugs.webrtc.org/12937): Remove OpenGL deprecation warning
530 # workaround.
Björn Terelius02768ae2021-07-02 16:19:32 +0200531 defines = [ "GLES_SILENCE_DEPRECATION" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700532 }
533 if (is_mac) {
534 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200535 "objc/components/renderer/opengl/RTCNSGLVideoView.h",
536 "objc/components/renderer/opengl/RTCNSGLVideoView.m",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700537 ]
538 }
539 configs += [ "..:common_objc" ]
540 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200541 ":base_objc",
542 ":helpers_objc",
Jake Brombergfb7fd242021-06-14 13:44:25 -0700543 ":metal_objc",
Jordan Rose53d3fc92021-07-06 12:16:41 -0700544 ":opengl_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100545 ":videocapture_objc",
546 ":videoframebuffer_objc",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700547 ]
548 }
kthelgasonebc34e72016-09-15 04:30:18 -0700549
Jake Brombergfb7fd242021-06-14 13:44:25 -0700550 rtc_library("metal_objc") {
551 visibility = [ "*" ]
552 allow_poison = [
553 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
554 "default_task_queue",
555 ]
556 sources = [
557 "objc/components/renderer/metal/RTCMTLI420Renderer.h",
558 "objc/components/renderer/metal/RTCMTLI420Renderer.mm",
559 "objc/components/renderer/metal/RTCMTLNV12Renderer.h",
560 "objc/components/renderer/metal/RTCMTLNV12Renderer.mm",
561 "objc/components/renderer/metal/RTCMTLRGBRenderer.h",
562 "objc/components/renderer/metal/RTCMTLRGBRenderer.mm",
563 "objc/components/renderer/metal/RTCMTLRenderer+Private.h",
564 "objc/components/renderer/metal/RTCMTLRenderer.h",
565 "objc/components/renderer/metal/RTCMTLRenderer.mm",
566 ]
567 frameworks = [
568 "CoreVideo.framework",
569 "Metal.framework",
570 "MetalKit.framework",
571 ]
572 if (is_ios) {
573 sources += [
574 "objc/components/renderer/metal/RTCMTLVideoView.h",
575 "objc/components/renderer/metal/RTCMTLVideoView.m",
Danil Chapovalov41300af2019-07-10 12:44:43 +0200576 ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700577 }
Jake Brombergfb7fd242021-06-14 13:44:25 -0700578 if (is_mac) {
579 sources += [
580 "objc/components/renderer/metal/RTCMTLNSVideoView.h",
581 "objc/components/renderer/metal/RTCMTLNSVideoView.m",
582 ]
583 frameworks += [ "AppKit.framework" ]
584 }
585 deps = [
586 ":base_objc",
587 ":peerconnectionfactory_base_objc",
Jake Brombergfb7fd242021-06-14 13:44:25 -0700588 ":videoframebuffer_objc",
589 "../api/video:video_frame",
590 "../api/video:video_rtp_headers",
591 "../rtc_base:checks",
592 "../rtc_base:rtc_base_approved",
593 ]
594 configs += [ "..:common_objc" ]
595 public_configs = [ ":common_config_objc" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700596 }
597
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200598 # TODO(bugs.webrtc.org/9627): Remove this target.
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200599 rtc_library("videocapturebase_objc") {
Anders Carlsson73119182018-03-15 09:41:03 +0100600 visibility = [ "*" ]
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +0100601 sources = [ "objc/helpers/noop.mm" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100602
603 configs += [ "..:common_objc" ]
604
605 public_configs = [ ":common_config_objc" ]
606
607 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200608 ":base_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100609 ":videoframebuffer_objc",
610 ]
611 }
612
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200613 rtc_library("videocapture_objc") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000614 visibility = [ "*" ]
Anders Carlsson45340ca2019-01-14 14:23:23 +0100615 allow_poison = [ "audio_codecs" ] # TODO(bugs.webrtc.org/8396): Remove.
mbonadei2c8ac1b2017-05-31 05:14:26 -0700616 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200617 "objc/components/capturer/RTCCameraVideoCapturer.h",
618 "objc/components/capturer/RTCCameraVideoCapturer.m",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200619 "objc/components/capturer/RTCFileVideoCapturer.h",
620 "objc/components/capturer/RTCFileVideoCapturer.m",
zhihuanga4c113a2017-06-28 14:05:44 -0700621 ]
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200622 frameworks = [
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100623 "AVFoundation.framework",
624 "CoreVideo.framework",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200625 "QuartzCore.framework",
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100626 ]
zhihuanga4c113a2017-06-28 14:05:44 -0700627
zhihuanga4c113a2017-06-28 14:05:44 -0700628 configs += [ "..:common_objc" ]
629
kthelgason36d658d2017-08-24 05:43:45 -0700630 public_configs = [ ":common_config_objc" ]
zhihuanga4c113a2017-06-28 14:05:44 -0700631
zhihuanga4c113a2017-06-28 14:05:44 -0700632 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200633 ":base_objc",
634 ":helpers_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100635 ":videoframebuffer_objc",
Yura Yaroshevichebf739b2020-03-16 18:00:59 +0300636 "../rtc_base/system:gcd_helpers",
zhihuanga4c113a2017-06-28 14:05:44 -0700637 ]
zhihuanga4c113a2017-06-28 14:05:44 -0700638 }
639
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200640 rtc_library("videocodec_objc") {
Karl Wibergbb23c832018-04-22 19:55:00 +0200641 visibility = [ "*" ]
Mirko Bonadei96ede162018-09-06 13:45:44 +0200642 configs += [ "..:no_global_constructors" ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100643 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200644 "objc/components/video_codec/RTCCodecSpecificInfoH264+Private.h",
645 "objc/components/video_codec/RTCCodecSpecificInfoH264.h",
646 "objc/components/video_codec/RTCCodecSpecificInfoH264.mm",
647 "objc/components/video_codec/RTCH264ProfileLevelId.h",
648 "objc/components/video_codec/RTCH264ProfileLevelId.mm",
zhihuanga4c113a2017-06-28 14:05:44 -0700649 ]
Yura Yaroshevich0f77fea2018-04-26 15:41:01 +0300650 if (is_ios) {
651 sources += [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200652 "objc/components/video_codec/UIDevice+H264Profile.h",
653 "objc/components/video_codec/UIDevice+H264Profile.mm",
Yura Yaroshevich0f77fea2018-04-26 15:41:01 +0300654 ]
655 }
Mirko Bonadeifc52b912019-03-01 10:32:56 +0100656
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100657 public_configs = [ ":common_config_objc" ]
658 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200659 ":base_objc",
660 ":helpers_objc",
kthelgasonfb143122017-07-25 07:55:58 -0700661 "../api/video_codecs:video_codecs_api",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100662 "../common_video",
zhihuanga4c113a2017-06-28 14:05:44 -0700663 "../media:rtc_media_base",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100664 "../modules/video_coding:video_codec_interface",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200665 "../rtc_base:checks",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100666 "../rtc_base:rtc_base_approved",
zhihuanga4c113a2017-06-28 14:05:44 -0700667 ]
668 }
669
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200670 rtc_library("default_codec_factory_objc") {
Anders Carlssondd8c1652018-01-30 10:32:13 +0100671 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200672 "objc/components/video_codec/RTCDefaultVideoDecoderFactory.h",
673 "objc/components/video_codec/RTCDefaultVideoDecoderFactory.m",
674 "objc/components/video_codec/RTCDefaultVideoEncoderFactory.h",
675 "objc/components/video_codec/RTCDefaultVideoEncoderFactory.m",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100676 ]
677
678 deps = [
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +0300679 ":av1",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200680 ":base_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100681 ":native_video",
682 ":videocodec_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200683 ":videotoolbox_objc",
Magnus Jedvert8b4e92d2018-04-13 15:36:43 +0200684 ":vp8",
685 ":vp9",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200686 ":vpx_codec_constants",
687 ]
688 }
689
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200690 rtc_library("vpx_codec_constants") {
Mirko Bonadei96ede162018-09-06 13:45:44 +0200691 configs += [ "..:no_global_constructors" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200692 sources = [
693 "objc/api/video_codec/RTCVideoCodecConstants.h",
694 "objc/api/video_codec/RTCVideoCodecConstants.mm",
695 ]
696
697 deps = [
698 ":base_objc",
699 "../media:rtc_media_base",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100700 ]
Anders Carlssondd8c1652018-01-30 10:32:13 +0100701 }
702
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200703 rtc_library("vp8") {
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100704 visibility = [ "*" ]
Karl Wiberg7ba22b82018-04-27 04:31:53 +0200705 allow_poison = [ "software_video_codecs" ]
Anders Carlssondd8c1652018-01-30 10:32:13 +0100706 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200707 "objc/api/video_codec/RTCVideoDecoderVP8.h",
708 "objc/api/video_codec/RTCVideoDecoderVP8.mm",
709 "objc/api/video_codec/RTCVideoEncoderVP8.h",
710 "objc/api/video_codec/RTCVideoEncoderVP8.mm",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100711 ]
712
Anders Carlssondd8c1652018-01-30 10:32:13 +0100713 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200714 ":base_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100715 ":wrapped_native_codec_objc",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100716 "../modules/video_coding:webrtc_vp8",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100717 ]
718 }
719
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200720 rtc_library("vp9") {
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100721 visibility = [ "*" ]
Karl Wiberg7ba22b82018-04-27 04:31:53 +0200722 allow_poison = [ "software_video_codecs" ]
Anders Carlssondd8c1652018-01-30 10:32:13 +0100723 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200724 "objc/api/video_codec/RTCVideoDecoderVP9.h",
725 "objc/api/video_codec/RTCVideoDecoderVP9.mm",
726 "objc/api/video_codec/RTCVideoEncoderVP9.h",
727 "objc/api/video_codec/RTCVideoEncoderVP9.mm",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100728 ]
729
Anders Carlssondd8c1652018-01-30 10:32:13 +0100730 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200731 ":base_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100732 ":wrapped_native_codec_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200733 "../media:rtc_media_base",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100734 "../modules/video_coding:webrtc_vp9",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100735 ]
736 }
737
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +0300738 rtc_library("av1") {
739 visibility = [ "*" ]
740 allow_poison = [ "software_video_codecs" ]
741 sources = [
742 "objc/api/video_codec/RTCVideoDecoderAV1.h",
743 "objc/api/video_codec/RTCVideoDecoderAV1.mm",
744 "objc/api/video_codec/RTCVideoEncoderAV1.h",
745 "objc/api/video_codec/RTCVideoEncoderAV1.mm",
746 ]
747
748 deps = [
749 ":base_objc",
750 ":wrapped_native_codec_objc",
751 "../media:rtc_media_base",
752 "../modules/video_coding/codecs/av1:libaom_av1_decoder",
philipel95701502022-01-18 18:47:52 +0100753 "../modules/video_coding/codecs/av1:libaom_av1_encoder_if_supported",
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +0300754 ]
755 }
756
zhihuanga4c113a2017-06-28 14:05:44 -0700757 # Build the PeerConnectionFactory without audio/video support.
758 # This target depends on the objc_peeerconnectionfactory_base which still
759 # includes some audio/video related objects such as RTCAudioSource because
760 # these objects are just thin wrappers of native C++ interfaces required
761 # when implementing webrtc::PeerConnectionFactoryInterface and
762 # webrtc::PeerConnectionInterface.
Kári Tristan Helgasona2d89fc2018-03-06 10:18:43 +0100763 # The applications which only use WebRTC DataChannel can depend on this.
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200764 rtc_library("peerconnectionfactory_no_media_objc") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000765 visibility = [ "*" ]
Danil Chapovalov41300af2019-07-10 12:44:43 +0200766 allow_poison = [
767 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
768 "default_task_queue",
769 ]
zhihuanga4c113a2017-06-28 14:05:44 -0700770 defines = [ "HAVE_NO_MEDIA" ]
771
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +0100772 sources = [ "objc/helpers/noop.mm" ]
zhihuanga4c113a2017-06-28 14:05:44 -0700773
kthelgason36d658d2017-08-24 05:43:45 -0700774 public_configs = [ ":common_config_objc" ]
zhihuanga4c113a2017-06-28 14:05:44 -0700775
zhihuanga4c113a2017-06-28 14:05:44 -0700776 deps = [
Anders Carlsson3ff50fb2018-02-01 15:47:05 +0100777 ":native_api",
778 ":native_video",
kthelgason36d658d2017-08-24 05:43:45 -0700779 ":peerconnectionfactory_base_objc",
zhihuanga4c113a2017-06-28 14:05:44 -0700780 "../api:libjingle_peerconnection_api",
Artem Titov94b57c02019-03-21 13:35:10 +0100781 "../rtc_base",
zhihuanga4c113a2017-06-28 14:05:44 -0700782 ]
783 }
784
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200785 rtc_library("mediaconstraints_objc") {
Mirko Bonadei96ede162018-09-06 13:45:44 +0200786 configs += [ "..:no_global_constructors" ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100787 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200788 "objc/api/peerconnection/RTCMediaConstraints+Private.h",
789 "objc/api/peerconnection/RTCMediaConstraints.h",
790 "objc/api/peerconnection/RTCMediaConstraints.mm",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100791 ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100792
793 public_configs = [ ":common_config_objc" ]
794 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200795 ":base_objc",
796 ":helpers_objc",
Niels Möllerdac03d92019-02-13 08:52:27 +0100797 ":media_constraints",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100798 ]
799 }
800
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200801 # TODO(bugs.webrtc.org/9627): Remove, targets should depend on base_objc.
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200802 rtc_library("videorenderer_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200803 visibility = [ "*" ]
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +0100804 sources = [ "objc/helpers/noop.mm" ]
Anders Carlsson9823ee42018-03-07 10:32:03 +0100805
806 configs += [ "..:common_objc" ]
Anders Carlsson9823ee42018-03-07 10:32:03 +0100807 public_configs = [ ":common_config_objc" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200808
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +0100809 deps = [ ":base_objc" ]
Anders Carlsson9823ee42018-03-07 10:32:03 +0100810 }
811
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200812 rtc_library("videorendereradapter_objc") {
Karl Wibergbb23c832018-04-22 19:55:00 +0200813 visibility = [ "*" ]
Anders Carlsson45340ca2019-01-14 14:23:23 +0100814 allow_poison = [ "audio_codecs" ] # TODO(bugs.webrtc.org/8396): Remove.
Anders Carlsson9823ee42018-03-07 10:32:03 +0100815 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200816 "objc/api/RTCVideoRendererAdapter+Private.h",
817 "objc/api/RTCVideoRendererAdapter.h",
818 "objc/api/RTCVideoRendererAdapter.mm",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100819 ]
820
821 configs += [ "..:common_objc" ]
Anders Carlsson9823ee42018-03-07 10:32:03 +0100822 public_configs = [ ":common_config_objc" ]
823
824 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200825 ":base_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100826 ":native_api",
827 ":videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100828 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200829 "../api:media_stream_interface",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100830 ]
831 }
832
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200833 rtc_library("mediasource_objc") {
Anders Carlsson9823ee42018-03-07 10:32:03 +0100834 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200835 "objc/api/peerconnection/RTCMediaSource+Private.h",
836 "objc/api/peerconnection/RTCMediaSource.h",
837 "objc/api/peerconnection/RTCMediaSource.mm",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100838 ]
839
Anders Carlsson358f2e02018-06-04 10:24:37 +0200840 configs += [
841 "..:common_objc",
842 ":used_from_extension",
843 ]
Anders Carlsson9823ee42018-03-07 10:32:03 +0100844 public_configs = [ ":common_config_objc" ]
845
846 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200847 ":base_objc",
Niels Möllere942b142019-09-17 14:30:41 +0200848 "../api:media_stream_interface",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100849 "../rtc_base:checks",
850 ]
851 }
852
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200853 rtc_library("base_native_additions_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200854 sources = [
855 "objc/api/peerconnection/RTCEncodedImage+Private.h",
856 "objc/api/peerconnection/RTCEncodedImage+Private.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200857 "objc/api/peerconnection/RTCVideoCodecInfo+Private.h",
858 "objc/api/peerconnection/RTCVideoCodecInfo+Private.mm",
859 "objc/api/peerconnection/RTCVideoEncoderSettings+Private.h",
860 "objc/api/peerconnection/RTCVideoEncoderSettings+Private.mm",
861 ]
862
863 configs += [ "..:common_objc" ]
864
865 public_configs = [ ":common_config_objc" ]
866
867 deps = [
868 ":base_objc",
869 ":helpers_objc",
Niels Möller4dc66c52018-10-05 14:17:58 +0200870 "../api/video:encoded_image",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200871 "../api/video_codecs:video_codecs_api",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200872 "../modules/video_coding:video_codec_interface",
Artem Titov94b57c02019-03-21 13:35:10 +0100873 "../rtc_base",
Florent Castellif86f6f92022-04-05 02:54:12 +0200874 "../rtc_base:refcount",
Florent Castellie10a9f62022-04-04 17:04:37 +0200875 "../rtc_base:safe_conversions",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200876 ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200877 }
878
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200879 rtc_library("peerconnectionfactory_base_objc") {
Karl Wibergbb23c832018-04-22 19:55:00 +0200880 visibility = [ "*" ]
Danil Chapovalov41300af2019-07-10 12:44:43 +0200881 allow_poison = [
882 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
883 "default_task_queue",
884 ]
Byoungchan Lee524a4222021-11-19 19:03:49 +0900885 configs += [ "..:no_global_constructors" ]
zhihuanga4c113a2017-06-28 14:05:44 -0700886 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200887 "objc/api/peerconnection/RTCAudioSource+Private.h",
888 "objc/api/peerconnection/RTCAudioSource.h",
889 "objc/api/peerconnection/RTCAudioSource.mm",
890 "objc/api/peerconnection/RTCAudioTrack+Private.h",
891 "objc/api/peerconnection/RTCAudioTrack.h",
892 "objc/api/peerconnection/RTCAudioTrack.mm",
893 "objc/api/peerconnection/RTCCertificate.h",
894 "objc/api/peerconnection/RTCCertificate.mm",
895 "objc/api/peerconnection/RTCConfiguration+Native.h",
896 "objc/api/peerconnection/RTCConfiguration+Private.h",
897 "objc/api/peerconnection/RTCConfiguration.h",
898 "objc/api/peerconnection/RTCConfiguration.mm",
Benjamin Wright8c27cca2018-10-25 10:16:44 -0700899 "objc/api/peerconnection/RTCCryptoOptions.h",
900 "objc/api/peerconnection/RTCCryptoOptions.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200901 "objc/api/peerconnection/RTCDataChannel+Private.h",
902 "objc/api/peerconnection/RTCDataChannel.h",
903 "objc/api/peerconnection/RTCDataChannel.mm",
904 "objc/api/peerconnection/RTCDataChannelConfiguration+Private.h",
905 "objc/api/peerconnection/RTCDataChannelConfiguration.h",
906 "objc/api/peerconnection/RTCDataChannelConfiguration.mm",
907 "objc/api/peerconnection/RTCDtmfSender+Private.h",
908 "objc/api/peerconnection/RTCDtmfSender.h",
909 "objc/api/peerconnection/RTCDtmfSender.mm",
910 "objc/api/peerconnection/RTCFieldTrials.h",
911 "objc/api/peerconnection/RTCFieldTrials.mm",
912 "objc/api/peerconnection/RTCIceCandidate+Private.h",
913 "objc/api/peerconnection/RTCIceCandidate.h",
914 "objc/api/peerconnection/RTCIceCandidate.mm",
Jaehyun Kod2110982021-11-30 19:01:43 +0900915 "objc/api/peerconnection/RTCIceCandidateErrorEvent+Private.h",
916 "objc/api/peerconnection/RTCIceCandidateErrorEvent.h",
917 "objc/api/peerconnection/RTCIceCandidateErrorEvent.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200918 "objc/api/peerconnection/RTCIceServer+Private.h",
919 "objc/api/peerconnection/RTCIceServer.h",
920 "objc/api/peerconnection/RTCIceServer.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200921 "objc/api/peerconnection/RTCLegacyStatsReport+Private.h",
922 "objc/api/peerconnection/RTCLegacyStatsReport.h",
923 "objc/api/peerconnection/RTCLegacyStatsReport.mm",
924 "objc/api/peerconnection/RTCMediaStream+Private.h",
925 "objc/api/peerconnection/RTCMediaStream.h",
926 "objc/api/peerconnection/RTCMediaStream.mm",
927 "objc/api/peerconnection/RTCMediaStreamTrack+Private.h",
928 "objc/api/peerconnection/RTCMediaStreamTrack.h",
929 "objc/api/peerconnection/RTCMediaStreamTrack.mm",
930 "objc/api/peerconnection/RTCMetrics.h",
931 "objc/api/peerconnection/RTCMetrics.mm",
932 "objc/api/peerconnection/RTCMetricsSampleInfo+Private.h",
933 "objc/api/peerconnection/RTCMetricsSampleInfo.h",
934 "objc/api/peerconnection/RTCMetricsSampleInfo.mm",
935 "objc/api/peerconnection/RTCPeerConnection+DataChannel.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200936 "objc/api/peerconnection/RTCPeerConnection+Private.h",
937 "objc/api/peerconnection/RTCPeerConnection+Stats.mm",
938 "objc/api/peerconnection/RTCPeerConnection.h",
939 "objc/api/peerconnection/RTCPeerConnection.mm",
940 "objc/api/peerconnection/RTCPeerConnectionFactory+Native.h",
941 "objc/api/peerconnection/RTCPeerConnectionFactory+Private.h",
942 "objc/api/peerconnection/RTCPeerConnectionFactory.h",
943 "objc/api/peerconnection/RTCPeerConnectionFactory.mm",
944 "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder+DefaultComponents.h",
945 "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder+DefaultComponents.mm",
946 "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder.h",
947 "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder.mm",
948 "objc/api/peerconnection/RTCPeerConnectionFactoryOptions+Private.h",
949 "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.h",
950 "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.mm",
951 "objc/api/peerconnection/RTCRtcpParameters+Private.h",
952 "objc/api/peerconnection/RTCRtcpParameters.h",
953 "objc/api/peerconnection/RTCRtcpParameters.mm",
954 "objc/api/peerconnection/RTCRtpCodecParameters+Private.h",
955 "objc/api/peerconnection/RTCRtpCodecParameters.h",
956 "objc/api/peerconnection/RTCRtpCodecParameters.mm",
957 "objc/api/peerconnection/RTCRtpEncodingParameters+Private.h",
958 "objc/api/peerconnection/RTCRtpEncodingParameters.h",
959 "objc/api/peerconnection/RTCRtpEncodingParameters.mm",
960 "objc/api/peerconnection/RTCRtpHeaderExtension+Private.h",
961 "objc/api/peerconnection/RTCRtpHeaderExtension.h",
962 "objc/api/peerconnection/RTCRtpHeaderExtension.mm",
963 "objc/api/peerconnection/RTCRtpParameters+Private.h",
964 "objc/api/peerconnection/RTCRtpParameters.h",
965 "objc/api/peerconnection/RTCRtpParameters.mm",
Benjamin Wrightddf1a3e2018-10-02 10:20:58 -0700966 "objc/api/peerconnection/RTCRtpReceiver+Native.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200967 "objc/api/peerconnection/RTCRtpReceiver+Private.h",
968 "objc/api/peerconnection/RTCRtpReceiver.h",
969 "objc/api/peerconnection/RTCRtpReceiver.mm",
Benjamin Wrightddf1a3e2018-10-02 10:20:58 -0700970 "objc/api/peerconnection/RTCRtpSender+Native.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200971 "objc/api/peerconnection/RTCRtpSender+Private.h",
972 "objc/api/peerconnection/RTCRtpSender.h",
973 "objc/api/peerconnection/RTCRtpSender.mm",
974 "objc/api/peerconnection/RTCRtpTransceiver+Private.h",
975 "objc/api/peerconnection/RTCRtpTransceiver.h",
976 "objc/api/peerconnection/RTCRtpTransceiver.mm",
977 "objc/api/peerconnection/RTCSSLAdapter.h",
978 "objc/api/peerconnection/RTCSSLAdapter.mm",
979 "objc/api/peerconnection/RTCSessionDescription+Private.h",
980 "objc/api/peerconnection/RTCSessionDescription.h",
981 "objc/api/peerconnection/RTCSessionDescription.mm",
Peter Hanspersbed86042019-02-21 17:27:09 +0100982 "objc/api/peerconnection/RTCStatisticsReport+Private.h",
983 "objc/api/peerconnection/RTCStatisticsReport.h",
984 "objc/api/peerconnection/RTCStatisticsReport.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200985 "objc/api/peerconnection/RTCTracing.h",
986 "objc/api/peerconnection/RTCTracing.mm",
987 "objc/api/peerconnection/RTCVideoTrack+Private.h",
988 "objc/api/peerconnection/RTCVideoTrack.h",
989 "objc/api/peerconnection/RTCVideoTrack.mm",
kthelgason5fe4d492016-12-05 11:27:30 -0800990 ]
kthelgasonebc34e72016-09-15 04:30:18 -0700991
Anders Carlsson358f2e02018-06-04 10:24:37 +0200992 configs += [
993 "..:common_objc",
994 ":used_from_extension",
995 ]
kthelgason36d658d2017-08-24 05:43:45 -0700996 public_configs = [ ":common_config_objc" ]
kthelgasonc0977102017-04-24 00:57:16 -0700997
mbonadei2c8ac1b2017-05-31 05:14:26 -0700998 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200999 ":base_native_additions_objc",
1000 ":base_objc",
1001 ":file_logger_objc",
1002 ":helpers_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001003 ":mediaconstraints_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001004 ":mediasource_objc",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001005 ":native_api",
1006 ":native_video",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001007 ":videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001008 ":videorendereradapter_objc",
1009 ":videosource_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001010 ":videotoolbox_objc",
Mirko Bonadeie51f7852017-12-06 11:23:19 +01001011 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +02001012 "../api:media_stream_interface",
Niels Möller695cf6a2019-05-13 12:27:23 +02001013 "../api:rtc_event_log_output_file",
Peter Hanspersbed86042019-02-21 17:27:09 +01001014 "../api:rtc_stats_api",
Niels Möller6dcd4dc2019-08-26 10:45:28 +02001015 "../api:rtp_parameters",
Mirko Bonadeid9708072019-01-25 20:26:48 +01001016 "../api:scoped_refptr",
Jiawei Ouae810c12018-06-20 16:18:59 -07001017 "../api/audio_codecs:audio_codecs_api",
Karl Wiberg5817d3d2018-04-06 10:06:42 +02001018 "../api/audio_codecs:builtin_audio_decoder_factory",
Jiawei Ouae810c12018-06-20 16:18:59 -07001019 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadeieaaaf412019-09-13 14:42:15 +02001020 "../api/crypto:frame_decryptor_interface",
1021 "../api/crypto:frame_encryptor_interface",
Danil Chapovalov4ba04b72019-06-26 15:49:47 +02001022 "../api/rtc_event_log:rtc_event_log_factory",
Danil Chapovalovaaa11432019-05-17 13:20:14 +02001023 "../api/task_queue:default_task_queue_factory",
Erik Språngceb44952020-09-22 11:36:35 +02001024 "../api/transport:field_trial_based_config",
Niels Möllerc6ce9c52018-05-11 11:15:30 +02001025 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +02001026 "../api/video:video_rtp_headers",
Anders Carlsson7e042812017-10-05 16:55:38 +02001027 "../api/video_codecs:video_codecs_api",
Anders Carlssone5960ce2017-06-22 15:26:30 +02001028 "../common_video",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001029 "../media:rtc_media_base",
Jiawei Ouae810c12018-06-20 16:18:59 -07001030 "../modules/audio_device:audio_device_api",
Artem Titov94b57c02019-03-21 13:35:10 +01001031 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +00001032 "../modules/audio_processing:api",
Patrik Höglund99175c62018-01-08 11:05:10 +01001033 "../modules/video_coding:video_codec_interface",
Harald Alvestrandc1e8aeb2022-03-31 19:53:50 +00001034 "../pc:peer_connection_factory",
1035 "../pc:webrtc_sdp",
Artem Titov94b57c02019-03-21 13:35:10 +01001036 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001037 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001038 "../rtc_base:logging",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +01001039 "../rtc_base:network_constants",
Florent Castellie10a9f62022-04-04 17:04:37 +02001040 "../rtc_base:safe_conversions",
Harald Alvestrandc1e8aeb2022-03-31 19:53:50 +00001041 "../stats:rtc_stats",
Mirko Bonadei17f48782018-09-28 08:51:10 +02001042 "../system_wrappers:field_trial",
1043 "../system_wrappers:metrics",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001044 ]
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001045
1046 if (is_ios) {
1047 deps += [ ":native_api_audio_device_module" ]
1048 }
kthelgasonebc34e72016-09-15 04:30:18 -07001049 }
Zeke Chindd0e1e02016-10-11 13:27:26 -07001050
mbonadei2c8ac1b2017-05-31 05:14:26 -07001051 if (rtc_include_tests) {
Daniela012b56b2017-11-15 13:15:24 +01001052 if (is_ios) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001053 rtc_library("sdk_unittests_sources") {
Danielaae012cf2017-10-12 13:46:00 +02001054 testonly = true
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001055 include_dirs = [ "objc/" ]
Daniela012b56b2017-11-15 13:15:24 +01001056
Danielaae012cf2017-10-12 13:46:00 +02001057 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001058 "objc/unittests/ObjCVideoTrackSource_xctest.mm",
1059 "objc/unittests/RTCCVPixelBuffer_xctest.mm",
1060 "objc/unittests/RTCCallbackLogger_xctest.m",
Kári Tristan Helgasonecbdbf62020-02-20 07:34:45 -08001061 "objc/unittests/RTCEncodedImage_xctest.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001062 "objc/unittests/RTCFileVideoCapturer_xctest.mm",
1063 "objc/unittests/RTCH264ProfileLevelId_xctest.m",
Jake Brombergfb7fd242021-06-14 13:44:25 -07001064 "objc/unittests/RTCMTLVideoView_xctest.m",
Aaron Goldenfb4e9bc2019-01-04 12:03:31 -08001065 "objc/unittests/RTCNV12TextureCache_xctest.m",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001066 "objc/unittests/RTCPeerConnectionFactory_xctest.m",
1067 "objc/unittests/frame_buffer_helpers.h",
1068 "objc/unittests/frame_buffer_helpers.mm",
Artem Titarenko42b43152018-10-29 18:18:09 +01001069 "objc/unittests/nalu_rewriter_xctest.mm",
Danielaae012cf2017-10-12 13:46:00 +02001070 ]
Daniela012b56b2017-11-15 13:15:24 +01001071
Mirko Bonadei6b09c452021-07-05 16:47:49 +02001072 # TODO(bugs.webrtc.org/12937): Remove OpenGL deprecation warning
1073 # workaround.
1074 defines = [ "GLES_SILENCE_DEPRECATION" ]
1075
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001076 # TODO(peterhanspers): Reenable these tests on simulator.
1077 # See bugs.webrtc.org/7812
Lahiru Ginnaliya Gamathige1d0e7b62020-10-20 02:43:02 -07001078 if (target_environment != "simulator") {
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001079 sources += [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001080 "objc/unittests/RTCAudioDeviceModule_xctest.mm",
1081 "objc/unittests/RTCAudioDevice_xctest.mm",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001082 ]
1083 }
1084
Danielaae012cf2017-10-12 13:46:00 +02001085 deps = [
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001086 ":audio_device",
Joe Chen0b3a6e32019-12-26 23:01:42 -08001087 ":audio_session_objc",
Kári Tristan Helgasonecbdbf62020-02-20 07:34:45 -08001088 ":base_native_additions_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001089 ":base_objc",
1090 ":callback_logger_objc",
Anders Carlssondc6b4772018-01-15 13:31:03 +01001091 ":framework_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001092 ":mediaconstraints_objc",
Jake Brombergfb7fd242021-06-14 13:44:25 -07001093 ":metal_objc",
Anders Carlssonfe9d8172018-04-03 11:40:39 +02001094 ":native_api",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001095 ":native_api_audio_device_module",
Anders Carlssonfe9d8172018-04-03 11:40:39 +02001096 ":native_video",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001097 ":peerconnectionfactory_base_objc",
Artem Titarenko42b43152018-10-29 18:18:09 +01001098 ":video_toolbox_cc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001099 ":videocapture_objc",
Anders Carlsson79ce8202018-06-01 12:51:09 +02001100 ":videocodec_objc",
Anders Carlssonfe9d8172018-04-03 11:40:39 +02001101 ":videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001102 ":videosource_objc",
Danielaae012cf2017-10-12 13:46:00 +02001103 ":videotoolbox_objc",
Mirko Bonadeid9708072019-01-25 20:26:48 +01001104 "../api:scoped_refptr",
Byoungchan Lee43bd7602019-10-08 23:58:41 +09001105 "../api/task_queue:default_task_queue_factory",
Ilya Nikolaevskiy38e9b062020-10-08 14:36:33 +00001106 "../api/video:video_frame",
Artem Titov94b57c02019-03-21 13:35:10 +01001107 "../common_video",
Danielaae012cf2017-10-12 13:46:00 +02001108 "../media:rtc_media_base",
Anders Carlssonfe9d8172018-04-03 11:40:39 +02001109 "../media:rtc_media_tests_utils",
Artem Titov94b57c02019-03-21 13:35:10 +01001110 "../rtc_base",
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001111 "../rtc_base:gunit_helpers",
Florent Castelli4467ad72022-04-04 15:18:46 +02001112 "../rtc_base:macromagic",
Florent Castellif86f6f92022-04-05 02:54:12 +02001113 "../rtc_base:refcount",
Byoungchan Lee83ceb902021-11-16 11:31:57 +09001114 "../rtc_base/system:unused",
Artem Titov94b57c02019-03-21 13:35:10 +01001115 "../system_wrappers",
Anders Carlssonfe9d8172018-04-03 11:40:39 +02001116 "//third_party/libyuv",
Danielaae012cf2017-10-12 13:46:00 +02001117 ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001118
Jordan Rose53d3fc92021-07-06 12:16:41 -07001119 if (rtc_ios_macos_use_opengl_rendering) {
1120 deps += [ ":opengl_objc" ]
1121 }
1122
Danielaae012cf2017-10-12 13:46:00 +02001123 public_deps = [
1124 "//build/config/ios:xctest",
1125 "//third_party/ocmock",
1126 ]
1127 }
1128
Daniela012b56b2017-11-15 13:15:24 +01001129 bundle_data("sdk_unittests_bundle_data") {
Daniela012b56b2017-11-15 13:15:24 +01001130 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001131 "objc/unittests/audio_short16.pcm",
1132 "objc/unittests/audio_short44.pcm",
1133 "objc/unittests/audio_short48.pcm",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001134
1135 # Sample video taken from https://media.xiph.org/video/derf/
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001136 "objc/unittests/foreman.mp4",
Daniela012b56b2017-11-15 13:15:24 +01001137 ]
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +01001138 outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
Daniela012b56b2017-11-15 13:15:24 +01001139 }
1140
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001141 # These tests use static linking.
Mirko Bonadeiaef8a212020-09-16 15:09:53 +02001142 rtc_test("sdk_unittests") {
1143 is_xctest = true
Danielaae012cf2017-10-12 13:46:00 +02001144 info_plist = "//test/ios/Info.plist"
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +01001145 sources = [ "objc/unittests/main.mm" ]
Daniela012b56b2017-11-15 13:15:24 +01001146
Artem Titarenkoa2bc3622019-08-19 14:24:00 +02001147 extra_substitutions = [ "GTEST_BUNDLE_ID_SUFFIX=generic-unit-test" ]
Danielaae012cf2017-10-12 13:46:00 +02001148 deps = [
Yura Yaroshevich5297bd22018-06-19 12:51:51 +03001149 ":peerconnectionfactory_base_objc",
Daniela012b56b2017-11-15 13:15:24 +01001150 ":sdk_unittests_bundle_data",
Danielaae012cf2017-10-12 13:46:00 +02001151 ":sdk_unittests_sources",
Niels Möller5a8f8602019-06-12 11:30:59 +02001152 "../rtc_base",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +01001153 "../rtc_base:threading",
Artem Titarenko34fc3462018-11-06 12:29:29 +01001154 "//test:test_support",
Danielaae012cf2017-10-12 13:46:00 +02001155 ]
1156 ldflags = [ "-all_load" ]
1157 }
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001158
1159 # These tests link to the framework.
Mirko Bonadeiaef8a212020-09-16 15:09:53 +02001160 rtc_test("sdk_framework_unittests") {
1161 is_xctest = true
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001162 info_plist = "//test/ios/Info.plist"
1163 sources = [
1164 "objc/unittests/RTCDoNotPutCPlusPlusInFrameworkHeaders_xctest.m",
Artem Titarenko34fc3462018-11-06 12:29:29 +01001165 "objc/unittests/main.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001166 ]
1167
Artem Titarenkoa2bc3622019-08-19 14:24:00 +02001168 extra_substitutions = [ "GTEST_BUNDLE_ID_SUFFIX=generic-unit-test" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001169 deps = [
1170 ":framework_objc+link",
1171 ":ios_framework_bundle",
Niels Möller5a8f8602019-06-12 11:30:59 +02001172 "../rtc_base",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +01001173 "../rtc_base:threading",
Artem Titarenko34fc3462018-11-06 12:29:29 +01001174 "//test:test_support",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001175 ]
1176 }
Danielaae012cf2017-10-12 13:46:00 +02001177 }
1178
1179 # TODO(denicija): once all tests are migrated to xctest remove this source set.
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001180 rtc_library("rtc_unittests_objc") {
mbonadei2c8ac1b2017-05-31 05:14:26 -07001181 testonly = true
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001182
mbonadei2c8ac1b2017-05-31 05:14:26 -07001183 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001184 "objc/unittests/RTCCertificateTest.mm",
1185 "objc/unittests/RTCConfigurationTest.mm",
1186 "objc/unittests/RTCDataChannelConfigurationTest.mm",
1187 "objc/unittests/RTCIceCandidateTest.mm",
1188 "objc/unittests/RTCIceServerTest.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001189 "objc/unittests/RTCMediaConstraintsTest.mm",
1190 "objc/unittests/RTCPeerConnectionFactoryBuilderTest.mm",
1191 "objc/unittests/RTCPeerConnectionTest.mm",
1192 "objc/unittests/RTCSessionDescriptionTest.mm",
1193 "objc/unittests/RTCTracingTest.mm",
1194 "objc/unittests/objc_video_decoder_factory_tests.mm",
1195 "objc/unittests/objc_video_encoder_factory_tests.mm",
1196 "objc/unittests/scoped_cftyperef_tests.mm",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001197 ]
Anders Carlssone7dd83f2018-01-19 11:28:44 +01001198 if (is_ios) {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001199 sources += [ "objc/unittests/RTCCameraVideoCapturerTests.mm" ]
oprypin45197522017-06-22 01:47:20 -07001200 }
mbonadeid7620582017-05-30 01:50:35 -07001201
mbonadei2c8ac1b2017-05-31 05:14:26 -07001202 # |-ObjC| flag needed to make sure category method implementations
1203 # are included:
1204 # https://developer.apple.com/library/mac/qa/qa1490/_index.html
1205 ldflags = [ "-ObjC" ]
magjed3149e092017-05-08 05:32:05 -07001206
mbonadei2c8ac1b2017-05-31 05:14:26 -07001207 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001208 ":base_objc",
1209 ":helpers_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001210 ":mediaconstraints_objc",
1211 ":native_api",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001212 ":native_video",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001213 ":peerconnectionfactory_base_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001214 ":videocapture_objc",
1215 ":videocodec_objc",
1216 ":videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001217 ":videosource_objc",
kthelgason36d658d2017-08-24 05:43:45 -07001218 ":videotoolbox_objc",
Piotr (Peter) Slatalae0c2e972018-10-08 09:43:21 -07001219 "../api:libjingle_peerconnection_api",
Jiawei Ouae810c12018-06-20 16:18:59 -07001220 "../api/audio_codecs:audio_codecs_api",
1221 "../api/audio_codecs:builtin_audio_decoder_factory",
1222 "../api/audio_codecs:builtin_audio_encoder_factory",
Magnus Jedvert8b4e92d2018-04-13 15:36:43 +02001223 "../api/video_codecs:video_codecs_api",
kthelgasonebd4f792017-09-04 04:36:21 -07001224 "../media:rtc_media_base",
Jiawei Ouae810c12018-06-20 16:18:59 -07001225 "../modules/audio_device:audio_device_api",
Artem Titov94b57c02019-03-21 13:35:10 +01001226 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +00001227 "../modules/audio_processing:api",
Patrik Höglund99175c62018-01-08 11:05:10 +01001228 "../modules/video_coding:video_codec_interface",
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001229 "../rtc_base:gunit_helpers",
Byoungchan Lee0a54e7a2021-09-06 22:32:52 +09001230 "../rtc_base:rtc_event",
Niels Möllera12c42a2018-07-25 16:05:48 +02001231 "../rtc_base/system:unused",
Yves Gerey21cddff2018-10-30 21:12:42 +01001232 "../test:test_support",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001233 "//third_party/ocmock",
1234 ]
magjed3149e092017-05-08 05:32:05 -07001235
denicija59ee91b2017-06-05 05:48:47 -07001236 if (is_ios) {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001237 sources += [ "objc/unittests/RTCAudioSessionTest.mm" ]
Joe Chen0b3a6e32019-12-26 23:01:42 -08001238 deps += [ ":audio_session_objc" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -07001239 }
mbonadei2c8ac1b2017-05-31 05:14:26 -07001240 }
kthelgason2f088792017-05-30 01:48:47 -07001241 }
1242
mbonadei2c8ac1b2017-05-31 05:14:26 -07001243 if (is_ios) {
Anders Carlssondc6b4772018-01-15 13:31:03 +01001244 ios_framework_bundle_with_umbrella_header("framework_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001245 info_plist = "objc/Info.plist"
mbonadei2c8ac1b2017-05-31 05:14:26 -07001246 output_name = "WebRTC"
Magnus Jedvertf83dc8b2017-08-29 09:49:43 +00001247
mbonadei2c8ac1b2017-05-31 05:14:26 -07001248 common_objc_headers = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001249 "objc/base/RTCCodecSpecificInfo.h",
1250 "objc/base/RTCEncodedImage.h",
Anders Carlsson4e5af962018-09-03 14:44:50 +02001251 "objc/base/RTCI420Buffer.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001252 "objc/base/RTCLogging.h",
1253 "objc/base/RTCMacros.h",
Anders Carlsson4e5af962018-09-03 14:44:50 +02001254 "objc/base/RTCMutableI420Buffer.h",
1255 "objc/base/RTCMutableYUVPlanarBuffer.h",
Yury Yaroshevich19a6e942022-03-11 09:22:08 +01001256 "objc/base/RTCSSLCertificateVerifier.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001257 "objc/base/RTCVideoCapturer.h",
1258 "objc/base/RTCVideoCodecInfo.h",
1259 "objc/base/RTCVideoDecoder.h",
1260 "objc/base/RTCVideoDecoderFactory.h",
1261 "objc/base/RTCVideoEncoder.h",
1262 "objc/base/RTCVideoEncoderFactory.h",
1263 "objc/base/RTCVideoEncoderQpThresholds.h",
1264 "objc/base/RTCVideoEncoderSettings.h",
1265 "objc/base/RTCVideoFrame.h",
1266 "objc/base/RTCVideoFrameBuffer.h",
1267 "objc/base/RTCVideoRenderer.h",
Anders Carlsson4e5af962018-09-03 14:44:50 +02001268 "objc/base/RTCYUVPlanarBuffer.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001269 "objc/components/audio/RTCAudioSession.h",
1270 "objc/components/audio/RTCAudioSessionConfiguration.h",
1271 "objc/components/capturer/RTCCameraVideoCapturer.h",
1272 "objc/components/capturer/RTCFileVideoCapturer.h",
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001273 "objc/components/network/RTCNetworkMonitor.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001274 "objc/components/renderer/metal/RTCMTLVideoView.h",
1275 "objc/components/renderer/opengl/RTCEAGLVideoView.h",
1276 "objc/components/renderer/opengl/RTCVideoViewShading.h",
1277 "objc/components/video_codec/RTCCodecSpecificInfoH264.h",
1278 "objc/components/video_codec/RTCDefaultVideoDecoderFactory.h",
1279 "objc/components/video_codec/RTCDefaultVideoEncoderFactory.h",
1280 "objc/components/video_codec/RTCH264ProfileLevelId.h",
1281 "objc/components/video_codec/RTCVideoDecoderFactoryH264.h",
1282 "objc/components/video_codec/RTCVideoDecoderH264.h",
1283 "objc/components/video_codec/RTCVideoEncoderFactoryH264.h",
1284 "objc/components/video_codec/RTCVideoEncoderH264.h",
1285 "objc/components/video_frame_buffer/RTCCVPixelBuffer.h",
1286 "objc/helpers/RTCCameraPreviewView.h",
1287 "objc/helpers/RTCDispatcher.h",
1288 "objc/helpers/UIDevice+RTCDevice.h",
1289 "objc/api/peerconnection/RTCAudioSource.h",
1290 "objc/api/peerconnection/RTCAudioTrack.h",
1291 "objc/api/peerconnection/RTCConfiguration.h",
1292 "objc/api/peerconnection/RTCDataChannel.h",
1293 "objc/api/peerconnection/RTCDataChannelConfiguration.h",
1294 "objc/api/peerconnection/RTCFieldTrials.h",
1295 "objc/api/peerconnection/RTCIceCandidate.h",
Jaehyun Kod2110982021-11-30 19:01:43 +09001296 "objc/api/peerconnection/RTCIceCandidateErrorEvent.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001297 "objc/api/peerconnection/RTCIceServer.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001298 "objc/api/peerconnection/RTCLegacyStatsReport.h",
1299 "objc/api/peerconnection/RTCMediaConstraints.h",
1300 "objc/api/peerconnection/RTCMediaSource.h",
1301 "objc/api/peerconnection/RTCMediaStream.h",
1302 "objc/api/peerconnection/RTCMediaStreamTrack.h",
1303 "objc/api/peerconnection/RTCMetrics.h",
1304 "objc/api/peerconnection/RTCMetricsSampleInfo.h",
1305 "objc/api/peerconnection/RTCPeerConnection.h",
1306 "objc/api/peerconnection/RTCPeerConnectionFactory.h",
1307 "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.h",
1308 "objc/api/peerconnection/RTCRtcpParameters.h",
1309 "objc/api/peerconnection/RTCRtpCodecParameters.h",
1310 "objc/api/peerconnection/RTCRtpEncodingParameters.h",
1311 "objc/api/peerconnection/RTCRtpHeaderExtension.h",
1312 "objc/api/peerconnection/RTCRtpParameters.h",
1313 "objc/api/peerconnection/RTCRtpReceiver.h",
1314 "objc/api/peerconnection/RTCRtpSender.h",
1315 "objc/api/peerconnection/RTCRtpTransceiver.h",
1316 "objc/api/peerconnection/RTCDtmfSender.h",
1317 "objc/api/peerconnection/RTCSSLAdapter.h",
1318 "objc/api/peerconnection/RTCSessionDescription.h",
CZ Theng682dabd2019-10-21 11:25:18 +08001319 "objc/api/peerconnection/RTCStatisticsReport.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001320 "objc/api/peerconnection/RTCTracing.h",
1321 "objc/api/peerconnection/RTCCertificate.h",
Benjamin Wright8c27cca2018-10-25 10:16:44 -07001322 "objc/api/peerconnection/RTCCryptoOptions.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001323 "objc/api/peerconnection/RTCVideoSource.h",
1324 "objc/api/peerconnection/RTCVideoTrack.h",
Anders Carlsson4e5af962018-09-03 14:44:50 +02001325 "objc/api/video_codec/RTCVideoCodecConstants.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001326 "objc/api/video_codec/RTCVideoDecoderVP8.h",
1327 "objc/api/video_codec/RTCVideoDecoderVP9.h",
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +03001328 "objc/api/video_codec/RTCVideoDecoderAV1.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001329 "objc/api/video_codec/RTCVideoEncoderVP8.h",
1330 "objc/api/video_codec/RTCVideoEncoderVP9.h",
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +03001331 "objc/api/video_codec/RTCVideoEncoderAV1.h",
Anders Carlsson4e5af962018-09-03 14:44:50 +02001332 "objc/api/video_frame_buffer/RTCNativeI420Buffer.h",
1333 "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.h",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001334 ]
Magnus Jedvert8b4e92d2018-04-13 15:36:43 +02001335
mbonadei2c8ac1b2017-05-31 05:14:26 -07001336 if (!build_with_chromium) {
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001337 common_objc_headers += [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001338 "objc/api/logging/RTCCallbackLogger.h",
1339 "objc/api/peerconnection/RTCFileLogger.h",
Anders Carlsson3b3364e2018-01-30 15:46:13 +01001340 ]
mbonadei2c8ac1b2017-05-31 05:14:26 -07001341 }
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001342
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001343 sources = common_objc_headers
1344 public_headers = common_objc_headers
1345
mbonadei2c8ac1b2017-05-31 05:14:26 -07001346 ldflags = [
1347 "-all_load",
1348 "-install_name",
1349 "@rpath/$output_name.framework/$output_name",
1350 ]
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001351
mbonadei2c8ac1b2017-05-31 05:14:26 -07001352 deps = [
kthelgason36d658d2017-08-24 05:43:45 -07001353 ":audio_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001354 ":base_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001355 ":default_codec_factory_objc",
Mirko Bonadei91d39752022-01-19 08:43:17 +01001356 ":metal_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001357 ":native_api",
1358 ":native_video",
1359 ":peerconnectionfactory_base_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001360 ":videocapture_objc",
1361 ":videocodec_objc",
1362 ":videotoolbox_objc",
ehmaldonadof6a861a2017-07-19 10:40:47 -07001363 "../rtc_base:rtc_base_approved",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001364 ]
Jordan Rose53d3fc92021-07-06 12:16:41 -07001365 if (rtc_ios_macos_use_opengl_rendering) {
1366 deps += [ ":opengl_ui_objc" ]
1367 }
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001368 if (!build_with_chromium) {
1369 deps += [
1370 ":callback_logger_objc",
1371 ":file_logger_objc",
1372 ]
1373 }
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001374
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +02001375 frameworks = [
mbonadei2c8ac1b2017-05-31 05:14:26 -07001376 "AVFoundation.framework",
1377 "CoreGraphics.framework",
1378 "CoreMedia.framework",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001379 ]
1380
Anders Carlsson358f2e02018-06-04 10:24:37 +02001381 configs += [
1382 "..:common_objc",
1383 ":used_from_extension",
1384 ]
mbonadei2c8ac1b2017-05-31 05:14:26 -07001385
kthelgason36d658d2017-08-24 05:43:45 -07001386 public_configs = [ ":common_config_objc" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -07001387 }
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001388
1389 bundle_data("ios_framework_bundle") {
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +01001390 deps = [ "../sdk:framework_objc" ]
1391 sources = [ "$root_build_dir/WebRTC.framework" ]
1392 outputs = [ "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001393 }
1394 }
1395
1396 if (is_mac) {
Anders Carlsson37bbf792018-09-05 16:29:27 +02001397 mac_framework_bundle_with_umbrella_header("mac_framework_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001398 info_plist = "objc/Info.plist"
1399 output_name = "WebRTC"
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001400
Anders Carlsson37bbf792018-09-05 16:29:27 +02001401 sources = [
1402 "objc/api/peerconnection/RTCAudioSource.h",
1403 "objc/api/peerconnection/RTCAudioTrack.h",
1404 "objc/api/peerconnection/RTCCertificate.h",
1405 "objc/api/peerconnection/RTCConfiguration.h",
Benjamin Wright8c27cca2018-10-25 10:16:44 -07001406 "objc/api/peerconnection/RTCCryptoOptions.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001407 "objc/api/peerconnection/RTCDataChannel.h",
1408 "objc/api/peerconnection/RTCDataChannelConfiguration.h",
1409 "objc/api/peerconnection/RTCDtmfSender.h",
1410 "objc/api/peerconnection/RTCFieldTrials.h",
1411 "objc/api/peerconnection/RTCIceCandidate.h",
Jaehyun Kod2110982021-11-30 19:01:43 +09001412 "objc/api/peerconnection/RTCIceCandidateErrorEvent.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001413 "objc/api/peerconnection/RTCIceServer.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001414 "objc/api/peerconnection/RTCLegacyStatsReport.h",
1415 "objc/api/peerconnection/RTCMediaConstraints.h",
1416 "objc/api/peerconnection/RTCMediaSource.h",
1417 "objc/api/peerconnection/RTCMediaStream.h",
1418 "objc/api/peerconnection/RTCMediaStreamTrack.h",
1419 "objc/api/peerconnection/RTCMetrics.h",
1420 "objc/api/peerconnection/RTCMetricsSampleInfo.h",
1421 "objc/api/peerconnection/RTCPeerConnection.h",
1422 "objc/api/peerconnection/RTCPeerConnectionFactory.h",
1423 "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.h",
1424 "objc/api/peerconnection/RTCRtcpParameters.h",
1425 "objc/api/peerconnection/RTCRtpCodecParameters.h",
1426 "objc/api/peerconnection/RTCRtpEncodingParameters.h",
1427 "objc/api/peerconnection/RTCRtpHeaderExtension.h",
1428 "objc/api/peerconnection/RTCRtpParameters.h",
1429 "objc/api/peerconnection/RTCRtpReceiver.h",
1430 "objc/api/peerconnection/RTCRtpSender.h",
1431 "objc/api/peerconnection/RTCRtpTransceiver.h",
1432 "objc/api/peerconnection/RTCSSLAdapter.h",
1433 "objc/api/peerconnection/RTCSessionDescription.h",
Saúl Ibarra Corretgéf7aa2672021-07-28 23:09:14 +02001434 "objc/api/peerconnection/RTCStatisticsReport.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001435 "objc/api/peerconnection/RTCTracing.h",
1436 "objc/api/peerconnection/RTCVideoSource.h",
1437 "objc/api/peerconnection/RTCVideoTrack.h",
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +03001438 "objc/api/video_codec/RTCVideoDecoderAV1.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001439 "objc/api/video_codec/RTCVideoDecoderVP8.h",
1440 "objc/api/video_codec/RTCVideoDecoderVP9.h",
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +03001441 "objc/api/video_codec/RTCVideoEncoderAV1.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001442 "objc/api/video_codec/RTCVideoEncoderVP8.h",
1443 "objc/api/video_codec/RTCVideoEncoderVP9.h",
1444 "objc/api/video_frame_buffer/RTCNativeI420Buffer.h",
1445 "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.h",
1446 "objc/base/RTCCodecSpecificInfo.h",
1447 "objc/base/RTCEncodedImage.h",
1448 "objc/base/RTCI420Buffer.h",
1449 "objc/base/RTCLogging.h",
1450 "objc/base/RTCMacros.h",
1451 "objc/base/RTCMutableI420Buffer.h",
1452 "objc/base/RTCMutableYUVPlanarBuffer.h",
Yury Yaroshevich19a6e942022-03-11 09:22:08 +01001453 "objc/base/RTCSSLCertificateVerifier.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001454 "objc/base/RTCVideoCapturer.h",
1455 "objc/base/RTCVideoCodecInfo.h",
1456 "objc/base/RTCVideoDecoder.h",
1457 "objc/base/RTCVideoDecoderFactory.h",
1458 "objc/base/RTCVideoEncoder.h",
1459 "objc/base/RTCVideoEncoderFactory.h",
1460 "objc/base/RTCVideoEncoderQpThresholds.h",
1461 "objc/base/RTCVideoEncoderSettings.h",
1462 "objc/base/RTCVideoFrame.h",
1463 "objc/base/RTCVideoFrameBuffer.h",
1464 "objc/base/RTCVideoRenderer.h",
1465 "objc/base/RTCYUVPlanarBuffer.h",
1466 "objc/components/capturer/RTCCameraVideoCapturer.h",
1467 "objc/components/capturer/RTCFileVideoCapturer.h",
1468 "objc/components/renderer/metal/RTCMTLNSVideoView.h",
1469 "objc/components/renderer/opengl/RTCNSGLVideoView.h",
1470 "objc/components/renderer/opengl/RTCVideoViewShading.h",
1471 "objc/components/video_codec/RTCCodecSpecificInfoH264.h",
1472 "objc/components/video_codec/RTCDefaultVideoDecoderFactory.h",
1473 "objc/components/video_codec/RTCDefaultVideoEncoderFactory.h",
1474 "objc/components/video_codec/RTCH264ProfileLevelId.h",
1475 "objc/components/video_codec/RTCVideoDecoderFactoryH264.h",
1476 "objc/components/video_codec/RTCVideoDecoderH264.h",
1477 "objc/components/video_codec/RTCVideoEncoderFactoryH264.h",
1478 "objc/components/video_codec/RTCVideoEncoderH264.h",
1479 "objc/components/video_frame_buffer/RTCCVPixelBuffer.h",
1480 "objc/helpers/RTCDispatcher.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001481 ]
Anders Carlsson37bbf792018-09-05 16:29:27 +02001482 if (!build_with_chromium) {
1483 sources += [
1484 "objc/api/logging/RTCCallbackLogger.h",
1485 "objc/api/peerconnection/RTCFileLogger.h",
1486 ]
1487 }
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001488
1489 deps = [
1490 ":base_objc",
1491 ":default_codec_factory_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001492 ":native_api",
1493 ":native_video",
Jordan Rose53d3fc92021-07-06 12:16:41 -07001494 ":opengl_ui_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001495 ":peerconnectionfactory_base_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001496 ":videocapture_objc",
1497 ":videocodec_objc",
1498 ":videotoolbox_objc",
1499 "../rtc_base:rtc_base_approved",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001500 ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001501 if (!build_with_chromium) {
1502 deps += [
1503 ":callback_logger_objc",
1504 ":file_logger_objc",
1505 ]
1506 }
1507
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +02001508 frameworks = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001509 "AVFoundation.framework",
1510 "CoreGraphics.framework",
1511 "CoreMedia.framework",
1512 "OpenGL.framework",
1513 ]
1514
Anders Carlsson37bbf792018-09-05 16:29:27 +02001515 configs = [ "..:common_objc" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001516
1517 public_configs = [ ":common_config_objc" ]
1518 }
1519
1520 bundle_data("mac_framework_bundle") {
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +01001521 deps = [ "../sdk:mac_framework_objc" ]
1522 sources = [ "$root_build_dir/WebRTC.framework" ]
1523 outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001524 }
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001525 }
1526
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001527 rtc_library("wrapped_native_codec_objc") {
Anders Carlsson9823ee42018-03-07 10:32:03 +01001528 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001529 "objc/api/video_codec/RTCWrappedNativeVideoDecoder.h",
1530 "objc/api/video_codec/RTCWrappedNativeVideoDecoder.mm",
1531 "objc/api/video_codec/RTCWrappedNativeVideoEncoder.h",
1532 "objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001533 ]
1534
1535 configs += [ "..:common_objc" ]
1536 public_configs = [ ":common_config_objc" ]
1537
Anders Carlsson9823ee42018-03-07 10:32:03 +01001538 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001539 ":base_objc",
1540 ":helpers_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001541 "../api/video_codecs:video_codecs_api",
1542 "../media:rtc_media_base",
1543 ]
1544 }
1545
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001546 # The native API is currently experimental and may change without notice.
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001547 rtc_library("native_api") {
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001548 visibility = [ "*" ]
Anders Carlsson45340ca2019-01-14 14:23:23 +01001549 allow_poison = [ "audio_codecs" ] # TODO(bugs.webrtc.org/8396): Remove.
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001550 sources = [
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001551 "objc/native/api/network_monitor_factory.h",
1552 "objc/native/api/network_monitor_factory.mm",
Yury Yaroshevich19a6e942022-03-11 09:22:08 +01001553 "objc/native/api/ssl_certificate_verifier.h",
1554 "objc/native/api/ssl_certificate_verifier.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001555 "objc/native/api/video_capturer.h",
1556 "objc/native/api/video_capturer.mm",
1557 "objc/native/api/video_decoder_factory.h",
1558 "objc/native/api/video_decoder_factory.mm",
1559 "objc/native/api/video_encoder_factory.h",
1560 "objc/native/api/video_encoder_factory.mm",
1561 "objc/native/api/video_frame.h",
1562 "objc/native/api/video_frame.mm",
1563 "objc/native/api/video_frame_buffer.h",
1564 "objc/native/api/video_frame_buffer.mm",
1565 "objc/native/api/video_renderer.h",
1566 "objc/native/api/video_renderer.mm",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001567 ]
1568
1569 configs += [ "..:common_objc" ]
1570
1571 public_configs = [ ":common_config_objc" ]
1572
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001573 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001574 ":base_objc",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001575 ":native_video",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001576 ":videoframebuffer_objc",
Anders Carlsson73119182018-03-15 09:41:03 +01001577 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +02001578 "../api:media_stream_interface",
Mirko Bonadeid9708072019-01-25 20:26:48 +01001579 "../api:scoped_refptr",
Niels Möllerc6ce9c52018-05-11 11:15:30 +02001580 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +02001581 "../api/video:video_rtp_headers",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001582 "../api/video_codecs:video_codecs_api",
1583 "../common_video",
Artem Titov94b57c02019-03-21 13:35:10 +01001584 "../rtc_base",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001585 "../rtc_base:logging",
Florent Castellif86f6f92022-04-05 02:54:12 +02001586 "../rtc_base:refcount",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +01001587 "../rtc_base:threading",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001588 ]
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001589 if (is_ios) {
1590 deps += [ ":native_network_monitor" ]
1591 }
Mirko Bonadei2dcf3482020-06-05 14:30:41 +02001592 absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001593 }
1594
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001595 if (is_ios) {
1596 rtc_library("native_network_monitor") {
1597 visibility = [ "*" ]
1598
1599 sources = [
1600 "objc/native/src/objc_network_monitor.h",
1601 "objc/native/src/objc_network_monitor.mm",
1602 ]
1603
1604 deps = [
1605 ":network_monitor_objc",
1606 ":network_monitor_observer",
Jonas Orelande62c2f22022-03-29 11:04:48 +02001607 "../api:field_trials_view",
Artem Titovd15a5752021-02-10 14:31:24 +01001608 "../api:sequence_checker",
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001609 "../rtc_base",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001610 "../rtc_base:logging",
Florent Castelli4467ad72022-04-04 15:18:46 +02001611 "../rtc_base:macromagic",
Florent Castelli57aa81b2022-04-04 17:14:02 +02001612 "../rtc_base:stringutils",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +01001613 "../rtc_base:threading",
Niels Möllerbe140b42021-03-11 10:24:06 +01001614 "../rtc_base/task_utils:pending_task_safety_flag",
1615 "../rtc_base/task_utils:to_queued_task",
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001616 ]
Ali Tofigh7fa90572022-03-17 15:47:49 +01001617
1618 absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001619 }
1620 }
1621
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001622 rtc_library("native_video") {
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001623 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001624 "objc/native/src/objc_frame_buffer.h",
1625 "objc/native/src/objc_frame_buffer.mm",
1626 "objc/native/src/objc_video_decoder_factory.h",
1627 "objc/native/src/objc_video_decoder_factory.mm",
1628 "objc/native/src/objc_video_encoder_factory.h",
1629 "objc/native/src/objc_video_encoder_factory.mm",
1630 "objc/native/src/objc_video_frame.h",
1631 "objc/native/src/objc_video_frame.mm",
1632 "objc/native/src/objc_video_renderer.h",
1633 "objc/native/src/objc_video_renderer.mm",
1634 "objc/native/src/objc_video_track_source.h",
1635 "objc/native/src/objc_video_track_source.mm",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001636 ]
1637
1638 configs += [ "..:common_objc" ]
1639
1640 public_configs = [ ":common_config_objc" ]
1641
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001642 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001643 ":base_native_additions_objc",
1644 ":base_objc",
1645 ":helpers_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001646 ":videocodec_objc",
1647 ":videoframebuffer_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001648 ":vpx_codec_constants",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001649 ":wrapped_native_codec_objc",
Niels Möllerc6ce9c52018-05-11 11:15:30 +02001650 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +02001651 "../api/video:video_rtp_headers",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001652 "../api/video_codecs:video_codecs_api",
1653 "../common_video",
1654 "../media:rtc_audio_video",
1655 "../media:rtc_media_base",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001656 "../modules/video_coding:video_codec_interface",
Artem Titov94b57c02019-03-21 13:35:10 +01001657 "../rtc_base",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001658 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001659 "../rtc_base:logging",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001660 ]
1661 }
1662
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001663 rtc_library("video_toolbox_cc") {
Artem Titarenko42b43152018-10-29 18:18:09 +01001664 visibility = [
Mirko Bonadei08574ae2020-09-16 07:22:57 +00001665 ":sdk_unittests_sources",
Mirko Bonadeiaef8a212020-09-16 15:09:53 +02001666 ":videotoolbox_objc",
Artem Titarenko42b43152018-10-29 18:18:09 +01001667 ]
mbonadei2c8ac1b2017-05-31 05:14:26 -07001668 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001669 "objc/components/video_codec/helpers.cc",
1670 "objc/components/video_codec/helpers.h",
1671 "objc/components/video_codec/nalu_rewriter.cc",
1672 "objc/components/video_codec/nalu_rewriter.h",
mbonadeic0af5ac2017-08-24 12:26:05 -07001673 ]
1674 deps = [
1675 "../common_video",
mbonadeic0af5ac2017-08-24 12:26:05 -07001676 "../modules/video_coding:webrtc_h264",
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001677 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001678 "../rtc_base:logging",
mbonadeic0af5ac2017-08-24 12:26:05 -07001679 "../rtc_base:rtc_base_approved",
1680 ]
mbonadeic0af5ac2017-08-24 12:26:05 -07001681 }
1682
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001683 rtc_library("videotoolbox_objc") {
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001684 visibility = [ "*" ]
Anders Carlsson45340ca2019-01-14 14:23:23 +01001685 allow_poison = [ "audio_codecs" ] # TODO(bugs.webrtc.org/8396): Remove.
mbonadeic0af5ac2017-08-24 12:26:05 -07001686 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001687 "objc/components/video_codec/RTCVideoDecoderFactoryH264.h",
1688 "objc/components/video_codec/RTCVideoDecoderFactoryH264.m",
1689 "objc/components/video_codec/RTCVideoDecoderH264.h",
1690 "objc/components/video_codec/RTCVideoDecoderH264.mm",
1691 "objc/components/video_codec/RTCVideoEncoderFactoryH264.h",
1692 "objc/components/video_codec/RTCVideoEncoderFactoryH264.m",
1693 "objc/components/video_codec/RTCVideoEncoderH264.h",
1694 "objc/components/video_codec/RTCVideoEncoderH264.mm",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001695 ]
1696
Anders Carlsson358f2e02018-06-04 10:24:37 +02001697 configs += [
1698 "..:common_objc",
1699 ":used_from_extension",
1700 ]
1701
1702 if (is_ios && rtc_apprtcmobile_broadcast_extension) {
1703 defines = [ "RTC_APPRTCMOBILE_BROADCAST_EXTENSION" ]
1704 }
mbonadei2c8ac1b2017-05-31 05:14:26 -07001705
1706 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001707 ":base_native_additions_objc",
1708 ":base_objc",
1709 ":helpers_objc",
mbonadeic0af5ac2017-08-24 12:26:05 -07001710 ":video_toolbox_cc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001711 ":videocodec_objc",
1712 ":videoframebuffer_objc",
Johannes Kronc3fcee72021-04-19 09:09:26 +02001713 "../api/video_codecs:video_codecs_api",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001714 "../common_video",
Patrik Höglund99175c62018-01-08 11:05:10 +01001715 "../modules/video_coding:video_codec_interface",
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001716 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001717 "../rtc_base:logging",
ehmaldonadof6a861a2017-07-19 10:40:47 -07001718 "../rtc_base:rtc_base_approved",
Mirko Bonadei401d0562017-12-14 11:24:00 +01001719 "//third_party/libyuv",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001720 ]
1721
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +02001722 frameworks = [
mbonadei2c8ac1b2017-05-31 05:14:26 -07001723 "CoreFoundation.framework",
1724 "CoreMedia.framework",
1725 "CoreVideo.framework",
1726 "VideoToolbox.framework",
1727 ]
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001728 }
1729 }
tkchin9eeb6242016-04-27 01:54:20 -07001730}