You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

888 lines
27 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. import("../webrtc.gni")
  9. if (is_android) {
  10. import("//build/config/android/config.gni")
  11. import("//build/config/android/rules.gni")
  12. } else if (is_mac) {
  13. import("//build/config/mac/rules.gni")
  14. } else if (is_ios) {
  15. import("//build/config/ios/rules.gni")
  16. }
  17. group("examples") {
  18. # This target shall build all targets in examples.
  19. testonly = true
  20. deps = []
  21. if (is_android) {
  22. deps += [
  23. ":AppRTCMobile",
  24. ":AppRTCMobile_test_apk",
  25. ":libwebrtc_unity",
  26. ]
  27. # TODO(sakal): We include some code from the tests. Remove this dependency
  28. # and remove this if-clause.
  29. if (rtc_include_tests) {
  30. deps += [ "androidnativeapi" ]
  31. }
  32. }
  33. if (!build_with_chromium) {
  34. deps += [ ":stun_prober" ]
  35. }
  36. if (is_ios || (is_mac && target_cpu != "x86")) {
  37. deps += [ ":AppRTCMobile" ]
  38. }
  39. if (is_linux || is_win) {
  40. deps += [
  41. ":peerconnection_server",
  42. ":relayserver",
  43. ":stunserver",
  44. ":turnserver",
  45. ]
  46. if (current_os != "winuwp") {
  47. deps += [ ":peerconnection_client" ]
  48. }
  49. }
  50. if (is_android || is_win) {
  51. deps += [ ":webrtc_unity_plugin" ]
  52. }
  53. }
  54. rtc_library("read_auth_file") {
  55. testonly = true
  56. sources = [
  57. "turnserver/read_auth_file.cc",
  58. "turnserver/read_auth_file.h",
  59. ]
  60. deps = [
  61. "../rtc_base",
  62. ]
  63. }
  64. if (rtc_include_tests) {
  65. rtc_test("examples_unittests") {
  66. testonly = true
  67. sources = [
  68. "turnserver/read_auth_file_unittest.cc",
  69. ]
  70. deps = [
  71. ":read_auth_file",
  72. "../test:test_main",
  73. "//test:test_support",
  74. "//testing/gtest",
  75. ]
  76. }
  77. }
  78. if (is_android) {
  79. rtc_android_apk("AppRTCMobile") {
  80. testonly = true
  81. apk_name = "AppRTCMobile"
  82. android_manifest = "androidapp/AndroidManifest.xml"
  83. min_sdk_version = 16
  84. target_sdk_version = 29
  85. deps = [
  86. ":AppRTCMobile_javalib",
  87. ":AppRTCMobile_resources",
  88. "../rtc_base:base_java",
  89. ]
  90. shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
  91. }
  92. rtc_android_library("AppRTCMobile_javalib") {
  93. testonly = true
  94. android_manifest_for_lint = "androidapp/AndroidManifest.xml"
  95. java_files = [
  96. "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
  97. "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
  98. "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
  99. "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
  100. "androidapp/src/org/appspot/apprtc/CallActivity.java",
  101. "androidapp/src/org/appspot/apprtc/CallFragment.java",
  102. "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
  103. "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
  104. "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
  105. "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
  106. "androidapp/src/org/appspot/apprtc/HudFragment.java",
  107. "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
  108. "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
  109. "androidapp/src/org/appspot/apprtc/RtcEventLog.java",
  110. "androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java",
  111. "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
  112. "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
  113. "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
  114. "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
  115. "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
  116. "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
  117. "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
  118. "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
  119. ]
  120. deps = [
  121. ":AppRTCMobile_resources",
  122. "../rtc_base:base_java",
  123. "../sdk/android:audio_api_java",
  124. "../sdk/android:base_java",
  125. "../sdk/android:camera_java",
  126. "../sdk/android:default_video_codec_factory_java",
  127. "../sdk/android:filevideo_java",
  128. "../sdk/android:hwcodecs_java",
  129. "../sdk/android:java_audio_device_module_java",
  130. "../sdk/android:libjingle_peerconnection_java",
  131. "../sdk/android:libjingle_peerconnection_metrics_default_java",
  132. "../sdk/android:peerconnection_java",
  133. "../sdk/android:screencapturer_java",
  134. "../sdk/android:surfaceviewrenderer_java",
  135. "../sdk/android:swcodecs_java",
  136. "../sdk/android:video_api_java",
  137. "../sdk/android:video_java",
  138. "androidapp/third_party/autobanh:autobanh_java",
  139. "//third_party/android_deps:com_android_support_support_annotations_java",
  140. ]
  141. }
  142. android_resources("AppRTCMobile_resources") {
  143. testonly = true
  144. resource_dirs = [ "androidapp/res" ]
  145. custom_package = "org.appspot.apprtc"
  146. }
  147. rtc_instrumentation_test_apk("AppRTCMobile_test_apk") {
  148. apk_name = "AppRTCMobileTest"
  149. android_manifest = "androidtests/AndroidManifest.xml"
  150. min_sdk_version = 16
  151. target_sdk_version = 21
  152. java_files = [
  153. "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
  154. ]
  155. apk_under_test = ":AppRTCMobile"
  156. deps = [
  157. ":AppRTCMobile_javalib",
  158. "../sdk/android:libjingle_peerconnection_java",
  159. "../sdk/android:video_java",
  160. "//third_party/android_support_test_runner:runner_java",
  161. "//third_party/junit",
  162. ]
  163. }
  164. }
  165. if (is_ios || (is_mac && target_cpu != "x86")) {
  166. config("apprtc_common_config") {
  167. include_dirs = [ "objc/AppRTCMobile/common" ]
  168. }
  169. rtc_library("apprtc_common") {
  170. testonly = true
  171. sources = [
  172. "objc/AppRTCMobile/common/ARDUtilities.h",
  173. "objc/AppRTCMobile/common/ARDUtilities.m",
  174. ]
  175. public_configs = [ ":apprtc_common_config" ]
  176. if (is_ios) {
  177. # iOS must use WebRTC.framework which is dynamically linked.
  178. deps = [
  179. "../sdk:framework_objc+link",
  180. ]
  181. } else {
  182. deps = [
  183. "../sdk:mac_framework_objc+link",
  184. ]
  185. }
  186. }
  187. config("apprtc_signaling_config") {
  188. include_dirs = [ "objc/AppRTCMobile" ]
  189. cflags_objc = [
  190. # TODO(bugs.webrtc.org/10837): Remove this when usage of
  191. # archivedDataWithRootObject will be removed.
  192. "-Wno-unguarded-availability",
  193. ]
  194. }
  195. rtc_library("apprtc_signaling") {
  196. testonly = true
  197. sources = [
  198. "objc/AppRTCMobile/ARDAppClient+Internal.h",
  199. "objc/AppRTCMobile/ARDAppClient.h",
  200. "objc/AppRTCMobile/ARDAppClient.m",
  201. "objc/AppRTCMobile/ARDAppEngineClient.h",
  202. "objc/AppRTCMobile/ARDAppEngineClient.m",
  203. "objc/AppRTCMobile/ARDBitrateTracker.h",
  204. "objc/AppRTCMobile/ARDBitrateTracker.m",
  205. "objc/AppRTCMobile/ARDCaptureController.h",
  206. "objc/AppRTCMobile/ARDCaptureController.m",
  207. "objc/AppRTCMobile/ARDExternalSampleCapturer.h",
  208. "objc/AppRTCMobile/ARDExternalSampleCapturer.m",
  209. "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
  210. "objc/AppRTCMobile/ARDJoinResponse.h",
  211. "objc/AppRTCMobile/ARDJoinResponse.m",
  212. "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
  213. "objc/AppRTCMobile/ARDMessageResponse.h",
  214. "objc/AppRTCMobile/ARDMessageResponse.m",
  215. "objc/AppRTCMobile/ARDRoomServerClient.h",
  216. "objc/AppRTCMobile/ARDSettingsModel+Private.h",
  217. "objc/AppRTCMobile/ARDSettingsModel.h",
  218. "objc/AppRTCMobile/ARDSettingsModel.m",
  219. "objc/AppRTCMobile/ARDSettingsStore.h",
  220. "objc/AppRTCMobile/ARDSettingsStore.m",
  221. "objc/AppRTCMobile/ARDSignalingChannel.h",
  222. "objc/AppRTCMobile/ARDSignalingMessage.h",
  223. "objc/AppRTCMobile/ARDSignalingMessage.m",
  224. "objc/AppRTCMobile/ARDStatsBuilder.h",
  225. "objc/AppRTCMobile/ARDStatsBuilder.m",
  226. "objc/AppRTCMobile/ARDTURNClient+Internal.h",
  227. "objc/AppRTCMobile/ARDTURNClient.h",
  228. "objc/AppRTCMobile/ARDTURNClient.m",
  229. "objc/AppRTCMobile/ARDWebSocketChannel.h",
  230. "objc/AppRTCMobile/ARDWebSocketChannel.m",
  231. "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
  232. "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
  233. "objc/AppRTCMobile/RTCIceServer+JSON.h",
  234. "objc/AppRTCMobile/RTCIceServer+JSON.m",
  235. "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
  236. "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
  237. ]
  238. public_configs = [ ":apprtc_signaling_config" ]
  239. deps = [
  240. ":apprtc_common",
  241. ":socketrocket",
  242. ]
  243. if (is_ios) {
  244. # iOS must use WebRTC.framework which is dynamically linked.
  245. deps += [
  246. "../sdk:framework_objc+link",
  247. "../sdk:ios_framework_bundle",
  248. ]
  249. } else {
  250. deps += [ "../sdk:mac_framework_objc+link" ]
  251. }
  252. libs = [
  253. "CoreMedia.framework",
  254. "QuartzCore.framework",
  255. ]
  256. }
  257. if (is_ios) {
  258. rtc_library("AppRTCMobile_lib") {
  259. # iOS must use WebRTC.framework which is dynamically linked.
  260. testonly = true
  261. sources = [
  262. "objc/AppRTCMobile/ios/ARDAppDelegate.h",
  263. "objc/AppRTCMobile/ios/ARDAppDelegate.m",
  264. "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
  265. "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
  266. "objc/AppRTCMobile/ios/ARDMainView.h",
  267. "objc/AppRTCMobile/ios/ARDMainView.m",
  268. "objc/AppRTCMobile/ios/ARDMainViewController.h",
  269. "objc/AppRTCMobile/ios/ARDMainViewController.m",
  270. "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
  271. "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
  272. "objc/AppRTCMobile/ios/ARDStatsView.h",
  273. "objc/AppRTCMobile/ios/ARDStatsView.m",
  274. "objc/AppRTCMobile/ios/ARDVideoCallView.h",
  275. "objc/AppRTCMobile/ios/ARDVideoCallView.m",
  276. "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
  277. "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
  278. "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
  279. "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
  280. "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
  281. "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
  282. ]
  283. configs += [ "..:common_objc" ]
  284. deps = [
  285. ":apprtc_common",
  286. ":apprtc_signaling",
  287. "../sdk:framework_objc+link",
  288. "../sdk:ios_framework_bundle",
  289. ]
  290. libs = [ "AVFoundation.framework" ]
  291. }
  292. ios_app_bundle("AppRTCMobile") {
  293. testonly = true
  294. sources = [
  295. "objc/AppRTCMobile/ios/main.m",
  296. ]
  297. info_plist = "objc/AppRTCMobile/ios/Info.plist"
  298. configs += [ "..:common_config" ]
  299. public_configs = [ "..:common_inherited_config" ]
  300. deps = [
  301. ":AppRTCMobile_ios_bundle_data",
  302. ":AppRTCMobile_lib",
  303. "../sdk:framework_objc",
  304. "../sdk:ios_framework_bundle",
  305. ]
  306. if (rtc_apprtcmobile_broadcast_extension) {
  307. deps += [
  308. ":AppRTCMobileBroadcastSetupUI_extension_bundle",
  309. ":AppRTCMobileBroadcastUpload_extension_bundle",
  310. ]
  311. }
  312. if (target_cpu == "x86") {
  313. deps += [ "//testing/iossim" ]
  314. }
  315. }
  316. if (rtc_apprtcmobile_broadcast_extension) {
  317. bundle_data("AppRTCMobileBroadcastUpload_extension_bundle") {
  318. testonly = true
  319. public_deps = [
  320. ":AppRTCMobileBroadcastUpload",
  321. ]
  322. sources = [
  323. "$root_out_dir/AppRTCMobileBroadcastUpload.appex",
  324. ]
  325. outputs = [
  326. "{{bundle_contents_dir}}/Plugins/{{source_file_part}}",
  327. ]
  328. }
  329. bundle_data("AppRTCMobileBroadcastSetupUI_extension_bundle") {
  330. testonly = true
  331. public_deps = [
  332. ":AppRTCMobileBroadcastSetupUI",
  333. ]
  334. sources = [
  335. "$root_out_dir/AppRTCMobileBroadcastSetupUI.appex",
  336. ]
  337. outputs = [
  338. "{{bundle_contents_dir}}/Plugins/{{source_file_part}}",
  339. ]
  340. }
  341. rtc_library("AppRTCMobileBroadcastUpload_lib") {
  342. testonly = true
  343. sources = [
  344. "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.h",
  345. "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.m",
  346. ]
  347. deps = [
  348. ":apprtc_signaling",
  349. "../sdk:framework_objc+link",
  350. "../sdk:ios_framework_bundle",
  351. ]
  352. libs = [ "ReplayKit.framework" ]
  353. }
  354. ios_appex_bundle("AppRTCMobileBroadcastUpload") {
  355. testonly = true
  356. configs += [ "..:common_config" ]
  357. public_configs = [ "..:common_inherited_config" ]
  358. info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastUploadInfo.plist"
  359. deps = [
  360. ":AppRTCMobileBroadcastUpload_lib",
  361. "../sdk:framework_objc",
  362. ]
  363. }
  364. ios_appex_bundle("AppRTCMobileBroadcastSetupUI") {
  365. sources = [
  366. "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.h",
  367. "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.m",
  368. ]
  369. info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastSetupUIInfo.plist"
  370. libs = [ "ReplayKit.framework" ]
  371. deps = [
  372. ":AppRTCMobile_ios_bundle_data",
  373. ]
  374. }
  375. }
  376. bundle_data("AppRTCMobile_ios_bundle_data") {
  377. sources = [
  378. "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
  379. # Sample video taken from https://media.xiph.org/video/derf/
  380. "objc/AppRTCMobile/ios/resources/foreman.mp4",
  381. "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
  382. "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
  383. "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
  384. "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
  385. "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
  386. "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
  387. "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
  388. "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
  389. "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
  390. "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
  391. "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
  392. "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
  393. "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
  394. "objc/AppRTCMobile/ios/resources/mozart.mp3",
  395. "objc/Icon-120.png",
  396. "objc/Icon-180.png",
  397. "objc/Icon.png",
  398. ]
  399. outputs = [
  400. "{{bundle_resources_dir}}/{{source_file_part}}",
  401. ]
  402. }
  403. rtc_library("ObjCNativeAPIDemo_lib") {
  404. testonly = true
  405. sources = [
  406. "objcnativeapi/objc/NADAppDelegate.h",
  407. "objcnativeapi/objc/NADAppDelegate.m",
  408. "objcnativeapi/objc/NADViewController.h",
  409. "objcnativeapi/objc/NADViewController.mm",
  410. "objcnativeapi/objc/objc_call_client.h",
  411. "objcnativeapi/objc/objc_call_client.mm",
  412. ]
  413. deps = [
  414. "../api:libjingle_peerconnection_api",
  415. "../api:scoped_refptr",
  416. "../api/audio_codecs:builtin_audio_decoder_factory",
  417. "../api/audio_codecs:builtin_audio_encoder_factory",
  418. "../api/rtc_event_log:rtc_event_log_factory",
  419. "../api/task_queue:default_task_queue_factory",
  420. "../media:rtc_audio_video",
  421. "../modules/audio_processing",
  422. "../modules/audio_processing:api",
  423. "../pc:libjingle_peerconnection",
  424. "../rtc_base",
  425. "../sdk:base_objc",
  426. "../sdk:default_codec_factory_objc",
  427. "../sdk:helpers_objc",
  428. "../sdk:native_api",
  429. "../sdk:ui_objc",
  430. "../sdk:videocapture_objc",
  431. "../sdk:videotoolbox_objc",
  432. ]
  433. if (current_cpu == "arm64") {
  434. deps += [ "../sdk:metal_objc" ]
  435. }
  436. }
  437. ios_app_bundle("ObjCNativeAPIDemo") {
  438. testonly = true
  439. sources = [
  440. "objcnativeapi/objc/main.m",
  441. ]
  442. info_plist = "objcnativeapi/Info.plist"
  443. configs += [ "..:common_config" ]
  444. public_configs = [ "..:common_inherited_config" ]
  445. deps = [
  446. ":ObjCNativeAPIDemo_lib",
  447. ]
  448. if (target_cpu == "x86") {
  449. deps += [ "//testing/iossim" ]
  450. }
  451. }
  452. }
  453. if (is_mac) {
  454. rtc_library("AppRTCMobile_lib") {
  455. testonly = true
  456. sources = [
  457. "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
  458. "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
  459. "objc/AppRTCMobile/mac/APPRTCViewController.h",
  460. "objc/AppRTCMobile/mac/APPRTCViewController.m",
  461. ]
  462. configs += [ "..:common_objc" ]
  463. deps = [
  464. ":apprtc_common",
  465. ":apprtc_signaling",
  466. "../sdk:mac_framework_objc+link",
  467. ]
  468. }
  469. mac_app_bundle("AppRTCMobile") {
  470. testonly = true
  471. output_name = "AppRTCMobile"
  472. sources = [
  473. "objc/AppRTCMobile/mac/main.m",
  474. ]
  475. public_configs = [ "..:common_inherited_config" ]
  476. info_plist = "objc/AppRTCMobile/mac/Info.plist"
  477. libs = [ "AppKit.framework" ]
  478. ldflags = [
  479. "-rpath",
  480. "@executable_path/../Frameworks",
  481. ]
  482. deps = [
  483. ":AppRTCMobile_lib",
  484. "../sdk:mac_framework_bundle",
  485. "../sdk:mac_framework_objc+link",
  486. ]
  487. }
  488. }
  489. config("socketrocket_include_config") {
  490. include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
  491. }
  492. config("socketrocket_warning_config") {
  493. # GN orders flags on a target before flags from configs. The default config
  494. # adds these flags so to cancel them out they need to come from a config and
  495. # cannot be on the target directly.
  496. cflags = [
  497. "-Wno-deprecated-declarations",
  498. "-Wno-nonnull",
  499. "-Wno-semicolon-before-method-body",
  500. "-Wno-unused-variable",
  501. ]
  502. cflags_objc = [
  503. # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
  504. "-Wno-objc-missing-property-synthesis",
  505. ]
  506. }
  507. rtc_library("socketrocket") {
  508. testonly = true
  509. sources = [
  510. "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
  511. "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
  512. ]
  513. configs += [ ":socketrocket_warning_config" ]
  514. public_configs = [ ":socketrocket_include_config" ]
  515. libs = [
  516. "CFNetwork.framework",
  517. "Security.framework",
  518. "icucore",
  519. ]
  520. }
  521. if (rtc_include_tests) {
  522. # TODO(kthelgason): compile xctests on mac when chromium supports it.
  523. if (is_ios) {
  524. rtc_library("apprtcmobile_test_sources") {
  525. # iOS must use WebRTC.framework which is dynamically linked.
  526. testonly = true
  527. include_dirs = [
  528. "objc/AppRTCMobile",
  529. "objc/AppRTCMobile/ios",
  530. ]
  531. sources = [
  532. "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
  533. "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
  534. "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
  535. ]
  536. deps = [
  537. ":AppRTCMobile_lib",
  538. ":apprtc_signaling",
  539. "../rtc_base",
  540. "../sdk:framework_objc+link",
  541. "../sdk:ios_framework_bundle",
  542. "//build/config/ios:xctest",
  543. "//third_party/ocmock",
  544. ]
  545. }
  546. rtc_ios_xctest_test("apprtcmobile_tests") {
  547. info_plist = "objc/AppRTCMobile/ios/Info.plist"
  548. sources = [
  549. "objc/AppRTCMobile/tests/main.mm",
  550. ]
  551. deps = [
  552. ":AppRTCMobile_lib",
  553. ":apprtcmobile_test_sources",
  554. "../sdk:framework_objc",
  555. "//test:test_support",
  556. ]
  557. ldflags = [ "-all_load" ]
  558. }
  559. }
  560. }
  561. }
  562. if (is_linux || is_win) {
  563. rtc_executable("peerconnection_client") {
  564. testonly = true
  565. sources = [
  566. "peerconnection/client/conductor.cc",
  567. "peerconnection/client/conductor.h",
  568. "peerconnection/client/defaults.cc",
  569. "peerconnection/client/defaults.h",
  570. "peerconnection/client/peer_connection_client.cc",
  571. "peerconnection/client/peer_connection_client.h",
  572. ]
  573. deps = [
  574. "../api:audio_options_api",
  575. "../api:create_peerconnection_factory",
  576. "../api:libjingle_peerconnection_api",
  577. "../api:media_stream_interface",
  578. "../api:scoped_refptr",
  579. "../api/audio:audio_mixer_api",
  580. "../api/audio_codecs:audio_codecs_api",
  581. "../api/video:video_frame_i420",
  582. "../api/video:video_rtp_headers",
  583. "../api/video_codecs:video_codecs_api",
  584. "../media:rtc_media_base",
  585. "../p2p:rtc_p2p",
  586. "../rtc_base:checks",
  587. "../rtc_base/third_party/sigslot",
  588. "../system_wrappers:field_trial",
  589. "../test:field_trial",
  590. "../test:platform_video_capturer",
  591. "../test:rtp_test_utils",
  592. "//third_party/abseil-cpp/absl/memory",
  593. "//third_party/abseil-cpp/absl/types:optional",
  594. ]
  595. if (is_win) {
  596. sources += [
  597. "peerconnection/client/flag_defs.h",
  598. "peerconnection/client/main.cc",
  599. "peerconnection/client/main_wnd.cc",
  600. "peerconnection/client/main_wnd.h",
  601. ]
  602. configs += [ "//build/config/win:windowed" ]
  603. deps += [ "../media:rtc_media_base" ]
  604. }
  605. if (is_linux) {
  606. sources += [
  607. "peerconnection/client/linux/main.cc",
  608. "peerconnection/client/linux/main_wnd.cc",
  609. "peerconnection/client/linux/main_wnd.h",
  610. ]
  611. cflags = [ "-Wno-deprecated-declarations" ]
  612. libs = [
  613. "X11",
  614. "Xcomposite",
  615. "Xext",
  616. "Xrender",
  617. ]
  618. deps += [ "//build/config/linux/gtk" ]
  619. }
  620. deps += [
  621. "../api:libjingle_peerconnection_api",
  622. "../api/audio_codecs:builtin_audio_decoder_factory",
  623. "../api/audio_codecs:builtin_audio_encoder_factory",
  624. "../api/video:video_frame",
  625. "../api/video:video_rtp_headers",
  626. "../api/video_codecs:builtin_video_decoder_factory",
  627. "../api/video_codecs:builtin_video_encoder_factory",
  628. "../media:rtc_audio_video",
  629. "../modules/audio_device",
  630. "../modules/audio_processing",
  631. "../modules/audio_processing:api",
  632. "../modules/video_capture:video_capture_module",
  633. "../pc:libjingle_peerconnection",
  634. "../pc:peerconnection",
  635. "../rtc_base",
  636. "../rtc_base:rtc_base_approved",
  637. "../rtc_base:rtc_json",
  638. "../test:video_test_common",
  639. "//third_party/abseil-cpp/absl/flags:flag",
  640. "//third_party/abseil-cpp/absl/flags:parse",
  641. "//third_party/libyuv",
  642. ]
  643. }
  644. rtc_executable("peerconnection_server") {
  645. testonly = true
  646. sources = [
  647. "peerconnection/server/data_socket.cc",
  648. "peerconnection/server/data_socket.h",
  649. "peerconnection/server/main.cc",
  650. "peerconnection/server/peer_channel.cc",
  651. "peerconnection/server/peer_channel.h",
  652. "peerconnection/server/utils.cc",
  653. "peerconnection/server/utils.h",
  654. ]
  655. deps = [
  656. "../rtc_base:rtc_base_approved",
  657. "../system_wrappers:field_trial",
  658. "../test:field_trial",
  659. "//third_party/abseil-cpp/absl/flags:flag",
  660. "//third_party/abseil-cpp/absl/flags:parse",
  661. "//third_party/abseil-cpp/absl/flags:usage",
  662. ]
  663. }
  664. rtc_executable("relayserver") {
  665. testonly = true
  666. sources = [
  667. "relayserver/relayserver_main.cc",
  668. ]
  669. deps = [
  670. "../p2p:p2p_server_utils",
  671. "../p2p:rtc_p2p",
  672. "../pc:rtc_pc",
  673. "../rtc_base",
  674. "../rtc_base:rtc_base_approved",
  675. ]
  676. }
  677. rtc_executable("turnserver") {
  678. testonly = true
  679. sources = [
  680. "turnserver/turnserver_main.cc",
  681. ]
  682. deps = [
  683. ":read_auth_file",
  684. "../p2p:p2p_server_utils",
  685. "../p2p:rtc_p2p",
  686. "../pc:rtc_pc",
  687. "../rtc_base",
  688. "../rtc_base:rtc_base_approved",
  689. ]
  690. }
  691. rtc_executable("stunserver") {
  692. testonly = true
  693. sources = [
  694. "stunserver/stunserver_main.cc",
  695. ]
  696. deps = [
  697. "../p2p:p2p_server_utils",
  698. "../p2p:rtc_p2p",
  699. "../pc:rtc_pc",
  700. "../rtc_base",
  701. "../rtc_base:rtc_base_approved",
  702. ]
  703. }
  704. }
  705. if (is_win || is_android) {
  706. rtc_shared_library("webrtc_unity_plugin") {
  707. testonly = true
  708. sources = [
  709. "unityplugin/simple_peer_connection.cc",
  710. "unityplugin/simple_peer_connection.h",
  711. "unityplugin/unity_plugin_apis.cc",
  712. "unityplugin/unity_plugin_apis.h",
  713. "unityplugin/video_observer.cc",
  714. "unityplugin/video_observer.h",
  715. ]
  716. if (is_android) {
  717. sources += [
  718. "unityplugin/class_reference_holder.cc",
  719. "unityplugin/class_reference_holder.h",
  720. "unityplugin/jni_onload.cc",
  721. ]
  722. suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
  723. }
  724. if (is_win) {
  725. configs += [ "//build/config/win:windowed" ]
  726. }
  727. deps = [
  728. "../api:create_peerconnection_factory",
  729. "../api:libjingle_peerconnection_api",
  730. "../api:media_stream_interface",
  731. "../api/audio_codecs:builtin_audio_decoder_factory",
  732. "../api/audio_codecs:builtin_audio_encoder_factory",
  733. "../api/video:video_frame",
  734. "../api/video:video_rtp_headers",
  735. "../media:rtc_audio_video",
  736. "../media:rtc_internal_video_codecs",
  737. "../media:rtc_media",
  738. "../media:rtc_media_base",
  739. "../modules/audio_device",
  740. "../modules/audio_processing",
  741. "../modules/audio_processing:api",
  742. "../modules/video_capture:video_capture_module",
  743. "../pc:libjingle_peerconnection",
  744. "../pc:peerconnection",
  745. "../rtc_base",
  746. "../test:platform_video_capturer",
  747. "../test:video_test_common",
  748. "//third_party/abseil-cpp/absl/memory",
  749. ]
  750. if (is_android) {
  751. deps += [
  752. "../modules/utility",
  753. "../sdk/android:libjingle_peerconnection_jni",
  754. ]
  755. }
  756. }
  757. }
  758. if (is_android) {
  759. rtc_android_library("webrtc_unity_java") {
  760. java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
  761. deps = [
  762. "../rtc_base:base_java",
  763. "../sdk/android:camera_java",
  764. "../sdk/android:libjingle_peerconnection_java",
  765. "../sdk/android:peerconnection_java",
  766. "../sdk/android:video_java",
  767. "//third_party/android_deps:com_android_support_support_annotations_java",
  768. ]
  769. }
  770. dist_jar("libwebrtc_unity") {
  771. _target_dir_name = get_label_info(":$target_name", "dir")
  772. output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
  773. direct_deps_only = false
  774. use_interface_jars = false
  775. use_unprocessed_jars = false
  776. requires_android = true
  777. deps = [
  778. ":webrtc_unity_java",
  779. "../rtc_base:base_java",
  780. "../sdk/android:libjingle_peerconnection_java",
  781. "../sdk/android:libjingle_peerconnection_metrics_default_java",
  782. "//third_party/android_deps:com_android_support_support_annotations_java",
  783. ]
  784. }
  785. }
  786. if (!build_with_chromium) {
  787. # Doesn't build within Chrome on Win.
  788. rtc_executable("stun_prober") {
  789. testonly = true
  790. sources = [
  791. "stunprober/main.cc",
  792. ]
  793. deps = [
  794. "../p2p:libstunprober",
  795. "../p2p:rtc_p2p",
  796. "../rtc_base",
  797. "../rtc_base:checks",
  798. "../rtc_base:rtc_base_approved",
  799. "//third_party/abseil-cpp/absl/flags:flag",
  800. "//third_party/abseil-cpp/absl/flags:parse",
  801. ]
  802. }
  803. }