blob: de3c3c9e9581018df7d02627aa175f98a5d70c44 [file] [log] [blame]
# Copyright (c) 2016 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")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
group("android") {
if (!build_with_chromium && is_android) {
public_deps = [
":libjingle_peerconnection_datachannelonly_so",
":libjingle_peerconnection_jni",
":libjingle_peerconnection_so",
":libwebrtc",
]
}
}
config("libjingle_peerconnection_jni_warnings_config") {
# The warnings below are enabled by default. Since GN orders compiler flags
# for a target before flags from configs, the only way to disable such
# warnings is by having them in a separate config, loaded from the target.
if (!is_win) {
cflags = [
"-Wno-sign-compare",
"-Wno-unused-variable",
]
}
}
rtc_source_set("base_jni") {
sources = [
"src/jni/androidhistogram_jni.cc",
"src/jni/classreferenceholder.cc",
"src/jni/classreferenceholder.h",
"src/jni/jni_common.cc",
"src/jni/jni_helpers.cc",
"src/jni/jni_helpers.h",
"src/jni/pc/audio_jni.h",
"src/jni/pc/media_jni.h",
"src/jni/pc/video_jni.h",
]
deps = [
"../../api:libjingle_peerconnection_api",
"../../rtc_base:rtc_base",
"../../rtc_base:rtc_base_approved",
"../../system_wrappers:metrics_api",
]
if (is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [
"//build/config/clang:extra_warnings",
"//build/config/clang:find_bad_constructs",
]
}
}
rtc_static_library("audio_jni") {
sources = [
"src/jni/pc/audio_jni.cc",
]
deps = [
":base_jni",
"../../api/audio_codecs:builtin_audio_decoder_factory",
"../../api/audio_codecs:builtin_audio_encoder_factory",
"../../voice_engine:voice_engine",
]
}
rtc_static_library("null_audio_jni") {
sources = [
"src/jni/pc/null_audio_jni.cc",
]
deps = [
":base_jni",
]
}
rtc_static_library("video_jni") {
sources = [
"src/jni/androidmediacodeccommon.h",
"src/jni/androidmediadecoder_jni.cc",
"src/jni/androidmediadecoder_jni.h",
"src/jni/androidmediaencoder_jni.cc",
"src/jni/androidmediaencoder_jni.h",
"src/jni/androidvideotracksource.cc",
"src/jni/androidvideotracksource.h",
"src/jni/androidvideotracksource_jni.cc",
"src/jni/filevideocapturer_jni.cc",
"src/jni/native_handle_impl.cc",
"src/jni/native_handle_impl.h",
"src/jni/nv12buffer_jni.cc",
"src/jni/nv21buffer_jni.cc",
"src/jni/pc/video_jni.cc",
"src/jni/surfacetexturehelper_jni.cc",
"src/jni/surfacetexturehelper_jni.h",
"src/jni/video_renderer_jni.cc",
"src/jni/videodecoderfactorywrapper.cc",
"src/jni/videodecoderfactorywrapper.h",
"src/jni/videodecoderwrapper.cc",
"src/jni/videodecoderwrapper.h",
"src/jni/videoencoderfactorywrapper.cc",
"src/jni/videoencoderfactorywrapper.h",
"src/jni/videoencoderwrapper.cc",
"src/jni/videoencoderwrapper.h",
"src/jni/videofilerenderer_jni.cc",
"src/jni/videoframe_jni.cc",
"src/jni/videotrack_jni.cc",
"src/jni/wrapped_native_i420_buffer.cc",
"src/jni/wrapped_native_i420_buffer.h",
]
configs += [ ":libjingle_peerconnection_jni_warnings_config" ]
if (is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [
"//build/config/clang:extra_warnings",
"//build/config/clang:find_bad_constructs",
]
}
# TODO(jschuh): Bug 1348: fix this warning.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
if (is_win) {
cflags += [
"/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch.
"/wd4389", # signed/unsigned mismatch.
]
}
deps = [
":base_jni",
":peerconnection_jni",
"../..:webrtc_common",
"../../api:libjingle_peerconnection_api",
"../../api:video_frame_api",
"../../api/video_codecs:video_codecs_api",
"../../common_video:common_video",
"../../media:rtc_audio_video",
"../../media:rtc_media_base",
"../../modules:module_api",
"../../modules/utility:utility",
"../../modules/video_coding:codec_globals_headers",
"../../modules/video_coding:video_coding_utility",
"../../rtc_base:rtc_base",
"../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_task_queue",
"../../rtc_base:sequenced_task_checker",
"../../rtc_base:weak_ptr",
"../../system_wrappers:system_wrappers",
]
if (rtc_build_libyuv) {
deps += [ "$rtc_libyuv_dir" ]
public_deps = [
"$rtc_libyuv_dir",
]
} else {
# Need to add a directory normally exported by libyuv.
include_dirs = [ "$rtc_libyuv_dir/include" ]
}
}
rtc_static_library("null_video_jni") {
sources = [
"src/jni/pc/null_video_jni.cc",
]
deps = [
":base_jni",
]
}
rtc_static_library("media_jni") {
sources = [
"src/jni/pc/media_jni.cc",
]
deps = [
":base_jni",
"../../call:call_interfaces",
"../../logging:rtc_event_log_api",
"../../media:rtc_audio_video",
"../../modules/audio_processing:audio_processing",
]
if (is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [
"//build/config/clang:extra_warnings",
"//build/config/clang:find_bad_constructs",
]
}
}
rtc_static_library("null_media_jni") {
sources = [
"src/jni/pc/null_media_jni.cc",
]
deps = [
":base_jni",
]
}
rtc_static_library("peerconnection_jni") {
sources = [
"src/jni/androidnetworkmonitor_jni.h",
"src/jni/pc/androidnetworkmonitor_jni.cc",
"src/jni/pc/androidnetworkmonitor_jni.h",
"src/jni/pc/audiotrack_jni.cc",
"src/jni/pc/callsessionfilerotatinglogsink_jni.cc",
"src/jni/pc/datachannel_jni.cc",
"src/jni/pc/datachannelobserver_jni.cc",
"src/jni/pc/datachannelobserver_jni.h",
"src/jni/pc/dtmfsender_jni.cc",
"src/jni/pc/java_native_conversion.cc",
"src/jni/pc/java_native_conversion.h",
"src/jni/pc/logging_jni.cc",
"src/jni/pc/mediaconstraints_jni.cc",
"src/jni/pc/mediaconstraints_jni.h",
"src/jni/pc/mediasource_jni.cc",
"src/jni/pc/mediastream_jni.cc",
"src/jni/pc/mediastreamtrack_jni.cc",
"src/jni/pc/ownedfactoryandthreads.cc",
"src/jni/pc/ownedfactoryandthreads.h",
"src/jni/pc/peerconnection_jni.cc",
"src/jni/pc/peerconnectionfactory_jni.cc",
"src/jni/pc/peerconnectionobserver_jni.cc",
"src/jni/pc/peerconnectionobserver_jni.h",
"src/jni/pc/rtcstatscollectorcallbackwrapper.cc",
"src/jni/pc/rtcstatscollectorcallbackwrapper.h",
"src/jni/pc/rtpreceiver_jni.cc",
"src/jni/pc/rtpreceiverobserver_jni.cc",
"src/jni/pc/rtpreceiverobserver_jni.h",
"src/jni/pc/rtpsender_jni.cc",
"src/jni/pc/sdpobserver_jni.h",
"src/jni/pc/statsobserver_jni.cc",
"src/jni/pc/statsobserver_jni.h",
]
configs += [ ":libjingle_peerconnection_jni_warnings_config" ]
if (is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [
"//build/config/clang:extra_warnings",
"//build/config/clang:find_bad_constructs",
]
}
# TODO(jschuh): Bug 1348: fix this warning.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
if (is_win) {
cflags += [
"/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatch.
"/wd4389", # signed/unsigned mismatch.
]
}
deps = [
":base_jni",
"../..:webrtc_common",
"../../media:rtc_data",
"../../media:rtc_media_base",
"../../modules/utility:utility",
"../../pc:peerconnection",
"../../rtc_base:rtc_base",
"../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_task_queue",
"../../system_wrappers:system_wrappers",
]
}
rtc_static_library("libjingle_peerconnection_jni") {
public_deps = [
":audio_jni",
":base_jni",
":media_jni",
":peerconnection_jni",
":video_jni",
"../../pc:create_pc_factory",
]
}
rtc_static_library("libjingle_peerconnection_metrics_default_jni") {
sources = [
"src/jni/androidmetrics_jni.cc",
]
configs += [ ":libjingle_peerconnection_jni_warnings_config" ]
deps = [
":base_jni",
":peerconnection_jni",
"../../pc:peerconnection",
"../../system_wrappers",
"../../system_wrappers:field_trial_default",
"../../system_wrappers:metrics_default",
]
}
# The modular build targets can be used to build WebRTC with different
# functionalities. The users can choose either the real implemenation or the
# null implementation of the audio/video modules based on their requirments.
rtc_shared_library("libjingle_peerconnection_datachannelonly_so") {
sources = [
"src/jni/jni_onload.cc",
]
suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ "//build/config/android:hide_all_but_jni" ]
deps = [
":base_jni",
":libjingle_peerconnection_metrics_default_jni",
":null_audio_jni",
":null_media_jni",
":null_video_jni",
":peerconnection_jni",
"../../pc:peerconnection",
"../../rtc_base:rtc_base",
"../../rtc_base:rtc_base_approved",
]
output_extension = "so"
}
rtc_shared_library("libjingle_peerconnection_so") {
sources = [
"src/jni/jni_onload.cc",
]
suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ "//build/config/android:hide_all_but_jni" ]
deps = [
":libjingle_peerconnection_jni",
":libjingle_peerconnection_metrics_default_jni",
"../../pc:libjingle_peerconnection",
"../../rtc_base:rtc_base",
]
output_extension = "so"
}
dist_jar("libwebrtc") {
_target_dir_name = get_label_info(":$target_name", "dir")
output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
direct_deps_only = true
use_interface_jars = false
deps = [
":libjingle_peerconnection_java",
":libjingle_peerconnection_metrics_default_java",
"../../modules/audio_device:audio_device_java",
"../../rtc_base:base_java",
]
}
android_library("libjingle_peerconnection_java") {
java_files = [
"api/org/webrtc/AudioSource.java",
"api/org/webrtc/AudioTrack.java",
"api/org/webrtc/CallSessionFileRotatingLogSink.java",
"api/org/webrtc/Camera1Capturer.java",
"api/org/webrtc/Camera1Enumerator.java",
"api/org/webrtc/Camera2Capturer.java",
"api/org/webrtc/Camera2Enumerator.java",
"api/org/webrtc/CameraEnumerationAndroid.java",
"api/org/webrtc/CameraEnumerator.java",
"api/org/webrtc/CameraVideoCapturer.java",
"api/org/webrtc/DataChannel.java",
"api/org/webrtc/DtmfSender.java",
"api/org/webrtc/EglBase.java",
"api/org/webrtc/EglRenderer.java",
"api/org/webrtc/EncodedImage.java",
"api/org/webrtc/FileVideoCapturer.java",
"api/org/webrtc/GlRectDrawer.java",
"api/org/webrtc/GlShader.java",
"api/org/webrtc/GlTextureFrameBuffer.java",
"api/org/webrtc/GlUtil.java",
"api/org/webrtc/HardwareVideoDecoderFactory.java",
"api/org/webrtc/HardwareVideoEncoderFactory.java",
"api/org/webrtc/IceCandidate.java",
"api/org/webrtc/MediaCodecVideoDecoder.java",
"api/org/webrtc/MediaCodecVideoEncoder.java",
"api/org/webrtc/MediaConstraints.java",
"api/org/webrtc/MediaSource.java",
"api/org/webrtc/MediaStream.java",
"api/org/webrtc/MediaStreamTrack.java",
"api/org/webrtc/NetworkMonitor.java",
"api/org/webrtc/NetworkMonitorAutoDetect.java",
"api/org/webrtc/PeerConnection.java",
"api/org/webrtc/PeerConnectionFactory.java",
"api/org/webrtc/RendererCommon.java",
"api/org/webrtc/RTCStats.java",
"api/org/webrtc/RTCStatsCollectorCallback.java",
"api/org/webrtc/RTCStatsReport.java",
"api/org/webrtc/RtpParameters.java",
"api/org/webrtc/RtpReceiver.java",
"api/org/webrtc/RtpSender.java",
"api/org/webrtc/ScreenCapturerAndroid.java",
"api/org/webrtc/SdpObserver.java",
"api/org/webrtc/SessionDescription.java",
"api/org/webrtc/StatsObserver.java",
"api/org/webrtc/StatsReport.java",
"api/org/webrtc/SurfaceTextureHelper.java",
"api/org/webrtc/SurfaceViewRenderer.java",
"api/org/webrtc/VideoCapturer.java",
"api/org/webrtc/VideoCodecInfo.java",
"api/org/webrtc/VideoCodecStatus.java",
"api/org/webrtc/VideoDecoder.java",
"api/org/webrtc/VideoDecoderFactory.java",
"api/org/webrtc/VideoEncoder.java",
"api/org/webrtc/VideoEncoderFactory.java",
"api/org/webrtc/VideoFileRenderer.java",
"api/org/webrtc/VideoFrame.java",
"api/org/webrtc/VideoFrameDrawer.java",
"api/org/webrtc/VideoRenderer.java",
"api/org/webrtc/VideoSink.java",
"api/org/webrtc/VideoSource.java",
"api/org/webrtc/VideoTrack.java",
"src/java/org/webrtc/AndroidVideoTrackSourceObserver.java",
"src/java/org/webrtc/BaseBitrateAdjuster.java",
"src/java/org/webrtc/BitrateAdjuster.java",
"src/java/org/webrtc/Camera1Session.java",
"src/java/org/webrtc/Camera2Session.java",
"src/java/org/webrtc/CameraCapturer.java",
"src/java/org/webrtc/CameraSession.java",
"src/java/org/webrtc/DynamicBitrateAdjuster.java",
"src/java/org/webrtc/EglBase10.java",
"src/java/org/webrtc/EglBase14.java",
"src/java/org/webrtc/FramerateBitrateAdjuster.java",
"src/java/org/webrtc/HardwareVideoDecoder.java",
"src/java/org/webrtc/HardwareVideoEncoder.java",
"src/java/org/webrtc/Histogram.java",
"src/java/org/webrtc/I420BufferImpl.java",
"src/java/org/webrtc/JniCommon.java",
"src/java/org/webrtc/MediaCodecUtils.java",
"src/java/org/webrtc/NV12Buffer.java",
"src/java/org/webrtc/NV21Buffer.java",
"src/java/org/webrtc/TextureBufferImpl.java",
"src/java/org/webrtc/VideoCodecType.java",
"src/java/org/webrtc/VideoDecoderWrapperCallback.java",
"src/java/org/webrtc/VideoEncoderWrapperCallback.java",
"src/java/org/webrtc/WrappedNativeI420Buffer.java",
"src/java/org/webrtc/YuvConverter.java",
]
deps = [
"../../modules/audio_device:audio_device_java",
"../../rtc_base:base_java",
]
# TODO(sakal): Fix build hooks crbug.com/webrtc/8148
no_build_hooks = true
}
android_library("libjingle_peerconnection_metrics_default_java") {
java_files = [ "api/org/webrtc/Metrics.java" ]
deps = [
"../../rtc_base:base_java",
]
# TODO(sakal): Fix build hooks crbug.com/webrtc/8148
no_build_hooks = true
}
if (rtc_include_tests) {
instrumentation_test_apk("libjingle_peerconnection_android_unittest") {
apk_name = "libjingle_peerconnection_android_unittest"
android_manifest = "instrumentationtests/AndroidManifest.xml"
java_files = [
"instrumentationtests/src/org/webrtc/Camera1CapturerUsingByteBufferTest.java",
"instrumentationtests/src/org/webrtc/Camera1CapturerUsingTextureTest.java",
"instrumentationtests/src/org/webrtc/Camera2CapturerTest.java",
"instrumentationtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java",
"instrumentationtests/src/org/webrtc/EglRendererTest.java",
"instrumentationtests/src/org/webrtc/FileVideoCapturerTest.java",
"instrumentationtests/src/org/webrtc/GlRectDrawerTest.java",
"instrumentationtests/src/org/webrtc/HardwareVideoEncoderTest.java",
"instrumentationtests/src/org/webrtc/HardwareVideoDecoderTest.java",
"instrumentationtests/src/org/webrtc/MediaCodecVideoEncoderTest.java",
"instrumentationtests/src/org/webrtc/NetworkMonitorTest.java",
"instrumentationtests/src/org/webrtc/PeerConnectionTest.java",
"instrumentationtests/src/org/webrtc/RendererCommonTest.java",
"instrumentationtests/src/org/webrtc/SurfaceTextureHelperTest.java",
"instrumentationtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java",
"instrumentationtests/src/org/webrtc/VideoFileRendererTest.java",
"instrumentationtests/src/org/webrtc/WebRtcJniBootTest.java",
]
data = [
"../../sdk/android/instrumentationtests/src/org/webrtc/capturetestvideo.y4m",
]
deps = [
"../../rtc_base:base_java",
"../../sdk/android:libjingle_peerconnection_java",
"../../sdk/android:libjingle_peerconnection_metrics_default_java",
"//base:base_java",
"//base:base_java_test_support",
"//third_party/android_support_test_runner:rules_java",
"//third_party/android_support_test_runner:runner_java",
"//third_party/junit",
]
shared_libraries = [ "../../sdk/android:libjingle_peerconnection_so" ]
# TODO(sakal): Fix build hooks crbug.com/webrtc/8148
no_build_hooks = true
}
}