The eventual goal is to allow PlatformThread to use SequencedTaskChecker, but getting to that point will require some more detangling. Here are (roughly) the steps taken in this CL: * Make constructormagic a separate target. * Move atomicops and arraysize to separate targets * Move platform_thread_types to a separate target * Move criticalsection to a separate target * Move thread_checker to separate target * Make sequenced_task_checker not depend on base_approved * Move ptr_util to a separate target * Move scoped_ptr to ptr_util * Make rtc_task_queue_api not depend on base_approved * Make sequenced_task_checker depend on rtc_task_queue_api * Move rtc::Event to its own target * Move basictypes.h to constructormagic * Move format_macros and stringize_macros into constructormagic * Rename constructormagic target to... macromagic * Move stringencode to stringutils * New target for safe_conversions * Move timeutils to a new target. * Move logging to a new target. * Move platform_thread to a new target. * Make refcount a new target (refcount, refcountedobject, refcounter). * Remove rtc_base_approved from deps of TQ * Remove a circular dependency between event tracer and platform thread. Further steps will probably be to factor TaskQueue::Current() to not be a part of the TaskQueue class itself and have it declared+implemented in a target that's lower level than TQ itself. SequencedTaskChecker can then depend on that target and avoid the TQ dependency. Once we're there, PlatformThread will be able to depend on SequencedTaskChecker. Attempted but eventually removed from this CL: * Make TQ a part of rtc_base_approved * Remove direct dependencies on sequenced_task_checker. * Profit. A few include-what-you-use updates along the way. Fix a few targets that were depending on rtc_task_queue_api Change-Id: Iee79aa2e81d978444c51b3005db9df7dc12d92a9 Bug: webrtc:8957 Reviewed-on: https://webrtc-review.googlesource.com/58480 Commit-Queue: Tommi <tommi@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22487}
557 lines
16 KiB
Plaintext
557 lines
16 KiB
Plaintext
# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
|
|
#
|
|
# Use of this source code is governed by a BSD-style license
|
|
# that can be found in the LICENSE file in the root of the source
|
|
# tree. An additional intellectual property rights grant can be found
|
|
# in the file PATENTS. All contributing project authors may
|
|
# be found in the AUTHORS file in the root of the source tree.
|
|
|
|
import("../webrtc.gni")
|
|
if (is_android) {
|
|
import("//build/config/android/config.gni")
|
|
import("//build/config/android/rules.gni")
|
|
}
|
|
|
|
group("pc") {
|
|
deps = [
|
|
":rtc_pc",
|
|
]
|
|
}
|
|
|
|
config("rtc_pc_config") {
|
|
defines = []
|
|
if (rtc_enable_sctp) {
|
|
defines += [ "HAVE_SCTP" ]
|
|
}
|
|
}
|
|
|
|
rtc_static_library("rtc_pc_base") {
|
|
visibility = [ "*" ]
|
|
defines = []
|
|
sources = [
|
|
"audiomonitor.h",
|
|
"bundlefilter.cc",
|
|
"bundlefilter.h",
|
|
"channel.cc",
|
|
"channel.h",
|
|
"channelmanager.cc",
|
|
"channelmanager.h",
|
|
"currentspeakermonitor.cc",
|
|
"currentspeakermonitor.h",
|
|
"dtlssrtptransport.cc",
|
|
"dtlssrtptransport.h",
|
|
"externalhmac.cc",
|
|
"externalhmac.h",
|
|
"jseptransport.cc",
|
|
"jseptransport.h",
|
|
"jseptransport2.cc",
|
|
"jseptransport2.h",
|
|
"jseptransportcontroller.cc",
|
|
"jseptransportcontroller.h",
|
|
"mediasession.cc",
|
|
"mediasession.h",
|
|
"rtcpmuxfilter.cc",
|
|
"rtcpmuxfilter.h",
|
|
"rtpmediautils.cc",
|
|
"rtpmediautils.h",
|
|
"rtptransport.cc",
|
|
"rtptransport.h",
|
|
"rtptransportinternal.h",
|
|
"rtptransportinternaladapter.h",
|
|
"sessiondescription.cc",
|
|
"sessiondescription.h",
|
|
"srtpfilter.cc",
|
|
"srtpfilter.h",
|
|
"srtpsession.cc",
|
|
"srtpsession.h",
|
|
"srtptransport.cc",
|
|
"srtptransport.h",
|
|
"transportcontroller.cc",
|
|
"transportcontroller.h",
|
|
"transportstats.cc",
|
|
"transportstats.h",
|
|
]
|
|
|
|
deps = [
|
|
"..:webrtc_common",
|
|
"../api:array_view",
|
|
"../api:call_api",
|
|
"../api:libjingle_peerconnection_api",
|
|
"../api:optional",
|
|
"../api:ortc_api",
|
|
"../api:video_frame_api",
|
|
"../common_video:common_video",
|
|
"../media:rtc_data",
|
|
"../media:rtc_h264_profile_id",
|
|
"../media:rtc_media_base",
|
|
"../p2p:rtc_p2p",
|
|
"../rtc_base:checks",
|
|
"../rtc_base:rtc_base",
|
|
"../rtc_base:rtc_task_queue",
|
|
"../rtc_base:stringutils",
|
|
]
|
|
|
|
if (rtc_build_libsrtp) {
|
|
deps += [ "//third_party/libsrtp" ]
|
|
}
|
|
|
|
public_configs = [ ":rtc_pc_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" ]
|
|
}
|
|
}
|
|
|
|
rtc_source_set("rtc_pc") {
|
|
visibility = [ "*" ]
|
|
deps = [
|
|
":rtc_pc_base",
|
|
"../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
|
|
# cannot be on the target directly.
|
|
if (!is_win && !is_clang) {
|
|
cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
|
|
}
|
|
}
|
|
|
|
rtc_static_library("peerconnection") {
|
|
visibility = [ "*" ]
|
|
cflags = []
|
|
sources = [
|
|
"audiotrack.cc",
|
|
"audiotrack.h",
|
|
"datachannel.cc",
|
|
"datachannel.h",
|
|
"dtmfsender.cc",
|
|
"dtmfsender.h",
|
|
"iceserverparsing.cc",
|
|
"iceserverparsing.h",
|
|
"jsepicecandidate.cc",
|
|
"jsepsessiondescription.cc",
|
|
"localaudiosource.cc",
|
|
"localaudiosource.h",
|
|
"mediastream.cc",
|
|
"mediastream.h",
|
|
"mediastreamobserver.cc",
|
|
"mediastreamobserver.h",
|
|
"mediastreamtrack.h",
|
|
"peerconnection.cc",
|
|
"peerconnection.h",
|
|
"peerconnectionfactory.cc",
|
|
"peerconnectionfactory.h",
|
|
"peerconnectioninternal.h",
|
|
"remoteaudiosource.cc",
|
|
"remoteaudiosource.h",
|
|
"rtcstatscollector.cc",
|
|
"rtcstatscollector.h",
|
|
"rtcstatstraversal.cc",
|
|
"rtcstatstraversal.h",
|
|
"rtpreceiver.cc",
|
|
"rtpreceiver.h",
|
|
"rtpsender.cc",
|
|
"rtpsender.h",
|
|
"rtptransceiver.cc",
|
|
"rtptransceiver.h",
|
|
"sctputils.cc",
|
|
"sctputils.h",
|
|
"sdputils.cc",
|
|
"sdputils.h",
|
|
"statscollector.cc",
|
|
"statscollector.h",
|
|
"streamcollection.h",
|
|
"trackmediainfomap.cc",
|
|
"trackmediainfomap.h",
|
|
"videocapturertracksource.cc",
|
|
"videocapturertracksource.h",
|
|
"videotrack.cc",
|
|
"videotrack.h",
|
|
"videotracksource.cc",
|
|
"videotracksource.h",
|
|
"webrtcsdp.cc",
|
|
"webrtcsdp.h",
|
|
"webrtcsessiondescriptionfactory.cc",
|
|
"webrtcsessiondescriptionfactory.h",
|
|
]
|
|
|
|
configs += [ ":libjingle_peerconnection_warnings_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" ]
|
|
}
|
|
|
|
deps = [
|
|
":rtc_pc_base",
|
|
"..:webrtc_common",
|
|
"../api:call_api",
|
|
"../api:fec_controller_api",
|
|
"../api:libjingle_peerconnection_api",
|
|
"../api:optional",
|
|
"../api:rtc_stats_api",
|
|
"../api:video_frame_api",
|
|
"../api/video_codecs:video_codecs_api",
|
|
"../call:call_interfaces",
|
|
"../common_video:common_video",
|
|
"../logging:ice_log",
|
|
"../logging:rtc_event_log_api",
|
|
"../logging:rtc_event_log_impl_output",
|
|
"../media:rtc_data",
|
|
"../media:rtc_media_base",
|
|
"../p2p:rtc_p2p",
|
|
"../rtc_base:checks",
|
|
"../rtc_base:rtc_base",
|
|
"../rtc_base:rtc_base_approved",
|
|
"../rtc_base:stringutils",
|
|
"../stats",
|
|
"../system_wrappers",
|
|
"../system_wrappers:field_trial_api",
|
|
]
|
|
}
|
|
|
|
# This target implements CreatePeerConnectionFactory methods that will create a
|
|
# PeerConnection will full functionality (audio, video and data). Applications
|
|
# that wish to reduce their binary size by ommitting functionality they don't
|
|
# need should use CreateModularCreatePeerConnectionFactory instead, using the
|
|
# "peerconnection" build target and other targets specific to their
|
|
# requrements. See comment in peerconnectionfactoryinterface.h.
|
|
rtc_static_library("create_pc_factory") {
|
|
sources = [
|
|
"createpeerconnectionfactory.cc",
|
|
]
|
|
|
|
deps = [
|
|
"../api:callfactory_api",
|
|
"../api:libjingle_peerconnection_api",
|
|
"../api/audio:audio_mixer_api",
|
|
"../api/audio_codecs:audio_codecs_api",
|
|
"../api/video_codecs:video_codecs_api",
|
|
"../call",
|
|
"../call:call_interfaces",
|
|
"../logging:rtc_event_log_api",
|
|
"../logging:rtc_event_log_impl_base",
|
|
"../media:rtc_audio_video",
|
|
"../media:rtc_media_base",
|
|
"../modules/audio_device:audio_device",
|
|
"../modules/audio_processing:audio_processing",
|
|
"../rtc_base:rtc_base",
|
|
"../rtc_base:rtc_base_approved",
|
|
]
|
|
|
|
configs += [ ":libjingle_peerconnection_warnings_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" ]
|
|
}
|
|
}
|
|
|
|
rtc_source_set("libjingle_peerconnection") {
|
|
visibility = [ "*" ]
|
|
deps = [
|
|
":create_pc_factory",
|
|
":peerconnection",
|
|
"../api:libjingle_peerconnection_api",
|
|
]
|
|
}
|
|
|
|
if (rtc_include_tests) {
|
|
config("rtc_pc_unittests_config") {
|
|
# GN orders flags on a target before flags from configs. The default config
|
|
# adds -Wall, and this flag have to be after -Wall -- so they need to
|
|
# come from a config and can't be on the target directly.
|
|
if (!is_win && !is_clang) {
|
|
cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
|
|
}
|
|
}
|
|
|
|
rtc_test("rtc_pc_unittests") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"bundlefilter_unittest.cc",
|
|
"channel_unittest.cc",
|
|
"channelmanager_unittest.cc",
|
|
"currentspeakermonitor_unittest.cc",
|
|
"dtlssrtptransport_unittest.cc",
|
|
"jseptransport2_unittest.cc",
|
|
"jseptransport_unittest.cc",
|
|
"jseptransportcontroller_unittest.cc",
|
|
"mediasession_unittest.cc",
|
|
"rtcpmuxfilter_unittest.cc",
|
|
"rtptransport_unittest.cc",
|
|
"rtptransporttestutil.h",
|
|
"srtpfilter_unittest.cc",
|
|
"srtpsession_unittest.cc",
|
|
"srtptestutil.h",
|
|
"srtptransport_unittest.cc",
|
|
"transportcontroller_unittest.cc",
|
|
]
|
|
|
|
include_dirs = [ "//third_party/libsrtp/srtp" ]
|
|
|
|
configs += [ ":rtc_pc_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" ]
|
|
}
|
|
|
|
if (is_win) {
|
|
libs = [ "strmiids.lib" ]
|
|
}
|
|
|
|
deps = [
|
|
":libjingle_peerconnection",
|
|
":pc_test_utils",
|
|
":rtc_pc",
|
|
":rtc_pc_base",
|
|
"../api:array_view",
|
|
"../api:libjingle_peerconnection_api",
|
|
"../logging:rtc_event_log_api",
|
|
"../media:rtc_media_base",
|
|
"../media:rtc_media_tests_utils",
|
|
"../p2p:p2p_test_utils",
|
|
"../p2p:rtc_p2p",
|
|
"../rtc_base:checks",
|
|
"../rtc_base:rtc_base",
|
|
"../rtc_base:rtc_base_approved",
|
|
"../rtc_base:rtc_base_tests_main",
|
|
"../rtc_base:rtc_base_tests_utils",
|
|
"../system_wrappers:metrics_default",
|
|
"../system_wrappers:runtime_enabled_features_default",
|
|
"../test:test_support",
|
|
]
|
|
|
|
if (rtc_build_libsrtp) {
|
|
deps += [ "//third_party/libsrtp" ]
|
|
}
|
|
|
|
if (is_android) {
|
|
deps += [ "//testing/android/native_test:native_test_support" ]
|
|
}
|
|
}
|
|
|
|
rtc_source_set("pc_test_utils") {
|
|
testonly = true
|
|
sources = [
|
|
"test/fakeaudiocapturemodule.cc",
|
|
"test/fakeaudiocapturemodule.h",
|
|
"test/fakedatachannelprovider.h",
|
|
"test/fakepeerconnectionbase.h",
|
|
"test/fakepeerconnectionforstats.h",
|
|
"test/fakeperiodicvideocapturer.h",
|
|
"test/fakertccertificategenerator.h",
|
|
"test/fakesctptransport.h",
|
|
"test/faketransportcontroller.h",
|
|
"test/fakevideotrackrenderer.h",
|
|
"test/fakevideotracksource.h",
|
|
"test/mock_datachannel.h",
|
|
"test/mock_peerconnection.h",
|
|
"test/mock_rtpreceiverinternal.h",
|
|
"test/mock_rtpsenderinternal.h",
|
|
"test/mockpeerconnectionobservers.h",
|
|
"test/peerconnectiontestwrapper.cc",
|
|
"test/peerconnectiontestwrapper.h",
|
|
"test/rtcstatsobtainer.h",
|
|
"test/testsdpstrings.h",
|
|
]
|
|
|
|
deps = [
|
|
":libjingle_peerconnection",
|
|
":peerconnection",
|
|
":rtc_pc_base",
|
|
"..:webrtc_common",
|
|
"../api:libjingle_peerconnection_api",
|
|
"../api:libjingle_peerconnection_test_api",
|
|
"../api:rtc_stats_api",
|
|
"../call:call_interfaces",
|
|
"../logging:rtc_event_log_api",
|
|
"../media:rtc_data",
|
|
"../media:rtc_media",
|
|
"../media:rtc_media_base",
|
|
"../media:rtc_media_tests_utils",
|
|
"../modules/audio_device:audio_device",
|
|
"../p2p:p2p_test_utils",
|
|
"../rtc_base:checks",
|
|
"../rtc_base:rtc_base",
|
|
"../rtc_base:rtc_base_approved",
|
|
"../rtc_base:rtc_base_tests_utils",
|
|
"../rtc_base:rtc_task_queue",
|
|
"../test:test_support",
|
|
]
|
|
|
|
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" ]
|
|
}
|
|
}
|
|
|
|
config("peerconnection_unittests_config") {
|
|
# The warnings below are enabled by default. Since GN orders compiler flags
|
|
# for a target before flags from configs, the only way to disable such
|
|
# warnings is by having them in a separate config, loaded from the target.
|
|
# TODO(kjellander): Make the code compile without disabling these flags.
|
|
# See https://bugs.webrtc.org/3307.
|
|
if (is_clang && is_win) {
|
|
cflags = [
|
|
# See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
|
|
# for -Wno-sign-compare
|
|
"-Wno-sign-compare",
|
|
]
|
|
}
|
|
|
|
if (!is_win) {
|
|
cflags = [ "-Wno-sign-compare" ]
|
|
}
|
|
}
|
|
|
|
rtc_test("peerconnection_unittests") {
|
|
testonly = true
|
|
sources = [
|
|
"datachannel_unittest.cc",
|
|
"dtmfsender_unittest.cc",
|
|
"iceserverparsing_unittest.cc",
|
|
"jsepsessiondescription_unittest.cc",
|
|
"localaudiosource_unittest.cc",
|
|
"mediaconstraintsinterface_unittest.cc",
|
|
"mediastream_unittest.cc",
|
|
"peerconnection_bundle_unittest.cc",
|
|
"peerconnection_crypto_unittest.cc",
|
|
"peerconnection_datachannel_unittest.cc",
|
|
"peerconnection_ice_unittest.cc",
|
|
"peerconnection_integrationtest.cc",
|
|
"peerconnection_jsep_unittest.cc",
|
|
"peerconnection_media_unittest.cc",
|
|
"peerconnection_rtp_unittest.cc",
|
|
"peerconnection_signaling_unittest.cc",
|
|
"peerconnectionendtoend_unittest.cc",
|
|
"peerconnectionfactory_unittest.cc",
|
|
"peerconnectioninterface_unittest.cc",
|
|
"peerconnectionwrapper.cc",
|
|
"peerconnectionwrapper.h",
|
|
"proxy_unittest.cc",
|
|
"rtcstats_integrationtest.cc",
|
|
"rtcstatscollector_unittest.cc",
|
|
"rtcstatstraversal_unittest.cc",
|
|
"rtpmediautils_unittest.cc",
|
|
"rtpsenderreceiver_unittest.cc",
|
|
"sctputils_unittest.cc",
|
|
"statscollector_unittest.cc",
|
|
"test/fakeaudiocapturemodule_unittest.cc",
|
|
"test/testsdpstrings.h",
|
|
"trackmediainfomap_unittest.cc",
|
|
"videocapturertracksource_unittest.cc",
|
|
"videotrack_unittest.cc",
|
|
"webrtcsdp_unittest.cc",
|
|
]
|
|
|
|
if (rtc_enable_sctp) {
|
|
defines = [ "HAVE_SCTP" ]
|
|
}
|
|
|
|
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 = [
|
|
":peerconnection",
|
|
":rtc_pc_base",
|
|
"../api:libjingle_peerconnection_api",
|
|
"../api:mock_rtp",
|
|
"../rtc_base:checks",
|
|
"../rtc_base:stringutils",
|
|
"../test:fileutils",
|
|
]
|
|
if (is_android) {
|
|
deps += [ ":android_black_magic" ]
|
|
}
|
|
|
|
deps += [
|
|
":libjingle_peerconnection",
|
|
":pc_test_utils",
|
|
"..:webrtc_common",
|
|
"../api:callfactory_api",
|
|
"../api:fakemetricsobserver",
|
|
"../api:libjingle_peerconnection_test_api",
|
|
"../api:optional",
|
|
"../api:rtc_stats_api",
|
|
"../api/audio_codecs:audio_codecs_api",
|
|
"../api/audio_codecs:builtin_audio_decoder_factory",
|
|
"../api/audio_codecs:builtin_audio_encoder_factory",
|
|
"../api/audio_codecs/L16:audio_decoder_L16",
|
|
"../api/audio_codecs/L16:audio_encoder_L16",
|
|
"../call:call_interfaces",
|
|
"../logging:rtc_event_log_api",
|
|
"../logging:rtc_event_log_impl_base",
|
|
"../logging:rtc_event_log_impl_output",
|
|
"../media:rtc_audio_video",
|
|
"../media:rtc_data", # TODO(phoglund): AFAIK only used for one sctp constant.
|
|
"../media:rtc_media_base",
|
|
"../media:rtc_media_tests_utils",
|
|
"../modules/audio_processing:audio_processing",
|
|
"../modules/utility:utility",
|
|
"../p2p:p2p_test_utils",
|
|
"../p2p:rtc_p2p",
|
|
"../pc:rtc_pc",
|
|
"../rtc_base:rtc_base",
|
|
"../rtc_base:rtc_base_approved",
|
|
"../rtc_base:rtc_base_tests_main",
|
|
"../rtc_base:rtc_base_tests_utils",
|
|
"../rtc_base:rtc_task_queue",
|
|
"../system_wrappers:metrics_default",
|
|
"../system_wrappers:runtime_enabled_features_default",
|
|
"../test:audio_codec_mocks",
|
|
"../test:test_support",
|
|
]
|
|
|
|
if (is_android) {
|
|
deps += [
|
|
"//testing/android/native_test:native_test_support",
|
|
|
|
# We need to depend on this one directly, or classloads will fail for
|
|
# the voice engine BuildInfo, for instance.
|
|
"../sdk/android:libjingle_peerconnection_java",
|
|
]
|
|
|
|
shard_timeout = 900
|
|
}
|
|
}
|
|
|
|
if (is_android) {
|
|
rtc_source_set("android_black_magic") {
|
|
# The android code uses hacky includes to chromium-base and the ssl code;
|
|
# having this in a separate target enables us to keep the peerconnection
|
|
# unit tests clean.
|
|
check_includes = false
|
|
testonly = true
|
|
sources = [
|
|
"test/androidtestinitializer.cc",
|
|
"test/androidtestinitializer.h",
|
|
]
|
|
deps = [
|
|
"../sdk/android:libjingle_peerconnection_jni",
|
|
"//testing/android/native_test:native_test_support",
|
|
]
|
|
}
|
|
}
|
|
}
|