blob: 2b7e61231660b3b691caefdc5057fa81c1151765 [file] [log] [blame]
hjonaa32c3e2015-12-13 19:58:11 -08001# Copyright (c) 2015 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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020010if (is_android) {
11 import("//build/config/android/config.gni")
12 import("//build/config/android/rules.gni")
13}
kjellanderc76dc952016-06-03 03:09:32 -070014
15group("api") {
kjellander705ecc52016-09-15 00:53:26 -070016 public_deps = [
ossu7bb87ee2017-01-23 04:56:25 -080017 ":libjingle_peerconnection_api",
kjellanderc76dc952016-06-03 03:09:32 -070018 ]
19}
20
ehmaldonado38a21322016-09-02 04:10:34 -070021rtc_source_set("call_api") {
kjellandera69d9732016-08-31 07:33:05 -070022 sources = [
kjellandera69d9732016-08-31 07:33:05 -070023 "call/audio_sink.h",
kjellandera69d9732016-08-31 07:33:05 -070024 ]
25
kjellandera69d9732016-08-31 07:33:05 -070026 deps = [
27 # TODO(kjellander): Add remaining dependencies when webrtc:4243 is done.
aleloi81da4882016-11-08 04:26:30 -080028 ":audio_mixer_api",
aleloia8eb7562016-11-28 07:02:13 -080029 ":transport_api",
kjellandera69d9732016-08-31 07:33:05 -070030 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -070031 "../rtc_base:rtc_base_approved",
kwiberg087bd342017-02-10 08:15:44 -080032 "audio_codecs:audio_codecs_api",
kjellandera69d9732016-08-31 07:33:05 -070033 ]
34}
35
ossu7bb87ee2017-01-23 04:56:25 -080036rtc_static_library("libjingle_peerconnection_api") {
kjellanderc76dc952016-06-03 03:09:32 -070037 cflags = []
38 sources = [
Patrik Höglunde2d6a062017-10-05 14:53:33 +020039 "candidate.h",
kjellanderc76dc952016-06-03 03:09:32 -070040 "datachannelinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070041 "dtmfsenderinterface.h",
42 "jsep.h",
kjellanderc76dc952016-06-03 03:09:32 -070043 "jsepicecandidate.h",
kjellanderc76dc952016-06-03 03:09:32 -070044 "jsepsessiondescription.h",
kjellanderc76dc952016-06-03 03:09:32 -070045 "mediaconstraintsinterface.cc",
46 "mediaconstraintsinterface.h",
ossu7bb87ee2017-01-23 04:56:25 -080047 "mediastreaminterface.cc",
kjellanderc76dc952016-06-03 03:09:32 -070048 "mediastreamproxy.h",
kjellanderc76dc952016-06-03 03:09:32 -070049 "mediastreamtrackproxy.h",
ossu7bb87ee2017-01-23 04:56:25 -080050 "mediatypes.cc",
51 "mediatypes.h",
kjellanderc76dc952016-06-03 03:09:32 -070052 "notifier.h",
kjellanderc76dc952016-06-03 03:09:32 -070053 "peerconnectionfactoryproxy.h",
kjellanderc76dc952016-06-03 03:09:32 -070054 "peerconnectionproxy.h",
55 "proxy.h",
deadbeef6038e972017-02-16 23:31:33 -080056 "rtcerror.cc",
57 "rtcerror.h",
Stefan Holmer1acbd682017-09-01 15:29:28 +020058 "rtpparameters.cc",
kjellanderc76dc952016-06-03 03:09:32 -070059 "rtpparameters.h",
kjellanderc76dc952016-06-03 03:09:32 -070060 "rtpreceiverinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070061 "rtpsenderinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070062 "statstypes.cc",
63 "statstypes.h",
ossu7bb87ee2017-01-23 04:56:25 -080064 "umametrics.h",
kjellanderc76dc952016-06-03 03:09:32 -070065 "videosourceproxy.h",
kjellanderc76dc952016-06-03 03:09:32 -070066 ]
67
kjellandere40a7ee2016-10-16 23:56:12 -070068 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -070069 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070070 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -070071 }
72
Patrik Höglunde2d6a062017-10-05 14:53:33 +020073 public_deps = [
74 ":libjingle_api_deprecated_headers",
75 ":mediastream_interface_and_implicit_video_frame_api",
76 ":peerconnection_and_implicit_call_api",
77 ]
78
kjellanderc76dc952016-06-03 03:09:32 -070079 deps = [
Patrik Höglunde2d6a062017-10-05 14:53:33 +020080 # Basically, don't add stuff here. You might break sensitive downstream
81 # targets like pnacl. API should not depend on anything, really. All these
82 # should go away, in time.
83 ":optional",
hbos74e1a4f2016-09-15 23:33:01 -070084 ":rtc_stats_api",
kjellander8a116632017-04-21 05:17:08 -070085 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -070086 "../rtc_base:rtc_base",
87 "../rtc_base:rtc_base_approved",
kjellander8a116632017-04-21 05:17:08 -070088 "audio_codecs:audio_codecs_api",
kjellanderc76dc952016-06-03 03:09:32 -070089 ]
kjellander8a116632017-04-21 05:17:08 -070090
91 # This is needed until bugs.webrtc.org/7504 is removed so this target can
92 # properly depend on ../media:rtc_media_base
93 # TODO(kjellander): Remove this dependency.
94 if (is_nacl) {
95 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
96 }
ossu7bb87ee2017-01-23 04:56:25 -080097}
kjellanderc76dc952016-06-03 03:09:32 -070098
Patrik Höglunde2d6a062017-10-05 14:53:33 +020099rtc_source_set("peerconnection_and_implicit_call_api") {
100 # The peerconnectioninterface.h file pulls in call/callfactoryinterface.h
101 # and the entire call module with it. We need to either get rid of this
102 # dependency or pull most of call/ into the API. For now, silence the warnings
103 # this creates since it creates a circular dependency (call very much depends
104 # on API). See bugs.webrtc.org/7504.
105 check_includes = false
106 sources = [
107 "peerconnectioninterface.h",
108 ]
109}
110
111rtc_source_set("mediastream_interface_and_implicit_video_frame_api") {
112 # The mediastreaminterface.h file pulls in in video_frame.h, but the
113 # system_wrappers dependency that comes with that breaks pnacl downstream.
114 # TODO(phoglund): solve this (see bugs.webrtc.org/7504).
115 check_includes = false
116 sources = [
117 "mediastreaminterface.h",
118 ]
119}
120
121rtc_source_set("libjingle_api_deprecated_headers") {
122 # We need to include headers from undeclared targets here, since they cause
123 # circular dependencies. These deprecated headers are going away anyway.
124 # See http://bugs.webrtc.org/5883.
125 check_includes = false
126 sources = [
127 "datachannel.h",
128 "mediastream.h",
129 "mediastreamtrack.h",
130 "rtpsender.h",
131 "streamcollection.h",
132 "videotracksource.h",
133 "webrtcsdp.h",
134 ]
135}
136
deadbeefe814a0d2017-02-25 18:15:09 -0800137rtc_source_set("ortc_api") {
138 check_includes = false # TODO(deadbeef): Remove (bugs.webrtc.org/6828)
139 sources = [
zhihuang55adc0e2017-03-10 18:33:45 -0800140 "ortc/mediadescription.cc",
141 "ortc/mediadescription.h",
deadbeefe814a0d2017-02-25 18:15:09 -0800142 "ortc/ortcfactoryinterface.h",
143 "ortc/ortcrtpreceiverinterface.h",
144 "ortc/ortcrtpsenderinterface.h",
145 "ortc/packettransportinterface.h",
146 "ortc/rtptransportcontrollerinterface.h",
147 "ortc/rtptransportinterface.h",
zhihuang55adc0e2017-03-10 18:33:45 -0800148 "ortc/sessiondescription.cc",
149 "ortc/sessiondescription.h",
zhihuangd3501ad2017-03-03 14:39:06 -0800150 "ortc/srtptransportinterface.h",
deadbeefe814a0d2017-02-25 18:15:09 -0800151 "ortc/udptransportinterface.h",
152 ]
153
154 # For mediastreaminterface.h, etc.
155 # TODO(deadbeef): Create a separate target for the common things ORTC and
156 # PeerConnection code shares, so that ortc_api can depend on that instead of
157 # libjingle_peerconnection_api.
158 public_deps = [
159 ":libjingle_peerconnection_api",
160 ]
zhihuang55adc0e2017-03-10 18:33:45 -0800161 if (!build_with_chromium && is_clang) {
162 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
163 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
164 }
deadbeefe814a0d2017-02-25 18:15:09 -0800165}
166
ossu7bb87ee2017-01-23 04:56:25 -0800167# TODO(ossu): Remove once downstream projects have updated.
168rtc_source_set("libjingle_peerconnection") {
ossuda250062017-01-23 07:37:43 -0800169 public_deps = [
ossu7bb87ee2017-01-23 04:56:25 -0800170 "../pc:libjingle_peerconnection",
171 ]
kjellanderc76dc952016-06-03 03:09:32 -0700172}
kjellanderfd5b4e92016-06-13 12:08:33 -0700173
hbos74e1a4f2016-09-15 23:33:01 -0700174rtc_source_set("rtc_stats_api") {
175 cflags = []
176 sources = [
177 "stats/rtcstats.h",
178 "stats/rtcstats_objects.h",
ossu7bb87ee2017-01-23 04:56:25 -0800179 "stats/rtcstatscollectorcallback.h",
hbos74e1a4f2016-09-15 23:33:01 -0700180 "stats/rtcstatsreport.h",
181 ]
182
183 deps = [
ehmaldonadof6a861a2017-07-19 10:40:47 -0700184 "../rtc_base:rtc_base_approved",
hbos74e1a4f2016-09-15 23:33:01 -0700185 ]
186}
187
aleloi201dfe92016-10-20 05:06:39 -0700188rtc_source_set("audio_mixer_api") {
189 sources = [
190 "audio/audio_mixer.h",
191 ]
192
193 deps = [
mbonadei1140f972017-04-26 03:38:35 -0700194 "../modules:module_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700195 "../rtc_base:rtc_base_approved",
aleloi201dfe92016-10-20 05:06:39 -0700196 ]
197}
198
aleloia8eb7562016-11-28 07:02:13 -0800199rtc_source_set("transport_api") {
200 sources = [
201 "call/transport.h",
202 ]
203}
nisseb2250e52016-12-02 04:01:14 -0800204
205rtc_source_set("video_frame_api") {
206 sources = [
nisseaf916892017-01-10 07:44:26 -0800207 "video/i420_buffer.cc",
208 "video/i420_buffer.h",
ilnik6d5b4d62017-08-30 03:32:14 -0700209 "video/video_content_type.cc",
210 "video/video_content_type.h",
nisseaf916892017-01-10 07:44:26 -0800211 "video/video_frame.cc",
212 "video/video_frame.h",
magjed712338e2017-05-11 05:11:57 -0700213 "video/video_frame_buffer.cc",
nisseaf916892017-01-10 07:44:26 -0800214 "video/video_frame_buffer.h",
nisseb2250e52016-12-02 04:01:14 -0800215 "video/video_rotation.h",
ilnik2edc6842017-07-06 03:06:50 -0700216 "video/video_timing.cc",
ilnik04f4d122017-06-19 07:18:55 -0700217 "video/video_timing.h",
nisseb2250e52016-12-02 04:01:14 -0800218 ]
219
220 deps = [
ehmaldonadof6a861a2017-07-19 10:40:47 -0700221 "../rtc_base:rtc_base_approved",
nisseaf916892017-01-10 07:44:26 -0800222 "../system_wrappers",
nisseb2250e52016-12-02 04:01:14 -0800223 ]
224
225 # TODO(nisse): This logic is duplicated in multiple places.
226 # Define in a single place.
227 if (rtc_build_libyuv) {
228 deps += [ "$rtc_libyuv_dir" ]
229 public_deps = [
230 "$rtc_libyuv_dir",
231 ]
232 } else {
233 # Need to add a directory normally exported by libyuv.
234 include_dirs = [ "$rtc_libyuv_dir/include" ]
235 }
236}
237
kwiberg529662a2017-09-04 05:43:17 -0700238rtc_source_set("array_view") {
239 sources = [
240 "array_view.h",
241 ]
242 deps = [
243 "../rtc_base:rtc_base_approved",
244 ]
245}
246
kwiberg84f6a3f2017-09-05 08:43:13 -0700247rtc_source_set("optional") {
248 sources = [
249 "optional.cc",
250 "optional.h",
251 ]
252 deps = [
253 ":array_view",
254 "../rtc_base:rtc_base_approved",
255 ]
256}
257
kjellander1993b1d2017-03-06 00:29:21 -0800258rtc_source_set("libjingle_peerconnection_test_api") {
259 testonly = true
260 sources = [
261 "test/fakeconstraints.h",
262 ]
263
264 public_deps = [
265 ":libjingle_peerconnection_api",
266 ]
267
268 deps = [
ehmaldonadof6a861a2017-07-19 10:40:47 -0700269 "../rtc_base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800270 ]
271}
272
kjellanderfd5b4e92016-06-13 12:08:33 -0700273if (rtc_include_tests) {
kjellander2f6af9c2017-03-02 22:26:23 -0800274 rtc_source_set("mock_audio_mixer") {
275 testonly = true
276 sources = [
277 "test/mock_audio_mixer.h",
278 ]
279
280 public_deps = [
281 ":audio_mixer_api",
282 ]
283
284 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700285 "../test:test_support",
kjellander2f6af9c2017-03-02 22:26:23 -0800286 "//testing/gmock",
kjellander2f6af9c2017-03-02 22:26:23 -0800287 ]
288 }
289
kjellander2f6af9c2017-03-02 22:26:23 -0800290 rtc_source_set("fakemetricsobserver") {
291 testonly = true
292 sources = [
293 "fakemetricsobserver.cc",
294 "fakemetricsobserver.h",
295 ]
296 deps = [
297 ":libjingle_peerconnection_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700298 "../rtc_base:rtc_base_approved",
kjellander2f6af9c2017-03-02 22:26:23 -0800299 ]
300 if (!build_with_chromium && is_clang) {
301 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
302 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
303 }
304 }
305
deadbeefb5388d72017-02-24 01:17:43 -0800306 rtc_source_set("rtc_api_unittests") {
deadbeef6038e972017-02-16 23:31:33 -0800307 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700308
309 # Skip restricting visibility on mobile platforms since the tests on those
310 # gets additional generated targets which would require many lines here to
311 # cover (which would be confusing to read and hard to maintain).
312 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700313 visibility = [ "..:rtc_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700314 }
deadbeef6038e972017-02-16 23:31:33 -0800315 sources = [
kwiberg529662a2017-09-04 05:43:17 -0700316 "array_view_unittest.cc",
kwiberg84f6a3f2017-09-05 08:43:13 -0700317 "optional_unittest.cc",
zhihuang55adc0e2017-03-10 18:33:45 -0800318 "ortc/mediadescription_unittest.cc",
319 "ortc/sessiondescription_unittest.cc",
deadbeef6038e972017-02-16 23:31:33 -0800320 "rtcerror_unittest.cc",
Stefan Holmer1acbd682017-09-01 15:29:28 +0200321 "rtpparameters_unittest.cc",
deadbeef6038e972017-02-16 23:31:33 -0800322 ]
323
324 if (!build_with_chromium && is_clang) {
325 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
326 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
327 }
328
329 deps = [
kwiberg529662a2017-09-04 05:43:17 -0700330 ":array_view",
deadbeef6038e972017-02-16 23:31:33 -0800331 ":libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -0700332 ":optional",
zhihuang55adc0e2017-03-10 18:33:45 -0800333 ":ortc_api",
kwiberg529662a2017-09-04 05:43:17 -0700334 "../rtc_base:rtc_base_approved",
335 "../rtc_base:rtc_base_tests_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700336 "../test:test_support",
deadbeef6038e972017-02-16 23:31:33 -0800337 ]
deadbeef6038e972017-02-16 23:31:33 -0800338 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700339}