kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 1 | # 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 | |
| 9 | import("//build/config/linux/pkg_config.gni") |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 10 | import("../webrtc.gni") |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 11 | |
| 12 | group("media") { |
kjellander | 705ecc5 | 2016-09-15 00:53:26 -0700 | [diff] [blame] | 13 | public_deps = [ |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 14 | ":rtc_media", |
magjed | 0928a3c | 2016-11-25 00:40:18 -0800 | [diff] [blame] | 15 | ":rtc_media_base", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 16 | ] |
| 17 | } |
| 18 | |
| 19 | config("rtc_media_defines_config") { |
| 20 | defines = [ |
| 21 | "HAVE_WEBRTC_VIDEO", |
| 22 | "HAVE_WEBRTC_VOICE", |
| 23 | ] |
| 24 | } |
| 25 | |
| 26 | config("rtc_media_warnings_config") { |
| 27 | # GN orders flags on a target before flags from configs. The default config |
| 28 | # adds these flags so to cancel them out they need to come from a config and |
| 29 | # cannot be on the target directly. |
| 30 | if (!is_win) { |
| 31 | cflags = [ "-Wno-deprecated-declarations" ] |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 32 | } |
| 33 | } |
| 34 | |
magjed | 0928a3c | 2016-11-25 00:40:18 -0800 | [diff] [blame] | 35 | rtc_static_library("rtc_media_base") { |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 36 | # TODO(kjellander): Remove (bugs.webrtc.org/6828) |
| 37 | # Enabling GN check triggers cyclic dependency error: |
| 38 | # //webrtc/media:rtc_media_base -> |
| 39 | # //webrtc/pc:rtc_pc -> |
| 40 | # //webrtc/media:media -> |
| 41 | # //webrtc/media:rtc_media_base |
| 42 | check_includes = false |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 43 | defines = [] |
| 44 | libs = [] |
| 45 | deps = [] |
| 46 | sources = [ |
nisse | 6f5a6c3 | 2016-09-22 01:25:59 -0700 | [diff] [blame] | 47 | "base/adaptedvideotracksource.cc", |
| 48 | "base/adaptedvideotracksource.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 49 | "base/audiosource.h", |
| 50 | "base/codec.cc", |
| 51 | "base/codec.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 52 | "base/cryptoparams.h", |
| 53 | "base/device.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 54 | "base/mediachannel.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 55 | "base/mediaconstants.cc", |
| 56 | "base/mediaconstants.h", |
| 57 | "base/mediaengine.cc", |
| 58 | "base/mediaengine.h", |
| 59 | "base/rtpdataengine.cc", |
| 60 | "base/rtpdataengine.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 61 | "base/rtputils.cc", |
| 62 | "base/rtputils.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 63 | "base/streamparams.cc", |
| 64 | "base/streamparams.h", |
| 65 | "base/turnutils.cc", |
| 66 | "base/turnutils.h", |
| 67 | "base/videoadapter.cc", |
| 68 | "base/videoadapter.h", |
| 69 | "base/videobroadcaster.cc", |
| 70 | "base/videobroadcaster.h", |
| 71 | "base/videocapturer.cc", |
| 72 | "base/videocapturer.h", |
| 73 | "base/videocapturerfactory.h", |
| 74 | "base/videocommon.cc", |
| 75 | "base/videocommon.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 76 | "base/videoframe.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 77 | "base/videosourcebase.cc", |
| 78 | "base/videosourcebase.h", |
magjed | 0928a3c | 2016-11-25 00:40:18 -0800 | [diff] [blame] | 79 | ] |
| 80 | |
| 81 | configs += [ ":rtc_media_warnings_config" ] |
| 82 | |
| 83 | if (!build_with_chromium && is_clang) { |
| 84 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 85 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 86 | } |
| 87 | |
| 88 | include_dirs = [] |
| 89 | if (rtc_build_libyuv) { |
| 90 | deps += [ "$rtc_libyuv_dir" ] |
| 91 | public_deps = [ |
| 92 | "$rtc_libyuv_dir", |
| 93 | ] |
| 94 | } else { |
| 95 | # Need to add a directory normally exported by libyuv. |
| 96 | include_dirs += [ "$rtc_libyuv_dir/include" ] |
| 97 | } |
| 98 | |
| 99 | deps += [ |
| 100 | "..:webrtc_common", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 101 | "../api:libjingle_peerconnection_api", |
| 102 | "../api:video_frame_api", |
| 103 | "../api/audio_codecs:audio_codecs_api", |
| 104 | "../base:rtc_base", |
magjed | 0928a3c | 2016-11-25 00:40:18 -0800 | [diff] [blame] | 105 | "../base:rtc_base_approved", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 106 | "../call:call_interfaces", |
| 107 | "../common_video:common_video", |
magjed | 0928a3c | 2016-11-25 00:40:18 -0800 | [diff] [blame] | 108 | "../p2p", |
| 109 | ] |
| 110 | } |
| 111 | |
| 112 | rtc_static_library("rtc_media") { |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 113 | # TODO(kjellander): Remove (bugs.webrtc.org/6828) |
| 114 | # Enabling GN check triggers cyclic dependency error: |
| 115 | # //webrtc/media:media -> |
| 116 | # //webrtc/media:rtc_media -> |
| 117 | # //webrtc/pc:rtc_pc -> |
| 118 | # //webrtc/media:media |
| 119 | check_includes = false |
magjed | 0928a3c | 2016-11-25 00:40:18 -0800 | [diff] [blame] | 120 | defines = [] |
| 121 | libs = [] |
| 122 | deps = [] |
| 123 | sources = [ |
solenberg | 76377c5 | 2017-02-21 00:54:31 -0800 | [diff] [blame] | 124 | "engine/apm_helpers.cc", |
| 125 | "engine/apm_helpers.h", |
magjed | dd40702 | 2016-12-01 00:27:27 -0800 | [diff] [blame] | 126 | "engine/internaldecoderfactory.cc", |
| 127 | "engine/internaldecoderfactory.h", |
magjed | 509e4fe | 2016-11-18 01:34:11 -0800 | [diff] [blame] | 128 | "engine/internalencoderfactory.cc", |
| 129 | "engine/internalencoderfactory.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 130 | "engine/nullwebrtcvideoengine.h", |
ossu | 6f06cca | 2016-07-13 10:06:22 -0700 | [diff] [blame] | 131 | "engine/payload_type_mapper.cc", |
| 132 | "engine/payload_type_mapper.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 133 | "engine/simulcast.cc", |
| 134 | "engine/simulcast.h", |
magjed | f6acc2a | 2016-11-22 01:43:03 -0800 | [diff] [blame] | 135 | "engine/videodecodersoftwarefallbackwrapper.cc", |
| 136 | "engine/videodecodersoftwarefallbackwrapper.h", |
magjed | 614d5b7 | 2016-11-15 06:30:54 -0800 | [diff] [blame] | 137 | "engine/videoencodersoftwarefallbackwrapper.cc", |
| 138 | "engine/videoencodersoftwarefallbackwrapper.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 139 | "engine/webrtccommon.h", |
| 140 | "engine/webrtcmediaengine.cc", |
| 141 | "engine/webrtcmediaengine.h", |
| 142 | "engine/webrtcvideocapturer.cc", |
| 143 | "engine/webrtcvideocapturer.h", |
| 144 | "engine/webrtcvideocapturerfactory.cc", |
| 145 | "engine/webrtcvideocapturerfactory.h", |
| 146 | "engine/webrtcvideodecoderfactory.h", |
magjed | 1e45cc6 | 2016-10-28 07:43:45 -0700 | [diff] [blame] | 147 | "engine/webrtcvideoencoderfactory.cc", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 148 | "engine/webrtcvideoencoderfactory.h", |
| 149 | "engine/webrtcvideoengine2.cc", |
| 150 | "engine/webrtcvideoengine2.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 151 | "engine/webrtcvideoframe.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 152 | "engine/webrtcvoe.h", |
| 153 | "engine/webrtcvoiceengine.cc", |
| 154 | "engine/webrtcvoiceengine.h", |
deadbeef | 953c2ce | 2017-01-09 14:53:41 -0800 | [diff] [blame] | 155 | "sctp/sctptransportinternal.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 156 | ] |
| 157 | |
deadbeef | 40610e2 | 2016-12-22 10:53:38 -0800 | [diff] [blame] | 158 | if (rtc_enable_sctp) { |
| 159 | sources += [ |
deadbeef | 953c2ce | 2017-01-09 14:53:41 -0800 | [diff] [blame] | 160 | "sctp/sctptransport.cc", |
| 161 | "sctp/sctptransport.h", |
deadbeef | 40610e2 | 2016-12-22 10:53:38 -0800 | [diff] [blame] | 162 | ] |
| 163 | } |
| 164 | |
ehmaldonado | 7a2ce0b | 2016-09-05 01:35:44 -0700 | [diff] [blame] | 165 | configs += [ ":rtc_media_warnings_config" ] |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 166 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 167 | if (!build_with_chromium && is_clang) { |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 168 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
kjellander | 660312b | 2016-09-26 06:11:53 -0700 | [diff] [blame] | 169 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | if (is_win) { |
| 173 | cflags = [ |
| 174 | "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch. |
| 175 | "/wd4267", # conversion from "size_t" to "int", possible loss of data. |
| 176 | "/wd4389", # signed/unsigned mismatch. |
| 177 | ] |
| 178 | } |
| 179 | |
peah | 1bcfce5 | 2016-08-26 07:16:04 -0700 | [diff] [blame] | 180 | if (rtc_enable_intelligibility_enhancer) { |
| 181 | defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ] |
| 182 | } else { |
| 183 | defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ] |
| 184 | } |
| 185 | |
minyue | 2e03c66 | 2017-02-01 17:31:11 -0800 | [diff] [blame] | 186 | if (rtc_opus_support_120ms_ptime) { |
| 187 | defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=1" ] |
| 188 | } else { |
| 189 | defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=0" ] |
| 190 | } |
| 191 | |
kjellander | ec5c906 | 2016-08-19 01:07:30 -0700 | [diff] [blame] | 192 | include_dirs = [] |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 193 | if (rtc_build_libyuv) { |
| 194 | deps += [ "$rtc_libyuv_dir" ] |
| 195 | public_deps = [ |
| 196 | "$rtc_libyuv_dir", |
| 197 | ] |
| 198 | } else { |
| 199 | # Need to add a directory normally exported by libyuv. |
| 200 | include_dirs += [ "$rtc_libyuv_dir/include" ] |
| 201 | } |
| 202 | |
deadbeef | 40610e2 | 2016-12-22 10:53:38 -0800 | [diff] [blame] | 203 | if (rtc_enable_sctp && rtc_build_usrsctp) { |
kjellander | ec5c906 | 2016-08-19 01:07:30 -0700 | [diff] [blame] | 204 | include_dirs += [ |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 205 | # TODO(jiayl): move this into the public_configs of |
| 206 | # //third_party/usrsctp/BUILD.gn. |
| 207 | "//third_party/usrsctp/usrsctplib", |
| 208 | ] |
| 209 | deps += [ "//third_party/usrsctp" ] |
| 210 | } |
| 211 | |
ehmaldonado | e9cc686 | 2016-09-05 06:10:18 -0700 | [diff] [blame] | 212 | public_configs = [] |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 213 | if (build_with_chromium) { |
| 214 | deps += [ "../modules/video_capture:video_capture" ] |
| 215 | } else { |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 216 | public_configs += [ ":rtc_media_defines_config" ] |
| 217 | deps += [ "../modules/video_capture:video_capture_internal_impl" ] |
| 218 | } |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 219 | deps += [ |
magjed | 0928a3c | 2016-11-25 00:40:18 -0800 | [diff] [blame] | 220 | ":rtc_media_base", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 221 | "..:webrtc_common", |
kjellander | a69d973 | 2016-08-31 07:33:05 -0700 | [diff] [blame] | 222 | "../api:call_api", |
aleloi | a8eb756 | 2016-11-28 07:02:13 -0800 | [diff] [blame] | 223 | "../api:transport_api", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 224 | "../api:video_frame_api", |
| 225 | "../api/audio_codecs:audio_codecs_api", |
| 226 | "../api/audio_codecs:builtin_audio_decoder_factory", |
| 227 | "../base:rtc_base", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 228 | "../base:rtc_base_approved", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 229 | "../call", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 230 | "../common_video:common_video", |
| 231 | "../modules/audio_coding:rent_a_codec", |
| 232 | "../modules/audio_device:audio_device", |
aleloi | 10111bc | 2016-11-17 06:48:48 -0800 | [diff] [blame] | 233 | "../modules/audio_mixer:audio_mixer_impl", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 234 | "../modules/audio_processing:audio_processing", |
| 235 | "../modules/video_capture:video_capture_module", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 236 | "../modules/video_coding", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 237 | "../modules/video_coding:webrtc_h264", |
| 238 | "../modules/video_coding:webrtc_vp8", |
| 239 | "../modules/video_coding:webrtc_vp9", |
| 240 | "../p2p:rtc_p2p", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 241 | "../system_wrappers", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 242 | "../video", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 243 | "../voice_engine", |
| 244 | ] |
| 245 | } |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 246 | |
| 247 | if (rtc_include_tests) { |
| 248 | config("rtc_unittest_main_config") { |
| 249 | # GN orders flags on a target before flags from configs. The default config |
| 250 | # adds -Wall, and this flag have to be after -Wall -- so they need to |
| 251 | # come from a config and can"t be on the target directly. |
| 252 | if (is_clang && is_ios) { |
| 253 | cflags = [ "-Wno-unused-variable" ] |
| 254 | } |
| 255 | } |
| 256 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 257 | rtc_source_set("rtc_unittest_main") { |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 258 | testonly = true |
| 259 | |
kjellander | ec5c906 | 2016-08-19 01:07:30 -0700 | [diff] [blame] | 260 | include_dirs = [] |
| 261 | public_deps = [] |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 262 | deps = [ |
| 263 | "../modules/audio_coding:rent_a_codec", |
| 264 | "../modules/audio_processing:audio_processing", |
| 265 | "../p2p:rtc_p2p", |
| 266 | ] |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 267 | sources = [ |
| 268 | "base/fakemediaengine.h", |
| 269 | "base/fakenetworkinterface.h", |
| 270 | "base/fakertp.h", |
| 271 | "base/fakevideocapturer.h", |
| 272 | "base/fakevideorenderer.h", |
hbos | b24b1ce | 2016-08-16 01:19:43 -0700 | [diff] [blame] | 273 | "base/test/mock_mediachannel.h", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 274 | "base/testutils.cc", |
| 275 | "base/testutils.h", |
| 276 | "engine/fakewebrtccall.cc", |
| 277 | "engine/fakewebrtccall.h", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 278 | "engine/fakewebrtcdeviceinfo.h", |
| 279 | "engine/fakewebrtcvcmfactory.h", |
| 280 | "engine/fakewebrtcvideocapturemodule.h", |
| 281 | "engine/fakewebrtcvideoengine.h", |
| 282 | "engine/fakewebrtcvoiceengine.h", |
| 283 | ] |
| 284 | |
ehmaldonado | 7a2ce0b | 2016-09-05 01:35:44 -0700 | [diff] [blame] | 285 | configs += [ ":rtc_unittest_main_config" ] |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 286 | |
| 287 | if (rtc_build_libyuv) { |
| 288 | deps += [ "$rtc_libyuv_dir" ] |
kjellander | ec5c906 | 2016-08-19 01:07:30 -0700 | [diff] [blame] | 289 | public_deps += [ "$rtc_libyuv_dir" ] |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 290 | } else { |
| 291 | # Need to add a directory normally exported by libyuv. |
| 292 | include_dirs += [ "$rtc_libyuv_dir/include" ] |
| 293 | } |
| 294 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 295 | if (!build_with_chromium && is_clang) { |
| 296 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 297 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | deps += [ |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 301 | ":rtc_media", |
| 302 | ":rtc_media_base", |
| 303 | "..:webrtc_common", |
| 304 | "../api:call_api", |
| 305 | "../api:video_frame_api", |
| 306 | "../base:rtc_base", |
| 307 | "../base:rtc_base_approved", |
michaelt | 566d820 | 2017-01-12 10:17:38 -0800 | [diff] [blame] | 308 | "../base:rtc_base_tests_main", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 309 | "../base:rtc_base_tests_utils", |
| 310 | "../call:call_interfaces", |
| 311 | "../test:test_support", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 312 | "//testing/gtest", |
| 313 | ] |
| 314 | public_deps += [ "//testing/gmock" ] |
| 315 | } |
| 316 | |
| 317 | config("rtc_media_unittests_config") { |
| 318 | # GN orders flags on a target before flags from configs. The default config |
| 319 | # adds -Wall, and this flag have to be after -Wall -- so they need to |
| 320 | # come from a config and can"t be on the target directly. |
| 321 | # TODO(kjellander): Make the code compile without disabling these flags. |
| 322 | # See https://bugs.webrtc.org/3307. |
| 323 | if (is_clang && is_win) { |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 324 | cflags = [ |
| 325 | # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6266 |
| 326 | # for -Wno-sign-compare |
| 327 | "-Wno-sign-compare", |
| 328 | "-Wno-unused-function", |
| 329 | ] |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 330 | } |
| 331 | if (!is_win) { |
| 332 | cflags = [ "-Wno-sign-compare" ] |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 333 | } |
| 334 | } |
| 335 | |
ehmaldonado | 3a7f35b | 2016-09-14 05:10:01 -0700 | [diff] [blame] | 336 | rtc_media_unittests_resources = [ |
| 337 | "//resources/media/captured-320x240-2s-48.frames", |
| 338 | "//resources/media/faces.1280x720_P420.yuv", |
| 339 | "//resources/media/faces_I420.jpg", |
| 340 | "//resources/media/faces_I422.jpg", |
| 341 | "//resources/media/faces_I444.jpg", |
| 342 | "//resources/media/faces_I411.jpg", |
| 343 | "//resources/media/faces_I400.jpg", |
| 344 | ] |
kjellander | 32c4a20 | 2016-08-30 02:53:49 -0700 | [diff] [blame] | 345 | |
| 346 | if (is_ios) { |
| 347 | bundle_data("rtc_media_unittests_bundle_data") { |
| 348 | testonly = true |
| 349 | sources = rtc_media_unittests_resources |
| 350 | outputs = [ |
| 351 | "{{bundle_resources_dir}}/{{source_file_part}}", |
| 352 | ] |
| 353 | } |
| 354 | } |
| 355 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 356 | rtc_test("rtc_media_unittests") { |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 357 | testonly = true |
| 358 | |
johan | 073ece4 | 2016-08-26 02:59:47 -0700 | [diff] [blame] | 359 | defines = [] |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 360 | deps = [ |
| 361 | "../pc:rtc_pc", |
| 362 | "../test:field_trial", |
| 363 | ] |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 364 | sources = [ |
| 365 | "base/codec_unittest.cc", |
| 366 | "base/rtpdataengine_unittest.cc", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 367 | "base/rtputils_unittest.cc", |
| 368 | "base/streamparams_unittest.cc", |
| 369 | "base/turnutils_unittest.cc", |
| 370 | "base/videoadapter_unittest.cc", |
| 371 | "base/videobroadcaster_unittest.cc", |
| 372 | "base/videocapturer_unittest.cc", |
| 373 | "base/videocommon_unittest.cc", |
| 374 | "base/videoengine_unittest.h", |
solenberg | 76377c5 | 2017-02-21 00:54:31 -0800 | [diff] [blame] | 375 | "engine/apm_helpers_unittest.cc", |
magjed | dd40702 | 2016-12-01 00:27:27 -0800 | [diff] [blame] | 376 | "engine/internaldecoderfactory_unittest.cc", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 377 | "engine/nullwebrtcvideoengine_unittest.cc", |
ossu | c54071d | 2016-08-17 02:45:41 -0700 | [diff] [blame] | 378 | "engine/payload_type_mapper_unittest.cc", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 379 | "engine/simulcast_unittest.cc", |
magjed | f6acc2a | 2016-11-22 01:43:03 -0800 | [diff] [blame] | 380 | "engine/videodecodersoftwarefallbackwrapper_unittest.cc", |
magjed | 614d5b7 | 2016-11-15 06:30:54 -0800 | [diff] [blame] | 381 | "engine/videoencodersoftwarefallbackwrapper_unittest.cc", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 382 | "engine/webrtcmediaengine_unittest.cc", |
| 383 | "engine/webrtcvideocapturer_unittest.cc", |
noahric | be850e1 | 2017-01-20 01:07:26 -0800 | [diff] [blame] | 384 | "engine/webrtcvideoencoderfactory_unittest.cc", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 385 | "engine/webrtcvideoengine2_unittest.cc", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 386 | "engine/webrtcvoiceengine_unittest.cc", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 387 | ] |
| 388 | |
deadbeef | 40610e2 | 2016-12-22 10:53:38 -0800 | [diff] [blame] | 389 | if (rtc_enable_sctp) { |
deadbeef | 953c2ce | 2017-01-09 14:53:41 -0800 | [diff] [blame] | 390 | sources += [ "sctp/sctptransport_unittest.cc" ] |
deadbeef | 40610e2 | 2016-12-22 10:53:38 -0800 | [diff] [blame] | 391 | } |
| 392 | |
ehmaldonado | 7a2ce0b | 2016-09-05 01:35:44 -0700 | [diff] [blame] | 393 | configs += [ ":rtc_media_unittests_config" ] |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 394 | |
johan | 073ece4 | 2016-08-26 02:59:47 -0700 | [diff] [blame] | 395 | if (rtc_use_h264) { |
| 396 | defines += [ "WEBRTC_USE_H264" ] |
| 397 | } |
ossu | 11bfc53 | 2017-02-16 05:37:06 -0800 | [diff] [blame] | 398 | |
| 399 | if (rtc_opus_support_120ms_ptime) { |
| 400 | defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=1" ] |
| 401 | } else { |
| 402 | defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=0" ] |
| 403 | } |
| 404 | |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 405 | if (is_win) { |
| 406 | cflags = [ |
| 407 | "/wd4245", # conversion from int to size_t, signed/unsigned mismatch. |
| 408 | "/wd4373", # virtual function override. |
| 409 | "/wd4389", # signed/unsigned mismatch. |
| 410 | ] |
| 411 | } |
| 412 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 413 | if (!build_with_chromium && is_clang) { |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 414 | suppressed_configs += [ |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 415 | "//build/config/clang:extra_warnings", |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 416 | |
| 417 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 418 | "//build/config/clang:find_bad_constructs", |
| 419 | ] |
| 420 | } |
| 421 | |
ehmaldonado | 3a7f35b | 2016-09-14 05:10:01 -0700 | [diff] [blame] | 422 | data = rtc_media_unittests_resources |
| 423 | |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 424 | if (is_android) { |
| 425 | deps += [ "//testing/android/native_test:native_test_support" ] |
kjellander | 28a0ffd | 2016-08-24 07:48:42 -0700 | [diff] [blame] | 426 | shard_timeout = 900 |
| 427 | } |
kjellander | 32c4a20 | 2016-08-30 02:53:49 -0700 | [diff] [blame] | 428 | |
| 429 | if (is_ios) { |
| 430 | deps += [ ":rtc_media_unittests_bundle_data" ] |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 431 | } |
| 432 | |
| 433 | deps += [ |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 434 | ":rtc_media", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 435 | ":rtc_media_base", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 436 | ":rtc_unittest_main", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 437 | "../api:video_frame_api", |
| 438 | "../api/audio_codecs:builtin_audio_decoder_factory", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 439 | "../audio", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 440 | "../base:rtc_base", |
| 441 | "../base:rtc_base_approved", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 442 | "../base:rtc_base_tests_utils", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 443 | "../call:call_interfaces", |
| 444 | "../common_video:common_video", |
| 445 | "../logging:rtc_event_log_api", |
aleloi | 5de52fd | 2016-11-10 01:05:34 -0800 | [diff] [blame] | 446 | "../modules/audio_device:mock_audio_device", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 447 | "../modules/audio_processing:audio_processing", |
| 448 | "../modules/video_coding:video_coding_utility", |
| 449 | "../modules/video_coding:webrtc_vp8", |
| 450 | "../p2p:rtc_p2p_unittests", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 451 | "../system_wrappers:metrics_default", |
kjellander | a2ef4f9 | 2017-03-06 06:04:55 -0800 | [diff] [blame^] | 452 | "../test:test_support", |
| 453 | "../voice_engine:voice_engine", |
kjellander | 82a9449 | 2016-06-12 22:12:01 -0700 | [diff] [blame] | 454 | ] |
| 455 | } |
| 456 | } |