naiveproxy/third_party/webrtc/pc/BUILD.gn

582 lines
17 KiB
Plaintext
Raw Normal View History

2018-12-10 05:59:24 +03:00
# 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 = [
"channel.cc",
"channel.h",
"channelmanager.cc",
"channelmanager.h",
"dtlssrtptransport.cc",
"dtlssrtptransport.h",
"externalhmac.cc",
"externalhmac.h",
"jseptransport.cc",
"jseptransport.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",
"transportstats.cc",
"transportstats.h",
]
deps = [
"..:webrtc_common",
"../api:array_view",
"../api:call_api",
"../api:libjingle_peerconnection_api",
"../api:ortc_api",
"../api/video:video_frame",
"../call:rtp_interfaces",
"../call:rtp_receiver",
"../common_video:common_video",
"../logging:rtc_event_log_api",
"../media:rtc_data",
"../media:rtc_h264_profile_id",
"../media:rtc_media_base",
"../modules/rtp_rtcp:rtp_rtcp_format",
"../p2p:rtc_p2p",
"../rtc_base:checks",
"../rtc_base:rtc_base",
"../rtc_base:rtc_task_queue",
"../rtc_base:stringutils",
"../rtc_base/third_party/base64",
"../rtc_base/third_party/sigslot",
"../system_wrappers:metrics_api",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/types:optional",
]
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 = [ "*" ]
allow_poison = [
"audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
"software_video_codecs", # TODO(bugs.webrtc.org/7925): Remove.
]
deps = [
":rtc_pc_base",
"../media:rtc_audio_video",
]
}
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",
"rtpparametersconversion.cc",
"rtpparametersconversion.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",
]
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:rtc_stats_api",
"../api/video:video_frame",
"../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",
"../modules/congestion_controller/bbr",
"../p2p:rtc_p2p",
"../rtc_base:checks",
"../rtc_base:rtc_base",
"../rtc_base:rtc_base_approved",
"../rtc_base:stringutils",
"../rtc_base/experiments:congestion_controller_experiment",
"../rtc_base/third_party/base64",
"../rtc_base/third_party/sigslot",
"../stats",
"../system_wrappers",
"../system_wrappers:field_trial_api",
"../system_wrappers:metrics_api",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/types:optional",
]
}
rtc_static_library("builtin_video_bitrate_allocator_factory") {
sources = [
"builtin_video_bitrate_allocator_factory.cc",
"builtin_video_bitrate_allocator_factory.h",
]
deps = [
"../api/video:video_bitrate_allocator_factory",
"../media:rtc_media_base",
"../modules/video_coding:video_coding_utility",
"../modules/video_coding:webrtc_vp9_helpers",
"../rtc_base:ptr_util",
"../rtc_base/system:fallthrough",
"//third_party/abseil-cpp/absl/memory",
]
}
# 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",
]
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 = [ "*" ]
allow_poison = [
"audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
"software_video_codecs", # TODO(bugs.webrtc.org/7925): Remove.
]
deps = [
":create_pc_factory",
":peerconnection",
"../api:libjingle_peerconnection_api",
]
}
if (rtc_include_tests) {
rtc_test("rtc_pc_unittests") {
testonly = true
sources = [
"channel_unittest.cc",
"channelmanager_unittest.cc",
"dtlssrtptransport_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",
]
include_dirs = [ "//third_party/libsrtp/srtp" ]
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",
"../call:rtp_interfaces",
"../logging:rtc_event_log_api",
"../media:rtc_media_base",
"../media:rtc_media_tests_utils",
"../modules/rtp_rtcp:rtp_rtcp_format",
"../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",
"../rtc_base/third_party/sigslot",
"../system_wrappers:metrics_default",
"../system_wrappers:runtime_enabled_features_default",
"../test:test_support",
"//third_party/abseil-cpp/absl/memory",
]
if (rtc_build_libsrtp) {
deps += [ "//third_party/libsrtp" ]
}
if (is_android) {
deps += [ "//testing/android/native_test:native_test_support" ]
}
}
rtc_source_set("peerconnection_perf_tests") {
testonly = true
sources = [
"peerconnection_rampup_tests.cc",
"peerconnectionwrapper.cc",
"peerconnectionwrapper.h",
]
deps = [
":pc_test_utils",
"../api:libjingle_peerconnection_api",
"../api:rtc_stats_api",
"../api/audio_codecs:builtin_audio_decoder_factory",
"../api/audio_codecs:builtin_audio_encoder_factory",
"../api/video_codecs:builtin_video_decoder_factory",
"../api/video_codecs:builtin_video_encoder_factory",
"../media:rtc_media_tests_utils",
"../p2p:p2p_test_utils",
"../p2p:rtc_p2p",
"../pc:peerconnection",
"../rtc_base:rtc_base",
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_tests_utils",
"../test:perf_test",
"../test:test_support",
"//third_party/abseil-cpp/absl/memory",
]
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("pc_test_utils") {
testonly = true
sources = [
"test/fakeaudiocapturemodule.cc",
"test/fakeaudiocapturemodule.h",
"test/fakedatachannelprovider.h",
"test/fakepeerconnectionbase.h",
"test/fakepeerconnectionforstats.h",
"test/fakeperiodicvideosource.h",
"test/fakeperiodicvideotracksource.h",
"test/fakertccertificategenerator.h",
"test/fakesctptransport.h",
"test/fakevideotrackrenderer.h",
"test/fakevideotracksource.h",
"test/framegeneratorcapturervideotracksource.h",
"test/mock_datachannel.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",
"../api/video:video_frame",
"../api/video_codecs:builtin_video_decoder_factory",
"../api/video_codecs:builtin_video_encoder_factory",
"../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",
"../modules/audio_processing:audio_processing",
"../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",
"../rtc_base/third_party/sigslot",
"../test:test_support",
"../test:video_test_common",
"//third_party/abseil-cpp/absl/memory",
]
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_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_histogram_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",
"rtpparametersconversion_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" ]
}
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 = [
":peerconnection",
":rtc_pc_base",
"../api:libjingle_peerconnection_api",
"../api:mock_rtp",
"../api/units:time_delta",
"../logging:fake_rtc_event_log",
"../rtc_base:checks",
"../rtc_base:stringutils",
"../rtc_base/third_party/base64",
"../test:fileutils",
"//third_party/abseil-cpp/absl/memory",
]
if (is_android) {
deps += [ ":android_black_magic" ]
}
deps += [
":libjingle_peerconnection",
":pc_test_utils",
"..:webrtc_common",
"../api:callfactory_api",
"../api:libjingle_peerconnection_test_api",
"../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",
"../api/video_codecs:builtin_video_decoder_factory",
"../api/video_codecs:builtin_video_encoder_factory",
"../api/video_codecs:video_codecs_api",
"../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",
"../rtc_base:safe_conversions",
"../system_wrappers:metrics_default",
"../system_wrappers:runtime_enabled_features_default",
"../test:audio_codec_mocks",
"../test:test_support",
"//third_party/abseil-cpp/absl/types:optional",
]
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",
]
}
}
}