OLD | NEW |
1 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 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 | 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 | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 import("//webrtc/webrtc.gni") | 9 import("//webrtc/webrtc.gni") |
10 import("//build/config/android/config.gni") | 10 import("//build/config/android/config.gni") |
11 import("//build/config/android/rules.gni") | 11 import("//build/config/android/rules.gni") |
12 | 12 |
13 config("libjingle_peerconnection_jni_warnings_config") { | 13 config("libjingle_peerconnection_jni_warnings_config") { |
14 # The warnings below are enabled by default. Since GN orders compiler flags | 14 # The warnings below are enabled by default. Since GN orders compiler flags |
15 # for a target before flags from configs, the only way to disable such | 15 # for a target before flags from configs, the only way to disable such |
16 # warnings is by having them in a separate config, loaded from the target. | 16 # warnings is by having them in a separate config, loaded from the target. |
17 if (!is_win) { | 17 if (!is_win) { |
18 cflags = [ | 18 cflags = [ |
19 "-Wno-sign-compare", | 19 "-Wno-sign-compare", |
20 "-Wno-unused-variable", | 20 "-Wno-unused-variable", |
21 ] | 21 ] |
22 } | 22 } |
23 } | 23 } |
24 | 24 |
25 rtc_static_library("libjingle_peerconnection_jni") { | 25 rtc_source_set("base_jni") { |
| 26 sources = [ |
| 27 "src/jni/androidmediacodeccommon.h", |
| 28 "src/jni/audio_jni.h", |
| 29 "src/jni/classreferenceholder.cc", |
| 30 "src/jni/classreferenceholder.h", |
| 31 "src/jni/jni_helpers.cc", |
| 32 "src/jni/jni_helpers.h", |
| 33 "src/jni/media_jni.h", |
| 34 "src/jni/ownedfactoryandthreads.cc", |
| 35 "src/jni/ownedfactoryandthreads.h", |
| 36 "src/jni/video_jni.h", |
| 37 ] |
| 38 |
| 39 deps = [ |
| 40 "//webrtc/api:libjingle_peerconnection_api", |
| 41 "//webrtc/base:rtc_base", |
| 42 "//webrtc/base:rtc_base_approved", |
| 43 ] |
| 44 |
| 45 if (is_clang) { |
| 46 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 47 suppressed_configs += [ |
| 48 "//build/config/clang:extra_warnings", |
| 49 "//build/config/clang:find_bad_constructs", |
| 50 ] |
| 51 } |
| 52 } |
| 53 |
| 54 rtc_static_library("audio_jni") { |
| 55 sources = [ |
| 56 "src/jni/audio_jni.cc", |
| 57 ] |
| 58 |
| 59 deps = [ |
| 60 ":base_jni", |
| 61 "//webrtc/api/audio_codecs:builtin_audio_decoder_factory", |
| 62 "//webrtc/api/audio_codecs:builtin_audio_encoder_factory", |
| 63 "//webrtc/voice_engine:voice_engine", |
| 64 ] |
| 65 } |
| 66 |
| 67 rtc_static_library("null_audio_jni") { |
| 68 sources = [ |
| 69 "src/jni/null_audio_jni.cc", |
| 70 ] |
| 71 |
| 72 deps = [ |
| 73 ":base_jni", |
| 74 "//webrtc/api:libjingle_peerconnection_api", |
| 75 "//webrtc/base:rtc_base", |
| 76 "//webrtc/base:rtc_base_approved", |
| 77 ] |
| 78 } |
| 79 |
| 80 rtc_static_library("video_jni") { |
26 sources = [ | 81 sources = [ |
27 "src/jni/androidhistogram_jni.cc", | 82 "src/jni/androidhistogram_jni.cc", |
28 "src/jni/androidmediacodeccommon.h", | |
29 "src/jni/androidmediadecoder_jni.cc", | 83 "src/jni/androidmediadecoder_jni.cc", |
30 "src/jni/androidmediadecoder_jni.h", | 84 "src/jni/androidmediadecoder_jni.h", |
31 "src/jni/androidmediaencoder_jni.cc", | 85 "src/jni/androidmediaencoder_jni.cc", |
32 "src/jni/androidmediaencoder_jni.h", | 86 "src/jni/androidmediaencoder_jni.h", |
33 "src/jni/androidnetworkmonitor_jni.cc", | |
34 "src/jni/androidnetworkmonitor_jni.h", | |
35 "src/jni/androidvideotracksource.cc", | 87 "src/jni/androidvideotracksource.cc", |
36 "src/jni/androidvideotracksource.h", | 88 "src/jni/androidvideotracksource.h", |
37 "src/jni/androidvideotracksource_jni.cc", | 89 "src/jni/androidvideotracksource_jni.cc", |
38 "src/jni/classreferenceholder.cc", | |
39 "src/jni/classreferenceholder.h", | |
40 "src/jni/jni_helpers.cc", | |
41 "src/jni/jni_helpers.h", | |
42 "src/jni/native_handle_impl.cc", | 90 "src/jni/native_handle_impl.cc", |
43 "src/jni/native_handle_impl.h", | 91 "src/jni/native_handle_impl.h", |
44 "src/jni/peerconnection_jni.cc", | |
45 "src/jni/rtcstatscollectorcallbackwrapper.cc", | |
46 "src/jni/rtcstatscollectorcallbackwrapper.h", | |
47 "src/jni/surfacetexturehelper_jni.cc", | 92 "src/jni/surfacetexturehelper_jni.cc", |
48 "src/jni/surfacetexturehelper_jni.h", | 93 "src/jni/surfacetexturehelper_jni.h", |
| 94 "src/jni/video_jni.cc", |
| 95 "src/jni/video_renderer_jni.cc", |
49 "src/jni/wrapped_native_i420_buffer.cc", | 96 "src/jni/wrapped_native_i420_buffer.cc", |
50 "src/jni/wrapped_native_i420_buffer.h", | 97 "src/jni/wrapped_native_i420_buffer.h", |
51 ] | 98 ] |
52 | 99 |
53 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] | 100 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] |
54 | 101 |
55 if (is_clang) { | 102 if (is_clang) { |
56 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 103 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
57 suppressed_configs += [ | 104 suppressed_configs += [ |
58 "//build/config/clang:extra_warnings", | 105 "//build/config/clang:extra_warnings", |
59 "//build/config/clang:find_bad_constructs", | 106 "//build/config/clang:find_bad_constructs", |
60 ] | 107 ] |
61 } | 108 } |
62 | 109 |
63 # TODO(jschuh): Bug 1348: fix this warning. | 110 # TODO(jschuh): Bug 1348: fix this warning. |
64 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | 111 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
65 | 112 |
66 if (is_win) { | 113 if (is_win) { |
67 cflags += [ | 114 cflags += [ |
68 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch. | 115 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch. |
69 "/wd4389", # signed/unsigned mismatch. | 116 "/wd4389", # signed/unsigned mismatch. |
70 ] | 117 ] |
71 } | 118 } |
72 | 119 |
73 deps = [ | 120 deps = [ |
74 "../..:webrtc_common", | 121 ":base_jni", |
75 "../../api:video_frame_api", | 122 "//webrtc:webrtc_common", |
76 "../../api/video_codecs:video_codecs_api", | 123 "//webrtc/api:libjingle_peerconnection_api", |
77 "../../base:rtc_base", | 124 "//webrtc/api:video_frame_api", |
78 "../../base:rtc_base_approved", | 125 "//webrtc/api/video_codecs:video_codecs_api", |
79 "../../base:rtc_task_queue", | 126 "//webrtc/base:rtc_base", |
80 "../../base:sequenced_task_checker", | 127 "//webrtc/base:rtc_base_approved", |
81 "../../base:weak_ptr", | 128 "//webrtc/base:rtc_task_queue", |
82 "../../common_video:common_video", | 129 "//webrtc/base:sequenced_task_checker", |
83 "../../media:rtc_media", | 130 "//webrtc/base:weak_ptr", |
84 "../../media:rtc_media_base", | 131 "//webrtc/common_video:common_video", |
85 "../../modules/utility:utility", | 132 "//webrtc/media:rtc_audio_video", |
86 "../../modules/video_coding:video_coding_utility", | 133 "//webrtc/media:rtc_media_base", |
87 "../../system_wrappers:system_wrappers", | 134 "//webrtc/modules/utility:utility", |
88 "../../voice_engine:voice_engine", | 135 "//webrtc/modules/video_coding:video_coding_utility", |
89 "//webrtc/pc:libjingle_peerconnection", | 136 "//webrtc/system_wrappers:system_wrappers", |
90 ] | 137 ] |
91 | 138 |
92 if (rtc_build_libyuv) { | 139 if (rtc_build_libyuv) { |
93 deps += [ "$rtc_libyuv_dir" ] | 140 deps += [ "$rtc_libyuv_dir" ] |
94 public_deps = [ | 141 public_deps = [ |
95 "$rtc_libyuv_dir", | 142 "$rtc_libyuv_dir", |
96 ] | 143 ] |
97 } else { | 144 } else { |
98 # Need to add a directory normally exported by libyuv. | 145 # Need to add a directory normally exported by libyuv. |
99 include_dirs = [ "$rtc_libyuv_dir/include" ] | 146 include_dirs = [ "$rtc_libyuv_dir/include" ] |
100 } | 147 } |
101 } | 148 } |
102 | 149 |
| 150 rtc_static_library("null_video_jni") { |
| 151 sources = [ |
| 152 "src/jni/null_video_jni.cc", |
| 153 ] |
| 154 |
| 155 deps = [ |
| 156 ":base_jni", |
| 157 "//webrtc/base:rtc_base_approved", |
| 158 ] |
| 159 |
| 160 if (is_clang) { |
| 161 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 162 suppressed_configs += [ |
| 163 "//build/config/clang:extra_warnings", |
| 164 "//build/config/clang:find_bad_constructs", |
| 165 ] |
| 166 } |
| 167 } |
| 168 |
| 169 rtc_static_library("media_jni") { |
| 170 sources = [ |
| 171 "src/jni/media_jni.cc", |
| 172 ] |
| 173 |
| 174 deps = [ |
| 175 ":base_jni", |
| 176 "//webrtc/api:libjingle_peerconnection_api", |
| 177 "//webrtc/api/audio_codecs:audio_codecs_api", |
| 178 "//webrtc/base:rtc_base_approved", |
| 179 "//webrtc/media:rtc_audio_video", |
| 180 ] |
| 181 |
| 182 if (is_clang) { |
| 183 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 184 suppressed_configs += [ |
| 185 "//build/config/clang:extra_warnings", |
| 186 "//build/config/clang:find_bad_constructs", |
| 187 ] |
| 188 } |
| 189 } |
| 190 |
| 191 rtc_static_library("null_media_jni") { |
| 192 sources = [ |
| 193 "src/jni/null_media_jni.cc", |
| 194 ] |
| 195 |
| 196 deps = [ |
| 197 ":base_jni", |
| 198 "//webrtc/api:libjingle_peerconnection_api", |
| 199 "//webrtc/base:rtc_base", |
| 200 "//webrtc/base:rtc_base_approved", |
| 201 "//webrtc/call:call_interfaces", |
| 202 "//webrtc/logging:rtc_event_log_api", |
| 203 ] |
| 204 |
| 205 if (is_clang) { |
| 206 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 207 suppressed_configs += [ |
| 208 "//build/config/clang:extra_warnings", |
| 209 "//build/config/clang:find_bad_constructs", |
| 210 ] |
| 211 } |
| 212 } |
| 213 |
| 214 rtc_static_library("peerconnection_jni") { |
| 215 sources = [ |
| 216 "src/jni/androidnetworkmonitor_jni.cc", |
| 217 "src/jni/androidnetworkmonitor_jni.h", |
| 218 "src/jni/peerconnection_jni.cc", |
| 219 "src/jni/rtcstatscollectorcallbackwrapper.cc", |
| 220 "src/jni/rtcstatscollectorcallbackwrapper.h", |
| 221 ] |
| 222 |
| 223 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] |
| 224 |
| 225 if (is_clang) { |
| 226 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 227 suppressed_configs += [ |
| 228 "//build/config/clang:extra_warnings", |
| 229 "//build/config/clang:find_bad_constructs", |
| 230 ] |
| 231 } |
| 232 |
| 233 # TODO(jschuh): Bug 1348: fix this warning. |
| 234 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 235 |
| 236 if (is_win) { |
| 237 cflags += [ |
| 238 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch. |
| 239 "/wd4389", # signed/unsigned mismatch. |
| 240 ] |
| 241 } |
| 242 |
| 243 deps = [ |
| 244 ":base_jni", |
| 245 "../..:webrtc_common", |
| 246 "//webrtc/base:rtc_base", |
| 247 "//webrtc/base:rtc_base_approved", |
| 248 "//webrtc/base:rtc_task_queue", |
| 249 "//webrtc/media:rtc_data", |
| 250 "//webrtc/media:rtc_media_base", |
| 251 "//webrtc/modules/utility:utility", |
| 252 "//webrtc/pc:peerconnection", |
| 253 "//webrtc/system_wrappers:system_wrappers", |
| 254 ] |
| 255 } |
| 256 |
| 257 rtc_static_library("libjingle_peerconnection_jni") { |
| 258 public_deps = [ |
| 259 ":audio_jni", |
| 260 ":base_jni", |
| 261 ":media_jni", |
| 262 ":peerconnection_jni", |
| 263 ":video_jni", |
| 264 "//webrtc/pc:create_pc_factory", |
| 265 ] |
| 266 } |
| 267 |
103 rtc_static_library("libjingle_peerconnection_metrics_default_jni") { | 268 rtc_static_library("libjingle_peerconnection_metrics_default_jni") { |
104 sources = [ | 269 sources = [ |
105 "src/jni/androidmetrics_jni.cc", | 270 "src/jni/androidmetrics_jni.cc", |
106 ] | 271 ] |
107 | 272 |
108 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] | 273 configs += [ ":libjingle_peerconnection_jni_warnings_config" ] |
109 | 274 |
110 deps = [ | 275 deps = [ |
111 ":libjingle_peerconnection_jni", | 276 ":base_jni", |
112 "../../system_wrappers", | 277 ":peerconnection_jni", |
113 "//webrtc/pc:libjingle_peerconnection", | 278 "//webrtc/pc:peerconnection", |
| 279 "//webrtc/system_wrappers", |
114 "//webrtc/system_wrappers:field_trial_default", | 280 "//webrtc/system_wrappers:field_trial_default", |
115 "//webrtc/system_wrappers:metrics_default", | 281 "//webrtc/system_wrappers:metrics_default", |
116 ] | 282 ] |
117 } | 283 } |
118 | 284 |
| 285 # The modular build targets can be used to build WebRTC with different |
| 286 # functionalities. The users can choose either the real implemenation or the |
| 287 # null implementation of the audio/video modules based on their requirments. |
| 288 # |
| 289 # For example, to build WebRTC with datachannel support only, we would need the |
| 290 # the peerconnection and the null implementation of the audio, video and media |
| 291 # module. |
| 292 # rtc_shared_library("libjingle_peerconnection_datachannelonly_so") { |
| 293 # sources = [ |
| 294 # "src/jni/jni_onload.cc", |
| 295 # ] |
| 296 # |
| 297 # suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ] |
| 298 # configs += [ "//build/config/android:hide_all_but_jni" ] |
| 299 # |
| 300 # deps = [ |
| 301 # ":base_jni", |
| 302 # ":libjingle_peerconnection_metrics_default_jni", |
| 303 # ":null_audio_jni", |
| 304 # ":null_media_jni", |
| 305 # ":null_video_jni", |
| 306 # ":peerconnection_jni", |
| 307 # "//webrtc/base:rtc_base", |
| 308 # "//webrtc/base:rtc_base_approved", |
| 309 # "//webrtc/pc:peerconnection", |
| 310 # ] |
| 311 # output_extension = "so" |
| 312 # } |
| 313 |
119 rtc_shared_library("libjingle_peerconnection_so") { | 314 rtc_shared_library("libjingle_peerconnection_so") { |
120 sources = [ | 315 sources = [ |
121 "src/jni/jni_onload.cc", | 316 "src/jni/jni_onload.cc", |
122 ] | 317 ] |
123 | 318 |
124 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ] | 319 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ] |
125 configs += [ "//build/config/android:hide_all_but_jni" ] | 320 configs += [ "//build/config/android:hide_all_but_jni" ] |
126 | 321 |
127 deps = [ | 322 deps = [ |
128 ":libjingle_peerconnection_jni", | 323 ":libjingle_peerconnection_jni", |
129 ":libjingle_peerconnection_metrics_default_jni", | 324 ":libjingle_peerconnection_metrics_default_jni", |
130 "../../base:rtc_base", | 325 "//webrtc/base:rtc_base", |
131 "//webrtc/pc:libjingle_peerconnection", | 326 "//webrtc/pc:libjingle_peerconnection", |
132 ] | 327 ] |
133 output_extension = "so" | 328 output_extension = "so" |
134 } | 329 } |
135 | 330 |
136 dist_jar("libwebrtc") { | 331 dist_jar("libwebrtc") { |
137 _target_dir_name = get_label_info(":$target_name", "dir") | 332 _target_dir_name = get_label_info(":$target_name", "dir") |
138 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar" | 333 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar" |
139 direct_deps_only = true | 334 direct_deps_only = true |
140 use_interface_jars = false | 335 use_interface_jars = false |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 "//third_party/android_support_test_runner:runner_java", | 468 "//third_party/android_support_test_runner:runner_java", |
274 "//third_party/junit", | 469 "//third_party/junit", |
275 "//webrtc/base:base_java", | 470 "//webrtc/base:base_java", |
276 "//webrtc/sdk/android:libjingle_peerconnection_java", | 471 "//webrtc/sdk/android:libjingle_peerconnection_java", |
277 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java", | 472 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java", |
278 ] | 473 ] |
279 | 474 |
280 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ] | 475 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ] |
281 } | 476 } |
282 } | 477 } |
OLD | NEW |