summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/examples/androidvoip/BUILD.gn
blob: d390815406ab102c156f72e42533ca3973135857 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS.  All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

import("//webrtc.gni")

if (is_android) {
  import("//third_party/jni_zero/jni_zero.gni")
  rtc_android_apk("androidvoip") {
    testonly = true
    apk_name = "androidvoip"
    android_manifest = "AndroidManifest.xml"
    min_sdk_version = 21
    target_sdk_version = 31

    sources = [
      "java/org/webrtc/examples/androidvoip/MainActivity.java",
      "java/org/webrtc/examples/androidvoip/OnVoipClientTaskCompleted.java",
      "java/org/webrtc/examples/androidvoip/VoipClient.java",
    ]

    deps = [
      ":resources",
      "//rtc_base:base_java",
      "//sdk/android:base_java",
      "//sdk/android:java_audio_device_module_java",
      "//sdk/android:video_java",
      "//third_party/androidx:androidx_core_core_java",
      "//third_party/androidx:androidx_legacy_legacy_support_v4_java",
    ]

    shared_libraries = [ ":examples_androidvoip_jni" ]
  }

  generate_jni("generated_jni") {
    testonly = true
    sources = [ "java/org/webrtc/examples/androidvoip/VoipClient.java" ]
    namespace = "webrtc_examples"
    jni_generator_include = "//sdk/android/src/jni/jni_generator_helper.h"
  }

  rtc_shared_library("examples_androidvoip_jni") {
    testonly = true
    sources = [
      "jni/android_voip_client.cc",
      "jni/android_voip_client.h",
      "jni/onload.cc",
    ]

    suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
    configs += [ "//build/config/android:hide_all_but_jni" ]

    deps = [
      ":generated_jni",
      "../../rtc_base:async_packet_socket",
      "../../rtc_base:async_udp_socket",
      "../../rtc_base:logging",
      "../../rtc_base:network",
      "../../rtc_base:socket_address",
      "../../rtc_base:socket_server",
      "../../rtc_base:ssl",
      "../../rtc_base:threading",
      "//api:transport_api",
      "//api/audio_codecs:audio_codecs_api",
      "//api/audio_codecs:builtin_audio_decoder_factory",
      "//api/audio_codecs:builtin_audio_encoder_factory",
      "//api/task_queue:default_task_queue_factory",
      "//api/voip:voip_api",
      "//api/voip:voip_engine_factory",
      "//rtc_base/network:received_packet",
      "//sdk/android:native_api_audio_device_module",
      "//sdk/android:native_api_base",
      "//sdk/android:native_api_jni",
      "//third_party/abseil-cpp/absl/memory:memory",
    ]
  }

  android_resources("resources") {
    testonly = true
    custom_package = "org.webrtc.examples.androidvoip"
    sources = [
      "res/layout/activity_main.xml",
      "res/values/colors.xml",
      "res/values/strings.xml",
    ]

    # Needed for Bazel converter.
    resource_dirs = [ "res" ]
    assert(resource_dirs != [])  # Mark as used.
  }
}