xref: /aosp_15_r20/external/webrtc/sdk/BUILD.gn (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1# 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
9import("//third_party/libaom/options.gni")
10import("../webrtc.gni")
11if (is_ios) {
12  import("//build/config/ios/ios_sdk.gni")
13  import("//build/config/ios/rules.gni")
14}
15if (is_mac) {
16  import("//build/config/mac/rules.gni")
17}
18
19group("sdk") {
20  public_deps = []
21  if (!build_with_chromium) {
22    if (is_android) {
23      public_deps += [ "android" ]
24    }
25    if (is_ios) {
26      public_deps += [ ":framework_objc" ]
27    }
28  }
29}
30
31rtc_library("media_constraints") {
32  sources = [
33    "media_constraints.cc",
34    "media_constraints.h",
35  ]
36  deps = [
37    "../api:audio_options_api",
38    "../api:libjingle_peerconnection_api",
39  ]
40  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
41}
42
43rtc_library("sdk_tests") {
44  testonly = true
45  sources = [ "media_constraints_unittest.cc" ]
46  deps = [
47    ":media_constraints",
48    "../test:test_support",
49  ]
50}
51
52if (is_ios || is_mac) {
53  config("common_config_objc") {
54    include_dirs = [
55      "objc",
56
57      # This is needed so that framework headers can include base headers
58      # without pathname (so it works from within the framework module).
59      "objc/base",
60    ]
61    cflags = [
62      "-Wimplicit-retain-self",
63      "-Wstrict-overflow",
64      "-Wmissing-field-initializers",
65    ]
66
67    if (use_clang_coverage) {
68      configs = [ "//build/config/coverage:default_coverage" ]
69    }
70  }
71
72  config("used_from_extension") {
73    if (is_ios && rtc_apprtcmobile_broadcast_extension) {
74      cflags = [ "-fapplication-extension" ]
75    }
76  }
77
78  # TODO(bugs.webrtc.org/9627): Remove this when unused. Targets should depend on base_objc
79  # or helpers_objc directly instead.
80  rtc_library("common_objc") {
81    visibility = [ "*" ]
82
83    sources = [ "objc/helpers/noop.mm" ]
84
85    public_configs = [ ":common_config_objc" ]
86
87    deps = [
88      ":base_objc",
89      ":helpers_objc",
90    ]
91  }
92
93  rtc_library("base_objc") {
94    visibility = [ "*" ]
95    sources = [
96      "objc/base/RTCCodecSpecificInfo.h",
97      "objc/base/RTCEncodedImage.h",
98      "objc/base/RTCEncodedImage.m",
99      "objc/base/RTCI420Buffer.h",
100      "objc/base/RTCLogging.h",
101      "objc/base/RTCLogging.mm",
102      "objc/base/RTCMacros.h",
103      "objc/base/RTCMutableI420Buffer.h",
104      "objc/base/RTCMutableYUVPlanarBuffer.h",
105      "objc/base/RTCSSLCertificateVerifier.h",
106      "objc/base/RTCVideoCapturer.h",
107      "objc/base/RTCVideoCapturer.m",
108      "objc/base/RTCVideoCodecInfo.h",
109      "objc/base/RTCVideoCodecInfo.m",
110      "objc/base/RTCVideoDecoder.h",
111      "objc/base/RTCVideoDecoderFactory.h",
112      "objc/base/RTCVideoEncoder.h",
113      "objc/base/RTCVideoEncoderFactory.h",
114      "objc/base/RTCVideoEncoderQpThresholds.h",
115      "objc/base/RTCVideoEncoderQpThresholds.m",
116      "objc/base/RTCVideoEncoderSettings.h",
117      "objc/base/RTCVideoEncoderSettings.m",
118      "objc/base/RTCVideoFrame.h",
119      "objc/base/RTCVideoFrame.mm",
120      "objc/base/RTCVideoFrameBuffer.h",
121      "objc/base/RTCVideoRenderer.h",
122      "objc/base/RTCYUVPlanarBuffer.h",
123    ]
124
125    deps = [
126      "../rtc_base",
127      "../rtc_base:checks",
128      "../rtc_base:logging",
129    ]
130    configs += [
131      "..:common_objc",
132      ":used_from_extension",
133    ]
134
135    public_configs = [ ":common_config_objc" ]
136  }
137
138  rtc_library("helpers_objc") {
139    sources = [
140      "objc/helpers/AVCaptureSession+DevicePosition.h",
141      "objc/helpers/AVCaptureSession+DevicePosition.mm",
142      "objc/helpers/NSString+StdString.h",
143      "objc/helpers/NSString+StdString.mm",
144      "objc/helpers/RTCDispatcher+Private.h",
145      "objc/helpers/RTCDispatcher.h",
146      "objc/helpers/RTCDispatcher.m",
147      "objc/helpers/scoped_cftyperef.h",
148    ]
149
150    deps = [
151      ":base_objc",
152      "../rtc_base:checks",
153    ]
154
155    absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
156
157    frameworks = [
158      "AVFoundation.framework",
159      "CoreMedia.framework",
160    ]
161
162    configs += [
163      "..:common_objc",
164      ":used_from_extension",
165    ]
166
167    public_configs = [ ":common_config_objc" ]
168
169    if (is_ios) {
170      sources += [
171        "objc/helpers/RTCCameraPreviewView.h",
172        "objc/helpers/RTCCameraPreviewView.m",
173        "objc/helpers/UIDevice+RTCDevice.h",
174        "objc/helpers/UIDevice+RTCDevice.mm",
175      ]
176    }
177  }
178
179  if (!build_with_chromium) {
180    rtc_library("callback_logger_objc") {
181      sources = [
182        "objc/api/logging/RTCCallbackLogger.h",
183        "objc/api/logging/RTCCallbackLogger.mm",
184      ]
185
186      deps = [
187        ":base_objc",
188        ":helpers_objc",
189        "../rtc_base",
190        "../rtc_base:checks",
191        "../rtc_base:logging",
192      ]
193
194      configs += [
195        "..:common_objc",
196        ":used_from_extension",
197      ]
198
199      absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
200    }
201
202    rtc_library("file_logger_objc") {
203      sources = [
204        "objc/api/peerconnection/RTCFileLogger.h",
205        "objc/api/peerconnection/RTCFileLogger.mm",
206      ]
207
208      deps = [
209        ":base_objc",
210        "../rtc_base",
211        "../rtc_base:checks",
212        "../rtc_base:logging",
213      ]
214
215      configs += [
216        "..:common_objc",
217        ":used_from_extension",
218      ]
219    }
220  }
221
222  if (!build_with_chromium) {
223    if (is_ios) {
224      rtc_library("native_api_audio_device_module") {
225        visibility = [ "*" ]
226
227        sources = [
228          "objc/native/api/audio_device_module.h",
229          "objc/native/api/audio_device_module.mm",
230        ]
231
232        deps = [
233          ":audio_device",
234          "../api:make_ref_counted",
235          "../modules/audio_device:audio_device_api",
236          "../modules/audio_device:audio_device_generic",
237          "../rtc_base:checks",
238          "../rtc_base:logging",
239          "../system_wrappers",
240        ]
241      }
242
243      rtc_source_set("audio_session_observer") {
244        visibility = [ ":*" ]
245
246        sources = [ "objc/native/src/audio/audio_session_observer.h" ]
247
248        deps = [
249          "../rtc_base",
250          "../rtc_base:threading",
251        ]
252      }
253
254      rtc_library("audio_device") {
255        visibility = [ "*" ]
256
257        sources = [
258          "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",
266        ]
267
268        deps = [
269          ":audio_objc",
270          ":audio_session_observer",
271          ":base_objc",
272          "../api:array_view",
273          "../api:scoped_refptr",
274          "../api:sequence_checker",
275          "../api/task_queue",
276          "../api/task_queue:default_task_queue_factory",
277          "../api/task_queue:pending_task_safety_flag",
278          "../modules/audio_device:audio_device_api",
279          "../modules/audio_device:audio_device_buffer",
280          "../modules/audio_device:audio_device_generic",
281          "../rtc_base",
282          "../rtc_base:buffer",
283          "../rtc_base:checks",
284          "../rtc_base:logging",
285          "../rtc_base:macromagic",
286          "../rtc_base:refcount",
287          "../rtc_base:threading",
288          "../rtc_base:timeutils",
289          "../system_wrappers:field_trial",
290          "../system_wrappers:metrics",
291        ]
292        absl_deps = [ "//third_party/abseil-cpp/absl/base:core_headers" ]
293
294        frameworks = [ "AudioToolbox.framework" ]
295      }
296
297      # This target exists to expose :audio_session_objc and
298      # :audio_session_delegate_adapter_objc for backward compatibility,
299      # and should be deprecated.
300      group("audio_objc") {
301        public_deps = [  # no-presubmit-check TODO(webrtc:11238)
302          ":audio_session_delegate_adapter_objc",
303          ":audio_session_objc",
304        ]
305      }
306
307      rtc_library("audio_session_delegate_adapter_objc") {
308        sources = [
309          "objc/components/audio/RTCNativeAudioSessionDelegateAdapter.h",
310          "objc/components/audio/RTCNativeAudioSessionDelegateAdapter.mm",
311        ]
312
313        configs += [
314          "..:common_objc",
315          ":used_from_extension",
316        ]
317
318        public_configs = [ ":common_config_objc" ]
319
320        deps = [
321          ":audio_session_objc",
322          ":audio_session_observer",
323          ":base_objc",
324        ]
325      }
326
327      rtc_library("audio_session_objc") {
328        visibility = [ "*" ]
329
330        sources = [
331          "objc/components/audio/RTCAudioSession+Configuration.mm",
332          "objc/components/audio/RTCAudioSession+Private.h",
333          "objc/components/audio/RTCAudioSession.h",
334          "objc/components/audio/RTCAudioSession.mm",
335          "objc/components/audio/RTCAudioSessionConfiguration.h",
336          "objc/components/audio/RTCAudioSessionConfiguration.m",
337        ]
338
339        configs += [
340          "..:common_objc",
341          ":used_from_extension",
342        ]
343
344        public_configs = [ ":common_config_objc" ]
345
346        frameworks = [ "AVFoundation.framework" ]
347
348        deps = [
349          ":base_objc",
350          ":helpers_objc",
351          "../rtc_base",
352          "../rtc_base:checks",
353          "../rtc_base/synchronization:mutex",
354        ]
355
356        absl_deps = [ "//third_party/abseil-cpp/absl/base:core_headers" ]
357      }
358
359      rtc_source_set("network_monitor_observer") {
360        visibility = [ ":*" ]
361
362        sources = [ "objc/native/src/network_monitor_observer.h" ]
363
364        deps = [
365          "../rtc_base",
366          "../rtc_base:network_constants",
367          "../rtc_base:stringutils",
368          "../rtc_base:threading",
369        ]
370
371        absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
372      }
373
374      rtc_library("network_monitor_objc") {
375        visibility = [ "*" ]
376
377        sources = [
378          "objc/components/network/RTCNetworkMonitor+Private.h",
379          "objc/components/network/RTCNetworkMonitor.h",
380          "objc/components/network/RTCNetworkMonitor.mm",
381        ]
382
383        configs += [ ":used_from_extension" ]
384
385        frameworks = [ "Network.framework" ]
386
387        deps = [
388          ":base_objc",
389          ":helpers_objc",
390          ":network_monitor_observer",
391          "../rtc_base:stringutils",
392          "../rtc_base/system:gcd_helpers",
393        ]
394      }
395    }
396
397    rtc_source_set("audio_device_api_objc") {
398      visibility = [ "*" ]
399
400      sources = [ "objc/components/audio/RTCAudioDevice.h" ]
401
402      public_configs = [ ":common_config_objc" ]
403
404      frameworks = [ "AudioToolbox.framework" ]
405
406      deps = [ ":base_objc" ]
407    }
408
409    rtc_library("audio_device_objc") {
410      visibility = [ "*" ]
411      allow_poison = [ "default_task_queue" ]
412      sources = [
413        "objc/native/src/objc_audio_device.h",
414        "objc/native/src/objc_audio_device.mm",
415        "objc/native/src/objc_audio_device_delegate.h",
416        "objc/native/src/objc_audio_device_delegate.mm",
417      ]
418
419      deps = [
420        ":audio_device_api_objc",
421        "../api:array_view",
422        "../api:make_ref_counted",
423        "../api:refcountedbase",
424        "../api:scoped_refptr",
425        "../api:sequence_checker",
426        "../api/task_queue",
427        "../api/task_queue:default_task_queue_factory",
428        "../modules/audio_device:audio_device_api",
429        "../modules/audio_device:audio_device_buffer",
430        "../rtc_base:buffer",
431        "../rtc_base:checks",
432        "../rtc_base:logging",
433        "../rtc_base:safe_minmax",
434        "../rtc_base:threading",
435        "../rtc_base:timeutils",
436      ]
437    }
438
439    rtc_library("objc_audio_device_module") {
440      visibility = [ "*" ]
441      allow_poison = [ "default_task_queue" ]
442      sources = [
443        "objc/native/api/objc_audio_device_module.h",
444        "objc/native/api/objc_audio_device_module.mm",
445      ]
446
447      deps = [
448        ":audio_device_api_objc",
449        ":audio_device_objc",
450        "../api:make_ref_counted",
451        "../modules/audio_device:audio_device_api",
452        "../rtc_base:logging",
453      ]
454    }
455
456    rtc_library("videosource_objc") {
457      sources = [
458        "objc/api/peerconnection/RTCVideoSource+Private.h",
459        "objc/api/peerconnection/RTCVideoSource.h",
460        "objc/api/peerconnection/RTCVideoSource.mm",
461      ]
462
463      deps = [
464        ":base_objc",
465        ":mediasource_objc",
466        ":native_video",
467        ":videoframebuffer_objc",
468        "../api:libjingle_peerconnection_api",
469        "../api:media_stream_interface",
470        "../api/video:video_frame",
471        "../api/video:video_rtp_headers",
472        "../common_video",
473        "../media:rtc_media_base",
474        "../pc:video_track_source_proxy",
475        "../rtc_base",
476        "../rtc_base:checks",
477        "../rtc_base:threading",
478        "//third_party/libyuv",
479      ]
480
481      configs += [
482        "..:common_objc",
483        ":used_from_extension",
484      ]
485    }
486
487    rtc_library("videoframebuffer_objc") {
488      visibility = [ "*" ]
489      sources = [
490        "objc/api/video_frame_buffer/RTCNativeI420Buffer+Private.h",
491        "objc/api/video_frame_buffer/RTCNativeI420Buffer.h",
492        "objc/api/video_frame_buffer/RTCNativeI420Buffer.mm",
493        "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.h",
494        "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.mm",
495        "objc/components/video_frame_buffer/RTCCVPixelBuffer.h",
496        "objc/components/video_frame_buffer/RTCCVPixelBuffer.mm",
497      ]
498      deps = [
499        ":base_objc",
500        "../rtc_base:logging",
501        "//api/video:video_frame",
502        "//api/video:video_rtp_headers",
503        "//common_video",
504        "//rtc_base:checks",
505        "//third_party/libyuv",
506      ]
507      configs += [
508        "..:common_objc",
509        ":used_from_extension",
510      ]
511      frameworks = [
512        "VideoToolbox.framework",
513        "CoreGraphics.framework",
514        "CoreVideo.framework",
515      ]
516    }
517
518    rtc_library("opengl_objc") {
519      sources = [
520        "objc/components/renderer/opengl/RTCDefaultShader.h",
521        "objc/components/renderer/opengl/RTCDefaultShader.mm",
522        "objc/components/renderer/opengl/RTCI420TextureCache.h",
523        "objc/components/renderer/opengl/RTCI420TextureCache.mm",
524        "objc/components/renderer/opengl/RTCOpenGLDefines.h",
525        "objc/components/renderer/opengl/RTCShader.h",
526        "objc/components/renderer/opengl/RTCShader.mm",
527        "objc/components/renderer/opengl/RTCVideoViewShading.h",
528      ]
529      frameworks = [ "CoreVideo.framework" ]
530      if (is_ios) {
531        sources += [
532          "objc/components/renderer/opengl/RTCNV12TextureCache.h",
533          "objc/components/renderer/opengl/RTCNV12TextureCache.m",
534        ]
535        frameworks += [
536          "GLKit.framework",
537          "OpenGLES.framework",
538          "QuartzCore.framework",
539        ]
540      } else if (is_mac) {
541        frameworks += [
542          "CoreMedia.framework",
543          "OpenGL.framework",
544        ]
545      }
546
547      # TODO(bugs.webrtc.org/12937): Remove OpenGL deprecation warning
548      # workaround.
549      defines = [ "GLES_SILENCE_DEPRECATION" ]
550
551      deps = [
552        ":base_objc",
553        ":helpers_objc",
554        ":mediaconstraints_objc",
555        ":native_video",
556        ":videoframebuffer_objc",
557        ":videosource_objc",
558        "../api:libjingle_peerconnection_api",
559        "../api/video:video_frame",
560        "../api/video:video_rtp_headers",
561        "../common_video",
562        "../media:rtc_media_base",
563        "../rtc_base",
564        "../rtc_base:checks",
565        "../rtc_base:logging",
566      ]
567      absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
568
569      configs += [
570        "..:common_objc",
571        ":used_from_extension",
572      ]
573    }
574
575    rtc_library("opengl_ui_objc") {
576      visibility = [ "*" ]
577      allow_poison = [
578        "audio_codecs",  # TODO(bugs.webrtc.org/8396): Remove.
579        "default_task_queue",
580      ]
581      if (is_ios) {
582        sources = [
583          "objc/components/renderer/opengl/RTCDisplayLinkTimer.h",
584          "objc/components/renderer/opengl/RTCDisplayLinkTimer.m",
585          "objc/components/renderer/opengl/RTCEAGLVideoView.h",
586          "objc/components/renderer/opengl/RTCEAGLVideoView.m",
587        ]
588
589        # TODO(bugs.webrtc.org/12937): Remove OpenGL deprecation warning
590        # workaround.
591        defines = [ "GLES_SILENCE_DEPRECATION" ]
592      }
593      if (is_mac) {
594        sources = [
595          "objc/components/renderer/opengl/RTCNSGLVideoView.h",
596          "objc/components/renderer/opengl/RTCNSGLVideoView.m",
597        ]
598      }
599      configs += [ "..:common_objc" ]
600      deps = [
601        ":base_objc",
602        ":helpers_objc",
603        ":metal_objc",
604        ":opengl_objc",
605        ":videocapture_objc",
606        ":videoframebuffer_objc",
607      ]
608    }
609
610    rtc_library("metal_objc") {
611      visibility = [ "*" ]
612      allow_poison = [
613        "audio_codecs",  # TODO(bugs.webrtc.org/8396): Remove.
614        "default_task_queue",
615      ]
616      sources = [
617        "objc/components/renderer/metal/RTCMTLI420Renderer.h",
618        "objc/components/renderer/metal/RTCMTLI420Renderer.mm",
619        "objc/components/renderer/metal/RTCMTLNV12Renderer.h",
620        "objc/components/renderer/metal/RTCMTLNV12Renderer.mm",
621        "objc/components/renderer/metal/RTCMTLRGBRenderer.h",
622        "objc/components/renderer/metal/RTCMTLRGBRenderer.mm",
623        "objc/components/renderer/metal/RTCMTLRenderer+Private.h",
624        "objc/components/renderer/metal/RTCMTLRenderer.h",
625        "objc/components/renderer/metal/RTCMTLRenderer.mm",
626      ]
627      frameworks = [
628        "CoreVideo.framework",
629        "Metal.framework",
630        "MetalKit.framework",
631      ]
632      if (is_ios) {
633        sources += [
634          "objc/components/renderer/metal/RTCMTLVideoView.h",
635          "objc/components/renderer/metal/RTCMTLVideoView.m",
636        ]
637      }
638      if (is_mac) {
639        sources += [
640          "objc/components/renderer/metal/RTCMTLNSVideoView.h",
641          "objc/components/renderer/metal/RTCMTLNSVideoView.m",
642        ]
643        frameworks += [ "AppKit.framework" ]
644      }
645      deps = [
646        ":base_objc",
647        ":peerconnectionfactory_base_objc",
648        ":videoframebuffer_objc",
649        "../api/video:video_frame",
650        "../api/video:video_rtp_headers",
651        "../rtc_base:checks",
652      ]
653      configs += [ "..:common_objc" ]
654      public_configs = [ ":common_config_objc" ]
655    }
656
657    # TODO(bugs.webrtc.org/9627): Remove this target.
658    rtc_library("videocapturebase_objc") {
659      visibility = [ "*" ]
660      sources = [ "objc/helpers/noop.mm" ]
661
662      configs += [ "..:common_objc" ]
663
664      public_configs = [ ":common_config_objc" ]
665
666      deps = [
667        ":base_objc",
668        ":videoframebuffer_objc",
669      ]
670    }
671
672    rtc_library("videocapture_objc") {
673      visibility = [ "*" ]
674      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
675      sources = [
676        "objc/components/capturer/RTCCameraVideoCapturer.h",
677        "objc/components/capturer/RTCCameraVideoCapturer.m",
678        "objc/components/capturer/RTCFileVideoCapturer.h",
679        "objc/components/capturer/RTCFileVideoCapturer.m",
680      ]
681      frameworks = [
682        "AVFoundation.framework",
683        "CoreVideo.framework",
684        "QuartzCore.framework",
685      ]
686
687      configs += [ "..:common_objc" ]
688
689      public_configs = [ ":common_config_objc" ]
690
691      deps = [
692        ":base_objc",
693        ":helpers_objc",
694        ":videoframebuffer_objc",
695        "../rtc_base/system:gcd_helpers",
696      ]
697    }
698
699    rtc_library("videocodec_objc") {
700      visibility = [ "*" ]
701      configs += [ "..:no_global_constructors" ]
702      sources = [
703        "objc/components/video_codec/RTCCodecSpecificInfoH264+Private.h",
704        "objc/components/video_codec/RTCCodecSpecificInfoH264.h",
705        "objc/components/video_codec/RTCCodecSpecificInfoH264.mm",
706        "objc/components/video_codec/RTCH264ProfileLevelId.h",
707        "objc/components/video_codec/RTCH264ProfileLevelId.mm",
708      ]
709      if (is_ios) {
710        sources += [
711          "objc/components/video_codec/UIDevice+H264Profile.h",
712          "objc/components/video_codec/UIDevice+H264Profile.mm",
713        ]
714      }
715
716      public_configs = [ ":common_config_objc" ]
717      deps = [
718        ":base_objc",
719        ":helpers_objc",
720        "../api/video_codecs:video_codecs_api",
721        "../common_video",
722        "../media:rtc_media_base",
723        "../modules/video_coding:video_codec_interface",
724        "../rtc_base:checks",
725      ]
726    }
727
728    rtc_library("default_codec_factory_objc") {
729      sources = [
730        "objc/components/video_codec/RTCDefaultVideoDecoderFactory.h",
731        "objc/components/video_codec/RTCDefaultVideoDecoderFactory.m",
732        "objc/components/video_codec/RTCDefaultVideoEncoderFactory.h",
733        "objc/components/video_codec/RTCDefaultVideoEncoderFactory.m",
734      ]
735
736      deps = [
737        ":base_objc",
738        ":native_video",
739        ":videocodec_objc",
740        ":videotoolbox_objc",
741        ":vp8",
742        ":vp9",
743        ":vpx_codec_constants",
744      ]
745
746      defines = []
747      if (enable_libaom) {
748        defines += [ "RTC_USE_LIBAOM_AV1_ENCODER" ]
749        deps += [ ":libaom_av1_encoder" ]
750      }
751
752      if (rtc_include_dav1d_in_internal_decoder_factory) {
753        deps += [ ":dav1d_decoder" ]
754      }
755    }
756
757    rtc_library("vpx_codec_constants") {
758      configs += [ "..:no_global_constructors" ]
759      sources = [
760        "objc/api/video_codec/RTCVideoCodecConstants.h",
761        "objc/api/video_codec/RTCVideoCodecConstants.mm",
762      ]
763
764      deps = [
765        ":base_objc",
766        "../media:rtc_media_base",
767      ]
768    }
769
770    rtc_library("vp8") {
771      visibility = [ "*" ]
772      allow_poison = [ "software_video_codecs" ]
773      sources = [
774        "objc/api/video_codec/RTCVideoDecoderVP8.h",
775        "objc/api/video_codec/RTCVideoDecoderVP8.mm",
776        "objc/api/video_codec/RTCVideoEncoderVP8.h",
777        "objc/api/video_codec/RTCVideoEncoderVP8.mm",
778      ]
779
780      deps = [
781        ":base_objc",
782        ":wrapped_native_codec_objc",
783        "../modules/video_coding:webrtc_vp8",
784      ]
785    }
786
787    rtc_library("vp9") {
788      visibility = [ "*" ]
789      allow_poison = [ "software_video_codecs" ]
790      sources = [
791        "objc/api/video_codec/RTCVideoDecoderVP9.h",
792        "objc/api/video_codec/RTCVideoDecoderVP9.mm",
793        "objc/api/video_codec/RTCVideoEncoderVP9.h",
794        "objc/api/video_codec/RTCVideoEncoderVP9.mm",
795      ]
796
797      deps = [
798        ":base_objc",
799        ":wrapped_native_codec_objc",
800        "../media:rtc_media_base",
801        "../modules/video_coding:webrtc_vp9",
802      ]
803    }
804
805    rtc_library("dav1d_decoder") {
806      visibility = [ "*" ]
807      allow_poison = [ "software_video_codecs" ]
808      sources = [
809        "objc/api/video_codec/RTCVideoDecoderAV1.h",
810        "objc/api/video_codec/RTCVideoDecoderAV1.mm",
811      ]
812
813      deps = [
814        ":base_objc",
815        ":wrapped_native_codec_objc",
816        "../media:rtc_media_base",
817        "../modules/video_coding/codecs/av1:dav1d_decoder",
818      ]
819    }
820
821    rtc_library("libaom_av1_encoder") {
822      visibility = [ "*" ]
823      allow_poison = [ "software_video_codecs" ]
824      sources = [
825        "objc/api/video_codec/RTCVideoEncoderAV1.h",
826        "objc/api/video_codec/RTCVideoEncoderAV1.mm",
827      ]
828
829      deps = [
830        ":base_objc",
831        ":wrapped_native_codec_objc",
832        "../media:rtc_media_base",
833        "../modules/video_coding/codecs/av1:libaom_av1_encoder",
834      ]
835    }
836
837    rtc_library("mediaconstraints_objc") {
838      configs += [ "..:no_global_constructors" ]
839      sources = [
840        "objc/api/peerconnection/RTCMediaConstraints+Private.h",
841        "objc/api/peerconnection/RTCMediaConstraints.h",
842        "objc/api/peerconnection/RTCMediaConstraints.mm",
843      ]
844
845      public_configs = [ ":common_config_objc" ]
846      deps = [
847        ":base_objc",
848        ":helpers_objc",
849        ":media_constraints",
850      ]
851    }
852
853    # TODO(bugs.webrtc.org/9627): Remove, targets should depend on base_objc.
854    rtc_library("videorenderer_objc") {
855      visibility = [ "*" ]
856      sources = [ "objc/helpers/noop.mm" ]
857
858      configs += [ "..:common_objc" ]
859      public_configs = [ ":common_config_objc" ]
860
861      deps = [ ":base_objc" ]
862    }
863
864    rtc_library("videorendereradapter_objc") {
865      visibility = [ "*" ]
866      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
867      sources = [
868        "objc/api/RTCVideoRendererAdapter+Private.h",
869        "objc/api/RTCVideoRendererAdapter.h",
870        "objc/api/RTCVideoRendererAdapter.mm",
871      ]
872
873      configs += [ "..:common_objc" ]
874      public_configs = [ ":common_config_objc" ]
875
876      deps = [
877        ":base_objc",
878        ":native_api",
879        ":videoframebuffer_objc",
880        "../api:libjingle_peerconnection_api",
881        "../api:media_stream_interface",
882      ]
883    }
884
885    rtc_library("mediasource_objc") {
886      sources = [
887        "objc/api/peerconnection/RTCMediaSource+Private.h",
888        "objc/api/peerconnection/RTCMediaSource.h",
889        "objc/api/peerconnection/RTCMediaSource.mm",
890      ]
891
892      configs += [
893        "..:common_objc",
894        ":used_from_extension",
895      ]
896      public_configs = [ ":common_config_objc" ]
897
898      deps = [
899        ":base_objc",
900        "../api:media_stream_interface",
901        "../rtc_base:checks",
902      ]
903    }
904
905    rtc_library("base_native_additions_objc") {
906      sources = [
907        "objc/api/peerconnection/RTCEncodedImage+Private.h",
908        "objc/api/peerconnection/RTCEncodedImage+Private.mm",
909        "objc/api/peerconnection/RTCVideoCodecInfo+Private.h",
910        "objc/api/peerconnection/RTCVideoCodecInfo+Private.mm",
911        "objc/api/peerconnection/RTCVideoEncoderSettings+Private.h",
912        "objc/api/peerconnection/RTCVideoEncoderSettings+Private.mm",
913      ]
914
915      configs += [ "..:common_objc" ]
916
917      public_configs = [ ":common_config_objc" ]
918
919      deps = [
920        ":base_objc",
921        ":helpers_objc",
922        "../api/video:encoded_image",
923        "../api/video_codecs:video_codecs_api",
924        "../modules/video_coding:video_codec_interface",
925        "../rtc_base",
926        "../rtc_base:refcount",
927        "../rtc_base:safe_conversions",
928      ]
929    }
930
931    rtc_library("peerconnectionfactory_base_objc") {
932      visibility = [ "*" ]
933      allow_poison = [
934        "audio_codecs",  # TODO(bugs.webrtc.org/8396): Remove.
935        "default_task_queue",
936      ]
937      configs += [ "..:no_global_constructors" ]
938      sources = [
939        "objc/api/peerconnection/RTCAudioSource+Private.h",
940        "objc/api/peerconnection/RTCAudioSource.h",
941        "objc/api/peerconnection/RTCAudioSource.mm",
942        "objc/api/peerconnection/RTCAudioTrack+Private.h",
943        "objc/api/peerconnection/RTCAudioTrack.h",
944        "objc/api/peerconnection/RTCAudioTrack.mm",
945        "objc/api/peerconnection/RTCCertificate.h",
946        "objc/api/peerconnection/RTCCertificate.mm",
947        "objc/api/peerconnection/RTCConfiguration+Native.h",
948        "objc/api/peerconnection/RTCConfiguration+Private.h",
949        "objc/api/peerconnection/RTCConfiguration.h",
950        "objc/api/peerconnection/RTCConfiguration.mm",
951        "objc/api/peerconnection/RTCCryptoOptions.h",
952        "objc/api/peerconnection/RTCCryptoOptions.mm",
953        "objc/api/peerconnection/RTCDataChannel+Private.h",
954        "objc/api/peerconnection/RTCDataChannel.h",
955        "objc/api/peerconnection/RTCDataChannel.mm",
956        "objc/api/peerconnection/RTCDataChannelConfiguration+Private.h",
957        "objc/api/peerconnection/RTCDataChannelConfiguration.h",
958        "objc/api/peerconnection/RTCDataChannelConfiguration.mm",
959        "objc/api/peerconnection/RTCDtmfSender+Private.h",
960        "objc/api/peerconnection/RTCDtmfSender.h",
961        "objc/api/peerconnection/RTCDtmfSender.mm",
962        "objc/api/peerconnection/RTCFieldTrials.h",
963        "objc/api/peerconnection/RTCFieldTrials.mm",
964        "objc/api/peerconnection/RTCIceCandidate+Private.h",
965        "objc/api/peerconnection/RTCIceCandidate.h",
966        "objc/api/peerconnection/RTCIceCandidate.mm",
967        "objc/api/peerconnection/RTCIceCandidateErrorEvent+Private.h",
968        "objc/api/peerconnection/RTCIceCandidateErrorEvent.h",
969        "objc/api/peerconnection/RTCIceCandidateErrorEvent.mm",
970        "objc/api/peerconnection/RTCIceServer+Private.h",
971        "objc/api/peerconnection/RTCIceServer.h",
972        "objc/api/peerconnection/RTCIceServer.mm",
973        "objc/api/peerconnection/RTCLegacyStatsReport+Private.h",
974        "objc/api/peerconnection/RTCLegacyStatsReport.h",
975        "objc/api/peerconnection/RTCLegacyStatsReport.mm",
976        "objc/api/peerconnection/RTCMediaStream+Private.h",
977        "objc/api/peerconnection/RTCMediaStream.h",
978        "objc/api/peerconnection/RTCMediaStream.mm",
979        "objc/api/peerconnection/RTCMediaStreamTrack+Private.h",
980        "objc/api/peerconnection/RTCMediaStreamTrack.h",
981        "objc/api/peerconnection/RTCMediaStreamTrack.mm",
982        "objc/api/peerconnection/RTCMetrics.h",
983        "objc/api/peerconnection/RTCMetrics.mm",
984        "objc/api/peerconnection/RTCMetricsSampleInfo+Private.h",
985        "objc/api/peerconnection/RTCMetricsSampleInfo.h",
986        "objc/api/peerconnection/RTCMetricsSampleInfo.mm",
987        "objc/api/peerconnection/RTCPeerConnection+DataChannel.mm",
988        "objc/api/peerconnection/RTCPeerConnection+Private.h",
989        "objc/api/peerconnection/RTCPeerConnection+Stats.mm",
990        "objc/api/peerconnection/RTCPeerConnection.h",
991        "objc/api/peerconnection/RTCPeerConnection.mm",
992        "objc/api/peerconnection/RTCPeerConnectionFactory+Native.h",
993        "objc/api/peerconnection/RTCPeerConnectionFactory+Private.h",
994        "objc/api/peerconnection/RTCPeerConnectionFactory.h",
995        "objc/api/peerconnection/RTCPeerConnectionFactory.mm",
996        "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder+DefaultComponents.h",
997        "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder+DefaultComponents.mm",
998        "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder.h",
999        "objc/api/peerconnection/RTCPeerConnectionFactoryBuilder.mm",
1000        "objc/api/peerconnection/RTCPeerConnectionFactoryOptions+Private.h",
1001        "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.h",
1002        "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.mm",
1003        "objc/api/peerconnection/RTCRtcpParameters+Private.h",
1004        "objc/api/peerconnection/RTCRtcpParameters.h",
1005        "objc/api/peerconnection/RTCRtcpParameters.mm",
1006        "objc/api/peerconnection/RTCRtpCodecParameters+Private.h",
1007        "objc/api/peerconnection/RTCRtpCodecParameters.h",
1008        "objc/api/peerconnection/RTCRtpCodecParameters.mm",
1009        "objc/api/peerconnection/RTCRtpEncodingParameters+Private.h",
1010        "objc/api/peerconnection/RTCRtpEncodingParameters.h",
1011        "objc/api/peerconnection/RTCRtpEncodingParameters.mm",
1012        "objc/api/peerconnection/RTCRtpHeaderExtension+Private.h",
1013        "objc/api/peerconnection/RTCRtpHeaderExtension.h",
1014        "objc/api/peerconnection/RTCRtpHeaderExtension.mm",
1015        "objc/api/peerconnection/RTCRtpParameters+Private.h",
1016        "objc/api/peerconnection/RTCRtpParameters.h",
1017        "objc/api/peerconnection/RTCRtpParameters.mm",
1018        "objc/api/peerconnection/RTCRtpReceiver+Native.h",
1019        "objc/api/peerconnection/RTCRtpReceiver+Private.h",
1020        "objc/api/peerconnection/RTCRtpReceiver.h",
1021        "objc/api/peerconnection/RTCRtpReceiver.mm",
1022        "objc/api/peerconnection/RTCRtpSender+Native.h",
1023        "objc/api/peerconnection/RTCRtpSender+Private.h",
1024        "objc/api/peerconnection/RTCRtpSender.h",
1025        "objc/api/peerconnection/RTCRtpSender.mm",
1026        "objc/api/peerconnection/RTCRtpTransceiver+Private.h",
1027        "objc/api/peerconnection/RTCRtpTransceiver.h",
1028        "objc/api/peerconnection/RTCRtpTransceiver.mm",
1029        "objc/api/peerconnection/RTCSSLAdapter.h",
1030        "objc/api/peerconnection/RTCSSLAdapter.mm",
1031        "objc/api/peerconnection/RTCSessionDescription+Private.h",
1032        "objc/api/peerconnection/RTCSessionDescription.h",
1033        "objc/api/peerconnection/RTCSessionDescription.mm",
1034        "objc/api/peerconnection/RTCStatisticsReport+Private.h",
1035        "objc/api/peerconnection/RTCStatisticsReport.h",
1036        "objc/api/peerconnection/RTCStatisticsReport.mm",
1037        "objc/api/peerconnection/RTCTracing.h",
1038        "objc/api/peerconnection/RTCTracing.mm",
1039        "objc/api/peerconnection/RTCVideoTrack+Private.h",
1040        "objc/api/peerconnection/RTCVideoTrack.h",
1041        "objc/api/peerconnection/RTCVideoTrack.mm",
1042      ]
1043
1044      configs += [
1045        "..:common_objc",
1046        ":used_from_extension",
1047      ]
1048      public_configs = [ ":common_config_objc" ]
1049
1050      deps = [
1051        ":audio_device_api_objc",
1052        ":base_native_additions_objc",
1053        ":base_objc",
1054        ":file_logger_objc",
1055        ":helpers_objc",
1056        ":mediaconstraints_objc",
1057        ":mediasource_objc",
1058        ":native_api",
1059        ":native_video",
1060        ":objc_audio_device_module",
1061        ":videoframebuffer_objc",
1062        ":videorendereradapter_objc",
1063        ":videosource_objc",
1064        ":videotoolbox_objc",
1065        "../api:dtmf_sender_interface",
1066        "../api:libjingle_peerconnection_api",
1067        "../api:media_stream_interface",
1068        "../api:rtc_event_log_output_file",
1069        "../api:rtc_stats_api",
1070        "../api:rtp_parameters",
1071        "../api:rtp_sender_interface",
1072        "../api:scoped_refptr",
1073        "../api/audio_codecs:audio_codecs_api",
1074        "../api/audio_codecs:builtin_audio_decoder_factory",
1075        "../api/audio_codecs:builtin_audio_encoder_factory",
1076        "../api/crypto:frame_decryptor_interface",
1077        "../api/crypto:frame_encryptor_interface",
1078        "../api/rtc_event_log:rtc_event_log_factory",
1079        "../api/task_queue:default_task_queue_factory",
1080        "../api/transport:field_trial_based_config",
1081        "../api/video:video_frame",
1082        "../api/video:video_rtp_headers",
1083        "../api/video_codecs:video_codecs_api",
1084        "../common_video",
1085        "../media:rtc_audio_video",
1086        "../media:rtc_media_base",
1087        "../modules/audio_device:audio_device_api",
1088        "../modules/audio_processing",
1089        "../modules/audio_processing:api",
1090        "../modules/video_coding:video_codec_interface",
1091        "../pc:peer_connection_factory",
1092        "../pc:webrtc_sdp",
1093        "../rtc_base",
1094        "../rtc_base:checks",
1095        "../rtc_base:event_tracer",
1096        "../rtc_base:logging",
1097        "../rtc_base:network_constants",
1098        "../rtc_base:safe_conversions",
1099        "../rtc_base:stringutils",
1100        "../rtc_base:threading",
1101        "../rtc_base:timeutils",
1102        "../stats:rtc_stats",
1103        "../system_wrappers:field_trial",
1104        "../system_wrappers:metrics",
1105      ]
1106
1107      if (is_ios) {
1108        deps += [ ":native_api_audio_device_module" ]
1109      }
1110    }
1111
1112    if (rtc_include_tests) {
1113      if (is_ios) {
1114        rtc_library("sdk_unittests_sources") {
1115          testonly = true
1116          include_dirs = [ "objc/" ]
1117
1118          sources = [
1119            "objc/unittests/ObjCVideoTrackSource_xctest.mm",
1120            "objc/unittests/RTCAudioSessionTest.mm",
1121            "objc/unittests/RTCCVPixelBuffer_xctest.mm",
1122            "objc/unittests/RTCCallbackLogger_xctest.m",
1123            "objc/unittests/RTCCameraVideoCapturerTests.mm",
1124            "objc/unittests/RTCCertificateTest.mm",
1125            "objc/unittests/RTCConfigurationTest.mm",
1126            "objc/unittests/RTCDataChannelConfigurationTest.mm",
1127            "objc/unittests/RTCEncodedImage_xctest.mm",
1128            "objc/unittests/RTCFileVideoCapturer_xctest.mm",
1129            "objc/unittests/RTCH264ProfileLevelId_xctest.m",
1130            "objc/unittests/RTCIceCandidateTest.mm",
1131            "objc/unittests/RTCIceServerTest.mm",
1132            "objc/unittests/RTCMTLVideoView_xctest.m",
1133            "objc/unittests/RTCMediaConstraintsTest.mm",
1134            "objc/unittests/RTCNV12TextureCache_xctest.m",
1135            "objc/unittests/RTCPeerConnectionFactoryBuilderTest.mm",
1136            "objc/unittests/RTCPeerConnectionFactory_xctest.m",
1137            "objc/unittests/RTCPeerConnectionTest.mm",
1138            "objc/unittests/RTCSessionDescriptionTest.mm",
1139            "objc/unittests/RTCTracingTest.mm",
1140            "objc/unittests/frame_buffer_helpers.h",
1141            "objc/unittests/frame_buffer_helpers.mm",
1142            "objc/unittests/nalu_rewriter_xctest.mm",
1143            "objc/unittests/objc_video_decoder_factory_tests.mm",
1144            "objc/unittests/objc_video_encoder_factory_tests.mm",
1145            "objc/unittests/scoped_cftyperef_tests.mm",
1146          ]
1147
1148          # TODO(bugs.webrtc.org/12937): Remove OpenGL deprecation warning
1149          # workaround.
1150          defines = [ "GLES_SILENCE_DEPRECATION" ]
1151
1152          # TODO(peterhanspers): Reenable these tests on simulator.
1153          # See bugs.webrtc.org/7812
1154          if (target_environment != "simulator") {
1155            sources += [
1156              "objc/unittests/RTCAudioDeviceModule_xctest.mm",
1157              "objc/unittests/RTCAudioDevice_xctest.mm",
1158            ]
1159          }
1160
1161          deps = [
1162            ":audio_device",
1163            ":audio_session_objc",
1164            ":base_native_additions_objc",
1165            ":base_objc",
1166            ":callback_logger_objc",
1167            ":framework_objc",
1168            ":helpers_objc",
1169            ":mediaconstraints_objc",
1170            ":metal_objc",
1171            ":native_api",
1172            ":native_api_audio_device_module",
1173            ":native_video",
1174            ":peerconnectionfactory_base_objc",
1175            ":video_toolbox_cc",
1176            ":videocapture_objc",
1177            ":videocodec_objc",
1178            ":videoframebuffer_objc",
1179            ":videosource_objc",
1180            ":videotoolbox_objc",
1181            "../api:scoped_refptr",
1182            "../api/audio_codecs:builtin_audio_decoder_factory",
1183            "../api/audio_codecs:builtin_audio_encoder_factory",
1184            "../api/task_queue:default_task_queue_factory",
1185            "../api/video:video_frame",
1186            "../api/video_codecs:video_codecs_api",
1187            "../common_video",
1188            "../media:rtc_media_base",
1189            "../media:rtc_media_tests_utils",
1190            "../modules/audio_device:audio_device_api",
1191            "../modules/audio_processing:api",
1192            "../modules/video_coding:video_codec_interface",
1193            "../rtc_base",
1194            "../rtc_base:gunit_helpers",
1195            "../rtc_base:macromagic",
1196            "../rtc_base:refcount",
1197            "../rtc_base:rtc_event",
1198            "../rtc_base/system:unused",
1199            "../system_wrappers",
1200            "//third_party/libyuv",
1201          ]
1202
1203          if (rtc_ios_macos_use_opengl_rendering) {
1204            deps += [ ":opengl_objc" ]
1205          }
1206
1207          public_deps = [
1208            "//build/config/ios:xctest",
1209            "//third_party/ocmock",
1210          ]
1211        }
1212
1213        bundle_data("sdk_unittests_bundle_data") {
1214          sources = [
1215            "objc/unittests/audio_short16.pcm",
1216            "objc/unittests/audio_short44.pcm",
1217            "objc/unittests/audio_short48.pcm",
1218
1219            # Sample video taken from https://media.xiph.org/video/derf/
1220            "objc/unittests/foreman.mp4",
1221          ]
1222          outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
1223        }
1224
1225        # These tests use static linking.
1226        rtc_test("sdk_unittests") {
1227          is_xctest = true
1228          info_plist = "//test/ios/Info.plist"
1229          sources = [ "objc/unittests/main.mm" ]
1230
1231          extra_substitutions = [ "GTEST_BUNDLE_ID_SUFFIX=generic-unit-test" ]
1232          deps = [
1233            ":peerconnectionfactory_base_objc",
1234            ":sdk_unittests_bundle_data",
1235            ":sdk_unittests_sources",
1236            "../rtc_base",
1237            "../rtc_base:threading",
1238            "//test:test_support",
1239          ]
1240          ldflags = [ "-all_load" ]
1241        }
1242
1243        # These tests link to the framework.
1244        rtc_test("sdk_framework_unittests") {
1245          is_xctest = true
1246          info_plist = "//test/ios/Info.plist"
1247          sources = [
1248            "objc/unittests/RTCDoNotPutCPlusPlusInFrameworkHeaders_xctest.m",
1249            "objc/unittests/main.mm",
1250          ]
1251
1252          extra_substitutions = [ "GTEST_BUNDLE_ID_SUFFIX=generic-unit-test" ]
1253          deps = [
1254            ":framework_objc+link",
1255            ":ios_framework_bundle",
1256            "../rtc_base",
1257            "../rtc_base:threading",
1258            "//test:test_support",
1259          ]
1260        }
1261      }
1262    }
1263
1264    if (is_ios) {
1265      apple_framework_bundle_with_umbrella_header("framework_objc") {
1266        info_plist = "objc/Info.plist"
1267        output_name = "WebRTC"
1268
1269        common_objc_headers = [
1270          "objc/base/RTCCodecSpecificInfo.h",
1271          "objc/base/RTCEncodedImage.h",
1272          "objc/base/RTCI420Buffer.h",
1273          "objc/base/RTCLogging.h",
1274          "objc/base/RTCMacros.h",
1275          "objc/base/RTCMutableI420Buffer.h",
1276          "objc/base/RTCMutableYUVPlanarBuffer.h",
1277          "objc/base/RTCSSLCertificateVerifier.h",
1278          "objc/base/RTCVideoCapturer.h",
1279          "objc/base/RTCVideoCodecInfo.h",
1280          "objc/base/RTCVideoDecoder.h",
1281          "objc/base/RTCVideoDecoderFactory.h",
1282          "objc/base/RTCVideoEncoder.h",
1283          "objc/base/RTCVideoEncoderFactory.h",
1284          "objc/base/RTCVideoEncoderQpThresholds.h",
1285          "objc/base/RTCVideoEncoderSettings.h",
1286          "objc/base/RTCVideoFrame.h",
1287          "objc/base/RTCVideoFrameBuffer.h",
1288          "objc/base/RTCVideoRenderer.h",
1289          "objc/base/RTCYUVPlanarBuffer.h",
1290          "objc/components/audio/RTCAudioDevice.h",
1291          "objc/components/audio/RTCAudioSession.h",
1292          "objc/components/audio/RTCAudioSessionConfiguration.h",
1293          "objc/components/capturer/RTCCameraVideoCapturer.h",
1294          "objc/components/capturer/RTCFileVideoCapturer.h",
1295          "objc/components/network/RTCNetworkMonitor.h",
1296          "objc/components/renderer/metal/RTCMTLVideoView.h",
1297          "objc/components/renderer/opengl/RTCEAGLVideoView.h",
1298          "objc/components/renderer/opengl/RTCVideoViewShading.h",
1299          "objc/components/video_codec/RTCCodecSpecificInfoH264.h",
1300          "objc/components/video_codec/RTCDefaultVideoDecoderFactory.h",
1301          "objc/components/video_codec/RTCDefaultVideoEncoderFactory.h",
1302          "objc/components/video_codec/RTCH264ProfileLevelId.h",
1303          "objc/components/video_codec/RTCVideoDecoderFactoryH264.h",
1304          "objc/components/video_codec/RTCVideoDecoderH264.h",
1305          "objc/components/video_codec/RTCVideoEncoderFactoryH264.h",
1306          "objc/components/video_codec/RTCVideoEncoderH264.h",
1307          "objc/components/video_frame_buffer/RTCCVPixelBuffer.h",
1308          "objc/helpers/RTCCameraPreviewView.h",
1309          "objc/helpers/RTCDispatcher.h",
1310          "objc/helpers/UIDevice+RTCDevice.h",
1311          "objc/api/peerconnection/RTCAudioSource.h",
1312          "objc/api/peerconnection/RTCAudioTrack.h",
1313          "objc/api/peerconnection/RTCConfiguration.h",
1314          "objc/api/peerconnection/RTCDataChannel.h",
1315          "objc/api/peerconnection/RTCDataChannelConfiguration.h",
1316          "objc/api/peerconnection/RTCFieldTrials.h",
1317          "objc/api/peerconnection/RTCIceCandidate.h",
1318          "objc/api/peerconnection/RTCIceCandidateErrorEvent.h",
1319          "objc/api/peerconnection/RTCIceServer.h",
1320          "objc/api/peerconnection/RTCLegacyStatsReport.h",
1321          "objc/api/peerconnection/RTCMediaConstraints.h",
1322          "objc/api/peerconnection/RTCMediaSource.h",
1323          "objc/api/peerconnection/RTCMediaStream.h",
1324          "objc/api/peerconnection/RTCMediaStreamTrack.h",
1325          "objc/api/peerconnection/RTCMetrics.h",
1326          "objc/api/peerconnection/RTCMetricsSampleInfo.h",
1327          "objc/api/peerconnection/RTCPeerConnection.h",
1328          "objc/api/peerconnection/RTCPeerConnectionFactory.h",
1329          "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.h",
1330          "objc/api/peerconnection/RTCRtcpParameters.h",
1331          "objc/api/peerconnection/RTCRtpCodecParameters.h",
1332          "objc/api/peerconnection/RTCRtpEncodingParameters.h",
1333          "objc/api/peerconnection/RTCRtpHeaderExtension.h",
1334          "objc/api/peerconnection/RTCRtpParameters.h",
1335          "objc/api/peerconnection/RTCRtpReceiver.h",
1336          "objc/api/peerconnection/RTCRtpSender.h",
1337          "objc/api/peerconnection/RTCRtpTransceiver.h",
1338          "objc/api/peerconnection/RTCDtmfSender.h",
1339          "objc/api/peerconnection/RTCSSLAdapter.h",
1340          "objc/api/peerconnection/RTCSessionDescription.h",
1341          "objc/api/peerconnection/RTCStatisticsReport.h",
1342          "objc/api/peerconnection/RTCTracing.h",
1343          "objc/api/peerconnection/RTCCertificate.h",
1344          "objc/api/peerconnection/RTCCryptoOptions.h",
1345          "objc/api/peerconnection/RTCVideoSource.h",
1346          "objc/api/peerconnection/RTCVideoTrack.h",
1347          "objc/api/video_codec/RTCVideoCodecConstants.h",
1348          "objc/api/video_codec/RTCVideoDecoderVP8.h",
1349          "objc/api/video_codec/RTCVideoDecoderVP9.h",
1350          "objc/api/video_codec/RTCVideoDecoderAV1.h",
1351          "objc/api/video_codec/RTCVideoEncoderVP8.h",
1352          "objc/api/video_codec/RTCVideoEncoderVP9.h",
1353          "objc/api/video_codec/RTCVideoEncoderAV1.h",
1354          "objc/api/video_frame_buffer/RTCNativeI420Buffer.h",
1355          "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.h",
1356        ]
1357
1358        if (!build_with_chromium) {
1359          common_objc_headers += [
1360            "objc/api/logging/RTCCallbackLogger.h",
1361            "objc/api/peerconnection/RTCFileLogger.h",
1362          ]
1363        }
1364
1365        sources = common_objc_headers
1366        public_headers = common_objc_headers
1367
1368        ldflags = [
1369          "-all_load",
1370          "-install_name",
1371          "@rpath/$output_name.framework/$output_name",
1372        ]
1373
1374        deps = [
1375          ":audio_objc",
1376          ":base_objc",
1377          ":default_codec_factory_objc",
1378          ":metal_objc",
1379          ":native_api",
1380          ":native_video",
1381          ":peerconnectionfactory_base_objc",
1382          ":videocapture_objc",
1383          ":videocodec_objc",
1384          ":videotoolbox_objc",
1385        ]
1386        if (rtc_ios_macos_use_opengl_rendering) {
1387          deps += [ ":opengl_ui_objc" ]
1388        }
1389        if (!build_with_chromium) {
1390          deps += [
1391            ":callback_logger_objc",
1392            ":file_logger_objc",
1393          ]
1394        }
1395
1396        frameworks = [
1397          "AVFoundation.framework",
1398          "CoreGraphics.framework",
1399          "CoreMedia.framework",
1400        ]
1401
1402        configs = [
1403          "..:common_objc",
1404          ":used_from_extension",
1405        ]
1406
1407        public_configs = [ ":common_config_objc" ]
1408      }
1409
1410      bundle_data("ios_framework_bundle") {
1411        deps = [ "../sdk:framework_objc" ]
1412        sources = [ "$root_build_dir/WebRTC.framework" ]
1413        outputs = [ "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}" ]
1414      }
1415    }
1416
1417    if (is_mac) {
1418      apple_framework_bundle_with_umbrella_header("mac_framework_objc") {
1419        info_plist = "objc/Info.plist"
1420        output_name = "WebRTC"
1421
1422        sources = [
1423          "objc/api/peerconnection/RTCAudioSource.h",
1424          "objc/api/peerconnection/RTCAudioTrack.h",
1425          "objc/api/peerconnection/RTCCertificate.h",
1426          "objc/api/peerconnection/RTCConfiguration.h",
1427          "objc/api/peerconnection/RTCCryptoOptions.h",
1428          "objc/api/peerconnection/RTCDataChannel.h",
1429          "objc/api/peerconnection/RTCDataChannelConfiguration.h",
1430          "objc/api/peerconnection/RTCDtmfSender.h",
1431          "objc/api/peerconnection/RTCFieldTrials.h",
1432          "objc/api/peerconnection/RTCIceCandidate.h",
1433          "objc/api/peerconnection/RTCIceCandidateErrorEvent.h",
1434          "objc/api/peerconnection/RTCIceServer.h",
1435          "objc/api/peerconnection/RTCLegacyStatsReport.h",
1436          "objc/api/peerconnection/RTCMediaConstraints.h",
1437          "objc/api/peerconnection/RTCMediaSource.h",
1438          "objc/api/peerconnection/RTCMediaStream.h",
1439          "objc/api/peerconnection/RTCMediaStreamTrack.h",
1440          "objc/api/peerconnection/RTCMetrics.h",
1441          "objc/api/peerconnection/RTCMetricsSampleInfo.h",
1442          "objc/api/peerconnection/RTCPeerConnection.h",
1443          "objc/api/peerconnection/RTCPeerConnectionFactory.h",
1444          "objc/api/peerconnection/RTCPeerConnectionFactoryOptions.h",
1445          "objc/api/peerconnection/RTCRtcpParameters.h",
1446          "objc/api/peerconnection/RTCRtpCodecParameters.h",
1447          "objc/api/peerconnection/RTCRtpEncodingParameters.h",
1448          "objc/api/peerconnection/RTCRtpHeaderExtension.h",
1449          "objc/api/peerconnection/RTCRtpParameters.h",
1450          "objc/api/peerconnection/RTCRtpReceiver.h",
1451          "objc/api/peerconnection/RTCRtpSender.h",
1452          "objc/api/peerconnection/RTCRtpTransceiver.h",
1453          "objc/api/peerconnection/RTCSSLAdapter.h",
1454          "objc/api/peerconnection/RTCSessionDescription.h",
1455          "objc/api/peerconnection/RTCStatisticsReport.h",
1456          "objc/api/peerconnection/RTCTracing.h",
1457          "objc/api/peerconnection/RTCVideoSource.h",
1458          "objc/api/peerconnection/RTCVideoTrack.h",
1459          "objc/api/video_codec/RTCVideoDecoderAV1.h",
1460          "objc/api/video_codec/RTCVideoDecoderVP8.h",
1461          "objc/api/video_codec/RTCVideoDecoderVP9.h",
1462          "objc/api/video_codec/RTCVideoEncoderAV1.h",
1463          "objc/api/video_codec/RTCVideoEncoderVP8.h",
1464          "objc/api/video_codec/RTCVideoEncoderVP9.h",
1465          "objc/api/video_frame_buffer/RTCNativeI420Buffer.h",
1466          "objc/api/video_frame_buffer/RTCNativeMutableI420Buffer.h",
1467          "objc/base/RTCCodecSpecificInfo.h",
1468          "objc/base/RTCEncodedImage.h",
1469          "objc/base/RTCI420Buffer.h",
1470          "objc/base/RTCLogging.h",
1471          "objc/base/RTCMacros.h",
1472          "objc/base/RTCMutableI420Buffer.h",
1473          "objc/base/RTCMutableYUVPlanarBuffer.h",
1474          "objc/base/RTCSSLCertificateVerifier.h",
1475          "objc/base/RTCVideoCapturer.h",
1476          "objc/base/RTCVideoCodecInfo.h",
1477          "objc/base/RTCVideoDecoder.h",
1478          "objc/base/RTCVideoDecoderFactory.h",
1479          "objc/base/RTCVideoEncoder.h",
1480          "objc/base/RTCVideoEncoderFactory.h",
1481          "objc/base/RTCVideoEncoderQpThresholds.h",
1482          "objc/base/RTCVideoEncoderSettings.h",
1483          "objc/base/RTCVideoFrame.h",
1484          "objc/base/RTCVideoFrameBuffer.h",
1485          "objc/base/RTCVideoRenderer.h",
1486          "objc/base/RTCYUVPlanarBuffer.h",
1487          "objc/components/capturer/RTCCameraVideoCapturer.h",
1488          "objc/components/capturer/RTCFileVideoCapturer.h",
1489          "objc/components/renderer/metal/RTCMTLNSVideoView.h",
1490          "objc/components/renderer/opengl/RTCNSGLVideoView.h",
1491          "objc/components/renderer/opengl/RTCVideoViewShading.h",
1492          "objc/components/video_codec/RTCCodecSpecificInfoH264.h",
1493          "objc/components/video_codec/RTCDefaultVideoDecoderFactory.h",
1494          "objc/components/video_codec/RTCDefaultVideoEncoderFactory.h",
1495          "objc/components/video_codec/RTCH264ProfileLevelId.h",
1496          "objc/components/video_codec/RTCVideoDecoderFactoryH264.h",
1497          "objc/components/video_codec/RTCVideoDecoderH264.h",
1498          "objc/components/video_codec/RTCVideoEncoderFactoryH264.h",
1499          "objc/components/video_codec/RTCVideoEncoderH264.h",
1500          "objc/components/video_frame_buffer/RTCCVPixelBuffer.h",
1501          "objc/helpers/RTCDispatcher.h",
1502        ]
1503        if (!build_with_chromium) {
1504          sources += [
1505            "objc/api/logging/RTCCallbackLogger.h",
1506            "objc/api/peerconnection/RTCFileLogger.h",
1507          ]
1508        }
1509
1510        deps = [
1511          ":base_objc",
1512          ":default_codec_factory_objc",
1513          ":native_api",
1514          ":native_video",
1515          ":opengl_ui_objc",
1516          ":peerconnectionfactory_base_objc",
1517          ":videocapture_objc",
1518          ":videocodec_objc",
1519          ":videotoolbox_objc",
1520        ]
1521        if (!build_with_chromium) {
1522          deps += [
1523            ":callback_logger_objc",
1524            ":file_logger_objc",
1525          ]
1526        }
1527
1528        frameworks = [
1529          "AVFoundation.framework",
1530          "CoreGraphics.framework",
1531          "CoreMedia.framework",
1532          "OpenGL.framework",
1533        ]
1534
1535        configs = [ "..:common_objc" ]
1536
1537        public_configs = [ ":common_config_objc" ]
1538      }
1539
1540      bundle_data("mac_framework_bundle") {
1541        deps = [ "../sdk:mac_framework_objc" ]
1542        sources = [ "$root_build_dir/WebRTC.framework" ]
1543        outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
1544      }
1545    }
1546
1547    rtc_library("wrapped_native_codec_objc") {
1548      sources = [
1549        "objc/api/video_codec/RTCWrappedNativeVideoDecoder.h",
1550        "objc/api/video_codec/RTCWrappedNativeVideoDecoder.mm",
1551        "objc/api/video_codec/RTCWrappedNativeVideoEncoder.h",
1552        "objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm",
1553      ]
1554
1555      configs += [ "..:common_objc" ]
1556      public_configs = [ ":common_config_objc" ]
1557
1558      deps = [
1559        ":base_objc",
1560        ":helpers_objc",
1561        "../api/video_codecs:video_codecs_api",
1562        "../media:rtc_media_base",
1563      ]
1564    }
1565
1566    # The native API is currently experimental and may change without notice.
1567    rtc_library("native_api") {
1568      visibility = [ "*" ]
1569      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
1570      sources = [
1571        "objc/native/api/network_monitor_factory.h",
1572        "objc/native/api/network_monitor_factory.mm",
1573        "objc/native/api/ssl_certificate_verifier.h",
1574        "objc/native/api/ssl_certificate_verifier.mm",
1575        "objc/native/api/video_capturer.h",
1576        "objc/native/api/video_capturer.mm",
1577        "objc/native/api/video_decoder_factory.h",
1578        "objc/native/api/video_decoder_factory.mm",
1579        "objc/native/api/video_encoder_factory.h",
1580        "objc/native/api/video_encoder_factory.mm",
1581        "objc/native/api/video_frame.h",
1582        "objc/native/api/video_frame.mm",
1583        "objc/native/api/video_frame_buffer.h",
1584        "objc/native/api/video_frame_buffer.mm",
1585        "objc/native/api/video_renderer.h",
1586        "objc/native/api/video_renderer.mm",
1587      ]
1588
1589      configs += [ "..:common_objc" ]
1590
1591      public_configs = [ ":common_config_objc" ]
1592
1593      deps = [
1594        ":base_objc",
1595        ":native_video",
1596        ":videoframebuffer_objc",
1597        "../api:libjingle_peerconnection_api",
1598        "../api:make_ref_counted",
1599        "../api:media_stream_interface",
1600        "../api:scoped_refptr",
1601        "../api/video:video_frame",
1602        "../api/video:video_rtp_headers",
1603        "../api/video_codecs:video_codecs_api",
1604        "../common_video",
1605        "../rtc_base",
1606        "../rtc_base:buffer",
1607        "../rtc_base:logging",
1608        "../rtc_base:threading",
1609      ]
1610      if (is_ios) {
1611        deps += [ ":native_network_monitor" ]
1612      }
1613      absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
1614    }
1615
1616    if (is_ios) {
1617      rtc_library("native_network_monitor") {
1618        visibility = [ "*" ]
1619
1620        sources = [
1621          "objc/native/src/objc_network_monitor.h",
1622          "objc/native/src/objc_network_monitor.mm",
1623        ]
1624
1625        deps = [
1626          ":network_monitor_objc",
1627          ":network_monitor_observer",
1628          "../api:field_trials_view",
1629          "../api:sequence_checker",
1630          "../api/task_queue:pending_task_safety_flag",
1631          "../rtc_base",
1632          "../rtc_base:logging",
1633          "../rtc_base:macromagic",
1634          "../rtc_base:stringutils",
1635          "../rtc_base:threading",
1636        ]
1637
1638        absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
1639      }
1640    }
1641
1642    rtc_library("native_video") {
1643      sources = [
1644        "objc/native/src/objc_frame_buffer.h",
1645        "objc/native/src/objc_frame_buffer.mm",
1646        "objc/native/src/objc_video_decoder_factory.h",
1647        "objc/native/src/objc_video_decoder_factory.mm",
1648        "objc/native/src/objc_video_encoder_factory.h",
1649        "objc/native/src/objc_video_encoder_factory.mm",
1650        "objc/native/src/objc_video_frame.h",
1651        "objc/native/src/objc_video_frame.mm",
1652        "objc/native/src/objc_video_renderer.h",
1653        "objc/native/src/objc_video_renderer.mm",
1654        "objc/native/src/objc_video_track_source.h",
1655        "objc/native/src/objc_video_track_source.mm",
1656      ]
1657
1658      configs += [ "..:common_objc" ]
1659
1660      public_configs = [ ":common_config_objc" ]
1661
1662      deps = [
1663        ":base_native_additions_objc",
1664        ":base_objc",
1665        ":helpers_objc",
1666        ":videocodec_objc",
1667        ":videoframebuffer_objc",
1668        ":vpx_codec_constants",
1669        ":wrapped_native_codec_objc",
1670        "../api:make_ref_counted",
1671        "../api/video:video_frame",
1672        "../api/video:video_rtp_headers",
1673        "../api/video_codecs:video_codecs_api",
1674        "../common_video",
1675        "../media:rtc_audio_video",
1676        "../media:rtc_media_base",
1677        "../modules/video_coding:video_codec_interface",
1678        "../rtc_base",
1679        "../rtc_base:checks",
1680        "../rtc_base:logging",
1681        "../rtc_base:timestamp_aligner",
1682        "../rtc_base:timeutils",
1683      ]
1684    }
1685
1686    rtc_library("video_toolbox_cc") {
1687      visibility = [
1688        ":sdk_unittests_sources",
1689        ":videotoolbox_objc",
1690      ]
1691      sources = [
1692        "objc/components/video_codec/helpers.cc",
1693        "objc/components/video_codec/helpers.h",
1694        "objc/components/video_codec/nalu_rewriter.cc",
1695        "objc/components/video_codec/nalu_rewriter.h",
1696      ]
1697      deps = [
1698        "../common_video",
1699        "../modules/video_coding:webrtc_h264",
1700        "../rtc_base:buffer",
1701        "../rtc_base:checks",
1702        "../rtc_base:logging",
1703      ]
1704    }
1705
1706    rtc_library("videotoolbox_objc") {
1707      visibility = [ "*" ]
1708      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
1709      sources = [
1710        "objc/components/video_codec/RTCVideoDecoderFactoryH264.h",
1711        "objc/components/video_codec/RTCVideoDecoderFactoryH264.m",
1712        "objc/components/video_codec/RTCVideoDecoderH264.h",
1713        "objc/components/video_codec/RTCVideoDecoderH264.mm",
1714        "objc/components/video_codec/RTCVideoEncoderFactoryH264.h",
1715        "objc/components/video_codec/RTCVideoEncoderFactoryH264.m",
1716        "objc/components/video_codec/RTCVideoEncoderH264.h",
1717        "objc/components/video_codec/RTCVideoEncoderH264.mm",
1718      ]
1719
1720      configs += [
1721        "..:common_objc",
1722        ":used_from_extension",
1723      ]
1724
1725      if (is_ios && rtc_apprtcmobile_broadcast_extension) {
1726        defines = [ "RTC_APPRTCMOBILE_BROADCAST_EXTENSION" ]
1727      }
1728
1729      deps = [
1730        ":base_native_additions_objc",
1731        ":base_objc",
1732        ":helpers_objc",
1733        ":video_toolbox_cc",
1734        ":videocodec_objc",
1735        ":videoframebuffer_objc",
1736        "../api/video_codecs:video_codecs_api",
1737        "../common_video",
1738        "../modules/video_coding:video_codec_interface",
1739        "../rtc_base:buffer",
1740        "../rtc_base:checks",
1741        "../rtc_base:logging",
1742        "../rtc_base:timeutils",
1743        "//third_party/libyuv",
1744      ]
1745
1746      frameworks = [
1747        "CoreFoundation.framework",
1748        "CoreMedia.framework",
1749        "CoreVideo.framework",
1750        "VideoToolbox.framework",
1751      ]
1752    }
1753  }
1754}
1755