blob: ced97d97610dd85c26799ab74dd6640d5aa66cde [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",
365 "../rtc_base:threading",
366 ]
Ali Tofigh7fa90572022-03-17 15:47:49 +0100367
368 absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -0700369 }
370
371 rtc_library("network_monitor_objc") {
372 visibility = [ "*" ]
373
374 sources = [
375 "objc/components/network/RTCNetworkMonitor+Private.h",
376 "objc/components/network/RTCNetworkMonitor.h",
377 "objc/components/network/RTCNetworkMonitor.mm",
378 ]
379
380 configs += [ ":used_from_extension" ]
381
382 frameworks = [ "Network.framework" ]
383
384 deps = [
385 ":base_objc",
386 ":helpers_objc",
387 ":network_monitor_observer",
Ali Tofigh7fa90572022-03-17 15:47:49 +0100388 "../rtc_base:stringutils",
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -0700389 "../rtc_base/system:gcd_helpers",
390 ]
391 }
denicija59ee91b2017-06-05 05:48:47 -0700392 }
zhihuanga4c113a2017-06-28 14:05:44 -0700393
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200394 rtc_library("videosource_objc") {
zhihuanga4c113a2017-06-28 14:05:44 -0700395 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200396 "objc/api/peerconnection/RTCVideoSource+Private.h",
397 "objc/api/peerconnection/RTCVideoSource.h",
398 "objc/api/peerconnection/RTCVideoSource.mm",
zhihuanga4c113a2017-06-28 14:05:44 -0700399 ]
400
401 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200402 ":base_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100403 ":mediasource_objc",
404 ":native_video",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100405 ":videoframebuffer_objc",
zhihuanga4c113a2017-06-28 14:05:44 -0700406 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200407 "../api:media_stream_interface",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200408 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200409 "../api/video:video_rtp_headers",
zhihuanga4c113a2017-06-28 14:05:44 -0700410 "../common_video",
411 "../media:rtc_media_base",
Harald Alvestrande5a73f52022-03-28 12:06:34 +0000412 "../pc:video_track_source_proxy",
Artem Titov94b57c02019-03-21 13:35:10 +0100413 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100414 "../rtc_base:checks",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100415 "../rtc_base:threading",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100416 "//third_party/libyuv",
zhihuanga4c113a2017-06-28 14:05:44 -0700417 ]
418
Anders Carlsson358f2e02018-06-04 10:24:37 +0200419 configs += [
420 "..:common_objc",
421 ":used_from_extension",
422 ]
zhihuanga4c113a2017-06-28 14:05:44 -0700423 }
424
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200425 rtc_library("videoframebuffer_objc") {
Mirko Bonadei2ad8c432018-08-09 10:54:40 +0200426 visibility = [ "*" ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100427 sources = [
Anders Carlsson4e5af962018-09-03 14:44:50 +0200428 "objc/api/video_frame_buffer/RTCNativeI420Buffer+Private.h",
429 "objc/api/video_frame_buffer/RTCNativeI420Buffer.h",
430 "objc/api/video_frame_buffer/RTCNativeI420Buffer.mm",
431 "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.h",
432 "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200433 "objc/components/video_frame_buffer/RTCCVPixelBuffer.h",
434 "objc/components/video_frame_buffer/RTCCVPixelBuffer.mm",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100435 ]
436 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200437 ":base_objc",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200438 "../rtc_base:logging",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200439 "//api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200440 "//api/video:video_rtp_headers",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100441 "//common_video",
442 "//rtc_base:checks",
443 "//rtc_base:rtc_base_approved",
444 "//third_party/libyuv",
445 ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200446 configs += [
447 "..:common_objc",
448 ":used_from_extension",
449 ]
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200450 frameworks = [
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100451 "VideoToolbox.framework",
Oleh Prypinb3f78de2019-07-18 22:25:48 +0200452 "CoreGraphics.framework",
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100453 "CoreVideo.framework",
454 ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100455 }
456
Jordan Rose53d3fc92021-07-06 12:16:41 -0700457 rtc_library("opengl_objc") {
kthelgason2f088792017-05-30 01:48:47 -0700458 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200459 "objc/components/renderer/opengl/RTCDefaultShader.h",
460 "objc/components/renderer/opengl/RTCDefaultShader.mm",
461 "objc/components/renderer/opengl/RTCI420TextureCache.h",
462 "objc/components/renderer/opengl/RTCI420TextureCache.mm",
463 "objc/components/renderer/opengl/RTCOpenGLDefines.h",
464 "objc/components/renderer/opengl/RTCShader.h",
465 "objc/components/renderer/opengl/RTCShader.mm",
466 "objc/components/renderer/opengl/RTCVideoViewShading.h",
kthelgason2f088792017-05-30 01:48:47 -0700467 ]
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200468 frameworks = [ "CoreVideo.framework" ]
denicijad2088152017-04-28 02:14:54 -0700469 if (is_ios) {
denicija070d5e32017-02-26 11:44:13 -0800470 sources += [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200471 "objc/components/renderer/opengl/RTCNV12TextureCache.h",
472 "objc/components/renderer/opengl/RTCNV12TextureCache.m",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700473 ]
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200474 frameworks += [
mbonadei2c8ac1b2017-05-31 05:14:26 -0700475 "GLKit.framework",
476 "OpenGLES.framework",
477 "QuartzCore.framework",
478 ]
479 } else if (is_mac) {
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200480 frameworks += [
mbonadei2c8ac1b2017-05-31 05:14:26 -0700481 "CoreMedia.framework",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700482 "OpenGL.framework",
denicija070d5e32017-02-26 11:44:13 -0800483 ]
484 }
Mirko Bonadei6b09c452021-07-05 16:47:49 +0200485
486 # TODO(bugs.webrtc.org/12937): Remove OpenGL deprecation warning
487 # workaround.
Björn Terelius02768ae2021-07-02 16:19:32 +0200488 defines = [ "GLES_SILENCE_DEPRECATION" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700489
kthelgason2f088792017-05-30 01:48:47 -0700490 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200491 ":base_objc",
492 ":helpers_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100493 ":mediaconstraints_objc",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +0100494 ":native_video",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100495 ":videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100496 ":videosource_objc",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700497 "../api:libjingle_peerconnection_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200498 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200499 "../api/video:video_rtp_headers",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700500 "../common_video",
501 "../media:rtc_media_base",
Artem Titov94b57c02019-03-21 13:35:10 +0100502 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100503 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200504 "../rtc_base:logging",
tkchin9eeb6242016-04-27 01:54:20 -0700505 ]
Mirko Bonadei2dcf3482020-06-05 14:30:41 +0200506 absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700507
Anders Carlsson358f2e02018-06-04 10:24:37 +0200508 configs += [
509 "..:common_objc",
510 ":used_from_extension",
511 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800512 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800513
Jordan Rose53d3fc92021-07-06 12:16:41 -0700514 rtc_library("opengl_ui_objc") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000515 visibility = [ "*" ]
Jake Brombergfb7fd242021-06-14 13:44:25 -0700516 allow_poison = [
517 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
518 "default_task_queue",
519 ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700520 if (is_ios) {
521 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200522 "objc/components/renderer/opengl/RTCDisplayLinkTimer.h",
523 "objc/components/renderer/opengl/RTCDisplayLinkTimer.m",
524 "objc/components/renderer/opengl/RTCEAGLVideoView.h",
525 "objc/components/renderer/opengl/RTCEAGLVideoView.m",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700526 ]
Mirko Bonadei6b09c452021-07-05 16:47:49 +0200527
528 # TODO(bugs.webrtc.org/12937): Remove OpenGL deprecation warning
529 # workaround.
Björn Terelius02768ae2021-07-02 16:19:32 +0200530 defines = [ "GLES_SILENCE_DEPRECATION" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700531 }
532 if (is_mac) {
533 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200534 "objc/components/renderer/opengl/RTCNSGLVideoView.h",
535 "objc/components/renderer/opengl/RTCNSGLVideoView.m",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700536 ]
537 }
538 configs += [ "..:common_objc" ]
539 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200540 ":base_objc",
541 ":helpers_objc",
Jake Brombergfb7fd242021-06-14 13:44:25 -0700542 ":metal_objc",
Jordan Rose53d3fc92021-07-06 12:16:41 -0700543 ":opengl_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100544 ":videocapture_objc",
545 ":videoframebuffer_objc",
mbonadei2c8ac1b2017-05-31 05:14:26 -0700546 ]
547 }
kthelgasonebc34e72016-09-15 04:30:18 -0700548
Jake Brombergfb7fd242021-06-14 13:44:25 -0700549 rtc_library("metal_objc") {
550 visibility = [ "*" ]
551 allow_poison = [
552 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
553 "default_task_queue",
554 ]
555 sources = [
556 "objc/components/renderer/metal/RTCMTLI420Renderer.h",
557 "objc/components/renderer/metal/RTCMTLI420Renderer.mm",
558 "objc/components/renderer/metal/RTCMTLNV12Renderer.h",
559 "objc/components/renderer/metal/RTCMTLNV12Renderer.mm",
560 "objc/components/renderer/metal/RTCMTLRGBRenderer.h",
561 "objc/components/renderer/metal/RTCMTLRGBRenderer.mm",
562 "objc/components/renderer/metal/RTCMTLRenderer+Private.h",
563 "objc/components/renderer/metal/RTCMTLRenderer.h",
564 "objc/components/renderer/metal/RTCMTLRenderer.mm",
565 ]
566 frameworks = [
567 "CoreVideo.framework",
568 "Metal.framework",
569 "MetalKit.framework",
570 ]
571 if (is_ios) {
572 sources += [
573 "objc/components/renderer/metal/RTCMTLVideoView.h",
574 "objc/components/renderer/metal/RTCMTLVideoView.m",
Danil Chapovalov41300af2019-07-10 12:44:43 +0200575 ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700576 }
Jake Brombergfb7fd242021-06-14 13:44:25 -0700577 if (is_mac) {
578 sources += [
579 "objc/components/renderer/metal/RTCMTLNSVideoView.h",
580 "objc/components/renderer/metal/RTCMTLNSVideoView.m",
581 ]
582 frameworks += [ "AppKit.framework" ]
583 }
584 deps = [
585 ":base_objc",
586 ":peerconnectionfactory_base_objc",
Jake Brombergfb7fd242021-06-14 13:44:25 -0700587 ":videoframebuffer_objc",
588 "../api/video:video_frame",
589 "../api/video:video_rtp_headers",
590 "../rtc_base:checks",
591 "../rtc_base:rtc_base_approved",
592 ]
593 configs += [ "..:common_objc" ]
594 public_configs = [ ":common_config_objc" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -0700595 }
596
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200597 # TODO(bugs.webrtc.org/9627): Remove this target.
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200598 rtc_library("videocapturebase_objc") {
Anders Carlsson73119182018-03-15 09:41:03 +0100599 visibility = [ "*" ]
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +0100600 sources = [ "objc/helpers/noop.mm" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100601
602 configs += [ "..:common_objc" ]
603
604 public_configs = [ ":common_config_objc" ]
605
606 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200607 ":base_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100608 ":videoframebuffer_objc",
609 ]
610 }
611
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200612 rtc_library("videocapture_objc") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000613 visibility = [ "*" ]
Anders Carlsson45340ca2019-01-14 14:23:23 +0100614 allow_poison = [ "audio_codecs" ] # TODO(bugs.webrtc.org/8396): Remove.
mbonadei2c8ac1b2017-05-31 05:14:26 -0700615 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200616 "objc/components/capturer/RTCCameraVideoCapturer.h",
617 "objc/components/capturer/RTCCameraVideoCapturer.m",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200618 "objc/components/capturer/RTCFileVideoCapturer.h",
619 "objc/components/capturer/RTCFileVideoCapturer.m",
zhihuanga4c113a2017-06-28 14:05:44 -0700620 ]
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200621 frameworks = [
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100622 "AVFoundation.framework",
623 "CoreVideo.framework",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200624 "QuartzCore.framework",
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100625 ]
zhihuanga4c113a2017-06-28 14:05:44 -0700626
zhihuanga4c113a2017-06-28 14:05:44 -0700627 configs += [ "..:common_objc" ]
628
kthelgason36d658d2017-08-24 05:43:45 -0700629 public_configs = [ ":common_config_objc" ]
zhihuanga4c113a2017-06-28 14:05:44 -0700630
zhihuanga4c113a2017-06-28 14:05:44 -0700631 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200632 ":base_objc",
633 ":helpers_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100634 ":videoframebuffer_objc",
Yura Yaroshevichebf739b2020-03-16 18:00:59 +0300635 "../rtc_base/system:gcd_helpers",
zhihuanga4c113a2017-06-28 14:05:44 -0700636 ]
zhihuanga4c113a2017-06-28 14:05:44 -0700637 }
638
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200639 rtc_library("videocodec_objc") {
Karl Wibergbb23c832018-04-22 19:55:00 +0200640 visibility = [ "*" ]
Mirko Bonadei96ede162018-09-06 13:45:44 +0200641 configs += [ "..:no_global_constructors" ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100642 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200643 "objc/components/video_codec/RTCCodecSpecificInfoH264+Private.h",
644 "objc/components/video_codec/RTCCodecSpecificInfoH264.h",
645 "objc/components/video_codec/RTCCodecSpecificInfoH264.mm",
646 "objc/components/video_codec/RTCH264ProfileLevelId.h",
647 "objc/components/video_codec/RTCH264ProfileLevelId.mm",
zhihuanga4c113a2017-06-28 14:05:44 -0700648 ]
Yura Yaroshevich0f77fea2018-04-26 15:41:01 +0300649 if (is_ios) {
650 sources += [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200651 "objc/components/video_codec/UIDevice+H264Profile.h",
652 "objc/components/video_codec/UIDevice+H264Profile.mm",
Yura Yaroshevich0f77fea2018-04-26 15:41:01 +0300653 ]
654 }
Mirko Bonadeifc52b912019-03-01 10:32:56 +0100655
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100656 public_configs = [ ":common_config_objc" ]
657 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200658 ":base_objc",
659 ":helpers_objc",
kthelgasonfb143122017-07-25 07:55:58 -0700660 "../api/video_codecs:video_codecs_api",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100661 "../common_video",
zhihuanga4c113a2017-06-28 14:05:44 -0700662 "../media:rtc_media_base",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100663 "../modules/video_coding:video_codec_interface",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200664 "../rtc_base:checks",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100665 "../rtc_base:rtc_base_approved",
zhihuanga4c113a2017-06-28 14:05:44 -0700666 ]
667 }
668
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200669 rtc_library("default_codec_factory_objc") {
Anders Carlssondd8c1652018-01-30 10:32:13 +0100670 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200671 "objc/components/video_codec/RTCDefaultVideoDecoderFactory.h",
672 "objc/components/video_codec/RTCDefaultVideoDecoderFactory.m",
673 "objc/components/video_codec/RTCDefaultVideoEncoderFactory.h",
674 "objc/components/video_codec/RTCDefaultVideoEncoderFactory.m",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100675 ]
676
677 deps = [
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +0300678 ":av1",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200679 ":base_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100680 ":native_video",
681 ":videocodec_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200682 ":videotoolbox_objc",
Magnus Jedvert8b4e92d2018-04-13 15:36:43 +0200683 ":vp8",
684 ":vp9",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200685 ":vpx_codec_constants",
686 ]
687 }
688
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200689 rtc_library("vpx_codec_constants") {
Mirko Bonadei96ede162018-09-06 13:45:44 +0200690 configs += [ "..:no_global_constructors" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200691 sources = [
692 "objc/api/video_codec/RTCVideoCodecConstants.h",
693 "objc/api/video_codec/RTCVideoCodecConstants.mm",
694 ]
695
696 deps = [
697 ":base_objc",
698 "../media:rtc_media_base",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100699 ]
Anders Carlssondd8c1652018-01-30 10:32:13 +0100700 }
701
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200702 rtc_library("vp8") {
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100703 visibility = [ "*" ]
Karl Wiberg7ba22b82018-04-27 04:31:53 +0200704 allow_poison = [ "software_video_codecs" ]
Anders Carlssondd8c1652018-01-30 10:32:13 +0100705 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200706 "objc/api/video_codec/RTCVideoDecoderVP8.h",
707 "objc/api/video_codec/RTCVideoDecoderVP8.mm",
708 "objc/api/video_codec/RTCVideoEncoderVP8.h",
709 "objc/api/video_codec/RTCVideoEncoderVP8.mm",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100710 ]
711
Anders Carlssondd8c1652018-01-30 10:32:13 +0100712 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200713 ":base_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100714 ":wrapped_native_codec_objc",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100715 "../modules/video_coding:webrtc_vp8",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100716 ]
717 }
718
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200719 rtc_library("vp9") {
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100720 visibility = [ "*" ]
Karl Wiberg7ba22b82018-04-27 04:31:53 +0200721 allow_poison = [ "software_video_codecs" ]
Anders Carlssondd8c1652018-01-30 10:32:13 +0100722 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200723 "objc/api/video_codec/RTCVideoDecoderVP9.h",
724 "objc/api/video_codec/RTCVideoDecoderVP9.mm",
725 "objc/api/video_codec/RTCVideoEncoderVP9.h",
726 "objc/api/video_codec/RTCVideoEncoderVP9.mm",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100727 ]
728
Anders Carlssondd8c1652018-01-30 10:32:13 +0100729 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200730 ":base_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100731 ":wrapped_native_codec_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200732 "../media:rtc_media_base",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100733 "../modules/video_coding:webrtc_vp9",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100734 ]
735 }
736
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +0300737 rtc_library("av1") {
738 visibility = [ "*" ]
739 allow_poison = [ "software_video_codecs" ]
740 sources = [
741 "objc/api/video_codec/RTCVideoDecoderAV1.h",
742 "objc/api/video_codec/RTCVideoDecoderAV1.mm",
743 "objc/api/video_codec/RTCVideoEncoderAV1.h",
744 "objc/api/video_codec/RTCVideoEncoderAV1.mm",
745 ]
746
747 deps = [
748 ":base_objc",
749 ":wrapped_native_codec_objc",
750 "../media:rtc_media_base",
751 "../modules/video_coding/codecs/av1:libaom_av1_decoder",
philipel95701502022-01-18 18:47:52 +0100752 "../modules/video_coding/codecs/av1:libaom_av1_encoder_if_supported",
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +0300753 ]
754 }
755
zhihuanga4c113a2017-06-28 14:05:44 -0700756 # Build the PeerConnectionFactory without audio/video support.
757 # This target depends on the objc_peeerconnectionfactory_base which still
758 # includes some audio/video related objects such as RTCAudioSource because
759 # these objects are just thin wrappers of native C++ interfaces required
760 # when implementing webrtc::PeerConnectionFactoryInterface and
761 # webrtc::PeerConnectionInterface.
Kári Tristan Helgasona2d89fc2018-03-06 10:18:43 +0100762 # The applications which only use WebRTC DataChannel can depend on this.
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200763 rtc_library("peerconnectionfactory_no_media_objc") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000764 visibility = [ "*" ]
Danil Chapovalov41300af2019-07-10 12:44:43 +0200765 allow_poison = [
766 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
767 "default_task_queue",
768 ]
zhihuanga4c113a2017-06-28 14:05:44 -0700769 defines = [ "HAVE_NO_MEDIA" ]
770
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +0100771 sources = [ "objc/helpers/noop.mm" ]
zhihuanga4c113a2017-06-28 14:05:44 -0700772
kthelgason36d658d2017-08-24 05:43:45 -0700773 public_configs = [ ":common_config_objc" ]
zhihuanga4c113a2017-06-28 14:05:44 -0700774
zhihuanga4c113a2017-06-28 14:05:44 -0700775 deps = [
Anders Carlsson3ff50fb2018-02-01 15:47:05 +0100776 ":native_api",
777 ":native_video",
kthelgason36d658d2017-08-24 05:43:45 -0700778 ":peerconnectionfactory_base_objc",
zhihuanga4c113a2017-06-28 14:05:44 -0700779 "../api:libjingle_peerconnection_api",
Artem Titov94b57c02019-03-21 13:35:10 +0100780 "../rtc_base",
zhihuanga4c113a2017-06-28 14:05:44 -0700781 ]
782 }
783
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200784 rtc_library("mediaconstraints_objc") {
Mirko Bonadei96ede162018-09-06 13:45:44 +0200785 configs += [ "..:no_global_constructors" ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100786 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200787 "objc/api/peerconnection/RTCMediaConstraints+Private.h",
788 "objc/api/peerconnection/RTCMediaConstraints.h",
789 "objc/api/peerconnection/RTCMediaConstraints.mm",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100790 ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100791
792 public_configs = [ ":common_config_objc" ]
793 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200794 ":base_objc",
795 ":helpers_objc",
Niels Möllerdac03d92019-02-13 08:52:27 +0100796 ":media_constraints",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100797 ]
798 }
799
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200800 # TODO(bugs.webrtc.org/9627): Remove, targets should depend on base_objc.
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200801 rtc_library("videorenderer_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200802 visibility = [ "*" ]
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +0100803 sources = [ "objc/helpers/noop.mm" ]
Anders Carlsson9823ee42018-03-07 10:32:03 +0100804
805 configs += [ "..:common_objc" ]
Anders Carlsson9823ee42018-03-07 10:32:03 +0100806 public_configs = [ ":common_config_objc" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200807
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +0100808 deps = [ ":base_objc" ]
Anders Carlsson9823ee42018-03-07 10:32:03 +0100809 }
810
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200811 rtc_library("videorendereradapter_objc") {
Karl Wibergbb23c832018-04-22 19:55:00 +0200812 visibility = [ "*" ]
Anders Carlsson45340ca2019-01-14 14:23:23 +0100813 allow_poison = [ "audio_codecs" ] # TODO(bugs.webrtc.org/8396): Remove.
Anders Carlsson9823ee42018-03-07 10:32:03 +0100814 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200815 "objc/api/RTCVideoRendererAdapter+Private.h",
816 "objc/api/RTCVideoRendererAdapter.h",
817 "objc/api/RTCVideoRendererAdapter.mm",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100818 ]
819
820 configs += [ "..:common_objc" ]
Anders Carlsson9823ee42018-03-07 10:32:03 +0100821 public_configs = [ ":common_config_objc" ]
822
823 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200824 ":base_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100825 ":native_api",
826 ":videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100827 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200828 "../api:media_stream_interface",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100829 ]
830 }
831
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200832 rtc_library("mediasource_objc") {
Anders Carlsson9823ee42018-03-07 10:32:03 +0100833 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200834 "objc/api/peerconnection/RTCMediaSource+Private.h",
835 "objc/api/peerconnection/RTCMediaSource.h",
836 "objc/api/peerconnection/RTCMediaSource.mm",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100837 ]
838
Anders Carlsson358f2e02018-06-04 10:24:37 +0200839 configs += [
840 "..:common_objc",
841 ":used_from_extension",
842 ]
Anders Carlsson9823ee42018-03-07 10:32:03 +0100843 public_configs = [ ":common_config_objc" ]
844
845 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200846 ":base_objc",
Niels Möllere942b142019-09-17 14:30:41 +0200847 "../api:media_stream_interface",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100848 "../rtc_base:checks",
849 ]
850 }
851
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200852 rtc_library("base_native_additions_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200853 sources = [
854 "objc/api/peerconnection/RTCEncodedImage+Private.h",
855 "objc/api/peerconnection/RTCEncodedImage+Private.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200856 "objc/api/peerconnection/RTCVideoCodecInfo+Private.h",
857 "objc/api/peerconnection/RTCVideoCodecInfo+Private.mm",
858 "objc/api/peerconnection/RTCVideoEncoderSettings+Private.h",
859 "objc/api/peerconnection/RTCVideoEncoderSettings+Private.mm",
860 ]
861
862 configs += [ "..:common_objc" ]
863
864 public_configs = [ ":common_config_objc" ]
865
866 deps = [
867 ":base_objc",
868 ":helpers_objc",
Niels Möller4dc66c52018-10-05 14:17:58 +0200869 "../api/video:encoded_image",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200870 "../api/video_codecs:video_codecs_api",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200871 "../modules/video_coding:video_codec_interface",
Artem Titov94b57c02019-03-21 13:35:10 +0100872 "../rtc_base",
Florent Castellif86f6f92022-04-05 02:54:12 +0200873 "../rtc_base:refcount",
Florent Castellie10a9f62022-04-04 17:04:37 +0200874 "../rtc_base:safe_conversions",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200875 ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200876 }
877
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200878 rtc_library("peerconnectionfactory_base_objc") {
Karl Wibergbb23c832018-04-22 19:55:00 +0200879 visibility = [ "*" ]
Danil Chapovalov41300af2019-07-10 12:44:43 +0200880 allow_poison = [
881 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
882 "default_task_queue",
883 ]
Byoungchan Lee524a4222021-11-19 19:03:49 +0900884 configs += [ "..:no_global_constructors" ]
zhihuanga4c113a2017-06-28 14:05:44 -0700885 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200886 "objc/api/peerconnection/RTCAudioSource+Private.h",
887 "objc/api/peerconnection/RTCAudioSource.h",
888 "objc/api/peerconnection/RTCAudioSource.mm",
889 "objc/api/peerconnection/RTCAudioTrack+Private.h",
890 "objc/api/peerconnection/RTCAudioTrack.h",
891 "objc/api/peerconnection/RTCAudioTrack.mm",
892 "objc/api/peerconnection/RTCCertificate.h",
893 "objc/api/peerconnection/RTCCertificate.mm",
894 "objc/api/peerconnection/RTCConfiguration+Native.h",
895 "objc/api/peerconnection/RTCConfiguration+Private.h",
896 "objc/api/peerconnection/RTCConfiguration.h",
897 "objc/api/peerconnection/RTCConfiguration.mm",
Benjamin Wright8c27cca2018-10-25 10:16:44 -0700898 "objc/api/peerconnection/RTCCryptoOptions.h",
899 "objc/api/peerconnection/RTCCryptoOptions.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200900 "objc/api/peerconnection/RTCDataChannel+Private.h",
901 "objc/api/peerconnection/RTCDataChannel.h",
902 "objc/api/peerconnection/RTCDataChannel.mm",
903 "objc/api/peerconnection/RTCDataChannelConfiguration+Private.h",
904 "objc/api/peerconnection/RTCDataChannelConfiguration.h",
905 "objc/api/peerconnection/RTCDataChannelConfiguration.mm",
906 "objc/api/peerconnection/RTCDtmfSender+Private.h",
907 "objc/api/peerconnection/RTCDtmfSender.h",
908 "objc/api/peerconnection/RTCDtmfSender.mm",
909 "objc/api/peerconnection/RTCFieldTrials.h",
910 "objc/api/peerconnection/RTCFieldTrials.mm",
911 "objc/api/peerconnection/RTCIceCandidate+Private.h",
912 "objc/api/peerconnection/RTCIceCandidate.h",
913 "objc/api/peerconnection/RTCIceCandidate.mm",
Jaehyun Kod2110982021-11-30 19:01:43 +0900914 "objc/api/peerconnection/RTCIceCandidateErrorEvent+Private.h",
915 "objc/api/peerconnection/RTCIceCandidateErrorEvent.h",
916 "objc/api/peerconnection/RTCIceCandidateErrorEvent.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200917 "objc/api/peerconnection/RTCIceServer+Private.h",
918 "objc/api/peerconnection/RTCIceServer.h",
919 "objc/api/peerconnection/RTCIceServer.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200920 "objc/api/peerconnection/RTCLegacyStatsReport+Private.h",
921 "objc/api/peerconnection/RTCLegacyStatsReport.h",
922 "objc/api/peerconnection/RTCLegacyStatsReport.mm",
923 "objc/api/peerconnection/RTCMediaStream+Private.h",
924 "objc/api/peerconnection/RTCMediaStream.h",
925 "objc/api/peerconnection/RTCMediaStream.mm",
926 "objc/api/peerconnection/RTCMediaStreamTrack+Private.h",
927 "objc/api/peerconnection/RTCMediaStreamTrack.h",
928 "objc/api/peerconnection/RTCMediaStreamTrack.mm",
929 "objc/api/peerconnection/RTCMetrics.h",
930 "objc/api/peerconnection/RTCMetrics.mm",
931 "objc/api/peerconnection/RTCMetricsSampleInfo+Private.h",
932 "objc/api/peerconnection/RTCMetricsSampleInfo.h",
933 "objc/api/peerconnection/RTCMetricsSampleInfo.mm",
934 "objc/api/peerconnection/RTCPeerConnection+DataChannel.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200935 "objc/api/peerconnection/RTCPeerConnection+Private.h",
936 "objc/api/peerconnection/RTCPeerConnection+Stats.mm",
937 "objc/api/peerconnection/RTCPeerConnection.h",
938 "objc/api/peerconnection/RTCPeerConnection.mm",
939 "objc/api/peerconnection/RTCPeerConnectionFactory+Native.h",
940 "objc/api/peerconnection/RTCPeerConnectionFactory+Private.h",
941 "objc/api/peerconnection/RTCPeerConnectionFactory.h",
942 "objc/api/peerconnection/RTCPeerConnectionFactory.mm",
943 "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder+DefaultComponents.h",
944 "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder+DefaultComponents.mm",
945 "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder.h",
946 "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder.mm",
947 "objc/api/peerconnection/RTCPeerConnectionFactoryOptions+Private.h",
948 "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.h",
949 "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.mm",
950 "objc/api/peerconnection/RTCRtcpParameters+Private.h",
951 "objc/api/peerconnection/RTCRtcpParameters.h",
952 "objc/api/peerconnection/RTCRtcpParameters.mm",
953 "objc/api/peerconnection/RTCRtpCodecParameters+Private.h",
954 "objc/api/peerconnection/RTCRtpCodecParameters.h",
955 "objc/api/peerconnection/RTCRtpCodecParameters.mm",
956 "objc/api/peerconnection/RTCRtpEncodingParameters+Private.h",
957 "objc/api/peerconnection/RTCRtpEncodingParameters.h",
958 "objc/api/peerconnection/RTCRtpEncodingParameters.mm",
959 "objc/api/peerconnection/RTCRtpHeaderExtension+Private.h",
960 "objc/api/peerconnection/RTCRtpHeaderExtension.h",
961 "objc/api/peerconnection/RTCRtpHeaderExtension.mm",
962 "objc/api/peerconnection/RTCRtpParameters+Private.h",
963 "objc/api/peerconnection/RTCRtpParameters.h",
964 "objc/api/peerconnection/RTCRtpParameters.mm",
Benjamin Wrightddf1a3e2018-10-02 10:20:58 -0700965 "objc/api/peerconnection/RTCRtpReceiver+Native.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200966 "objc/api/peerconnection/RTCRtpReceiver+Private.h",
967 "objc/api/peerconnection/RTCRtpReceiver.h",
968 "objc/api/peerconnection/RTCRtpReceiver.mm",
Benjamin Wrightddf1a3e2018-10-02 10:20:58 -0700969 "objc/api/peerconnection/RTCRtpSender+Native.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200970 "objc/api/peerconnection/RTCRtpSender+Private.h",
971 "objc/api/peerconnection/RTCRtpSender.h",
972 "objc/api/peerconnection/RTCRtpSender.mm",
973 "objc/api/peerconnection/RTCRtpTransceiver+Private.h",
974 "objc/api/peerconnection/RTCRtpTransceiver.h",
975 "objc/api/peerconnection/RTCRtpTransceiver.mm",
976 "objc/api/peerconnection/RTCSSLAdapter.h",
977 "objc/api/peerconnection/RTCSSLAdapter.mm",
978 "objc/api/peerconnection/RTCSessionDescription+Private.h",
979 "objc/api/peerconnection/RTCSessionDescription.h",
980 "objc/api/peerconnection/RTCSessionDescription.mm",
Peter Hanspersbed86042019-02-21 17:27:09 +0100981 "objc/api/peerconnection/RTCStatisticsReport+Private.h",
982 "objc/api/peerconnection/RTCStatisticsReport.h",
983 "objc/api/peerconnection/RTCStatisticsReport.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200984 "objc/api/peerconnection/RTCTracing.h",
985 "objc/api/peerconnection/RTCTracing.mm",
986 "objc/api/peerconnection/RTCVideoTrack+Private.h",
987 "objc/api/peerconnection/RTCVideoTrack.h",
988 "objc/api/peerconnection/RTCVideoTrack.mm",
kthelgason5fe4d492016-12-05 11:27:30 -0800989 ]
kthelgasonebc34e72016-09-15 04:30:18 -0700990
Anders Carlsson358f2e02018-06-04 10:24:37 +0200991 configs += [
992 "..:common_objc",
993 ":used_from_extension",
994 ]
kthelgason36d658d2017-08-24 05:43:45 -0700995 public_configs = [ ":common_config_objc" ]
kthelgasonc0977102017-04-24 00:57:16 -0700996
mbonadei2c8ac1b2017-05-31 05:14:26 -0700997 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200998 ":base_native_additions_objc",
999 ":base_objc",
1000 ":file_logger_objc",
1001 ":helpers_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001002 ":mediaconstraints_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001003 ":mediasource_objc",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001004 ":native_api",
1005 ":native_video",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001006 ":videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001007 ":videorendereradapter_objc",
1008 ":videosource_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001009 ":videotoolbox_objc",
Mirko Bonadeie51f7852017-12-06 11:23:19 +01001010 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +02001011 "../api:media_stream_interface",
Niels Möller695cf6a2019-05-13 12:27:23 +02001012 "../api:rtc_event_log_output_file",
Peter Hanspersbed86042019-02-21 17:27:09 +01001013 "../api:rtc_stats_api",
Niels Möller6dcd4dc2019-08-26 10:45:28 +02001014 "../api:rtp_parameters",
Mirko Bonadeid9708072019-01-25 20:26:48 +01001015 "../api:scoped_refptr",
Jiawei Ouae810c12018-06-20 16:18:59 -07001016 "../api/audio_codecs:audio_codecs_api",
Karl Wiberg5817d3d2018-04-06 10:06:42 +02001017 "../api/audio_codecs:builtin_audio_decoder_factory",
Jiawei Ouae810c12018-06-20 16:18:59 -07001018 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadeieaaaf412019-09-13 14:42:15 +02001019 "../api/crypto:frame_decryptor_interface",
1020 "../api/crypto:frame_encryptor_interface",
Danil Chapovalov4ba04b72019-06-26 15:49:47 +02001021 "../api/rtc_event_log:rtc_event_log_factory",
Danil Chapovalovaaa11432019-05-17 13:20:14 +02001022 "../api/task_queue:default_task_queue_factory",
Erik Språngceb44952020-09-22 11:36:35 +02001023 "../api/transport:field_trial_based_config",
Niels Möllerc6ce9c52018-05-11 11:15:30 +02001024 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +02001025 "../api/video:video_rtp_headers",
Anders Carlsson7e042812017-10-05 16:55:38 +02001026 "../api/video_codecs:video_codecs_api",
Anders Carlssone5960ce2017-06-22 15:26:30 +02001027 "../common_video",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001028 "../media:rtc_media_base",
Jiawei Ouae810c12018-06-20 16:18:59 -07001029 "../modules/audio_device:audio_device_api",
Artem Titov94b57c02019-03-21 13:35:10 +01001030 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +00001031 "../modules/audio_processing:api",
Patrik Höglund99175c62018-01-08 11:05:10 +01001032 "../modules/video_coding:video_codec_interface",
Harald Alvestrandc1e8aeb2022-03-31 19:53:50 +00001033 "../pc:peer_connection_factory",
1034 "../pc:webrtc_sdp",
Artem Titov94b57c02019-03-21 13:35:10 +01001035 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001036 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001037 "../rtc_base:logging",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +01001038 "../rtc_base:network_constants",
Florent Castellie10a9f62022-04-04 17:04:37 +02001039 "../rtc_base:safe_conversions",
Harald Alvestrandc1e8aeb2022-03-31 19:53:50 +00001040 "../stats:rtc_stats",
Mirko Bonadei17f48782018-09-28 08:51:10 +02001041 "../system_wrappers:field_trial",
1042 "../system_wrappers:metrics",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001043 ]
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001044
1045 if (is_ios) {
1046 deps += [ ":native_api_audio_device_module" ]
1047 }
kthelgasonebc34e72016-09-15 04:30:18 -07001048 }
Zeke Chindd0e1e02016-10-11 13:27:26 -07001049
mbonadei2c8ac1b2017-05-31 05:14:26 -07001050 if (rtc_include_tests) {
Daniela012b56b2017-11-15 13:15:24 +01001051 if (is_ios) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001052 rtc_library("sdk_unittests_sources") {
Danielaae012cf2017-10-12 13:46:00 +02001053 testonly = true
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001054 include_dirs = [ "objc/" ]
Daniela012b56b2017-11-15 13:15:24 +01001055
Danielaae012cf2017-10-12 13:46:00 +02001056 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001057 "objc/unittests/ObjCVideoTrackSource_xctest.mm",
1058 "objc/unittests/RTCCVPixelBuffer_xctest.mm",
1059 "objc/unittests/RTCCallbackLogger_xctest.m",
Kári Tristan Helgasonecbdbf62020-02-20 07:34:45 -08001060 "objc/unittests/RTCEncodedImage_xctest.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001061 "objc/unittests/RTCFileVideoCapturer_xctest.mm",
1062 "objc/unittests/RTCH264ProfileLevelId_xctest.m",
Jake Brombergfb7fd242021-06-14 13:44:25 -07001063 "objc/unittests/RTCMTLVideoView_xctest.m",
Aaron Goldenfb4e9bc2019-01-04 12:03:31 -08001064 "objc/unittests/RTCNV12TextureCache_xctest.m",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001065 "objc/unittests/RTCPeerConnectionFactory_xctest.m",
1066 "objc/unittests/frame_buffer_helpers.h",
1067 "objc/unittests/frame_buffer_helpers.mm",
Artem Titarenko42b43152018-10-29 18:18:09 +01001068 "objc/unittests/nalu_rewriter_xctest.mm",
Danielaae012cf2017-10-12 13:46:00 +02001069 ]
Daniela012b56b2017-11-15 13:15:24 +01001070
Mirko Bonadei6b09c452021-07-05 16:47:49 +02001071 # TODO(bugs.webrtc.org/12937): Remove OpenGL deprecation warning
1072 # workaround.
1073 defines = [ "GLES_SILENCE_DEPRECATION" ]
1074
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001075 # TODO(peterhanspers): Reenable these tests on simulator.
1076 # See bugs.webrtc.org/7812
Lahiru Ginnaliya Gamathige1d0e7b62020-10-20 02:43:02 -07001077 if (target_environment != "simulator") {
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001078 sources += [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001079 "objc/unittests/RTCAudioDeviceModule_xctest.mm",
1080 "objc/unittests/RTCAudioDevice_xctest.mm",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001081 ]
1082 }
1083
Danielaae012cf2017-10-12 13:46:00 +02001084 deps = [
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001085 ":audio_device",
Joe Chen0b3a6e32019-12-26 23:01:42 -08001086 ":audio_session_objc",
Kári Tristan Helgasonecbdbf62020-02-20 07:34:45 -08001087 ":base_native_additions_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001088 ":base_objc",
1089 ":callback_logger_objc",
Anders Carlssondc6b4772018-01-15 13:31:03 +01001090 ":framework_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001091 ":mediaconstraints_objc",
Jake Brombergfb7fd242021-06-14 13:44:25 -07001092 ":metal_objc",
Anders Carlssonfe9d8172018-04-03 11:40:39 +02001093 ":native_api",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001094 ":native_api_audio_device_module",
Anders Carlssonfe9d8172018-04-03 11:40:39 +02001095 ":native_video",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001096 ":peerconnectionfactory_base_objc",
Artem Titarenko42b43152018-10-29 18:18:09 +01001097 ":video_toolbox_cc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001098 ":videocapture_objc",
Anders Carlsson79ce8202018-06-01 12:51:09 +02001099 ":videocodec_objc",
Anders Carlssonfe9d8172018-04-03 11:40:39 +02001100 ":videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001101 ":videosource_objc",
Danielaae012cf2017-10-12 13:46:00 +02001102 ":videotoolbox_objc",
Mirko Bonadeid9708072019-01-25 20:26:48 +01001103 "../api:scoped_refptr",
Byoungchan Lee43bd7602019-10-08 23:58:41 +09001104 "../api/task_queue:default_task_queue_factory",
Ilya Nikolaevskiy38e9b062020-10-08 14:36:33 +00001105 "../api/video:video_frame",
Artem Titov94b57c02019-03-21 13:35:10 +01001106 "../common_video",
Danielaae012cf2017-10-12 13:46:00 +02001107 "../media:rtc_media_base",
Anders Carlssonfe9d8172018-04-03 11:40:39 +02001108 "../media:rtc_media_tests_utils",
Artem Titov94b57c02019-03-21 13:35:10 +01001109 "../rtc_base",
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001110 "../rtc_base:gunit_helpers",
Florent Castelli4467ad72022-04-04 15:18:46 +02001111 "../rtc_base:macromagic",
Florent Castellif86f6f92022-04-05 02:54:12 +02001112 "../rtc_base:refcount",
Byoungchan Lee83ceb902021-11-16 11:31:57 +09001113 "../rtc_base/system:unused",
Artem Titov94b57c02019-03-21 13:35:10 +01001114 "../system_wrappers",
Anders Carlssonfe9d8172018-04-03 11:40:39 +02001115 "//third_party/libyuv",
Danielaae012cf2017-10-12 13:46:00 +02001116 ]
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001117
Jordan Rose53d3fc92021-07-06 12:16:41 -07001118 if (rtc_ios_macos_use_opengl_rendering) {
1119 deps += [ ":opengl_objc" ]
1120 }
1121
Danielaae012cf2017-10-12 13:46:00 +02001122 public_deps = [
1123 "//build/config/ios:xctest",
1124 "//third_party/ocmock",
1125 ]
1126 }
1127
Daniela012b56b2017-11-15 13:15:24 +01001128 bundle_data("sdk_unittests_bundle_data") {
Daniela012b56b2017-11-15 13:15:24 +01001129 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001130 "objc/unittests/audio_short16.pcm",
1131 "objc/unittests/audio_short44.pcm",
1132 "objc/unittests/audio_short48.pcm",
Peter Hanspers8d95e3b2018-05-15 10:22:36 +02001133
1134 # Sample video taken from https://media.xiph.org/video/derf/
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001135 "objc/unittests/foreman.mp4",
Daniela012b56b2017-11-15 13:15:24 +01001136 ]
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +01001137 outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
Daniela012b56b2017-11-15 13:15:24 +01001138 }
1139
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001140 # These tests use static linking.
Mirko Bonadeiaef8a212020-09-16 15:09:53 +02001141 rtc_test("sdk_unittests") {
1142 is_xctest = true
Danielaae012cf2017-10-12 13:46:00 +02001143 info_plist = "//test/ios/Info.plist"
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +01001144 sources = [ "objc/unittests/main.mm" ]
Daniela012b56b2017-11-15 13:15:24 +01001145
Artem Titarenkoa2bc3622019-08-19 14:24:00 +02001146 extra_substitutions = [ "GTEST_BUNDLE_ID_SUFFIX=generic-unit-test" ]
Danielaae012cf2017-10-12 13:46:00 +02001147 deps = [
Yura Yaroshevich5297bd22018-06-19 12:51:51 +03001148 ":peerconnectionfactory_base_objc",
Daniela012b56b2017-11-15 13:15:24 +01001149 ":sdk_unittests_bundle_data",
Danielaae012cf2017-10-12 13:46:00 +02001150 ":sdk_unittests_sources",
Niels Möller5a8f8602019-06-12 11:30:59 +02001151 "../rtc_base",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +01001152 "../rtc_base:threading",
Artem Titarenko34fc3462018-11-06 12:29:29 +01001153 "//test:test_support",
Danielaae012cf2017-10-12 13:46:00 +02001154 ]
1155 ldflags = [ "-all_load" ]
1156 }
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001157
1158 # These tests link to the framework.
Mirko Bonadeiaef8a212020-09-16 15:09:53 +02001159 rtc_test("sdk_framework_unittests") {
1160 is_xctest = true
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001161 info_plist = "//test/ios/Info.plist"
1162 sources = [
1163 "objc/unittests/RTCDoNotPutCPlusPlusInFrameworkHeaders_xctest.m",
Artem Titarenko34fc3462018-11-06 12:29:29 +01001164 "objc/unittests/main.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001165 ]
1166
Artem Titarenkoa2bc3622019-08-19 14:24:00 +02001167 extra_substitutions = [ "GTEST_BUNDLE_ID_SUFFIX=generic-unit-test" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001168 deps = [
1169 ":framework_objc+link",
1170 ":ios_framework_bundle",
Niels Möller5a8f8602019-06-12 11:30:59 +02001171 "../rtc_base",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +01001172 "../rtc_base:threading",
Artem Titarenko34fc3462018-11-06 12:29:29 +01001173 "//test:test_support",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001174 ]
1175 }
Danielaae012cf2017-10-12 13:46:00 +02001176 }
1177
1178 # TODO(denicija): once all tests are migrated to xctest remove this source set.
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001179 rtc_library("rtc_unittests_objc") {
mbonadei2c8ac1b2017-05-31 05:14:26 -07001180 testonly = true
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001181
mbonadei2c8ac1b2017-05-31 05:14:26 -07001182 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001183 "objc/unittests/RTCCertificateTest.mm",
1184 "objc/unittests/RTCConfigurationTest.mm",
1185 "objc/unittests/RTCDataChannelConfigurationTest.mm",
1186 "objc/unittests/RTCIceCandidateTest.mm",
1187 "objc/unittests/RTCIceServerTest.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001188 "objc/unittests/RTCMediaConstraintsTest.mm",
1189 "objc/unittests/RTCPeerConnectionFactoryBuilderTest.mm",
1190 "objc/unittests/RTCPeerConnectionTest.mm",
1191 "objc/unittests/RTCSessionDescriptionTest.mm",
1192 "objc/unittests/RTCTracingTest.mm",
1193 "objc/unittests/objc_video_decoder_factory_tests.mm",
1194 "objc/unittests/objc_video_encoder_factory_tests.mm",
1195 "objc/unittests/scoped_cftyperef_tests.mm",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001196 ]
Anders Carlssone7dd83f2018-01-19 11:28:44 +01001197 if (is_ios) {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001198 sources += [ "objc/unittests/RTCCameraVideoCapturerTests.mm" ]
oprypin45197522017-06-22 01:47:20 -07001199 }
mbonadeid7620582017-05-30 01:50:35 -07001200
mbonadei2c8ac1b2017-05-31 05:14:26 -07001201 # |-ObjC| flag needed to make sure category method implementations
1202 # are included:
1203 # https://developer.apple.com/library/mac/qa/qa1490/_index.html
1204 ldflags = [ "-ObjC" ]
magjed3149e092017-05-08 05:32:05 -07001205
mbonadei2c8ac1b2017-05-31 05:14:26 -07001206 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001207 ":base_objc",
1208 ":helpers_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001209 ":mediaconstraints_objc",
1210 ":native_api",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001211 ":native_video",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001212 ":peerconnectionfactory_base_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001213 ":videocapture_objc",
1214 ":videocodec_objc",
1215 ":videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001216 ":videosource_objc",
kthelgason36d658d2017-08-24 05:43:45 -07001217 ":videotoolbox_objc",
Piotr (Peter) Slatalae0c2e972018-10-08 09:43:21 -07001218 "../api:libjingle_peerconnection_api",
Jiawei Ouae810c12018-06-20 16:18:59 -07001219 "../api/audio_codecs:audio_codecs_api",
1220 "../api/audio_codecs:builtin_audio_decoder_factory",
1221 "../api/audio_codecs:builtin_audio_encoder_factory",
Magnus Jedvert8b4e92d2018-04-13 15:36:43 +02001222 "../api/video_codecs:video_codecs_api",
kthelgasonebd4f792017-09-04 04:36:21 -07001223 "../media:rtc_media_base",
Jiawei Ouae810c12018-06-20 16:18:59 -07001224 "../modules/audio_device:audio_device_api",
Artem Titov94b57c02019-03-21 13:35:10 +01001225 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +00001226 "../modules/audio_processing:api",
Patrik Höglund99175c62018-01-08 11:05:10 +01001227 "../modules/video_coding:video_codec_interface",
Mirko Bonadeie3abb812018-11-23 13:15:08 +01001228 "../rtc_base:gunit_helpers",
Byoungchan Lee0a54e7a2021-09-06 22:32:52 +09001229 "../rtc_base:rtc_event",
Niels Möllera12c42a2018-07-25 16:05:48 +02001230 "../rtc_base/system:unused",
Yves Gerey21cddff2018-10-30 21:12:42 +01001231 "../test:test_support",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001232 "//third_party/ocmock",
1233 ]
magjed3149e092017-05-08 05:32:05 -07001234
denicija59ee91b2017-06-05 05:48:47 -07001235 if (is_ios) {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001236 sources += [ "objc/unittests/RTCAudioSessionTest.mm" ]
Joe Chen0b3a6e32019-12-26 23:01:42 -08001237 deps += [ ":audio_session_objc" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -07001238 }
mbonadei2c8ac1b2017-05-31 05:14:26 -07001239 }
kthelgason2f088792017-05-30 01:48:47 -07001240 }
1241
mbonadei2c8ac1b2017-05-31 05:14:26 -07001242 if (is_ios) {
Anders Carlssondc6b4772018-01-15 13:31:03 +01001243 ios_framework_bundle_with_umbrella_header("framework_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001244 info_plist = "objc/Info.plist"
mbonadei2c8ac1b2017-05-31 05:14:26 -07001245 output_name = "WebRTC"
Magnus Jedvertf83dc8b2017-08-29 09:49:43 +00001246
mbonadei2c8ac1b2017-05-31 05:14:26 -07001247 common_objc_headers = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001248 "objc/base/RTCCodecSpecificInfo.h",
1249 "objc/base/RTCEncodedImage.h",
Anders Carlsson4e5af962018-09-03 14:44:50 +02001250 "objc/base/RTCI420Buffer.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001251 "objc/base/RTCLogging.h",
1252 "objc/base/RTCMacros.h",
Anders Carlsson4e5af962018-09-03 14:44:50 +02001253 "objc/base/RTCMutableI420Buffer.h",
1254 "objc/base/RTCMutableYUVPlanarBuffer.h",
Yury Yaroshevich19a6e942022-03-11 09:22:08 +01001255 "objc/base/RTCSSLCertificateVerifier.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001256 "objc/base/RTCVideoCapturer.h",
1257 "objc/base/RTCVideoCodecInfo.h",
1258 "objc/base/RTCVideoDecoder.h",
1259 "objc/base/RTCVideoDecoderFactory.h",
1260 "objc/base/RTCVideoEncoder.h",
1261 "objc/base/RTCVideoEncoderFactory.h",
1262 "objc/base/RTCVideoEncoderQpThresholds.h",
1263 "objc/base/RTCVideoEncoderSettings.h",
1264 "objc/base/RTCVideoFrame.h",
1265 "objc/base/RTCVideoFrameBuffer.h",
1266 "objc/base/RTCVideoRenderer.h",
Anders Carlsson4e5af962018-09-03 14:44:50 +02001267 "objc/base/RTCYUVPlanarBuffer.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001268 "objc/components/audio/RTCAudioSession.h",
1269 "objc/components/audio/RTCAudioSessionConfiguration.h",
1270 "objc/components/capturer/RTCCameraVideoCapturer.h",
1271 "objc/components/capturer/RTCFileVideoCapturer.h",
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001272 "objc/components/network/RTCNetworkMonitor.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001273 "objc/components/renderer/metal/RTCMTLVideoView.h",
1274 "objc/components/renderer/opengl/RTCEAGLVideoView.h",
1275 "objc/components/renderer/opengl/RTCVideoViewShading.h",
1276 "objc/components/video_codec/RTCCodecSpecificInfoH264.h",
1277 "objc/components/video_codec/RTCDefaultVideoDecoderFactory.h",
1278 "objc/components/video_codec/RTCDefaultVideoEncoderFactory.h",
1279 "objc/components/video_codec/RTCH264ProfileLevelId.h",
1280 "objc/components/video_codec/RTCVideoDecoderFactoryH264.h",
1281 "objc/components/video_codec/RTCVideoDecoderH264.h",
1282 "objc/components/video_codec/RTCVideoEncoderFactoryH264.h",
1283 "objc/components/video_codec/RTCVideoEncoderH264.h",
1284 "objc/components/video_frame_buffer/RTCCVPixelBuffer.h",
1285 "objc/helpers/RTCCameraPreviewView.h",
1286 "objc/helpers/RTCDispatcher.h",
1287 "objc/helpers/UIDevice+RTCDevice.h",
1288 "objc/api/peerconnection/RTCAudioSource.h",
1289 "objc/api/peerconnection/RTCAudioTrack.h",
1290 "objc/api/peerconnection/RTCConfiguration.h",
1291 "objc/api/peerconnection/RTCDataChannel.h",
1292 "objc/api/peerconnection/RTCDataChannelConfiguration.h",
1293 "objc/api/peerconnection/RTCFieldTrials.h",
1294 "objc/api/peerconnection/RTCIceCandidate.h",
Jaehyun Kod2110982021-11-30 19:01:43 +09001295 "objc/api/peerconnection/RTCIceCandidateErrorEvent.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001296 "objc/api/peerconnection/RTCIceServer.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001297 "objc/api/peerconnection/RTCLegacyStatsReport.h",
1298 "objc/api/peerconnection/RTCMediaConstraints.h",
1299 "objc/api/peerconnection/RTCMediaSource.h",
1300 "objc/api/peerconnection/RTCMediaStream.h",
1301 "objc/api/peerconnection/RTCMediaStreamTrack.h",
1302 "objc/api/peerconnection/RTCMetrics.h",
1303 "objc/api/peerconnection/RTCMetricsSampleInfo.h",
1304 "objc/api/peerconnection/RTCPeerConnection.h",
1305 "objc/api/peerconnection/RTCPeerConnectionFactory.h",
1306 "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.h",
1307 "objc/api/peerconnection/RTCRtcpParameters.h",
1308 "objc/api/peerconnection/RTCRtpCodecParameters.h",
1309 "objc/api/peerconnection/RTCRtpEncodingParameters.h",
1310 "objc/api/peerconnection/RTCRtpHeaderExtension.h",
1311 "objc/api/peerconnection/RTCRtpParameters.h",
1312 "objc/api/peerconnection/RTCRtpReceiver.h",
1313 "objc/api/peerconnection/RTCRtpSender.h",
1314 "objc/api/peerconnection/RTCRtpTransceiver.h",
1315 "objc/api/peerconnection/RTCDtmfSender.h",
1316 "objc/api/peerconnection/RTCSSLAdapter.h",
1317 "objc/api/peerconnection/RTCSessionDescription.h",
CZ Theng682dabd2019-10-21 11:25:18 +08001318 "objc/api/peerconnection/RTCStatisticsReport.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001319 "objc/api/peerconnection/RTCTracing.h",
1320 "objc/api/peerconnection/RTCCertificate.h",
Benjamin Wright8c27cca2018-10-25 10:16:44 -07001321 "objc/api/peerconnection/RTCCryptoOptions.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001322 "objc/api/peerconnection/RTCVideoSource.h",
1323 "objc/api/peerconnection/RTCVideoTrack.h",
Anders Carlsson4e5af962018-09-03 14:44:50 +02001324 "objc/api/video_codec/RTCVideoCodecConstants.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001325 "objc/api/video_codec/RTCVideoDecoderVP8.h",
1326 "objc/api/video_codec/RTCVideoDecoderVP9.h",
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +03001327 "objc/api/video_codec/RTCVideoDecoderAV1.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001328 "objc/api/video_codec/RTCVideoEncoderVP8.h",
1329 "objc/api/video_codec/RTCVideoEncoderVP9.h",
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +03001330 "objc/api/video_codec/RTCVideoEncoderAV1.h",
Anders Carlsson4e5af962018-09-03 14:44:50 +02001331 "objc/api/video_frame_buffer/RTCNativeI420Buffer.h",
1332 "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.h",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001333 ]
Magnus Jedvert8b4e92d2018-04-13 15:36:43 +02001334
mbonadei2c8ac1b2017-05-31 05:14:26 -07001335 if (!build_with_chromium) {
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001336 common_objc_headers += [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001337 "objc/api/logging/RTCCallbackLogger.h",
1338 "objc/api/peerconnection/RTCFileLogger.h",
Anders Carlsson3b3364e2018-01-30 15:46:13 +01001339 ]
mbonadei2c8ac1b2017-05-31 05:14:26 -07001340 }
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001341
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001342 sources = common_objc_headers
1343 public_headers = common_objc_headers
1344
mbonadei2c8ac1b2017-05-31 05:14:26 -07001345 ldflags = [
1346 "-all_load",
1347 "-install_name",
1348 "@rpath/$output_name.framework/$output_name",
1349 ]
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001350
mbonadei2c8ac1b2017-05-31 05:14:26 -07001351 deps = [
kthelgason36d658d2017-08-24 05:43:45 -07001352 ":audio_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001353 ":base_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001354 ":default_codec_factory_objc",
Mirko Bonadei91d39752022-01-19 08:43:17 +01001355 ":metal_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001356 ":native_api",
1357 ":native_video",
1358 ":peerconnectionfactory_base_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001359 ":videocapture_objc",
1360 ":videocodec_objc",
1361 ":videotoolbox_objc",
ehmaldonadof6a861a2017-07-19 10:40:47 -07001362 "../rtc_base:rtc_base_approved",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001363 ]
Jordan Rose53d3fc92021-07-06 12:16:41 -07001364 if (rtc_ios_macos_use_opengl_rendering) {
1365 deps += [ ":opengl_ui_objc" ]
1366 }
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001367 if (!build_with_chromium) {
1368 deps += [
1369 ":callback_logger_objc",
1370 ":file_logger_objc",
1371 ]
1372 }
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001373
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +02001374 frameworks = [
mbonadei2c8ac1b2017-05-31 05:14:26 -07001375 "AVFoundation.framework",
1376 "CoreGraphics.framework",
1377 "CoreMedia.framework",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001378 ]
1379
Anders Carlsson358f2e02018-06-04 10:24:37 +02001380 configs += [
1381 "..:common_objc",
1382 ":used_from_extension",
1383 ]
mbonadei2c8ac1b2017-05-31 05:14:26 -07001384
kthelgason36d658d2017-08-24 05:43:45 -07001385 public_configs = [ ":common_config_objc" ]
mbonadei2c8ac1b2017-05-31 05:14:26 -07001386 }
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001387
1388 bundle_data("ios_framework_bundle") {
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +01001389 deps = [ "../sdk:framework_objc" ]
1390 sources = [ "$root_build_dir/WebRTC.framework" ]
1391 outputs = [ "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001392 }
1393 }
1394
1395 if (is_mac) {
Anders Carlsson37bbf792018-09-05 16:29:27 +02001396 mac_framework_bundle_with_umbrella_header("mac_framework_objc") {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001397 info_plist = "objc/Info.plist"
1398 output_name = "WebRTC"
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001399
Anders Carlsson37bbf792018-09-05 16:29:27 +02001400 sources = [
1401 "objc/api/peerconnection/RTCAudioSource.h",
1402 "objc/api/peerconnection/RTCAudioTrack.h",
1403 "objc/api/peerconnection/RTCCertificate.h",
1404 "objc/api/peerconnection/RTCConfiguration.h",
Benjamin Wright8c27cca2018-10-25 10:16:44 -07001405 "objc/api/peerconnection/RTCCryptoOptions.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001406 "objc/api/peerconnection/RTCDataChannel.h",
1407 "objc/api/peerconnection/RTCDataChannelConfiguration.h",
1408 "objc/api/peerconnection/RTCDtmfSender.h",
1409 "objc/api/peerconnection/RTCFieldTrials.h",
1410 "objc/api/peerconnection/RTCIceCandidate.h",
Jaehyun Kod2110982021-11-30 19:01:43 +09001411 "objc/api/peerconnection/RTCIceCandidateErrorEvent.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001412 "objc/api/peerconnection/RTCIceServer.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001413 "objc/api/peerconnection/RTCLegacyStatsReport.h",
1414 "objc/api/peerconnection/RTCMediaConstraints.h",
1415 "objc/api/peerconnection/RTCMediaSource.h",
1416 "objc/api/peerconnection/RTCMediaStream.h",
1417 "objc/api/peerconnection/RTCMediaStreamTrack.h",
1418 "objc/api/peerconnection/RTCMetrics.h",
1419 "objc/api/peerconnection/RTCMetricsSampleInfo.h",
1420 "objc/api/peerconnection/RTCPeerConnection.h",
1421 "objc/api/peerconnection/RTCPeerConnectionFactory.h",
1422 "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.h",
1423 "objc/api/peerconnection/RTCRtcpParameters.h",
1424 "objc/api/peerconnection/RTCRtpCodecParameters.h",
1425 "objc/api/peerconnection/RTCRtpEncodingParameters.h",
1426 "objc/api/peerconnection/RTCRtpHeaderExtension.h",
1427 "objc/api/peerconnection/RTCRtpParameters.h",
1428 "objc/api/peerconnection/RTCRtpReceiver.h",
1429 "objc/api/peerconnection/RTCRtpSender.h",
1430 "objc/api/peerconnection/RTCRtpTransceiver.h",
1431 "objc/api/peerconnection/RTCSSLAdapter.h",
1432 "objc/api/peerconnection/RTCSessionDescription.h",
Saúl Ibarra Corretgéf7aa2672021-07-28 23:09:14 +02001433 "objc/api/peerconnection/RTCStatisticsReport.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001434 "objc/api/peerconnection/RTCTracing.h",
1435 "objc/api/peerconnection/RTCVideoSource.h",
1436 "objc/api/peerconnection/RTCVideoTrack.h",
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +03001437 "objc/api/video_codec/RTCVideoDecoderAV1.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001438 "objc/api/video_codec/RTCVideoDecoderVP8.h",
1439 "objc/api/video_codec/RTCVideoDecoderVP9.h",
Yura Yaroshevich8cfb2872021-03-03 12:29:42 +03001440 "objc/api/video_codec/RTCVideoEncoderAV1.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001441 "objc/api/video_codec/RTCVideoEncoderVP8.h",
1442 "objc/api/video_codec/RTCVideoEncoderVP9.h",
1443 "objc/api/video_frame_buffer/RTCNativeI420Buffer.h",
1444 "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.h",
1445 "objc/base/RTCCodecSpecificInfo.h",
1446 "objc/base/RTCEncodedImage.h",
1447 "objc/base/RTCI420Buffer.h",
1448 "objc/base/RTCLogging.h",
1449 "objc/base/RTCMacros.h",
1450 "objc/base/RTCMutableI420Buffer.h",
1451 "objc/base/RTCMutableYUVPlanarBuffer.h",
Yury Yaroshevich19a6e942022-03-11 09:22:08 +01001452 "objc/base/RTCSSLCertificateVerifier.h",
Anders Carlsson37bbf792018-09-05 16:29:27 +02001453 "objc/base/RTCVideoCapturer.h",
1454 "objc/base/RTCVideoCodecInfo.h",
1455 "objc/base/RTCVideoDecoder.h",
1456 "objc/base/RTCVideoDecoderFactory.h",
1457 "objc/base/RTCVideoEncoder.h",
1458 "objc/base/RTCVideoEncoderFactory.h",
1459 "objc/base/RTCVideoEncoderQpThresholds.h",
1460 "objc/base/RTCVideoEncoderSettings.h",
1461 "objc/base/RTCVideoFrame.h",
1462 "objc/base/RTCVideoFrameBuffer.h",
1463 "objc/base/RTCVideoRenderer.h",
1464 "objc/base/RTCYUVPlanarBuffer.h",
1465 "objc/components/capturer/RTCCameraVideoCapturer.h",
1466 "objc/components/capturer/RTCFileVideoCapturer.h",
1467 "objc/components/renderer/metal/RTCMTLNSVideoView.h",
1468 "objc/components/renderer/opengl/RTCNSGLVideoView.h",
1469 "objc/components/renderer/opengl/RTCVideoViewShading.h",
1470 "objc/components/video_codec/RTCCodecSpecificInfoH264.h",
1471 "objc/components/video_codec/RTCDefaultVideoDecoderFactory.h",
1472 "objc/components/video_codec/RTCDefaultVideoEncoderFactory.h",
1473 "objc/components/video_codec/RTCH264ProfileLevelId.h",
1474 "objc/components/video_codec/RTCVideoDecoderFactoryH264.h",
1475 "objc/components/video_codec/RTCVideoDecoderH264.h",
1476 "objc/components/video_codec/RTCVideoEncoderFactoryH264.h",
1477 "objc/components/video_codec/RTCVideoEncoderH264.h",
1478 "objc/components/video_frame_buffer/RTCCVPixelBuffer.h",
1479 "objc/helpers/RTCDispatcher.h",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001480 ]
Anders Carlsson37bbf792018-09-05 16:29:27 +02001481 if (!build_with_chromium) {
1482 sources += [
1483 "objc/api/logging/RTCCallbackLogger.h",
1484 "objc/api/peerconnection/RTCFileLogger.h",
1485 ]
1486 }
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001487
1488 deps = [
1489 ":base_objc",
1490 ":default_codec_factory_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001491 ":native_api",
1492 ":native_video",
Jordan Rose53d3fc92021-07-06 12:16:41 -07001493 ":opengl_ui_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001494 ":peerconnectionfactory_base_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001495 ":videocapture_objc",
1496 ":videocodec_objc",
1497 ":videotoolbox_objc",
1498 "../rtc_base:rtc_base_approved",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001499 ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001500 if (!build_with_chromium) {
1501 deps += [
1502 ":callback_logger_objc",
1503 ":file_logger_objc",
1504 ]
1505 }
1506
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +02001507 frameworks = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001508 "AVFoundation.framework",
1509 "CoreGraphics.framework",
1510 "CoreMedia.framework",
1511 "OpenGL.framework",
1512 ]
1513
Anders Carlsson37bbf792018-09-05 16:29:27 +02001514 configs = [ "..:common_objc" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001515
1516 public_configs = [ ":common_config_objc" ]
1517 }
1518
1519 bundle_data("mac_framework_bundle") {
Danil Chapovalov64f1f3f2020-01-16 14:41:10 +01001520 deps = [ "../sdk:mac_framework_objc" ]
1521 sources = [ "$root_build_dir/WebRTC.framework" ]
1522 outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001523 }
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001524 }
1525
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001526 rtc_library("wrapped_native_codec_objc") {
Anders Carlsson9823ee42018-03-07 10:32:03 +01001527 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001528 "objc/api/video_codec/RTCWrappedNativeVideoDecoder.h",
1529 "objc/api/video_codec/RTCWrappedNativeVideoDecoder.mm",
1530 "objc/api/video_codec/RTCWrappedNativeVideoEncoder.h",
1531 "objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001532 ]
1533
1534 configs += [ "..:common_objc" ]
1535 public_configs = [ ":common_config_objc" ]
1536
Anders Carlsson9823ee42018-03-07 10:32:03 +01001537 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001538 ":base_objc",
1539 ":helpers_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001540 "../api/video_codecs:video_codecs_api",
1541 "../media:rtc_media_base",
1542 ]
1543 }
1544
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001545 # The native API is currently experimental and may change without notice.
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001546 rtc_library("native_api") {
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001547 visibility = [ "*" ]
Anders Carlsson45340ca2019-01-14 14:23:23 +01001548 allow_poison = [ "audio_codecs" ] # TODO(bugs.webrtc.org/8396): Remove.
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001549 sources = [
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001550 "objc/native/api/network_monitor_factory.h",
1551 "objc/native/api/network_monitor_factory.mm",
Yury Yaroshevich19a6e942022-03-11 09:22:08 +01001552 "objc/native/api/ssl_certificate_verifier.h",
1553 "objc/native/api/ssl_certificate_verifier.mm",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001554 "objc/native/api/video_capturer.h",
1555 "objc/native/api/video_capturer.mm",
1556 "objc/native/api/video_decoder_factory.h",
1557 "objc/native/api/video_decoder_factory.mm",
1558 "objc/native/api/video_encoder_factory.h",
1559 "objc/native/api/video_encoder_factory.mm",
1560 "objc/native/api/video_frame.h",
1561 "objc/native/api/video_frame.mm",
1562 "objc/native/api/video_frame_buffer.h",
1563 "objc/native/api/video_frame_buffer.mm",
1564 "objc/native/api/video_renderer.h",
1565 "objc/native/api/video_renderer.mm",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001566 ]
1567
1568 configs += [ "..:common_objc" ]
1569
1570 public_configs = [ ":common_config_objc" ]
1571
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001572 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001573 ":base_objc",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001574 ":native_video",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001575 ":videoframebuffer_objc",
Anders Carlsson73119182018-03-15 09:41:03 +01001576 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +02001577 "../api:media_stream_interface",
Mirko Bonadeid9708072019-01-25 20:26:48 +01001578 "../api:scoped_refptr",
Niels Möllerc6ce9c52018-05-11 11:15:30 +02001579 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +02001580 "../api/video:video_rtp_headers",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001581 "../api/video_codecs:video_codecs_api",
1582 "../common_video",
Artem Titov94b57c02019-03-21 13:35:10 +01001583 "../rtc_base",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001584 "../rtc_base:logging",
Florent Castellif86f6f92022-04-05 02:54:12 +02001585 "../rtc_base:refcount",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +01001586 "../rtc_base:threading",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001587 ]
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001588 if (is_ios) {
1589 deps += [ ":native_network_monitor" ]
1590 }
Mirko Bonadei2dcf3482020-06-05 14:30:41 +02001591 absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001592 }
1593
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001594 if (is_ios) {
1595 rtc_library("native_network_monitor") {
1596 visibility = [ "*" ]
1597
1598 sources = [
1599 "objc/native/src/objc_network_monitor.h",
1600 "objc/native/src/objc_network_monitor.mm",
1601 ]
1602
1603 deps = [
1604 ":network_monitor_objc",
1605 ":network_monitor_observer",
Jonas Orelande62c2f22022-03-29 11:04:48 +02001606 "../api:field_trials_view",
Artem Titovd15a5752021-02-10 14:31:24 +01001607 "../api:sequence_checker",
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001608 "../rtc_base",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001609 "../rtc_base:logging",
Florent Castelli4467ad72022-04-04 15:18:46 +02001610 "../rtc_base:macromagic",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +01001611 "../rtc_base:threading",
Niels Möllerbe140b42021-03-11 10:24:06 +01001612 "../rtc_base/task_utils:pending_task_safety_flag",
1613 "../rtc_base/task_utils:to_queued_task",
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001614 ]
Ali Tofigh7fa90572022-03-17 15:47:49 +01001615
1616 absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
Taylor Brandstetterea7fbfb2020-08-19 16:41:54 -07001617 }
1618 }
1619
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001620 rtc_library("native_video") {
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001621 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001622 "objc/native/src/objc_frame_buffer.h",
1623 "objc/native/src/objc_frame_buffer.mm",
1624 "objc/native/src/objc_video_decoder_factory.h",
1625 "objc/native/src/objc_video_decoder_factory.mm",
1626 "objc/native/src/objc_video_encoder_factory.h",
1627 "objc/native/src/objc_video_encoder_factory.mm",
1628 "objc/native/src/objc_video_frame.h",
1629 "objc/native/src/objc_video_frame.mm",
1630 "objc/native/src/objc_video_renderer.h",
1631 "objc/native/src/objc_video_renderer.mm",
1632 "objc/native/src/objc_video_track_source.h",
1633 "objc/native/src/objc_video_track_source.mm",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001634 ]
1635
1636 configs += [ "..:common_objc" ]
1637
1638 public_configs = [ ":common_config_objc" ]
1639
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001640 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001641 ":base_native_additions_objc",
1642 ":base_objc",
1643 ":helpers_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001644 ":videocodec_objc",
1645 ":videoframebuffer_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001646 ":vpx_codec_constants",
Anders Carlsson9823ee42018-03-07 10:32:03 +01001647 ":wrapped_native_codec_objc",
Niels Möllerc6ce9c52018-05-11 11:15:30 +02001648 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +02001649 "../api/video:video_rtp_headers",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001650 "../api/video_codecs:video_codecs_api",
1651 "../common_video",
1652 "../media:rtc_audio_video",
1653 "../media:rtc_media_base",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001654 "../modules/video_coding:video_codec_interface",
Artem Titov94b57c02019-03-21 13:35:10 +01001655 "../rtc_base",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001656 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001657 "../rtc_base:logging",
Anders Carlsson3ff50fb2018-02-01 15:47:05 +01001658 ]
1659 }
1660
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001661 rtc_library("video_toolbox_cc") {
Artem Titarenko42b43152018-10-29 18:18:09 +01001662 visibility = [
Mirko Bonadei08574ae2020-09-16 07:22:57 +00001663 ":sdk_unittests_sources",
Mirko Bonadeiaef8a212020-09-16 15:09:53 +02001664 ":videotoolbox_objc",
Artem Titarenko42b43152018-10-29 18:18:09 +01001665 ]
mbonadei2c8ac1b2017-05-31 05:14:26 -07001666 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001667 "objc/components/video_codec/helpers.cc",
1668 "objc/components/video_codec/helpers.h",
1669 "objc/components/video_codec/nalu_rewriter.cc",
1670 "objc/components/video_codec/nalu_rewriter.h",
mbonadeic0af5ac2017-08-24 12:26:05 -07001671 ]
1672 deps = [
1673 "../common_video",
mbonadeic0af5ac2017-08-24 12:26:05 -07001674 "../modules/video_coding:webrtc_h264",
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001675 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001676 "../rtc_base:logging",
mbonadeic0af5ac2017-08-24 12:26:05 -07001677 "../rtc_base:rtc_base_approved",
1678 ]
mbonadeic0af5ac2017-08-24 12:26:05 -07001679 }
1680
Mirko Bonadei86d053c2019-10-17 21:32:04 +02001681 rtc_library("videotoolbox_objc") {
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001682 visibility = [ "*" ]
Anders Carlsson45340ca2019-01-14 14:23:23 +01001683 allow_poison = [ "audio_codecs" ] # TODO(bugs.webrtc.org/8396): Remove.
mbonadeic0af5ac2017-08-24 12:26:05 -07001684 sources = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001685 "objc/components/video_codec/RTCVideoDecoderFactoryH264.h",
1686 "objc/components/video_codec/RTCVideoDecoderFactoryH264.m",
1687 "objc/components/video_codec/RTCVideoDecoderH264.h",
1688 "objc/components/video_codec/RTCVideoDecoderH264.mm",
1689 "objc/components/video_codec/RTCVideoEncoderFactoryH264.h",
1690 "objc/components/video_codec/RTCVideoEncoderFactoryH264.m",
1691 "objc/components/video_codec/RTCVideoEncoderH264.h",
1692 "objc/components/video_codec/RTCVideoEncoderH264.mm",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001693 ]
1694
Anders Carlsson358f2e02018-06-04 10:24:37 +02001695 configs += [
1696 "..:common_objc",
1697 ":used_from_extension",
1698 ]
1699
1700 if (is_ios && rtc_apprtcmobile_broadcast_extension) {
1701 defines = [ "RTC_APPRTCMOBILE_BROADCAST_EXTENSION" ]
1702 }
mbonadei2c8ac1b2017-05-31 05:14:26 -07001703
1704 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001705 ":base_native_additions_objc",
1706 ":base_objc",
1707 ":helpers_objc",
mbonadeic0af5ac2017-08-24 12:26:05 -07001708 ":video_toolbox_cc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +01001709 ":videocodec_objc",
1710 ":videoframebuffer_objc",
Johannes Kronc3fcee72021-04-19 09:09:26 +02001711 "../api/video_codecs:video_codecs_api",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001712 "../common_video",
Patrik Höglund99175c62018-01-08 11:05:10 +01001713 "../modules/video_coding:video_codec_interface",
Patrik Höglunda8005cf2017-12-13 16:05:42 +01001714 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +02001715 "../rtc_base:logging",
ehmaldonadof6a861a2017-07-19 10:40:47 -07001716 "../rtc_base:rtc_base_approved",
Mirko Bonadei401d0562017-12-14 11:24:00 +01001717 "//third_party/libyuv",
mbonadei2c8ac1b2017-05-31 05:14:26 -07001718 ]
1719
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +02001720 frameworks = [
mbonadei2c8ac1b2017-05-31 05:14:26 -07001721 "CoreFoundation.framework",
1722 "CoreMedia.framework",
1723 "CoreVideo.framework",
1724 "VideoToolbox.framework",
1725 ]
Kári Tristan Helgasoncbe74352016-11-09 10:43:26 +01001726 }
1727 }
tkchin9eeb6242016-04-27 01:54:20 -07001728}