1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
|
From: stransky <stransky@redhat.com>
Date: Thu, 5 Nov 2020 07:47:00 +0000
Subject: Bug 1654112 - Tweak upstream gn files for Firefox build. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D130075
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/127ace4d8887f11abb201d300a849772a2b519f8
---
.gn | 2 ++
BUILD.gn | 26 +++++++++++++-
api/BUILD.gn | 8 ++++-
api/task_queue/BUILD.gn | 2 ++
api/transport/BUILD.gn | 2 ++
common_audio/BUILD.gn | 4 ---
common_audio/fir_filter_avx2.cc | 2 ++
common_audio/intrin.h | 8 +++++
media/BUILD.gn | 30 ++++++++++++++++
modules/audio_coding/BUILD.gn | 2 +-
modules/audio_device/BUILD.gn | 8 ++---
modules/audio_processing/aec3/BUILD.gn | 13 +++----
.../aec3/adaptive_fir_filter_avx2.cc | 3 +-
.../audio_processing/agc2/rnn_vad/BUILD.gn | 2 +-
modules/desktop_capture/BUILD.gn | 29 +---------------
modules/portal/BUILD.gn | 24 +++++++++++++
modules/video_capture/BUILD.gn | 11 +-----
modules/video_coding/BUILD.gn | 6 ++++
rtc_base/BUILD.gn | 4 ++-
rtc_base/system/BUILD.gn | 2 +-
test/BUILD.gn | 14 ++++++++
webrtc.gni | 34 ++++++++++++-------
22 files changed, 162 insertions(+), 74 deletions(-)
create mode 100644 common_audio/intrin.h
diff --git a/.gn b/.gn
index c9824916ad..d35ea79ced 100644
--- a/.gn
+++ b/.gn
@@ -69,6 +69,8 @@ default_args = {
# Prevent jsoncpp to pass -Wno-deprecated-declarations to users
jsoncpp_no_deprecated_declarations = false
+ use_custom_libcxx = false
+
# Fixes the abi-revision issue.
# TODO(https://bugs.webrtc.org/14437): Remove this section if general
# Chromium fix resolves the problem.
diff --git a/BUILD.gn b/BUILD.gn
index 5817d22227..8b2648a306 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -33,7 +33,7 @@ if (is_android) {
import("//build/config/android/rules.gni")
}
-if (!build_with_chromium) {
+if (!build_with_chromium && !build_with_mozilla) {
# This target should (transitively) cause everything to be built; if you run
# 'ninja default' and then 'ninja all', the second build should do no work.
group("default") {
@@ -152,6 +152,10 @@ config("common_inherited_config") {
defines += [ "WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT" ]
}
+ if (build_with_mozilla) {
+ defines += [ "WEBRTC_MOZILLA_BUILD" ]
+ }
+
if (!rtc_builtin_ssl_root_certificates) {
defines += [ "WEBRTC_EXCLUDE_BUILT_IN_SSL_ROOT_CERTS" ]
}
@@ -460,9 +464,11 @@ config("common_config") {
}
}
+if (is_mac) {
config("common_objc") {
frameworks = [ "Foundation.framework" ]
}
+}
if (!build_with_chromium) {
# Target to build all the WebRTC production code.
@@ -502,6 +508,23 @@ if (!build_with_chromium) {
"sdk",
"video",
]
+ if (build_with_mozilla) {
+ deps -= [
+ "api:create_peerconnection_factory",
+ "api:rtc_error",
+ "api:transport_api",
+ "api/crypto",
+ "api/rtc_event_log:rtc_event_log_factory",
+ "api/task_queue",
+ "api/task_queue:default_task_queue_factory",
+ "api/test/metrics",
+ "logging:rtc_event_log_api",
+ "p2p:rtc_p2p",
+ "pc:libjingle_peerconnection",
+ "pc:rtc_pc",
+ "sdk",
+ ]
+ }
if (rtc_include_builtin_audio_codecs) {
deps += [
@@ -521,6 +544,7 @@ if (!build_with_chromium) {
deps += [
"api/video:video_frame",
"api/video:video_rtp_headers",
+ "test:rtp_test_utils",
]
} else {
deps += [
diff --git a/api/BUILD.gn b/api/BUILD.gn
index 33a6b0aaa6..ab5d6c91ce 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -35,7 +35,7 @@ rtc_source_set("callfactory_api") {
]
}
-if (!build_with_chromium) {
+if (!build_with_chromium && !build_with_mozilla) {
rtc_library("create_peerconnection_factory") {
visibility = [ "*" ]
allow_poison = [ "default_task_queue" ]
@@ -227,6 +227,7 @@ rtc_library("rtp_sender_interface") {
}
rtc_library("libjingle_peerconnection_api") {
+if (!build_with_mozilla) {
visibility = [ "*" ]
cflags = []
sources = [
@@ -343,6 +344,7 @@ rtc_library("libjingle_peerconnection_api") {
"//third_party/abseil-cpp/absl/types:optional",
]
}
+}
rtc_source_set("frame_transformer_interface") {
visibility = [ "*" ]
@@ -550,6 +552,7 @@ rtc_source_set("peer_network_dependencies") {
}
rtc_source_set("peer_connection_quality_test_fixture_api") {
+if (!build_with_mozilla) {
visibility = [ "*" ]
testonly = true
sources = [ "test/peerconnection_quality_test_fixture.h" ]
@@ -600,6 +603,7 @@ rtc_source_set("peer_connection_quality_test_fixture_api") {
"//third_party/abseil-cpp/absl/types:optional",
]
}
+}
rtc_source_set("frame_generator_api") {
visibility = [ "*" ]
@@ -885,6 +889,7 @@ rtc_source_set("refcountedbase") {
]
}
+if (!build_with_mozilla) {
rtc_library("ice_transport_factory") {
visibility = [ "*" ]
sources = [
@@ -903,6 +908,7 @@ rtc_library("ice_transport_factory") {
"rtc_event_log:rtc_event_log",
]
}
+}
rtc_library("neteq_simulator_api") {
visibility = [ "*" ]
diff --git a/api/task_queue/BUILD.gn b/api/task_queue/BUILD.gn
index 69393b80ff..c9b4a5d0ec 100644
--- a/api/task_queue/BUILD.gn
+++ b/api/task_queue/BUILD.gn
@@ -30,6 +30,7 @@ rtc_library("task_queue") {
]
}
+if (rtc_include_tests) {
rtc_library("task_queue_test") {
visibility = [ "*" ]
testonly = true
@@ -78,6 +79,7 @@ rtc_library("task_queue_test") {
]
}
}
+}
rtc_library("default_task_queue_factory") {
visibility = [ "*" ]
diff --git a/api/transport/BUILD.gn b/api/transport/BUILD.gn
index 08f3d6d1d0..e0b31122b2 100644
--- a/api/transport/BUILD.gn
+++ b/api/transport/BUILD.gn
@@ -90,6 +90,7 @@ rtc_source_set("sctp_transport_factory_interface") {
}
rtc_source_set("stun_types") {
+if (!build_with_mozilla) {
visibility = [ "*" ]
sources = [
"stun.cc",
@@ -110,6 +111,7 @@ rtc_source_set("stun_types") {
]
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
}
+}
if (rtc_include_tests) {
rtc_source_set("test_feedback_generator_interface") {
diff --git a/common_audio/BUILD.gn b/common_audio/BUILD.gn
index 2ae6d32710..a45214f754 100644
--- a/common_audio/BUILD.gn
+++ b/common_audio/BUILD.gn
@@ -267,14 +267,10 @@ if (current_cpu == "x86" || current_cpu == "x64") {
"resampler/sinc_resampler_avx2.cc",
]
- if (is_win) {
- cflags = [ "/arch:AVX2" ]
- } else {
cflags = [
"-mavx2",
"-mfma",
]
- }
deps = [
":fir_filter",
diff --git a/common_audio/fir_filter_avx2.cc b/common_audio/fir_filter_avx2.cc
index 9cb0f770ca..0031392f8a 100644
--- a/common_audio/fir_filter_avx2.cc
+++ b/common_audio/fir_filter_avx2.cc
@@ -15,6 +15,8 @@
#include <string.h>
#include <xmmintrin.h>
+#include "common_audio/intrin.h"
+
#include "rtc_base/checks.h"
#include "rtc_base/memory/aligned_malloc.h"
diff --git a/common_audio/intrin.h b/common_audio/intrin.h
new file mode 100644
index 0000000000..f6ff7f218f
--- /dev/null
+++ b/common_audio/intrin.h
@@ -0,0 +1,8 @@
+#if defined (__SSE__)
+ #include <immintrin.h>
+ #if defined (__clang__)
+ #include <avxintrin.h>
+ #include <avx2intrin.h>
+ #include <fmaintrin.h>
+ #endif
+#endif
diff --git a/media/BUILD.gn b/media/BUILD.gn
index 2e5c0bb872..4ddc8349a8 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -147,6 +147,27 @@ rtc_library("rtc_media_base") {
"base/video_source_base.cc",
"base/video_source_base.h",
]
+ if (build_with_mozilla) {
+ sources -= [
+ "base/adapted_video_track_source.cc",
+ "base/adapted_video_track_source.h",
+ "base/audio_source.h",
+ "base/delayable.h",
+ "base/media_channel.h",
+ "base/media_channel_impl.cc",
+ "base/media_channel_impl.h",
+ "base/media_engine.cc",
+ "base/media_engine.h",
+ "base/rid_description.cc",
+ "base/rid_description.h",
+ "base/rtp_utils.cc",
+ "base/rtp_utils.h",
+ "base/stream_params.cc",
+ "base/stream_params.h",
+ "base/turn_utils.cc",
+ "base/turn_utils.h",
+ ]
+ }
}
rtc_library("media_channel_impl") {
@@ -420,6 +441,9 @@ rtc_library("rtc_internal_video_codecs") {
"../system_wrappers:field_trial",
"../test:fake_video_codecs",
]
+ if (build_with_mozilla) {
+ deps -= [ "../test:fake_video_codecs" ]
+ }
if (enable_libaom) {
defines += [ "RTC_USE_LIBAOM_AV1_ENCODER" ]
@@ -449,6 +473,12 @@ rtc_library("rtc_internal_video_codecs") {
# targets depend on :rtc_encoder_simulcast_proxy directly.
"engine/encoder_simulcast_proxy.h",
]
+ if (build_with_mozilla) {
+ sources -= [
+ "engine/fake_video_codec_factory.cc",
+ "engine/fake_video_codec_factory.h",
+ ]
+ }
}
rtc_library("rtc_audio_video") {
diff --git a/modules/audio_coding/BUILD.gn b/modules/audio_coding/BUILD.gn
index dddc3edd83..eac0650a26 100644
--- a/modules/audio_coding/BUILD.gn
+++ b/modules/audio_coding/BUILD.gn
@@ -553,7 +553,7 @@ rtc_library("webrtc_opus_wrapper") {
deps += [ rtc_opus_dir ]
public_configs = [ "//third_party/opus:opus_config" ]
} else if (build_with_mozilla) {
- include_dirs = [ getenv("DIST") + "/include/opus" ]
+ public_configs = [ "//third_party/opus:opus_config" ]
}
}
diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn
index 4a6a0ab41c..e35a442025 100644
--- a/modules/audio_device/BUILD.gn
+++ b/modules/audio_device/BUILD.gn
@@ -233,9 +233,9 @@ rtc_library("audio_device_impl") {
]
if (build_with_mozilla) {
- sources += [
- "opensl/single_rw_fifo.cc",
- "opensl/single_rw_fifo.h",
+ sources -= [
+ "include/test_audio_device.cc",
+ "include/test_audio_device.h",
]
}
@@ -477,7 +477,7 @@ if (rtc_include_tests && !build_with_chromium) {
}
}
-if (!build_with_chromium && is_android) {
+if ((!build_with_chromium && !build_with_mozilla) && is_android) {
rtc_android_library("audio_device_java") {
sources = [
"android/java/src/org/webrtc/voiceengine/BuildInfo.java",
diff --git a/modules/audio_processing/aec3/BUILD.gn b/modules/audio_processing/aec3/BUILD.gn
index f5eb5d5951..3e11a245a1 100644
--- a/modules/audio_processing/aec3/BUILD.gn
+++ b/modules/audio_processing/aec3/BUILD.gn
@@ -264,14 +264,11 @@ if (current_cpu == "x86" || current_cpu == "x64") {
"vector_math_avx2.cc",
]
- if (is_win) {
- cflags = [ "/arch:AVX2" ]
- } else {
- cflags = [
- "-mavx2",
- "-mfma",
- ]
- }
+ cflags = [
+ "-mavx",
+ "-mavx2",
+ "-mfma",
+ ]
deps = [
":adaptive_fir_filter",
diff --git a/modules/audio_processing/aec3/adaptive_fir_filter_avx2.cc b/modules/audio_processing/aec3/adaptive_fir_filter_avx2.cc
index 6c8c948026..44d4514275 100644
--- a/modules/audio_processing/aec3/adaptive_fir_filter_avx2.cc
+++ b/modules/audio_processing/aec3/adaptive_fir_filter_avx2.cc
@@ -10,8 +10,7 @@
#include "modules/audio_processing/aec3/adaptive_fir_filter.h"
-#include <immintrin.h>
-
+#include "common_audio/intrin.h"
#include "rtc_base/checks.h"
namespace webrtc {
diff --git a/modules/audio_processing/agc2/rnn_vad/BUILD.gn b/modules/audio_processing/agc2/rnn_vad/BUILD.gn
index 9093a68cf3..3003a585bd 100644
--- a/modules/audio_processing/agc2/rnn_vad/BUILD.gn
+++ b/modules/audio_processing/agc2/rnn_vad/BUILD.gn
@@ -122,7 +122,7 @@ rtc_source_set("vector_math") {
if (current_cpu == "x86" || current_cpu == "x64") {
rtc_library("vector_math_avx2") {
sources = [ "vector_math_avx2.cc" ]
- if (is_win) {
+ if (is_win && !build_with_mozilla) {
cflags = [ "/arch:AVX2" ]
} else {
cflags = [
diff --git a/modules/desktop_capture/BUILD.gn b/modules/desktop_capture/BUILD.gn
index c9993dd47b..4aa9186527 100644
--- a/modules/desktop_capture/BUILD.gn
+++ b/modules/desktop_capture/BUILD.gn
@@ -342,37 +342,12 @@ rtc_library("desktop_capture") {
]
deps += [ ":desktop_capture_objc" ]
}
-
- if (build_with_mozilla) {
- sources += [
- "desktop_device_info.cc",
- "desktop_device_info.h",
- ]
- if (is_win) {
- sources += [
- "app_capturer_win.cc",
- "win/desktop_device_info_win.cc",
- "win/win_shared.cc",
- ]
- }
- }
if (rtc_use_x11_extensions || rtc_use_pipewire) {
sources += [
"mouse_cursor_monitor_linux.cc",
"screen_capturer_linux.cc",
"window_capturer_linux.cc",
]
-
- if (build_with_mozilla && (is_linux || is_chromeos)) {
- sources += [
- "app_capturer_linux.cc",
- "linux/x11/app_capturer_x11.cc",
- "linux/x11/desktop_device_info_linux.cc",
- "linux/x11/desktop_device_info_linux.h",
- "linux/x11/shared_x_util.cc",
- "linux/x11/shared_x_util.h",
- ]
- }
}
if (rtc_use_x11_extensions) {
@@ -536,9 +511,7 @@ rtc_library("desktop_capture") {
deps += [ "../../rtc_base:sanitizer" ]
}
- if (!build_with_mozilla) {
- deps += [ "//third_party/libyuv" ]
- }
+ deps += [ "//third_party/libyuv" ]
if (use_desktop_capture_differ_sse2) {
deps += [ ":desktop_capture_differ_sse2" ]
diff --git a/modules/portal/BUILD.gn b/modules/portal/BUILD.gn
index d0756f269b..d7768b2323 100644
--- a/modules/portal/BUILD.gn
+++ b/modules/portal/BUILD.gn
@@ -11,6 +11,7 @@ import("//tools/generate_stubs/rules.gni")
import("../../webrtc.gni")
if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+if (!build_with_mozilla) {
pkg_config("gio") {
packages = [
"gio-2.0",
@@ -88,6 +89,12 @@ if ((is_linux || is_chromeos) && rtc_use_pipewire) {
defines += [ "WEBRTC_USE_GIO" ]
}
}
+} else {
+ config("pipewire_all") {
+ }
+ config("pipewire_config") {
+ }
+}
rtc_library("portal") {
sources = [
@@ -120,5 +127,22 @@ if ((is_linux || is_chromeos) && rtc_use_pipewire) {
deps += [ ":pipewire_stubs" ]
}
+
+ if (build_with_mozilla) {
+ configs -= [
+ ":gio",
+ ":pipewire",
+ ":pipewire_config",
+ ]
+ deps -= [ ":pipewire_stubs" ]
+ defines -= [ "WEBRTC_DLOPEN_PIPEWIRE" ]
+ public_deps = [
+ "//third_party/pipewire",
+ "//third_party/drm",
+ "//third_party/gbm",
+ "//third_party/libepoxy"
+ ]
+ }
}
}
+
diff --git a/modules/video_capture/BUILD.gn b/modules/video_capture/BUILD.gn
index cfa5184d71..95548906c4 100644
--- a/modules/video_capture/BUILD.gn
+++ b/modules/video_capture/BUILD.gn
@@ -93,21 +93,12 @@ if (!build_with_chromium) {
"strmiids.lib",
"user32.lib",
]
-
- if (build_with_mozilla) {
- sources += [
- "windows/BaseFilter.cpp",
- "windows/BaseInputPin.cpp",
- "windows/BasePin.cpp",
- "windows/MediaType.cpp",
- ]
- }
}
if (is_fuchsia) {
sources = [ "video_capture_factory_null.cc" ]
}
- if (build_with_mozilla && is_android) {
+ if (!build_with_mozilla && is_android) {
include_dirs = [
"/config/external/nspr",
"/nsprpub/lib/ds",
diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn
index fe63804b19..e1b5e4ba84 100644
--- a/modules/video_coding/BUILD.gn
+++ b/modules/video_coding/BUILD.gn
@@ -237,6 +237,12 @@ rtc_library("video_coding") {
"video_receiver2.cc",
"video_receiver2.h",
]
+ if (build_with_mozilla) {
+ sources += [
+ "event_wrapper.cc",
+ "event_wrapper.h",
+ ]
+ }
deps = [
":codec_globals_headers",
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index 0d8bd4f759..7e162cecbb 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -820,7 +820,9 @@ rtc_library("rtc_json") {
"strings/json.h",
]
deps = [ ":stringutils" ]
+if (!build_with_mozilla) {
all_dependent_configs = [ "//third_party/jsoncpp:jsoncpp_config" ]
+}
if (rtc_build_json) {
deps += [ "//third_party/jsoncpp" ]
} else {
@@ -2073,7 +2075,7 @@ if (rtc_include_tests) {
}
}
-if (is_android) {
+if (is_android && !build_with_mozilla) {
rtc_android_library("base_java") {
visibility = [ "*" ]
sources = [
diff --git a/rtc_base/system/BUILD.gn b/rtc_base/system/BUILD.gn
index 77f5139a2f..486b37590c 100644
--- a/rtc_base/system/BUILD.gn
+++ b/rtc_base/system/BUILD.gn
@@ -101,7 +101,7 @@ if (is_mac || is_ios) {
rtc_source_set("warn_current_thread_is_deadlocked") {
sources = [ "warn_current_thread_is_deadlocked.h" ]
deps = []
- if (is_android && !build_with_chromium) {
+ if (is_android && (!build_with_chromium && !build_with_mozilla)) {
sources += [ "warn_current_thread_is_deadlocked.cc" ]
deps += [
"..:logging",
diff --git a/test/BUILD.gn b/test/BUILD.gn
index 0c71115f0d..04a718c411 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -156,6 +156,7 @@ rtc_library("audio_test_common") {
absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
}
+if (!build_with_mozilla) {
if (!build_with_chromium) {
if (is_mac || is_ios) {
rtc_library("video_test_mac") {
@@ -204,8 +205,12 @@ if (!build_with_chromium) {
}
}
}
+}
rtc_library("rtp_test_utils") {
+ if (build_with_mozilla) {
+ sources = []
+ } else {
testonly = true
sources = [
"rtcp_packet_parser.cc",
@@ -215,6 +220,7 @@ rtc_library("rtp_test_utils") {
"rtp_file_writer.cc",
"rtp_file_writer.h",
]
+ }
deps = [
"../api:array_view",
@@ -467,7 +473,9 @@ rtc_library("video_test_support") {
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
if (!is_ios) {
+ if (!build_with_mozilla) {
deps += [ "//third_party:jpeg" ]
+ }
sources += [ "testsupport/jpeg_frame_writer.cc" ]
} else {
sources += [ "testsupport/jpeg_frame_writer_ios.cc" ]
@@ -1036,6 +1044,10 @@ rtc_library("test_common") {
if (!is_android && !build_with_chromium) {
deps += [ "../modules/video_capture:video_capture_internal_impl" ]
}
+ # This, or some form of it should be upstreamed.
+ if (!rtc_include_tests) {
+ deps -= [ "../rtc_base:task_queue_for_test" ]
+ }
}
rtc_library("mock_transport") {
@@ -1203,6 +1215,7 @@ rtc_library("copy_to_file_audio_capturer_unittest") {
]
}
+if (!build_with_mozilla) {
if (!build_with_chromium && is_android) {
rtc_android_library("native_test_java") {
testonly = true
@@ -1216,6 +1229,7 @@ if (!build_with_chromium && is_android) {
]
}
}
+}
rtc_library("call_config_utils") {
# TODO(bugs.webrtc.org/10814): Remove rtc_json_suppressions as soon as it
diff --git a/webrtc.gni b/webrtc.gni
index 8dfcc9d244..6ae1b2329c 100644
--- a/webrtc.gni
+++ b/webrtc.gni
@@ -35,6 +35,11 @@ if (is_mac) {
import("//build/config/mac/rules.gni")
}
+if (is_android) {
+ import("//build/config/android/config.gni")
+ import("//build/config/android/rules.gni")
+}
+
if (is_fuchsia) {
import("//build/config/fuchsia/config.gni")
}
@@ -42,6 +47,11 @@ if (is_fuchsia) {
# This declare_args is separated from the next one because args declared
# in this one, can be read from the next one (args defined in the same
# declare_args cannot be referenced in that scope).
+declare_args() {
+ # Enable to use the Mozilla internal settings.
+ build_with_mozilla = true
+}
+
declare_args() {
# Setting this to true will make RTC_EXPORT (see rtc_base/system/rtc_export.h)
# expand to code that will manage symbols visibility.
@@ -84,7 +94,7 @@ declare_args() {
# will tell the pre-processor to remove the default definition of the
# SystemTimeNanos() which is defined in rtc_base/system_time.cc. In
# that case a new implementation needs to be provided.
- rtc_exclude_system_time = build_with_chromium
+ rtc_exclude_system_time = build_with_chromium || build_with_mozilla
# Setting this to false will require the API user to pass in their own
# SSLCertificateVerifier to verify the certificates presented from a
@@ -110,7 +120,7 @@ declare_args() {
# Used to specify an external OpenSSL include path when not compiling the
# library that comes with WebRTC (i.e. rtc_build_ssl == 0).
- rtc_ssl_root = ""
+ rtc_ssl_root = "unused"
# Enable when an external authentication mechanism is used for performing
# packet authentication for RTP packets instead of libsrtp.
@@ -127,13 +137,13 @@ declare_args() {
rtc_enable_bwe_test_logging = false
# Set this to false to skip building examples.
- rtc_build_examples = true
+ rtc_build_examples = false
# Set this to false to skip building tools.
- rtc_build_tools = true
+ rtc_build_tools = false
# Set this to false to skip building code that requires X11.
- rtc_use_x11 = ozone_platform_x11
+ rtc_use_x11 = use_x11
# Set this to use PipeWire on the Wayland display server.
# By default it's only enabled on desktop Linux (excludes ChromeOS) and
@@ -144,9 +154,6 @@ declare_args() {
# Set this to link PipeWire and required libraries directly instead of using the dlopen.
rtc_link_pipewire = false
- # Enable to use the Mozilla internal settings.
- build_with_mozilla = false
-
# Experimental: enable use of Android AAudio which requires Android SDK 26 or above
# and NDK r16 or above.
rtc_enable_android_aaudio = false
@@ -227,7 +234,7 @@ declare_args() {
# When set to true, a capturer implementation that uses the
# Windows.Graphics.Capture APIs will be available for use. This introduces a
# dependency on the Win 10 SDK v10.0.17763.0.
- rtc_enable_win_wgc = is_win
+ rtc_enable_win_wgc = false
# Includes the dav1d decoder in the internal decoder factory when set to true.
rtc_include_dav1d_in_internal_decoder_factory = true
@@ -256,7 +263,7 @@ declare_args() {
rtc_build_json = !build_with_mozilla
rtc_build_libsrtp = !build_with_mozilla
rtc_build_libvpx = !build_with_mozilla
- rtc_libvpx_build_vp9 = !build_with_mozilla
+ rtc_libvpx_build_vp9 = true
rtc_build_opus = !build_with_mozilla
rtc_build_ssl = !build_with_mozilla
@@ -275,7 +282,7 @@ declare_args() {
# Chromium uses its own IO handling, so the internal ADM is only built for
# standalone WebRTC.
- rtc_include_internal_audio_device = !build_with_chromium
+ rtc_include_internal_audio_device = !build_with_chromium && !build_with_mozilla
# Set this to true to enable the avx2 support in webrtc.
# TODO: Make sure that AVX2 works also for non-clang compilers.
@@ -319,6 +326,9 @@ declare_args() {
rtc_enable_grpc = rtc_enable_protobuf && (is_linux || is_mac)
}
+# Enable liboam only on non-mozilla builds.
+enable_libaom = !build_with_mozilla
+
# Make it possible to provide custom locations for some libraries (move these
# up into declare_args should we need to actually use them for the GN build).
rtc_libvpx_dir = "//third_party/libvpx"
@@ -1114,7 +1124,7 @@ if (is_mac || is_ios) {
}
}
-if (is_android) {
+if (is_android && !build_with_mozilla) {
template("rtc_android_library") {
android_library(target_name) {
forward_variables_from(invoker,
--
2.34.1
|