BUILD.gn 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. # Copyright 2017 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//build/config/chromecast_build.gni")
  5. import("//third_party/webrtc/webrtc.gni")
  6. if (is_android) {
  7. import("//build/config/android/rules.gni")
  8. }
  9. webrtc_configs = [ "//third_party/webrtc:common_config" ]
  10. webrtc_public_configs = [ "//third_party/webrtc:common_inherited_config" ]
  11. webrtc_public_deps = [
  12. ":init_webrtc",
  13. ":metrics",
  14. ":task_queue_factory",
  15. "//third_party/webrtc/api:array_view",
  16. "//third_party/webrtc/api:callfactory_api",
  17. "//third_party/webrtc/api:candidate",
  18. "//third_party/webrtc/api:dtls_transport_interface",
  19. "//third_party/webrtc/api:frame_transformer_interface",
  20. "//third_party/webrtc/api:ice_transport_factory",
  21. "//third_party/webrtc/api:ice_transport_interface",
  22. "//third_party/webrtc/api:libjingle_logging_api",
  23. "//third_party/webrtc/api:libjingle_peerconnection_api",
  24. "//third_party/webrtc/api:make_ref_counted",
  25. "//third_party/webrtc/api:media_stream_interface",
  26. "//third_party/webrtc/api:packet_socket_factory",
  27. "//third_party/webrtc/api:rtc_error",
  28. "//third_party/webrtc/api:rtc_stats_api",
  29. "//third_party/webrtc/api:rtp_headers",
  30. "//third_party/webrtc/api:rtp_packet_info",
  31. "//third_party/webrtc/api:rtp_parameters",
  32. "//third_party/webrtc/api:scoped_refptr",
  33. "//third_party/webrtc/api:turn_customizer",
  34. "//third_party/webrtc/api/adaptation:resource_adaptation_api",
  35. "//third_party/webrtc/api/audio:aec3_config",
  36. "//third_party/webrtc/api/audio:aec3_config_json",
  37. "//third_party/webrtc/api/audio:aec3_factory",
  38. "//third_party/webrtc/api/audio_codecs:audio_codecs_api",
  39. "//third_party/webrtc/api/audio_codecs/L16:audio_decoder_L16",
  40. "//third_party/webrtc/api/audio_codecs/L16:audio_encoder_L16",
  41. "//third_party/webrtc/api/audio_codecs/g711:audio_decoder_g711",
  42. "//third_party/webrtc/api/audio_codecs/g711:audio_encoder_g711",
  43. "//third_party/webrtc/api/audio_codecs/g722:audio_decoder_g722",
  44. "//third_party/webrtc/api/audio_codecs/g722:audio_encoder_g722",
  45. "//third_party/webrtc/api/audio_codecs/isac:audio_decoder_isac",
  46. "//third_party/webrtc/api/audio_codecs/isac:audio_encoder_isac",
  47. "//third_party/webrtc/api/audio_codecs/opus:audio_decoder_multiopus",
  48. "//third_party/webrtc/api/audio_codecs/opus:audio_decoder_opus",
  49. "//third_party/webrtc/api/audio_codecs/opus:audio_encoder_multiopus",
  50. "//third_party/webrtc/api/audio_codecs/opus:audio_encoder_opus",
  51. "//third_party/webrtc/api/metronome",
  52. "//third_party/webrtc/api/rtc_event_log:rtc_event_log_factory",
  53. "//third_party/webrtc/api/task_queue:task_queue",
  54. "//third_party/webrtc/api/transport:enums",
  55. "//third_party/webrtc/api/transport/rtp:rtp_source",
  56. "//third_party/webrtc/api/video:recordable_encoded_frame",
  57. "//third_party/webrtc/api/video:video_bitrate_allocation",
  58. "//third_party/webrtc/api/video:video_frame",
  59. "//third_party/webrtc/api/video:video_frame_metadata",
  60. "//third_party/webrtc/api/video:video_rtp_headers",
  61. "//third_party/webrtc/api/video_codecs:builtin_video_decoder_factory",
  62. "//third_party/webrtc/api/video_codecs:rtc_software_fallback_wrappers",
  63. "//third_party/webrtc/api/video_codecs:video_codecs_api",
  64. "//third_party/webrtc/common_video",
  65. "//third_party/webrtc/common_video:common_video",
  66. "//third_party/webrtc/media:rtc_audio_video",
  67. "//third_party/webrtc/media:rtc_internal_video_codecs",
  68. "//third_party/webrtc/media:rtc_media",
  69. "//third_party/webrtc/media:rtc_media_base",
  70. "//third_party/webrtc/media:rtc_simulcast_encoder_adapter",
  71. "//third_party/webrtc/modules/audio_device",
  72. "//third_party/webrtc/modules/audio_device:audio_device_api",
  73. "//third_party/webrtc/modules/audio_processing",
  74. "//third_party/webrtc/modules/audio_processing:api",
  75. "//third_party/webrtc/modules/audio_processing:audio_processing_statistics",
  76. "//third_party/webrtc/modules/audio_processing/aec_dump",
  77. "//third_party/webrtc/modules/audio_processing/aec_dump:aec_dump",
  78. "//third_party/webrtc/modules/desktop_capture",
  79. "//third_party/webrtc/modules/desktop_capture:primitives",
  80. "//third_party/webrtc/modules/video_coding:video_codec_interface",
  81. "//third_party/webrtc/modules/video_coding:webrtc_h264",
  82. "//third_party/webrtc/p2p:libstunprober",
  83. "//third_party/webrtc/p2p:rtc_p2p",
  84. "//third_party/webrtc/pc:ice_server_parsing",
  85. "//third_party/webrtc/pc:libjingle_peerconnection",
  86. "//third_party/webrtc/pc:media_session",
  87. "//third_party/webrtc/pc:rtc_pc",
  88. "//third_party/webrtc/pc:session_description",
  89. "//third_party/webrtc/pc:webrtc_sdp",
  90. "//third_party/webrtc/rtc_base",
  91. "//third_party/webrtc/rtc_base:async_resolver_interface",
  92. "//third_party/webrtc/rtc_base:byte_order",
  93. "//third_party/webrtc/rtc_base:event_tracer",
  94. "//third_party/webrtc/rtc_base:ip_address",
  95. "//third_party/webrtc/rtc_base:logging",
  96. "//third_party/webrtc/rtc_base:net_helpers",
  97. "//third_party/webrtc/rtc_base:refcount",
  98. "//third_party/webrtc/rtc_base:rtc_base",
  99. "//third_party/webrtc/rtc_base:rtc_task_queue",
  100. "//third_party/webrtc/rtc_base:socket",
  101. "//third_party/webrtc/rtc_base:socket_address",
  102. "//third_party/webrtc/rtc_base:threading",
  103. "//third_party/webrtc/rtc_base:timestamp_aligner",
  104. "//third_party/webrtc/rtc_base:timeutils",
  105. "//third_party/webrtc/rtc_base/system:rtc_export",
  106. "//third_party/webrtc/rtc_base/third_party/base64",
  107. "//third_party/webrtc/rtc_base/third_party/sigslot",
  108. "//third_party/webrtc/rtc_base/third_party/sigslot:sigslot",
  109. "//third_party/webrtc/stats",
  110. "//third_party/webrtc/stats:rtc_stats",
  111. "//third_party/webrtc/stats:rtc_stats_test_utils",
  112. "//third_party/webrtc/system_wrappers",
  113. ]
  114. if (defined(rtc_exclude_system_time) && rtc_exclude_system_time) {
  115. webrtc_public_deps += [ ":system_time" ]
  116. }
  117. if (is_castos || is_cast_android) {
  118. webrtc_public_deps += [
  119. "//third_party/webrtc/api:network_state_predictor_api",
  120. "//third_party/webrtc/api/audio:audio_frame_api",
  121. "//third_party/webrtc/api/transport:goog_cc",
  122. "//third_party/webrtc/api/transport:network_control",
  123. "//third_party/webrtc/api/units:time_delta",
  124. "//third_party/webrtc/api/video:encoded_image",
  125. "//third_party/webrtc/call:call_interfaces",
  126. "//third_party/webrtc/media:rtc_media_engine_defaults",
  127. "//third_party/webrtc/modules/audio_device:audio_device_default",
  128. "//third_party/webrtc/modules/audio_mixer:audio_mixer_impl",
  129. "//third_party/webrtc/modules/video_coding:codec_globals_headers",
  130. ]
  131. }
  132. if (is_castos || is_cast_android || is_nacl) {
  133. # For chromecast and NaCL, provide a default field trial implementation.
  134. webrtc_public_deps += [ "//third_party/webrtc/system_wrappers:field_trial" ]
  135. } else {
  136. # Other Chromium flavors get a custom implementation.
  137. # See the default value of "rtc_exclude_field_trial_default"
  138. # in https://cs.chromium.org/chromium/src/third_party/webrtc/webrtc.gni
  139. # for how that is done.
  140. webrtc_public_deps += [ ":field_trial" ]
  141. }
  142. component("webrtc_component") {
  143. configs += webrtc_configs
  144. public_configs = webrtc_public_configs
  145. public_deps = webrtc_public_deps
  146. }
  147. source_set("init_webrtc") {
  148. visibility = [ ":*" ]
  149. sources = [
  150. "init_webrtc.cc",
  151. "init_webrtc.h",
  152. ]
  153. configs += [
  154. "//third_party/webrtc:common_config",
  155. "//third_party/webrtc:library_impl_config",
  156. ]
  157. public_configs = [
  158. "//third_party/webrtc:common_inherited_config",
  159. # TODO(mbonadei): Abseil config propagation is needed because
  160. # WebRTC's BUILD.gn files don't use `public_deps`, there are
  161. # good reasons for this, but they may disappear in the future.
  162. # In that case it is ok to remove these two lines.
  163. "//third_party/abseil-cpp:absl_include_config",
  164. "//third_party/abseil-cpp:absl_define_config",
  165. ]
  166. deps = [
  167. "//base",
  168. "//third_party/webrtc/rtc_base",
  169. "//third_party/webrtc/rtc_base:event_tracer",
  170. "//third_party/webrtc/rtc_base:logging",
  171. "//third_party/webrtc/rtc_base/system:rtc_export",
  172. "//third_party/webrtc/system_wrappers",
  173. ]
  174. }
  175. source_set("metrics") {
  176. # TODO(mbonadei): Migrate WebRTC deps to webrtc_component and uncomment.
  177. # visibility = [ ":*" ]
  178. sources = [ "metrics.cc" ]
  179. deps = [ "//base" ]
  180. }
  181. source_set("field_trial") {
  182. # TODO(mbonadei): Migrate WebRTC deps to webrtc_component and uncomment.
  183. # visibility = [ ":*" ]
  184. sources = [ "field_trial.cc" ]
  185. deps = [ "//base" ]
  186. }
  187. # If you want to depend on this target you should depend on :webrtc_component
  188. # instead (which has a public dependency on this target).
  189. source_set("task_queue_factory") {
  190. visibility = [ ":*" ]
  191. sources = [
  192. # Tested in
  193. # third_party/blink/renderer/platform/peerconnection/coalesced_tasks_test.cc
  194. "coalesced_tasks.cc",
  195. "coalesced_tasks.h",
  196. # Tested in
  197. # third_party/blink/renderer/platform/peerconnection/metronome_source_test.cc
  198. "metronome_source.cc",
  199. "metronome_source.h",
  200. # Tested in
  201. # third_party/blink/renderer/platform/peerconnection/task_queue_factory_test.cc
  202. "task_queue_factory.cc",
  203. "task_queue_factory.h",
  204. # Tested in
  205. # third_party/blink/renderer/platform/peerconnection/low_precision_timer_test.cc
  206. "low_precision_timer.cc",
  207. "low_precision_timer.h",
  208. ]
  209. configs += [ "//third_party/webrtc:library_impl_config" ]
  210. deps = [
  211. "//base",
  212. "//third_party/webrtc/api/metronome",
  213. "//third_party/webrtc/api/task_queue",
  214. "//third_party/webrtc/api/task_queue:pending_task_safety_flag",
  215. "//third_party/webrtc/api/units:time_delta",
  216. "//third_party/webrtc/rtc_base/system:rtc_export",
  217. ]
  218. }
  219. source_set("metronome_like_task_queue_test") {
  220. configs += webrtc_configs
  221. public_configs = webrtc_public_configs
  222. testonly = true
  223. sources = [
  224. "test/metronome_like_task_queue_test.cc",
  225. "test/metronome_like_task_queue_test.h",
  226. ]
  227. deps = [
  228. ":webrtc_component",
  229. "//base",
  230. "//base/test:test_support",
  231. "//testing/gtest:gtest",
  232. ]
  233. }
  234. source_set("system_time") {
  235. # TODO(mbonadei): Migrate WebRTC deps to webrtc_component and uncomment.
  236. # visibility = [ ":*" ]
  237. sources = [ "rtc_base/system_time.cc" ]
  238. deps = [ "//base" ]
  239. }