blob: d7f5b0d182ba72a5417effaec70ecd46431ca9d8 [file] [log] [blame]
magjed768c6482016-12-06 04:29:37 -08001# Copyright (c) 2016 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
jianjun.zhuc0247402017-07-11 06:20:45 -07009import("../../webrtc.gni")
magjed768c6482016-12-06 04:29:37 -080010import("//build/config/android/config.gni")
11import("//build/config/android/rules.gni")
12
Henrik Kjellandera7d0df72017-06-27 08:56:46 +020013group("android") {
14 if (!build_with_chromium && is_android) {
15 public_deps = [
16 ":libjingle_peerconnection_datachannelonly_so",
17 ":libjingle_peerconnection_jni",
18 ":libjingle_peerconnection_so",
19 ":libwebrtc",
Sami Kalliomäki82f96e62018-01-29 13:18:57 +010020 ":native_api",
Henrik Kjellandera7d0df72017-06-27 08:56:46 +020021 ]
22 }
23}
24
magjed768c6482016-12-06 04:29:37 -080025config("libjingle_peerconnection_jni_warnings_config") {
26 # The warnings below are enabled by default. Since GN orders compiler flags
27 # for a target before flags from configs, the only way to disable such
28 # warnings is by having them in a separate config, loaded from the target.
29 if (!is_win) {
30 cflags = [
31 "-Wno-sign-compare",
32 "-Wno-unused-variable",
33 ]
34 }
35}
36
Magnus Jedvert3111e5f2017-11-07 12:33:43 +010037generate_jni("generated_base_jni") {
38 sources = [
Sami Kalliomäkiad148a32018-02-16 12:55:55 +010039 "api/org/webrtc/NetworkMonitor.java",
40 "api/org/webrtc/NetworkMonitorAutoDetect.java",
Magnus Jedvert84d8ae52017-12-20 15:12:10 +010041 "src/java/org/webrtc/Histogram.java",
42 "src/java/org/webrtc/JniCommon.java",
Magnus Jedvert3111e5f2017-11-07 12:33:43 +010043 ]
44 jni_package = ""
45 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
46}
47
Magnus Jedverta3199312017-11-18 16:20:52 +010048generate_jar_jni("generated_external_classes_jni") {
Magnus Jedvertbba8e9e2017-11-29 19:27:06 +010049 classes = [
50 "java/lang/Integer.class",
51 "java/lang/Double.class",
52 "java/lang/Long.class",
Magnus Jedvert38631532017-12-07 14:07:20 +010053 "java/lang/Iterable.class",
54 "java/util/Iterator.class",
Magnus Jedvertbba8e9e2017-11-29 19:27:06 +010055 "java/lang/Boolean.class",
56 "java/math/BigInteger.class",
Magnus Jedvert38631532017-12-07 14:07:20 +010057 "java/util/Map.class",
58 "java/util/LinkedHashMap.class",
59 "java/util/ArrayList.class",
60 "java/lang/Enum.class",
Magnus Jedvertbba8e9e2017-11-29 19:27:06 +010061 ]
Magnus Jedverta3199312017-11-18 16:20:52 +010062 jni_package = ""
63 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
64}
65
Sami Kalliomäki82f96e62018-01-29 13:18:57 +010066# Internal code that is needed by native_api_jni. The code cannot be placed in
67# base_jni because native_api_jni depends on the code (and base_jni depends on
68# native_api_jni).
69rtc_source_set("internal_jni") {
70 sources = [
71 "src/jni/jvm.cc",
72 "src/jni/jvm.h",
73 ]
74
75 deps = [
76 "../../rtc_base:checks",
77 ]
Sami Kalliomäki82f96e62018-01-29 13:18:57 +010078}
79
zhihuangaf629352017-06-17 22:31:24 -070080rtc_source_set("base_jni") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000081 visibility = [ "*" ]
magjed768c6482016-12-06 04:29:37 -080082 sources = [
Magnus Jedvert9060eb12017-12-12 12:52:54 +010083 "src/jni/androidhistogram.cc",
Sami Kalliomäkiad148a32018-02-16 12:55:55 +010084 "src/jni/androidnetworkmonitor.cc",
85 "src/jni/androidnetworkmonitor.h",
Magnus Jedvert3111e5f2017-11-07 12:33:43 +010086 "src/jni/class_loader.h",
magjed768c6482016-12-06 04:29:37 -080087 "src/jni/classreferenceholder.h",
magjedb1c74532017-08-27 13:47:20 -070088 "src/jni/jni_common.cc",
magjed768c6482016-12-06 04:29:37 -080089 "src/jni/jni_helpers.cc",
90 "src/jni/jni_helpers.h",
Magnus Jedvert9060eb12017-12-12 12:52:54 +010091 "src/jni/pc/audio.h",
92 "src/jni/pc/media.h",
93 "src/jni/pc/video.h",
zhihuangaf629352017-06-17 22:31:24 -070094 ]
95
96 deps = [
Magnus Jedvert3111e5f2017-11-07 12:33:43 +010097 ":generated_base_jni",
Sami Kalliomäki82f96e62018-01-29 13:18:57 +010098 ":internal_jni",
99 ":native_api_jni",
jianjun.zhuc0247402017-07-11 06:20:45 -0700100 "../../api:libjingle_peerconnection_api",
Magnus Jedvertcdda0d92017-11-18 14:02:59 +0100101 "../../api:optional",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100102 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700103 "../../rtc_base:rtc_base",
104 "../../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700105 "../../system_wrappers:metrics_api",
zhihuangaf629352017-06-17 22:31:24 -0700106 ]
zhihuangaf629352017-06-17 22:31:24 -0700107}
108
109rtc_static_library("audio_jni") {
110 sources = [
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100111 "src/jni/pc/audio.cc",
zhihuangaf629352017-06-17 22:31:24 -0700112 ]
113
114 deps = [
115 ":base_jni",
jianjun.zhuc0247402017-07-11 06:20:45 -0700116 "../../api/audio_codecs:builtin_audio_decoder_factory",
117 "../../api/audio_codecs:builtin_audio_encoder_factory",
Sam Zackrisson6f38d252017-10-20 09:36:16 +0200118 "../../modules/audio_processing:audio_processing",
119 "../../rtc_base:rtc_base_approved",
zhihuangaf629352017-06-17 22:31:24 -0700120 ]
121}
122
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100123rtc_source_set("native_api_audio_device_module") {
124 visibility = [ "*" ]
125
126 sources = [
127 "native_api/audio_device_module/audio_device_android.cc",
128 "native_api/audio_device_module/audio_device_android.h",
129 ]
130
131 deps = [
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100132 ":base_jni",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200133 ":java_audio_device_module",
134 ":opensles_audio_device_module",
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100135 "../../modules/audio_device:audio_device",
136 "../../rtc_base:checks",
137 "../../rtc_base:rtc_base_approved",
138 "../../system_wrappers",
139 "../../system_wrappers:metrics_api",
140 ]
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200141 if (rtc_enable_android_aaudio) {
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200142 deps += [ ":aaudio_audio_device_module" ]
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200143 }
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100144}
145
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200146rtc_source_set("audio_device_module_base") {
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100147 visibility = [ "*" ]
148
149 sources = [
150 "src/jni/audio_device/audio_common.h",
Magnus Jedvert1a18e0a2018-03-28 16:51:15 +0200151 "src/jni/audio_device/audio_device_module.cc",
152 "src/jni/audio_device/audio_device_module.h",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200153 ]
154
155 deps = [
156 ":base_jni",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200157 ":generated_audio_device_module_base_jni",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200158 ":native_api_jni",
159 "../../api:optional",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200160 "../../modules/audio_device:audio_device_buffer",
161 "../../rtc_base:checks",
162 "../../rtc_base:rtc_base_approved",
163 "../../system_wrappers:metrics_api",
164 ]
165}
166
167if (rtc_enable_android_aaudio) {
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200168 rtc_source_set("aaudio_audio_device_module") {
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200169 visibility = [ "*" ]
170 defines = [ "AUDIO_DEVICE_INCLUDE_ANDROID_AAUDIO" ]
171 sources = [
172 "src/jni/audio_device/aaudio_player.cc",
173 "src/jni/audio_device/aaudio_player.h",
174 "src/jni/audio_device/aaudio_recorder.cc",
175 "src/jni/audio_device/aaudio_recorder.h",
176 "src/jni/audio_device/aaudio_wrapper.cc",
177 "src/jni/audio_device/aaudio_wrapper.h",
178 ]
179 libs = [ "aaudio" ]
180 deps = [
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200181 ":audio_device_module_base",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200182 ":base_jni",
183 "../../api:array_view",
184 "../../api:optional",
185 "../../modules/audio_device:audio_device",
186 "../../modules/audio_device:audio_device_buffer",
187 "../../rtc_base:checks",
188 "../../rtc_base:rtc_base",
189 "../../rtc_base:rtc_base_approved",
190 "../../system_wrappers",
191 ]
192 }
193}
194
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200195rtc_source_set("opensles_audio_device_module") {
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200196 visibility = [ "*" ]
197 sources = [
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100198 "src/jni/audio_device/opensles_common.cc",
199 "src/jni/audio_device/opensles_common.h",
200 "src/jni/audio_device/opensles_player.cc",
201 "src/jni/audio_device/opensles_player.h",
202 "src/jni/audio_device/opensles_recorder.cc",
203 "src/jni/audio_device/opensles_recorder.h",
204 ]
205 libs = [ "OpenSLES" ]
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100206 deps = [
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200207 ":audio_device_module_base",
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100208 ":base_jni",
209 "../../api:array_view",
Magnus Jedvertff4cac92018-03-27 15:15:41 +0200210 "../../api:optional",
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100211 "../../modules/audio_device:audio_device",
212 "../../modules/audio_device:audio_device_buffer",
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100213 "../../rtc_base:checks",
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100214 "../../rtc_base:rtc_base_approved",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200215 ]
216}
217
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200218rtc_source_set("java_audio_device_module") {
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200219 visibility = [ "*" ]
220
221 sources = [
222 "src/jni/audio_device/audio_record_jni.cc",
223 "src/jni/audio_device/audio_record_jni.h",
224 "src/jni/audio_device/audio_track_jni.cc",
225 "src/jni/audio_device/audio_track_jni.h",
226 ]
227 deps = [
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200228 ":audio_device_module_base",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200229 ":base_jni",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200230 ":generated_java_audio_device_module_native_jni",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200231 "../../api:optional",
232 "../../modules/audio_device:audio_device",
233 "../../modules/audio_device:audio_device_buffer",
234 "../../rtc_base:checks",
235 "../../rtc_base:rtc_base_approved",
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100236 "../../system_wrappers:metrics_api",
237 ]
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100238}
239
zhihuangaf629352017-06-17 22:31:24 -0700240rtc_static_library("null_audio_jni") {
241 sources = [
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100242 "src/jni/pc/null_audio.cc",
zhihuangaf629352017-06-17 22:31:24 -0700243 ]
244
245 deps = [
246 ":base_jni",
zhihuangaf629352017-06-17 22:31:24 -0700247 ]
248}
249
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200250generate_jni("generated_audio_device_module_base_jni") {
Magnus Jedvert8fc79482018-03-20 19:11:19 +0100251 sources = [
Magnus Jedvert8fc79482018-03-20 19:11:19 +0100252 "src/java/org/webrtc/audio/WebRtcAudioManager.java",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200253 ]
254 jni_package = ""
255 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
256}
257
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200258generate_jni("generated_java_audio_device_module_native_jni") {
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200259 sources = [
Magnus Jedvert8fc79482018-03-20 19:11:19 +0100260 "src/java/org/webrtc/audio/WebRtcAudioRecord.java",
261 "src/java/org/webrtc/audio/WebRtcAudioTrack.java",
262 ]
263 jni_package = ""
264 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
265}
266
Magnus Jedvert56231d02017-10-31 17:47:06 +0100267generate_jni("generated_video_jni") {
268 sources = [
Magnus Jedvert4eb01882017-11-20 22:33:40 +0100269 "api/org/webrtc/EncodedImage.java",
Magnus Jedvert655e1962017-12-08 11:05:22 +0100270 "api/org/webrtc/MediaCodecVideoDecoder.java",
271 "api/org/webrtc/MediaCodecVideoEncoder.java",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100272 "api/org/webrtc/VideoCodecInfo.java",
Magnus Jedvert0371e102017-11-07 14:23:44 +0100273 "api/org/webrtc/VideoCodecStatus.java",
Magnus Jedvert4eb01882017-11-20 22:33:40 +0100274 "api/org/webrtc/VideoDecoder.java",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100275 "api/org/webrtc/VideoDecoderFactory.java",
Magnus Jedvert84d8ae52017-12-20 15:12:10 +0100276 "api/org/webrtc/VideoDecoderFallback.java",
Magnus Jedvert56231d02017-10-31 17:47:06 +0100277 "api/org/webrtc/VideoEncoder.java",
Magnus Jedvert38631532017-12-07 14:07:20 +0100278 "api/org/webrtc/VideoEncoderFactory.java",
Magnus Jedvert84d8ae52017-12-20 15:12:10 +0100279 "api/org/webrtc/VideoEncoderFallback.java",
Magnus Jedvertc2ac3c62017-11-14 17:08:59 +0100280 "api/org/webrtc/VideoFrame.java",
Magnus Jedverte987f2b2018-04-23 16:14:47 +0200281 "api/org/webrtc/VideoFrameDrawer.java",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100282 "api/org/webrtc/VideoRenderer.java",
Magnus Jedvert56231d02017-10-31 17:47:06 +0100283 "api/org/webrtc/VideoSink.java",
Magnus Jedvert84d8ae52017-12-20 15:12:10 +0100284 "api/org/webrtc/VideoSource.java",
285 "api/org/webrtc/VideoTrack.java",
286 "api/org/webrtc/YuvHelper.java",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100287 "src/java/org/webrtc/EglBase14.java",
Magnus Jedvert84d8ae52017-12-20 15:12:10 +0100288 "src/java/org/webrtc/NV12Buffer.java",
289 "src/java/org/webrtc/NV21Buffer.java",
Magnus Jedvert4eb01882017-11-20 22:33:40 +0100290 "src/java/org/webrtc/VideoDecoderWrapper.java",
Magnus Jedvert0371e102017-11-07 14:23:44 +0100291 "src/java/org/webrtc/VideoEncoderWrapper.java",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100292 "src/java/org/webrtc/WrappedNativeI420Buffer.java",
Anders Carlssondc1b9f12017-11-10 13:15:04 +0100293 "src/java/org/webrtc/WrappedNativeVideoDecoder.java",
294 "src/java/org/webrtc/WrappedNativeVideoEncoder.java",
Magnus Jedvert56231d02017-10-31 17:47:06 +0100295 ]
Anders Carlssondd8c1652018-01-30 10:32:13 +0100296 if (rtc_use_builtin_sw_codecs) {
297 sources += [ "api/org/webrtc/HardwareVideoEncoderFactory.java" ] # TODO(andersc): This currently depends on SoftwareVideoEncoderFactory
298 }
Magnus Jedvert56231d02017-10-31 17:47:06 +0100299 jni_package = ""
300 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
301}
302
zhihuangaf629352017-06-17 22:31:24 -0700303rtc_static_library("video_jni") {
Anders Carlssondd8c1652018-01-30 10:32:13 +0100304 sources = []
305 deps = []
306
307 sources += [
zhihuangaf629352017-06-17 22:31:24 -0700308 "src/jni/androidvideotracksource.cc",
309 "src/jni/androidvideotracksource.h",
Magnus Jedvert4eb01882017-11-20 22:33:40 +0100310 "src/jni/encodedimage.cc",
311 "src/jni/encodedimage.h",
Magnus Jedvert56231d02017-10-31 17:47:06 +0100312 "src/jni/jni_generator_helper.h",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100313 "src/jni/nv12buffer.cc",
314 "src/jni/nv21buffer.cc",
315 "src/jni/pc/video.cc",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100316 "src/jni/video_renderer.cc",
Anders Carlssondc1b9f12017-11-10 13:15:04 +0100317 "src/jni/videocodecinfo.cc",
318 "src/jni/videocodecinfo.h",
Magnus Jedvert4eb01882017-11-20 22:33:40 +0100319 "src/jni/videocodecstatus.cc",
320 "src/jni/videocodecstatus.h",
Sami Kalliomäki93ad1f72017-06-27 10:03:49 +0200321 "src/jni/videodecoderfactorywrapper.cc",
322 "src/jni/videodecoderfactorywrapper.h",
Anders Carlssondc1b9f12017-11-10 13:15:04 +0100323 "src/jni/videodecoderfallback.cc",
Sami Kalliomäki93ad1f72017-06-27 10:03:49 +0200324 "src/jni/videodecoderwrapper.cc",
325 "src/jni/videodecoderwrapper.h",
sakal07a3bd72017-09-04 03:57:21 -0700326 "src/jni/videoencoderfactorywrapper.cc",
327 "src/jni/videoencoderfactorywrapper.h",
Anders Carlssonc3fedcc2017-11-15 14:36:33 +0100328 "src/jni/videoencoderfallback.cc",
sakal07a3bd72017-09-04 03:57:21 -0700329 "src/jni/videoencoderwrapper.cc",
330 "src/jni/videoencoderwrapper.h",
Magnus Jedvertc2ac3c62017-11-14 17:08:59 +0100331 "src/jni/videoframe.cc",
332 "src/jni/videoframe.h",
Magnus Jedverte987f2b2018-04-23 16:14:47 +0200333 "src/jni/videoframedrawer.cc",
Jonathan Yufa6a2832018-02-12 17:32:37 -0800334 "src/jni/videosink.cc",
335 "src/jni/videosink.h",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100336 "src/jni/videotrack.cc",
Magnus Jedvert62faaab2017-06-14 19:03:31 +0200337 "src/jni/wrapped_native_i420_buffer.cc",
338 "src/jni/wrapped_native_i420_buffer.h",
Anders Carlssondc1b9f12017-11-10 13:15:04 +0100339 "src/jni/wrappednativecodec.cc",
340 "src/jni/wrappednativecodec.h",
Sami Kalliomäkif6515cd2017-11-02 11:25:58 +0100341 "src/jni/yuvhelper.cc",
magjed768c6482016-12-06 04:29:37 -0800342 ]
343
344 configs += [ ":libjingle_peerconnection_jni_warnings_config" ]
345
magjed768c6482016-12-06 04:29:37 -0800346 # TODO(jschuh): Bug 1348: fix this warning.
347 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
348
349 if (is_win) {
350 cflags += [
351 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch.
352 "/wd4389", # signed/unsigned mismatch.
353 ]
354 }
355
Anders Carlssondd8c1652018-01-30 10:32:13 +0100356 if (rtc_use_builtin_sw_codecs) {
357 sources += [
358 "src/jni/androidmediacodeccommon.h",
359 "src/jni/androidmediadecoder.cc",
360 "src/jni/androidmediadecoder_jni.h",
361 "src/jni/androidmediaencoder.cc",
362 "src/jni/androidmediaencoder_jni.h",
Anders Carlsson6deb65c2018-03-05 14:30:04 +0100363 "src/jni/hardwarevideoencoderfactory.cc",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100364 ]
365
366 deps += [
367 ":vp8_jni",
368 ":vp9_jni",
369 "../../media:rtc_internal_video_codecs",
370 ]
371 }
372 deps += [
zhihuangaf629352017-06-17 22:31:24 -0700373 ":base_jni",
Magnus Jedvert56231d02017-10-31 17:47:06 +0100374 ":generated_video_jni",
Sami Kalliomäki82f96e62018-01-29 13:18:57 +0100375 ":native_api_jni",
jianjun.zhuc0247402017-07-11 06:20:45 -0700376 "../..:webrtc_common",
377 "../../api:libjingle_peerconnection_api",
378 "../../api:video_frame_api",
379 "../../api/video_codecs:video_codecs_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700380 "../../common_video:common_video",
381 "../../media:rtc_audio_video",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100382 "../../media:rtc_h264_profile_id",
jianjun.zhuc0247402017-07-11 06:20:45 -0700383 "../../media:rtc_media_base",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100384 "../../media:rtc_software_fallback_wrappers",
sakal07a3bd72017-09-04 03:57:21 -0700385 "../../modules:module_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700386 "../../modules/utility:utility",
charujaincb728ea2017-09-18 03:08:08 -0700387 "../../modules/video_coding:codec_globals_headers",
Patrik Höglund99175c62018-01-08 11:05:10 +0100388 "../../modules/video_coding:video_codec_interface",
jianjun.zhuc0247402017-07-11 06:20:45 -0700389 "../../modules/video_coding:video_coding_utility",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100390 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700391 "../../rtc_base:rtc_base",
392 "../../rtc_base:rtc_base_approved",
393 "../../rtc_base:rtc_task_queue",
394 "../../rtc_base:sequenced_task_checker",
395 "../../rtc_base:weak_ptr",
Karl Wiberg29e7bee2018-03-22 14:11:52 +0100396 "../../rtc_base/memory:aligned_malloc",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100397 "../../system_wrappers:field_trial_api",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100398 "//third_party/libyuv",
magjed768c6482016-12-06 04:29:37 -0800399 ]
magjed768c6482016-12-06 04:29:37 -0800400}
401
zhihuangaf629352017-06-17 22:31:24 -0700402rtc_static_library("null_video_jni") {
403 sources = [
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100404 "src/jni/pc/null_video.cc",
zhihuangaf629352017-06-17 22:31:24 -0700405 ]
406
407 deps = [
408 ":base_jni",
zhihuangaf629352017-06-17 22:31:24 -0700409 ]
zhihuangaf629352017-06-17 22:31:24 -0700410}
411
Anders Carlssondd8c1652018-01-30 10:32:13 +0100412generate_jni("generated_vp8_jni") {
413 sources = [
414 "src/java/org/webrtc/VP8Decoder.java",
415 "src/java/org/webrtc/VP8Encoder.java",
416 ]
417
418 jni_package = ""
419 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
420}
421
422rtc_static_library("vp8_jni") {
423 sources = [
424 "src/jni/vp8codec.cc",
425 ]
426
Anders Carlssondd8c1652018-01-30 10:32:13 +0100427 deps = [
428 ":base_jni",
429 ":generated_vp8_jni",
430 "../../modules/video_coding:webrtc_vp8",
431 ]
432}
433
434generate_jni("generated_vp9_jni") {
435 sources = [
436 "src/java/org/webrtc/VP9Decoder.java",
437 "src/java/org/webrtc/VP9Encoder.java",
438 ]
439
440 jni_package = ""
441 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
442}
443
444rtc_static_library("vp9_jni") {
445 sources = [
446 "src/jni/vp9codec.cc",
447 ]
448
Anders Carlssondd8c1652018-01-30 10:32:13 +0100449 deps = [
450 ":base_jni",
451 ":generated_vp9_jni",
452 "../../modules/video_coding:webrtc_vp9",
453 ]
454}
455
zhihuangaf629352017-06-17 22:31:24 -0700456rtc_static_library("media_jni") {
457 sources = [
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100458 "src/jni/pc/media.cc",
zhihuangaf629352017-06-17 22:31:24 -0700459 ]
460
461 deps = [
462 ":base_jni",
Niels Möller8366e172018-02-14 12:20:13 +0100463 "../../api:callfactory_api",
Anders Carlssondc1b9f12017-11-10 13:15:04 +0100464 "../../api/video_codecs:video_codecs_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700465 "../../call:call_interfaces",
466 "../../logging:rtc_event_log_api",
467 "../../media:rtc_audio_video",
Anders Carlssondc1b9f12017-11-10 13:15:04 +0100468 "../../modules/audio_device:audio_device",
jianjun.zhuc0247402017-07-11 06:20:45 -0700469 "../../modules/audio_processing:audio_processing",
zhihuangaf629352017-06-17 22:31:24 -0700470 ]
zhihuangaf629352017-06-17 22:31:24 -0700471}
472
473rtc_static_library("null_media_jni") {
474 sources = [
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100475 "src/jni/pc/null_media.cc",
zhihuangaf629352017-06-17 22:31:24 -0700476 ]
477
478 deps = [
479 ":base_jni",
zhihuangaf629352017-06-17 22:31:24 -0700480 ]
zhihuangaf629352017-06-17 22:31:24 -0700481}
482
Magnus Jedvertcada6012017-11-20 21:55:27 +0100483generate_jni("generated_peerconnection_jni") {
484 sources = [
Magnus Jedvert84d8ae52017-12-20 15:12:10 +0100485 "api/org/webrtc/AudioTrack.java",
486 "api/org/webrtc/CallSessionFileRotatingLogSink.java",
Magnus Jedvert7bd6ccc2017-11-24 14:42:47 +0100487 "api/org/webrtc/DataChannel.java",
Magnus Jedvert84d8ae52017-12-20 15:12:10 +0100488 "api/org/webrtc/DtmfSender.java",
Magnus Jedvert80610c42017-11-25 21:18:34 +0100489 "api/org/webrtc/IceCandidate.java",
Magnus Jedvert3ecdd0f2017-11-24 11:21:14 +0100490 "api/org/webrtc/MediaConstraints.java",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100491 "api/org/webrtc/MediaSource.java",
Magnus Jedvert6a0345b2017-11-27 11:23:42 +0100492 "api/org/webrtc/MediaStream.java",
Magnus Jedvert4fa5da52017-11-27 13:44:38 +0100493 "api/org/webrtc/MediaStreamTrack.java",
Magnus Jedvertba700f62017-12-04 13:43:27 +0100494 "api/org/webrtc/PeerConnection.java",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100495 "api/org/webrtc/PeerConnectionFactory.java",
Magnus Jedvertc4c88762017-11-24 18:46:15 +0100496 "api/org/webrtc/RTCStats.java",
497 "api/org/webrtc/RTCStatsCollectorCallback.java",
498 "api/org/webrtc/RTCStatsReport.java",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100499 "api/org/webrtc/RtpParameters.java",
Magnus Jedvertba700f62017-12-04 13:43:27 +0100500 "api/org/webrtc/RtpReceiver.java",
Magnus Jedvert38631532017-12-07 14:07:20 +0100501 "api/org/webrtc/RtpSender.java",
Seth Hampsonc384e142018-03-06 15:47:10 -0800502 "api/org/webrtc/RtpTransceiver.java",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100503 "api/org/webrtc/SdpObserver.java",
504 "api/org/webrtc/SessionDescription.java",
Magnus Jedvertbba8e9e2017-11-29 19:27:06 +0100505 "api/org/webrtc/StatsObserver.java",
506 "api/org/webrtc/StatsReport.java",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100507 "api/org/webrtc/TurnCustomizer.java",
Magnus Jedvertcada6012017-11-20 21:55:27 +0100508 ]
509 jni_package = ""
510 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
511}
512
zhihuangaf629352017-06-17 22:31:24 -0700513rtc_static_library("peerconnection_jni") {
Sami Kalliomäkic4f18fe2018-01-15 13:51:38 +0100514 # Do not depend on this target externally unless you absolute have to. It is
515 # made public because we don't have a proper NDK yet. Header APIs here are not
516 # considered public and are subject to change.
517 visibility = [ "*" ]
Anders Carlssondd8c1652018-01-30 10:32:13 +0100518
zhihuangaf629352017-06-17 22:31:24 -0700519 sources = [
zhihuang1b1daec2017-08-02 18:01:05 -0700520 "src/jni/androidnetworkmonitor_jni.h",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100521 "src/jni/pc/androidnetworkmonitor.h",
522 "src/jni/pc/audiotrack.cc",
523 "src/jni/pc/callsessionfilerotatinglogsink.cc",
Magnus Jedvert7bd6ccc2017-11-24 14:42:47 +0100524 "src/jni/pc/datachannel.cc",
525 "src/jni/pc/datachannel.h",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100526 "src/jni/pc/dtmfsender.cc",
527 "src/jni/pc/icecandidate.cc",
528 "src/jni/pc/icecandidate.h",
529 "src/jni/pc/logging.cc",
530 "src/jni/pc/mediaconstraints.cc",
531 "src/jni/pc/mediaconstraints.h",
532 "src/jni/pc/mediasource.cc",
533 "src/jni/pc/mediastream.cc",
Magnus Jedvert1212f1e2017-12-20 12:00:50 +0100534 "src/jni/pc/mediastream.h",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100535 "src/jni/pc/mediastreamtrack.cc",
536 "src/jni/pc/mediastreamtrack.h",
deadbeef0d48c692017-08-03 10:20:17 -0700537 "src/jni/pc/ownedfactoryandthreads.cc",
538 "src/jni/pc/ownedfactoryandthreads.h",
Magnus Jedvertde5afcf2017-12-10 14:58:29 +0100539 "src/jni/pc/peerconnection.cc",
540 "src/jni/pc/peerconnection.h",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100541 "src/jni/pc/peerconnectionfactory.cc",
542 "src/jni/pc/peerconnectionfactory.h",
deadbeef0d48c692017-08-03 10:20:17 -0700543 "src/jni/pc/rtcstatscollectorcallbackwrapper.cc",
544 "src/jni/pc/rtcstatscollectorcallbackwrapper.h",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100545 "src/jni/pc/rtpparameters.cc",
546 "src/jni/pc/rtpparameters.h",
Magnus Jedvertba700f62017-12-04 13:43:27 +0100547 "src/jni/pc/rtpreceiver.cc",
548 "src/jni/pc/rtpreceiver.h",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100549 "src/jni/pc/rtpsender.cc",
Magnus Jedvert1212f1e2017-12-20 12:00:50 +0100550 "src/jni/pc/rtpsender.h",
Seth Hampsonc384e142018-03-06 15:47:10 -0800551 "src/jni/pc/rtptransceiver.cc",
552 "src/jni/pc/rtptransceiver.h",
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100553 "src/jni/pc/sdpobserver.cc",
554 "src/jni/pc/sdpobserver.h",
555 "src/jni/pc/sessiondescription.cc",
556 "src/jni/pc/sessiondescription.h",
557 "src/jni/pc/statsobserver.cc",
558 "src/jni/pc/statsobserver.h",
559 "src/jni/pc/turncustomizer.cc",
Magnus Jedvert1212f1e2017-12-20 12:00:50 +0100560 "src/jni/pc/turncustomizer.h",
zhihuangaf629352017-06-17 22:31:24 -0700561 ]
562
563 configs += [ ":libjingle_peerconnection_jni_warnings_config" ]
564
565 if (is_clang) {
566 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
567 suppressed_configs += [
568 "//build/config/clang:extra_warnings",
569 "//build/config/clang:find_bad_constructs",
570 ]
571 }
572
573 # TODO(jschuh): Bug 1348: fix this warning.
574 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
575
576 if (is_win) {
577 cflags += [
578 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch.
579 "/wd4389", # signed/unsigned mismatch.
580 ]
581 }
582
583 deps = [
584 ":base_jni",
Magnus Jedvertbba8e9e2017-11-29 19:27:06 +0100585 ":generated_external_classes_jni",
Magnus Jedvertcada6012017-11-20 21:55:27 +0100586 ":generated_peerconnection_jni",
Sami Kalliomäki82f96e62018-01-29 13:18:57 +0100587 ":native_api_jni",
zhihuangaf629352017-06-17 22:31:24 -0700588 "../..:webrtc_common",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100589 "../../api:libjingle_peerconnection_api",
Anders Carlssondc1b9f12017-11-10 13:15:04 +0100590 "../../api/video_codecs:video_codecs_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800591 "../../logging:rtc_event_log_api",
592 "../../logging:rtc_event_log_impl_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700593 "../../media:rtc_data",
594 "../../media:rtc_media_base",
Anders Carlssondc1b9f12017-11-10 13:15:04 +0100595 "../../modules/audio_device:audio_device",
jianjun.zhuc0247402017-07-11 06:20:45 -0700596 "../../modules/utility:utility",
597 "../../pc:peerconnection",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100598 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700599 "../../rtc_base:rtc_base",
600 "../../rtc_base:rtc_base_approved",
601 "../../rtc_base:rtc_task_queue",
Patrik Höglund3e113432017-12-15 14:40:10 +0100602 "../../rtc_base:stringutils",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100603 "../../system_wrappers:field_trial_api",
zhihuangaf629352017-06-17 22:31:24 -0700604 ]
605}
606
607rtc_static_library("libjingle_peerconnection_jni") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000608 visibility = [ "*" ]
Anders Carlsson1f433e42018-04-24 16:39:05 +0200609 allow_poison = [
610 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
611 "software_video_codecs", # TODO(bugs.webrtc.org/7925): Remove.
612 ]
zhihuangaf629352017-06-17 22:31:24 -0700613 public_deps = [
614 ":audio_jni",
615 ":base_jni",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200616 ":java_audio_device_module_jni",
zhihuangaf629352017-06-17 22:31:24 -0700617 ":media_jni",
618 ":peerconnection_jni",
619 ":video_jni",
jianjun.zhuc0247402017-07-11 06:20:45 -0700620 "../../pc:create_pc_factory",
zhihuangaf629352017-06-17 22:31:24 -0700621 ]
622}
623
Magnus Jedvert986a79c2017-11-18 16:45:18 +0100624generate_jni("generated_metrics_jni") {
625 sources = [
626 "api/org/webrtc/Metrics.java",
627 ]
628 jni_package = ""
629 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
630}
631
magjed768c6482016-12-06 04:29:37 -0800632rtc_static_library("libjingle_peerconnection_metrics_default_jni") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000633 visibility = [ "*" ]
magjed768c6482016-12-06 04:29:37 -0800634 sources = [
Magnus Jedvert9060eb12017-12-12 12:52:54 +0100635 "src/jni/androidmetrics.cc",
magjed768c6482016-12-06 04:29:37 -0800636 ]
637
638 configs += [ ":libjingle_peerconnection_jni_warnings_config" ]
639
640 deps = [
zhihuangaf629352017-06-17 22:31:24 -0700641 ":base_jni",
Magnus Jedvert986a79c2017-11-18 16:45:18 +0100642 ":generated_metrics_jni",
Sami Kalliomäki82f96e62018-01-29 13:18:57 +0100643 ":native_api_jni",
zhihuangaf629352017-06-17 22:31:24 -0700644 ":peerconnection_jni",
jianjun.zhuc0247402017-07-11 06:20:45 -0700645 "../../pc:peerconnection",
jianjun.zhuc0247402017-07-11 06:20:45 -0700646 "../../system_wrappers:field_trial_default",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100647 "../../system_wrappers:metrics_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700648 "../../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000649 "../../system_wrappers:runtime_enabled_features_default",
magjed768c6482016-12-06 04:29:37 -0800650 ]
651}
652
zhihuangaf629352017-06-17 22:31:24 -0700653# The modular build targets can be used to build WebRTC with different
654# functionalities. The users can choose either the real implemenation or the
655# null implementation of the audio/video modules based on their requirments.
Henrik Kjellandera7d0df72017-06-27 08:56:46 +0200656rtc_shared_library("libjingle_peerconnection_datachannelonly_so") {
657 sources = [
658 "src/jni/jni_onload.cc",
659 ]
660
661 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
662 configs += [ "//build/config/android:hide_all_but_jni" ]
663
664 deps = [
665 ":base_jni",
666 ":libjingle_peerconnection_metrics_default_jni",
667 ":null_audio_jni",
668 ":null_media_jni",
669 ":null_video_jni",
670 ":peerconnection_jni",
jianjun.zhuc0247402017-07-11 06:20:45 -0700671 "../../pc:peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700672 "../../rtc_base:rtc_base",
673 "../../rtc_base:rtc_base_approved",
Henrik Kjellandera7d0df72017-06-27 08:56:46 +0200674 ]
675 output_extension = "so"
676}
zhihuangaf629352017-06-17 22:31:24 -0700677
magjed768c6482016-12-06 04:29:37 -0800678rtc_shared_library("libjingle_peerconnection_so") {
679 sources = [
680 "src/jni/jni_onload.cc",
681 ]
682
kjellander12b3e032017-02-16 01:06:04 -0800683 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
684 configs += [ "//build/config/android:hide_all_but_jni" ]
magjed768c6482016-12-06 04:29:37 -0800685
686 deps = [
687 ":libjingle_peerconnection_jni",
688 ":libjingle_peerconnection_metrics_default_jni",
jianjun.zhuc0247402017-07-11 06:20:45 -0700689 "../../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700690 "../../rtc_base:rtc_base",
magjed768c6482016-12-06 04:29:37 -0800691 ]
692 output_extension = "so"
693}
694
Sami Kalliomäkie93de5f2018-01-22 14:43:18 +0100695dist_jar("libwebrtc") {
mbonadeib55bd972017-01-23 01:25:53 -0800696 _target_dir_name = get_label_info(":$target_name", "dir")
697 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
Sami Kalliomäkie93de5f2018-01-22 14:43:18 +0100698 direct_deps_only = true
699 use_unprocessed_jars = true
700 requires_android = true
Sami Kalliomäkib9f4bf22018-03-12 14:19:23 +0100701 no_build_hooks = true
Sami Kalliomäki7bc55b82017-11-08 14:24:41 +0100702
mbonadeib55bd972017-01-23 01:25:53 -0800703 deps = [
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200704 ":audio_api_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200705 ":base_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200706 ":camera_java",
707 ":filevideo_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200708 ":hwcodecs_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200709 ":java_audio_device_module_java",
mbonadeib55bd972017-01-23 01:25:53 -0800710 ":libjingle_peerconnection_java",
711 ":libjingle_peerconnection_metrics_default_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200712 ":peerconnection_java",
713 ":screencapturer_java",
714 ":surfaceviewrenderer_java",
715 ":video_api_java",
716 ":video_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700717 "../../modules/audio_device:audio_device_java",
718 "../../rtc_base:base_java",
mbonadeib55bd972017-01-23 01:25:53 -0800719 ]
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200720
721 if (rtc_use_builtin_sw_codecs) {
722 deps += [ ":swcodecs_java" ]
723 }
mbonadeib55bd972017-01-23 01:25:53 -0800724}
725
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200726# TODO(sakal): Extract files from this target to releveant subtargets, video, audio etc.
727rtc_android_library("base_java") {
magjed768c6482016-12-06 04:29:37 -0800728 java_files = [
Sami Kalliomäki61db3fd2018-04-09 17:51:19 +0200729 "api/org/webrtc/RefCounted.java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200730 "src/java/org/webrtc/CalledByNative.java",
731 "src/java/org/webrtc/CalledByNativeUnchecked.java",
732 "src/java/org/webrtc/Histogram.java",
733 "src/java/org/webrtc/JniCommon.java",
734 "src/java/org/webrtc/JniHelper.java",
735 "src/java/org/webrtc/JNINamespace.java",
736 "src/java/org/webrtc/NativeClassQualifiedName.java",
Sami Kalliomäki61db3fd2018-04-09 17:51:19 +0200737 "src/java/org/webrtc/RefCountDelegate.java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200738 "src/java/org/webrtc/WebRtcClassLoader.java",
739 ]
740
741 deps = [
742 "//rtc_base:base_java",
743 ]
744}
745
746rtc_android_library("video_api_java") {
747 java_files = [
Sami Kalliomäkie2410e92017-06-02 14:46:12 +0200748 "api/org/webrtc/EncodedImage.java",
magjed768c6482016-12-06 04:29:37 -0800749 "api/org/webrtc/VideoCapturer.java",
Sami Kalliomäkie2410e92017-06-02 14:46:12 +0200750 "api/org/webrtc/VideoCodecInfo.java",
Bjorn Mellem5c4eebb2017-06-12 09:21:03 -0700751 "api/org/webrtc/VideoCodecStatus.java",
Sami Kalliomäkie2410e92017-06-02 14:46:12 +0200752 "api/org/webrtc/VideoDecoder.java",
Bjorn Mellem38145242017-06-20 11:35:04 -0700753 "api/org/webrtc/VideoDecoderFactory.java",
Sami Kalliomäkie2410e92017-06-02 14:46:12 +0200754 "api/org/webrtc/VideoEncoder.java",
Bjorn Mellem9fbbdc22017-06-16 09:23:50 -0700755 "api/org/webrtc/VideoEncoderFactory.java",
magjed55220212017-06-02 02:45:56 -0700756 "api/org/webrtc/VideoFrame.java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200757 "api/org/webrtc/VideoRenderer.java", # TODO(sakal): Remove
sakal0ba43b52017-08-14 05:17:49 -0700758 "api/org/webrtc/VideoSink.java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200759 ]
760
761 # TODO(sakal): These should be moved to video_java but cannot because of dependencies.
762 java_files += [
763 "api/org/webrtc/EglBase.java",
764 "api/org/webrtc/GlShader.java",
765 "api/org/webrtc/GlTextureFrameBuffer.java",
766 "api/org/webrtc/GlUtil.java",
767 "api/org/webrtc/JavaI420Buffer.java",
768 "api/org/webrtc/RendererCommon.java",
769 "api/org/webrtc/SurfaceTextureHelper.java",
Magnus Jedvert1d270f82018-04-16 16:28:29 +0200770 "api/org/webrtc/TextureBufferImpl.java",
Sami Kalliomäkicb98b112017-10-16 11:20:26 +0200771 "api/org/webrtc/YuvConverter.java",
Sami Kalliomäkif6515cd2017-11-02 11:25:58 +0100772 "api/org/webrtc/YuvHelper.java",
magjed82de1792017-04-25 05:32:07 -0700773 "src/java/org/webrtc/EglBase10.java",
774 "src/java/org/webrtc/EglBase14.java",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200775 ]
776
777 deps = [
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200778 ":base_java",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200779 "//rtc_base:base_java",
780 ]
781}
782
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200783rtc_android_library("audio_api_java") {
784 java_files = [ "api/org/webrtc/audio/AudioDeviceModule.java" ]
785
786 deps = [
787 ":base_java",
788 "//rtc_base:base_java",
789 ]
790}
791
792rtc_android_library("java_audio_device_module_java") {
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200793 java_files = [
794 "api/org/webrtc/audio/JavaAudioDeviceModule.java",
795 "src/java/org/webrtc/audio/VolumeLogger.java",
Paulina Hensman89dd7bf2018-03-20 15:27:52 +0100796 "src/java/org/webrtc/audio/WebRtcAudioEffects.java",
797 "src/java/org/webrtc/audio/WebRtcAudioManager.java",
798 "src/java/org/webrtc/audio/WebRtcAudioRecord.java",
799 "src/java/org/webrtc/audio/WebRtcAudioTrack.java",
800 "src/java/org/webrtc/audio/WebRtcAudioUtils.java",
magjed768c6482016-12-06 04:29:37 -0800801 ]
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200802
803 deps = [
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200804 ":audio_api_java",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200805 ":base_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200806 "//rtc_base:base_java",
807 ]
808}
809
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200810# JNI target for java_audio_device_module_java
811rtc_source_set("java_audio_device_module_jni") {
812 sources = [
813 "src/jni/audio_device/java_audio_device_module.cc",
814 ]
815
816 deps = [
817 ":base_jni",
818 ":generated_java_audio_jni",
819 ":java_audio_device_module",
820 ]
821}
822
823generate_jni("generated_java_audio_jni") {
824 sources = [
825 "api/org/webrtc/audio/JavaAudioDeviceModule.java",
826 ]
827 jni_package = ""
828 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
829}
830
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200831rtc_android_library("video_java") {
832 java_files = [
833 "api/org/webrtc/EglRenderer.java",
834 "api/org/webrtc/GlRectDrawer.java",
835 "api/org/webrtc/VideoDecoderFallback.java",
836 "api/org/webrtc/VideoEncoderFallback.java",
837 "api/org/webrtc/VideoFrameDrawer.java",
Magnus Jedvert1a759c62018-04-24 15:11:02 +0200838 "src/java/org/webrtc/NV21Buffer.java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200839 "src/java/org/webrtc/VideoDecoderWrapper.java",
840 "src/java/org/webrtc/VideoEncoderWrapper.java",
841 "src/java/org/webrtc/WrappedNativeI420Buffer.java",
842 "src/java/org/webrtc/WrappedNativeVideoDecoder.java",
843 "src/java/org/webrtc/WrappedNativeVideoEncoder.java",
844 ]
845
846 deps = [
847 ":base_java",
848 ":video_api_java",
849 "//rtc_base:base_java",
850 ]
851}
852
853rtc_android_library("camera_java") {
854 java_files = [
855 "api/org/webrtc/Camera1Capturer.java",
856 "api/org/webrtc/Camera1Enumerator.java",
857 "api/org/webrtc/Camera2Capturer.java",
858 "api/org/webrtc/Camera2Enumerator.java",
859 "api/org/webrtc/CameraEnumerationAndroid.java",
860 "api/org/webrtc/CameraEnumerator.java",
861 "api/org/webrtc/CameraVideoCapturer.java",
862 "src/java/org/webrtc/Camera1Session.java",
863 "src/java/org/webrtc/Camera2Session.java",
864 "src/java/org/webrtc/CameraCapturer.java",
865 "src/java/org/webrtc/CameraSession.java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200866 ]
867
868 deps = [
869 ":base_java",
870 ":video_api_java",
871 ":video_java",
872 "//rtc_base:base_java",
873 ]
874}
875
876rtc_android_library("screencapturer_java") {
877 java_files = [ "api/org/webrtc/ScreenCapturerAndroid.java" ]
878
879 deps = [
880 ":video_api_java",
881 ":video_java",
882 "//rtc_base:base_java",
883 ]
884}
885
886rtc_android_library("surfaceviewrenderer_java") {
887 java_files = [
888 "api/org/webrtc/SurfaceEglRenderer.java",
889 "api/org/webrtc/SurfaceViewRenderer.java",
890 ]
891
892 deps = [
893 ":video_api_java",
894 ":video_java",
895 "//rtc_base:base_java",
896 ]
897}
898
899rtc_android_library("filevideo_java") {
900 java_files = [
901 "api/org/webrtc/VideoFileRenderer.java",
902 "api/org/webrtc/FileVideoCapturer.java",
903 ]
904
905 deps = [
906 ":base_java",
907 ":video_api_java",
908 ":video_java",
909 "//rtc_base:base_java",
910 ]
911}
912
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200913if (rtc_use_builtin_sw_codecs) {
914 rtc_android_library("swcodecs_java") {
915 java_files = [
Anders Carlssondd8c1652018-01-30 10:32:13 +0100916 "api/org/webrtc/SoftwareVideoDecoderFactory.java",
917 "api/org/webrtc/SoftwareVideoEncoderFactory.java",
918 "src/java/org/webrtc/VP8Encoder.java",
919 "src/java/org/webrtc/VP8Decoder.java",
920 "src/java/org/webrtc/VP9Encoder.java",
921 "src/java/org/webrtc/VP9Decoder.java",
922 ]
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200923
924 deps = [
925 ":base_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200926 ":video_api_java",
927 ":video_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200928 "//rtc_base:base_java",
929 ]
Anders Carlssondd8c1652018-01-30 10:32:13 +0100930 }
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200931}
932
933rtc_android_library("hwcodecs_java") {
934 java_files = [
935 "src/java/org/webrtc/BaseBitrateAdjuster.java",
936 "src/java/org/webrtc/BitrateAdjuster.java",
937 "src/java/org/webrtc/DynamicBitrateAdjuster.java",
938 "src/java/org/webrtc/FramerateBitrateAdjuster.java",
939 "src/java/org/webrtc/HardwareVideoDecoder.java",
940 "src/java/org/webrtc/HardwareVideoEncoder.java",
941 "src/java/org/webrtc/MediaCodecUtils.java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200942 "src/java/org/webrtc/NV12Buffer.java",
943 "src/java/org/webrtc/VideoCodecType.java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200944 ]
magjed768c6482016-12-06 04:29:37 -0800945
946 deps = [
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200947 ":base_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200948 ":video_api_java",
949 ":video_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200950 "//rtc_base:base_java",
magjed768c6482016-12-06 04:29:37 -0800951 ]
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200952
953 if (rtc_use_builtin_sw_codecs) {
954 java_files += [
955 "api/org/webrtc/HardwareVideoDecoderFactory.java", # TODO(andersc): make this not depend on SoftwareVideoDecoderFactory
956 "api/org/webrtc/HardwareVideoEncoderFactory.java", # TODO(andersc): make this not depend on SoftwareVideoEncoderFactory
957 ]
958
959 deps += [ ":swcodecs_java" ]
960 }
961}
962
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200963rtc_android_library("peerconnection_java") {
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200964 java_files = [
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200965 "api/org/webrtc/audio/LegacyAudioDeviceModule.java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200966 "api/org/webrtc/AudioProcessingFactory.java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200967 "api/org/webrtc/AudioSource.java",
968 "api/org/webrtc/AudioTrack.java",
969 "api/org/webrtc/CallSessionFileRotatingLogSink.java",
970 "api/org/webrtc/DataChannel.java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200971 "api/org/webrtc/DtmfSender.java",
972 "api/org/webrtc/FecControllerFactoryFactoryInterface.java",
973 "api/org/webrtc/IceCandidate.java",
974 "api/org/webrtc/MediaCodecVideoDecoder.java",
975 "api/org/webrtc/MediaCodecVideoEncoder.java",
976 "api/org/webrtc/MediaConstraints.java",
977 "api/org/webrtc/MediaSource.java",
978 "api/org/webrtc/MediaStream.java",
979 "api/org/webrtc/MediaStreamTrack.java",
980 "api/org/webrtc/NativeLibraryLoader.java",
981 "api/org/webrtc/NativePeerConnectionFactory.java",
982 "api/org/webrtc/NetworkMonitor.java", # TODDO(sakal): Break dependencies and move to base_java.
983 "api/org/webrtc/NetworkMonitorAutoDetect.java", # TODDO(sakal): Break dependencies and move to base_java.
984 "api/org/webrtc/PeerConnection.java",
985 "api/org/webrtc/PeerConnectionFactory.java",
986 "api/org/webrtc/RTCStats.java",
987 "api/org/webrtc/RTCStatsCollectorCallback.java",
988 "api/org/webrtc/RTCStatsReport.java",
989 "api/org/webrtc/RtpParameters.java",
990 "api/org/webrtc/RtpReceiver.java",
991 "api/org/webrtc/RtpSender.java",
992 "api/org/webrtc/RtpTransceiver.java",
993 "api/org/webrtc/SdpObserver.java",
994 "api/org/webrtc/SessionDescription.java",
995 "api/org/webrtc/StatsObserver.java",
996 "api/org/webrtc/StatsReport.java",
997 "api/org/webrtc/TurnCustomizer.java",
998 "api/org/webrtc/VideoSource.java",
999 "api/org/webrtc/VideoTrack.java",
1000 "src/java/org/webrtc/NativeLibrary.java",
1001 ]
1002
1003 deps = [
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +02001004 ":audio_api_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +02001005 ":base_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +02001006 ":video_api_java",
1007 ":video_java", # TODO(sakal): Remove dependency.
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +02001008 "//modules/audio_device:audio_device_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +02001009 "//rtc_base:base_java",
1010 ]
1011}
1012
1013# Old target that pulls in everything. This will be going away in the future,
1014# clients should depend on individual video_java etc. targets instead.
1015rtc_android_library("libjingle_peerconnection_java") {
1016 java_files = [ "src/java/org/webrtc/Empty.java" ]
1017
1018 deps = [
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +02001019 ":audio_api_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +02001020 ":base_java",
1021 ":camera_java",
1022 ":filevideo_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +02001023 ":hwcodecs_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +02001024 ":java_audio_device_module_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +02001025 ":peerconnection_java",
1026 ":screencapturer_java",
1027 ":surfaceviewrenderer_java",
1028 ":video_api_java",
1029 ":video_java",
Sami Kalliomäkid7e12662018-03-28 15:41:28 +02001030 "//modules/audio_device:audio_device_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +02001031 "//rtc_base:base_java",
1032 ]
1033
1034 if (rtc_use_builtin_sw_codecs) {
1035 deps += [ ":swcodecs_java" ]
Sami Kalliomäki1641ca32018-04-04 15:59:31 +02001036
1037 java_files += [
1038 "api/org/webrtc/DefaultVideoDecoderFactory.java",
1039 "api/org/webrtc/DefaultVideoEncoderFactory.java",
1040 ]
Sami Kalliomäki725c1062018-03-28 10:49:18 +02001041 }
magjed768c6482016-12-06 04:29:37 -08001042}
1043
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +00001044rtc_android_library("libjingle_peerconnection_metrics_default_java") {
magjed768c6482016-12-06 04:29:37 -08001045 java_files = [ "api/org/webrtc/Metrics.java" ]
1046
1047 deps = [
Sami Kalliomäki725c1062018-03-28 10:49:18 +02001048 ":base_java",
Magnus Jedvert986a79c2017-11-18 16:45:18 +01001049 ":libjingle_peerconnection_java",
jianjun.zhuc0247402017-07-11 06:20:45 -07001050 "../../rtc_base:base_java",
magjed768c6482016-12-06 04:29:37 -08001051 ]
1052}
1053
1054if (rtc_include_tests) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +00001055 rtc_instrumentation_test_apk("libjingle_peerconnection_android_unittest") {
magjed768c6482016-12-06 04:29:37 -08001056 apk_name = "libjingle_peerconnection_android_unittest"
1057 android_manifest = "instrumentationtests/AndroidManifest.xml"
1058
1059 java_files = [
1060 "instrumentationtests/src/org/webrtc/Camera1CapturerUsingByteBufferTest.java",
1061 "instrumentationtests/src/org/webrtc/Camera1CapturerUsingTextureTest.java",
1062 "instrumentationtests/src/org/webrtc/Camera2CapturerTest.java",
1063 "instrumentationtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java",
Anders Carlssondc1b9f12017-11-10 13:15:04 +01001064 "instrumentationtests/src/org/webrtc/DefaultVideoEncoderFactoryTest.java",
magjed768c6482016-12-06 04:29:37 -08001065 "instrumentationtests/src/org/webrtc/EglRendererTest.java",
sakale8aca242017-01-17 03:32:06 -08001066 "instrumentationtests/src/org/webrtc/FileVideoCapturerTest.java",
magjed768c6482016-12-06 04:29:37 -08001067 "instrumentationtests/src/org/webrtc/GlRectDrawerTest.java",
Bjorn Mellem38145242017-06-20 11:35:04 -07001068 "instrumentationtests/src/org/webrtc/HardwareVideoDecoderTest.java",
Sami Kalliomäkif6515cd2017-11-02 11:25:58 +01001069 "instrumentationtests/src/org/webrtc/HardwareVideoEncoderTest.java",
magjed768c6482016-12-06 04:29:37 -08001070 "instrumentationtests/src/org/webrtc/MediaCodecVideoEncoderTest.java",
1071 "instrumentationtests/src/org/webrtc/NetworkMonitorTest.java",
Sami Kalliomäki4e383212017-11-15 14:15:24 +01001072 "instrumentationtests/src/org/webrtc/PeerConnectionFactoryTest.java",
magjed768c6482016-12-06 04:29:37 -08001073 "instrumentationtests/src/org/webrtc/PeerConnectionTest.java",
1074 "instrumentationtests/src/org/webrtc/RendererCommonTest.java",
1075 "instrumentationtests/src/org/webrtc/SurfaceTextureHelperTest.java",
1076 "instrumentationtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java",
sakale8aca242017-01-17 03:32:06 -08001077 "instrumentationtests/src/org/webrtc/VideoFileRendererTest.java",
magjed768c6482016-12-06 04:29:37 -08001078 "instrumentationtests/src/org/webrtc/WebRtcJniBootTest.java",
Sami Kalliomäkif6515cd2017-11-02 11:25:58 +01001079 "instrumentationtests/src/org/webrtc/YuvHelperTest.java",
magjed768c6482016-12-06 04:29:37 -08001080 ]
1081
sakale8aca242017-01-17 03:32:06 -08001082 data = [
jianjun.zhuc0247402017-07-11 06:20:45 -07001083 "../../sdk/android/instrumentationtests/src/org/webrtc/capturetestvideo.y4m",
sakale8aca242017-01-17 03:32:06 -08001084 ]
1085
magjed768c6482016-12-06 04:29:37 -08001086 deps = [
Sami Kalliomäki725c1062018-03-28 10:49:18 +02001087 ":base_java",
1088 ":libjingle_peerconnection_java",
1089 ":libjingle_peerconnection_metrics_default_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +02001090 ":video_api_java",
magjed768c6482016-12-06 04:29:37 -08001091 "//base:base_java",
sakale1674ef2017-01-11 06:22:56 -08001092 "//base:base_java_test_support",
Sami Kalliomäki725c1062018-03-28 10:49:18 +02001093 "//rtc_base:base_java",
sakale1674ef2017-01-11 06:22:56 -08001094 "//third_party/android_support_test_runner:rules_java",
1095 "//third_party/android_support_test_runner:runner_java",
1096 "//third_party/junit",
magjed768c6482016-12-06 04:29:37 -08001097 ]
1098
jianjun.zhuc0247402017-07-11 06:20:45 -07001099 shared_libraries = [ "../../sdk/android:libjingle_peerconnection_so" ]
magjed768c6482016-12-06 04:29:37 -08001100 }
1101}
Sami Kalliomäki82f96e62018-01-29 13:18:57 +01001102
1103# The native API is currently experimental and may change without notice.
1104group("native_api") {
1105 deps = [
Paulina Hensman89dd7bf2018-03-20 15:27:52 +01001106 ":native_api_audio_device_module",
Sami Kalliomäki82f96e62018-01-29 13:18:57 +01001107 ":native_api_base",
1108 ":native_api_codecs",
1109 ":native_api_jni",
Artem Titov70899e02018-03-22 13:34:24 +01001110 ":native_api_peerconnection",
Jonathan Yufa6a2832018-02-12 17:32:37 -08001111 ":native_api_video",
Sami Kalliomäki82f96e62018-01-29 13:18:57 +01001112 ]
1113}
1114
1115rtc_static_library("native_api_base") {
1116 visibility = [ "*" ]
1117 sources = [
1118 "native_api/base/init.cc",
1119 "native_api/base/init.h",
Sami Kalliomäkiad148a32018-02-16 12:55:55 +01001120 "native_api/base/networkmonitor.cc",
1121 "native_api/base/networkmonitor.h",
Sami Kalliomäki82f96e62018-01-29 13:18:57 +01001122 ]
1123
1124 deps = [
1125 ":base_jni",
1126 ":native_api_jni",
1127 "//rtc_base:checks",
1128 "//rtc_base:rtc_base",
1129 ]
1130}
1131
1132generate_jni("generated_native_api_jni") {
1133 sources = [
1134 "src/java/org/webrtc/JniHelper.java",
1135 "src/java/org/webrtc/WebRtcClassLoader.java",
1136 ]
1137 jni_package = ""
1138 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
1139}
1140
1141# JNI helpers that are also needed from internal JNI code. Cannot depend on any
1142# other JNI targets than internal_jni.
1143rtc_static_library("native_api_jni") {
1144 visibility = [ "*" ]
1145 sources = [
1146 "native_api/jni/class_loader.cc",
1147 "native_api/jni/class_loader.h",
1148 "native_api/jni/java_types.cc",
1149 "native_api/jni/java_types.h",
1150 "native_api/jni/jvm.cc",
1151 "native_api/jni/jvm.h",
1152 "native_api/jni/scoped_java_ref.h",
1153 "src/jni/jni_generator_helper.cc",
1154 "src/jni/jni_generator_helper.h",
1155 ]
1156
1157 public = [
1158 "native_api/jni/class_loader.h",
1159 "native_api/jni/java_types.h",
1160 "native_api/jni/jvm.h",
1161 "native_api/jni/scoped_java_ref.h",
1162 ]
1163
1164 deps = [
1165 ":generated_external_classes_jni",
1166 ":generated_native_api_jni",
1167 ":internal_jni",
1168 "//api:optional",
1169 "//rtc_base:checks",
1170 "//rtc_base:rtc_base_approved",
1171 ]
1172}
1173
1174# API for wrapping Java VideoDecoderFactory/VideoEncoderFactory classes to C++
1175# objects.
1176rtc_static_library("native_api_codecs") {
1177 visibility = [ "*" ]
Anders Carlsson1f433e42018-04-24 16:39:05 +02001178 allow_poison = [
1179 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
1180 "software_video_codecs", # TODO(bugs.webrtc.org/7925): Remove.
1181 ]
Sami Kalliomäki82f96e62018-01-29 13:18:57 +01001182 sources = [
1183 "native_api/codecs/wrapper.cc",
1184 "native_api/codecs/wrapper.h",
1185 ]
1186
Sami Kalliomäki82f96e62018-01-29 13:18:57 +01001187 deps = [
1188 ":base_jni",
1189 ":video_jni",
1190 "//api/video_codecs:video_codecs_api",
1191 "//rtc_base:checks",
1192 "//rtc_base:rtc_base_approved",
1193 ]
1194}
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001195
Artem Titov70899e02018-03-22 13:34:24 +01001196# API for creating Java PeerConnectionFactory from C++ equivalents.
1197rtc_static_library("native_api_peerconnection") {
1198 visibility = [ "*" ]
1199 sources = [
1200 "native_api/peerconnection/peerconnectionfactory.cc",
1201 "native_api/peerconnection/peerconnectionfactory.h",
1202 ]
1203
1204 if (is_clang) {
1205 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
1206 suppressed_configs += [
1207 "//build/config/clang:extra_warnings",
1208 "//build/config/clang:find_bad_constructs",
1209 ]
1210 }
1211
1212 deps = [
1213 ":base_jni",
1214 ":peerconnection_jni",
1215 "//api:libjingle_peerconnection_api",
1216 "//api/video_codecs:video_codecs_api",
1217 "//rtc_base:rtc_base",
1218 ]
1219}
1220
Jonathan Yufa6a2832018-02-12 17:32:37 -08001221# API for creating C++ wrapper implementations of api/mediastreaminterface.h
1222# video interfaces from their Java equivalents.
1223rtc_static_library("native_api_video") {
1224 visibility = [ "*" ]
Anders Carlsson1f433e42018-04-24 16:39:05 +02001225 allow_poison = [
1226 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
1227 "software_video_codecs", # TODO(bugs.webrtc.org/7925): Remove.
1228 ]
Jonathan Yufa6a2832018-02-12 17:32:37 -08001229 sources = [
1230 "native_api/video/wrapper.cc",
1231 "native_api/video/wrapper.h",
1232 ]
1233 deps = [
1234 ":native_api_jni",
1235 ":video_jni",
1236 "//api:libjingle_peerconnection_api",
1237 "//api:video_frame_api",
1238 "//rtc_base:rtc_base_approved",
1239 ]
1240}
1241
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001242generate_jni("generated_native_unittests_jni") {
1243 testonly = true
1244
1245 sources = [
Paulina Hensmana2a98752018-04-11 17:08:17 +02001246 "native_unittests/org/webrtc/ApplicationContextProvider.java",
1247 "native_unittests/org/webrtc/BuildInfo.java",
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001248 "native_unittests/org/webrtc/JavaTypesTestHelper.java",
Artem Titov70899e02018-03-22 13:34:24 +01001249 "native_unittests/org/webrtc/PeerConnectionFactoryInitializationHelper.java",
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001250 ]
1251 jni_package = ""
1252 jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
1253}
1254
1255rtc_android_library("native_unittests_java") {
1256 testonly = true
1257
Artem Titov70899e02018-03-22 13:34:24 +01001258 java_files = [
Paulina Hensmana2a98752018-04-11 17:08:17 +02001259 "native_unittests/org/webrtc/ApplicationContextProvider.java",
1260 "native_unittests/org/webrtc/BuildInfo.java",
Artem Titov70899e02018-03-22 13:34:24 +01001261 "native_unittests/org/webrtc/JavaTypesTestHelper.java",
1262 "native_unittests/org/webrtc/PeerConnectionFactoryInitializationHelper.java",
1263 ]
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001264
1265 deps = [
1266 ":libjingle_peerconnection_java",
Paulina Hensmana2a98752018-04-11 17:08:17 +02001267 "//third_party/android_support_test_runner:runner_java",
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001268 ]
1269}
1270
1271rtc_source_set("native_unittests") {
1272 testonly = true
1273
1274 sources = [
Paulina Hensmana2a98752018-04-11 17:08:17 +02001275 "native_unittests/audio_device/audio_device_unittest.cc",
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001276 "native_unittests/java_types_unittest.cc",
Artem Titov70899e02018-03-22 13:34:24 +01001277 "native_unittests/peerconnection/peerconnectionfactory_unittest.cc",
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001278 "native_unittests/test_jni_onload.cc",
1279 ]
1280
Paulina Hensmana2a98752018-04-11 17:08:17 +02001281 data = [
1282 "../../resources/audio_device/audio_short44.pcm",
1283 "../../resources/audio_device/audio_short48.pcm",
1284 ]
1285
Artem Titov70899e02018-03-22 13:34:24 +01001286 if (is_clang) {
1287 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
1288 suppressed_configs += [
1289 "//build/config/clang:extra_warnings",
1290 "//build/config/clang:find_bad_constructs",
1291 ]
1292 }
1293
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001294 deps = [
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +02001295 ":audio_device_module_base",
Artem Titov70899e02018-03-22 13:34:24 +01001296 ":audio_jni",
Paulina Hensmana2a98752018-04-11 17:08:17 +02001297 ":base_jni",
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001298 ":generated_native_unittests_jni",
Artem Titov70899e02018-03-22 13:34:24 +01001299 ":media_jni",
Paulina Hensmana2a98752018-04-11 17:08:17 +02001300 ":native_api_audio_device_module",
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001301 ":native_api_base",
1302 ":native_api_jni",
Artem Titov70899e02018-03-22 13:34:24 +01001303 ":native_api_peerconnection",
1304 ":native_unittests_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +02001305 ":opensles_audio_device_module",
Artem Titov70899e02018-03-22 13:34:24 +01001306 ":video_jni",
Paulina Hensmana2a98752018-04-11 17:08:17 +02001307 "../../system_wrappers:system_wrappers",
Artem Titov70899e02018-03-22 13:34:24 +01001308 "//api/audio_codecs:builtin_audio_decoder_factory",
1309 "//api/audio_codecs:builtin_audio_encoder_factory",
1310 "//media:rtc_audio_video",
1311 "//media:rtc_internal_video_codecs",
1312 "//media:rtc_media_base",
Paulina Hensmana2a98752018-04-11 17:08:17 +02001313 "//modules/audio_device:audio_device",
1314 "//modules/audio_device:mock_audio_device",
Artem Titov70899e02018-03-22 13:34:24 +01001315 "//modules/audio_processing:audio_processing",
1316 "//modules/utility:utility",
1317 "//pc:libjingle_peerconnection",
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001318 "//rtc_base:checks",
Artem Titov70899e02018-03-22 13:34:24 +01001319 "//rtc_base:rtc_base_approved",
Paulina Hensmana2a98752018-04-11 17:08:17 +02001320 "//test:fileutils",
Sami Kalliomäki78498cf2018-02-07 16:59:33 +01001321 "//test:test_support",
1322 "//testing/gtest",
1323 ]
1324}