Index: webrtc/pc/BUILD.gn |
diff --git a/webrtc/pc/BUILD.gn b/webrtc/pc/BUILD.gn |
index 483485012da481803fe641f220ef643832af61bb..96561e5ae0828189fb4c713bde65320207c87c1c 100644 |
--- a/webrtc/pc/BUILD.gn |
+++ b/webrtc/pc/BUILD.gn |
@@ -25,7 +25,7 @@ config("rtc_pc_config") { |
} |
} |
-rtc_static_library("rtc_pc") { |
+rtc_static_library("rtc_pc_base") { |
defines = [] |
sources = [ |
"audiomonitor.cc", |
@@ -56,7 +56,8 @@ rtc_static_library("rtc_pc") { |
deps = [ |
"../api:call_api", |
"../base:rtc_base", |
- "../media", |
+ "../base:rtc_task_queue", |
+ "../media:rtc_data", |
] |
if (rtc_build_libsrtp) { |
@@ -71,6 +72,18 @@ rtc_static_library("rtc_pc") { |
} |
} |
+# TODO(zhihuang): Remove this once the downstream dependencies start using the |
+# modular targets. |
+rtc_source_set("rtc_pc") { |
+ public_deps = [ |
+ ":rtc_pc_base", |
+ ] |
+ |
+ deps = [ |
+ "../media:rtc_audio_video", |
+ ] |
+} |
+ |
config("libjingle_peerconnection_warnings_config") { |
# GN orders flags on a target before flags from configs. The default config |
# adds these flags so to cancel them out they need to come from a config and |
@@ -80,7 +93,93 @@ config("libjingle_peerconnection_warnings_config") { |
} |
} |
-rtc_static_library("libjingle_peerconnection") { |
+# This target contains the null implementation of the audio module and it is |
+# used to build WebRTC without audio support. |
+rtc_static_library("webrtc_null_audio") { |
+ sources = [ |
+ "nullaudiofactory.cc", |
+ ] |
+ |
+ if (!build_with_chromium && is_clang) { |
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
+ } |
+} |
+ |
+# This target contains the real implementation of the audio module and it is |
+# used to build WebRTC with audio support. It should never be used with |
+# "webrtc_null_audio" at the same time and it should always be linked with the |
+# "webrtc_media". |
+rtc_static_library("webrtc_audio") { |
+ sources = [ |
+ "audiofactory.cc", |
+ ] |
+ |
+ public_deps = [ |
+ "../media:rtc_audio_video", |
+ ] |
+ |
+ if (!build_with_chromium && is_clang) { |
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
+ } |
+} |
+ |
+# This target contains the null implementation of the audio/video related |
+# objects and it is used to build WebRTC without audio and video support. |
+rtc_source_set("webrtc_null_media") { |
+ sources = [ |
+ "nullmediafactory.cc", |
+ ] |
+ |
+ if (!build_with_chromium && is_clang) { |
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
+ } |
+} |
+ |
+# This target contains the real implementation of the audio/video related |
+# objects and it is used to build WebRTC with audio and video support. |
+rtc_source_set("webrtc_media") { |
kjellander_webrtc
2017/06/01 05:34:30
Can we call this pc_media instead?
Zhi Huang
2017/06/02 05:16:43
SGTM.
|
+ deps = [ |
+ "../call", |
+ "../media:rtc_audio_video", |
+ ] |
+ |
+ if (!build_with_chromium && is_clang) { |
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
+ } |
+} |
+ |
+# The modular build targets can be used to build WebRTC with different |
+# functionalities. The users can choose either the real implemenation |
+# or the null implementation of the audio/video modules based on their |
+# requirments. |
kjellander_webrtc
2017/06/01 05:34:30
requirements.
Zhi Huang
2017/06/02 05:16:43
Done.
|
+# |
+# For example, to build WebRTC with datachannel support only, we would need the |
+# the peerconnection and the null implementation of the audio and video modules. |
+# |
+# rtc_source_set("webrtc_datachannel_only") { |
+# deps = [ |
+# ":webrtc_null_audio", |
+# ":webrtc_null_media", |
+# ":webrtc_peerconnection", |
+# ] |
+# } |
+# |
+# To build WebRTC with all the audio, video and datachannel support, we would |
+# need the peerconnection and the real implementation of the audio and video |
+# modules. |
+# |
+# rtc_source_set("webrtc_full") { |
+# deps = [ |
+# ":webrtc_audio", |
+# ":webrtc_media", |
+# ":webrtc_peerconnection", |
+# ] |
+# } |
+rtc_static_library("webrtc_peerconnection") { |
cflags = [] |
sources = [ |
"audiotrack.cc", |
@@ -141,18 +240,28 @@ rtc_static_library("libjingle_peerconnection") { |
} |
deps = [ |
- ":rtc_pc", |
+ ":rtc_pc_base", |
"../api:call_api", |
"../api:rtc_stats_api", |
"../api/video_codecs:video_codecs_api", |
- "../call", |
- "../media", |
+ "../logging:rtc_event_log_api", |
"../stats", |
] |
public_deps = [ |
"../api:libjingle_peerconnection_api", |
] |
+} |
+ |
+# TODO(zhihuang): Remove this once the downstream dependencies start using the |
+# modular targets. |
+rtc_source_set("libjingle_peerconnection") { |
+ public_deps = [ |
+ ":webrtc_audio", |
+ ":webrtc_media", |
+ ":webrtc_peerconnection", |
+ "../api:libjingle_peerconnection_api", |
+ ] |
if (rtc_use_quic) { |
sources += [ |
@@ -244,7 +353,6 @@ if (rtc_include_tests) { |
] |
deps = [ |
- ":libjingle_peerconnection", |
"../base:rtc_base_tests_utils", |
"//testing/gmock", |
] |
@@ -368,4 +476,65 @@ if (rtc_include_tests) { |
shard_timeout = 900 |
} |
} |
+ |
+ rtc_test("peerconnection_datachannelonly_unittests") { |
+ testonly = true |
+ sources = [ |
+ "peerconnection_datachannelonly_unittest.cc", |
+ ] |
+ |
+ defines = [ "HAVE_SCTP" ] |
kjellander_webrtc
2017/06/01 05:34:30
You shouldn't need to define this since you depend
Zhi Huang
2017/06/02 05:16:43
Done.
|
+ |
+ configs += [ ":peerconnection_unittests_config" ] |
+ |
+ if (!build_with_chromium && is_clang) { |
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
+ } |
+ |
+ # TODO(jschuh): Bug 1348: fix this warning. |
+ configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
+ |
+ if (is_win) { |
+ cflags = [ |
+ "/wd4245", # conversion from int to size_t, signed/unsigned mismatch. |
+ "/wd4389", # signed/unsigned mismatch. |
+ ] |
+ } |
+ |
+ deps = [] |
+ if (is_android) { |
+ sources += [ |
+ "test/androidtestinitializer.cc", |
+ "test/androidtestinitializer.h", |
+ ] |
+ deps += [ |
+ "//testing/android/native_test:native_test_support", |
+ "//webrtc/sdk/android:base_jni", |
+ "//webrtc/sdk/android:libjingle_peerconnection_java", |
+ "//webrtc/sdk/android:null_audio_jni", |
+ "//webrtc/sdk/android:null_video_jni", |
+ ] |
+ } |
+ |
+ deps += [ |
+ ":pc_test_utils", |
+ ":webrtc_null_audio", |
+ ":webrtc_null_media", |
+ ":webrtc_peerconnection", |
+ "..:webrtc_common", |
+ "../api:fakemetricsobserver", |
+ "../base:rtc_base_tests_main", |
+ "../base:rtc_base_tests_utils", |
+ "../modules/utility", |
+ "../pc:rtc_pc_base", |
+ "../system_wrappers:metrics_default", |
+ "//testing/gmock", |
+ ] |
+ |
+ if (is_android) { |
+ deps += [ "//testing/android/native_test:native_test_support" ] |
+ shard_timeout = 900 |
+ } |
+ } |
} |