blob: ddebdcea1f7f5bf3173991af482aa12a9a0aa7c8 [file] [log] [blame]
# Copyright 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")
if (is_ios) {
import("//build/config/ios/rules.gni")
import("//build/config/ios/ios_sdk.gni")
}
declare_args() {
# Determine whether or not to include metal rendering
rtc_use_metal_rendering = is_mac || (is_ios && current_cpu == "arm64")
}
group("sdk") {
public_deps = []
if (!build_with_chromium) {
if (is_android) {
public_deps += [ "android" ]
}
if (is_ios) {
public_deps += [ ":framework_objc" ]
}
}
}
if (is_ios || is_mac) {
config("common_config_objc") {
include_dirs = [
"objc/Framework/Classes",
"objc/Framework/Classes/Audio",
"objc/Framework/Classes/Common",
"objc/Framework/Classes/Metal",
"objc/Framework/Classes/PeerConnection",
"objc/Framework/Classes/UI",
"objc/Framework/Classes/Video",
"objc/Framework/Classes/VideoToolbox",
"objc/Framework/Headers",
]
cflags = [
"-Wstrict-overflow",
"-Wmissing-field-initializers",
]
}
rtc_static_library("common_objc") {
sources = [
"objc/Framework/Classes/Common/NSString+StdString.h",
"objc/Framework/Classes/Common/NSString+StdString.mm",
"objc/Framework/Classes/Common/RTCDispatcher+Private.h",
"objc/Framework/Classes/Common/RTCDispatcher.m",
"objc/Framework/Classes/Common/RTCFieldTrials.mm",
"objc/Framework/Classes/Common/RTCLogging.mm",
"objc/Framework/Classes/Common/RTCUIApplicationStatusObserver.h",
"objc/Framework/Classes/Common/RTCUIApplicationStatusObserver.m",
"objc/Framework/Classes/Common/helpers.h",
"objc/Framework/Classes/Common/helpers.mm",
"objc/Framework/Classes/Common/scoped_cftyperef.h",
"objc/Framework/Headers/WebRTC/RTCDispatcher.h",
"objc/Framework/Headers/WebRTC/RTCFieldTrials.h",
"objc/Framework/Headers/WebRTC/RTCLogging.h",
"objc/Framework/Headers/WebRTC/RTCMacros.h",
]
deps = [
"../rtc_base:checks",
"../rtc_base:rtc_base",
]
configs += [ "..:common_objc" ]
public_configs = [ ":common_config_objc" ]
if (is_ios) {
sources += [
"objc/Framework/Classes/Common/UIDevice+RTCDevice.mm",
"objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h",
]
}
if (!build_with_chromium) {
sources += [
"objc/Framework/Classes/Common/RTCCallbackLogger.mm",
"objc/Framework/Classes/Common/RTCFileLogger.mm",
"objc/Framework/Headers/WebRTC/RTCCallbackLogger.h",
"objc/Framework/Headers/WebRTC/RTCFileLogger.h",
]
}
}
if (!build_with_chromium) {
rtc_static_library("audio_objc") {
sources = [
"objc/Framework/Classes/Audio/RTCAudioSession+Configuration.mm",
"objc/Framework/Classes/Audio/RTCAudioSession+Private.h",
"objc/Framework/Classes/Audio/RTCAudioSession.mm",
"objc/Framework/Classes/Audio/RTCAudioSessionConfiguration.m",
"objc/Framework/Headers/WebRTC/RTCAudioSession.h",
"objc/Framework/Headers/WebRTC/RTCAudioSessionConfiguration.h",
]
configs += [ "..:common_objc" ]
public_configs = [ ":common_config_objc" ]
deps = [
":common_objc",
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
]
if (is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
# Keep videotracksource related code in a separate target so that we can
# build PeerConnectionFactory without audio/video support when that's called
# for.
rtc_static_library("videotracksource_objc") {
sources = [
"objc/Framework/Classes/Video/RTCCVPixelBuffer.mm",
"objc/Framework/Classes/Video/RTCI420Buffer+Private.h",
"objc/Framework/Classes/Video/RTCI420Buffer.mm",
"objc/Framework/Classes/Video/objcvideotracksource.h",
"objc/Framework/Classes/Video/objcvideotracksource.mm",
"objc/Framework/Headers/WebRTC/RTCVideoFrameBuffer.h",
]
deps = [
":common_objc",
":native_video",
"../api:libjingle_peerconnection_api",
"../api:video_frame_api",
"../api:video_frame_api_i420",
"../common_video",
"../media:rtc_media_base",
"../rtc_base:checks",
"../rtc_base:rtc_base",
"//third_party/libyuv",
]
configs += [ "..:common_objc" ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
rtc_static_library("video_objc") {
sources = [
"objc/Framework/Classes/Video/AVCaptureSession+DevicePosition.h",
"objc/Framework/Classes/Video/AVCaptureSession+DevicePosition.mm",
"objc/Framework/Classes/Video/RTCDefaultShader.h",
"objc/Framework/Classes/Video/RTCDefaultShader.mm",
"objc/Framework/Classes/Video/RTCI420TextureCache.h",
"objc/Framework/Classes/Video/RTCI420TextureCache.mm",
"objc/Framework/Classes/Video/RTCOpenGLDefines.h",
"objc/Framework/Classes/Video/RTCShader.h",
"objc/Framework/Classes/Video/RTCShader.mm",
]
libs = []
if (is_ios) {
sources += [
"objc/Framework/Classes/Video/RTCNV12TextureCache.h",
"objc/Framework/Classes/Video/RTCNV12TextureCache.m",
]
libs += [
"GLKit.framework",
"OpenGLES.framework",
"QuartzCore.framework",
]
} else if (is_mac) {
sources += []
libs += [
"CoreMedia.framework",
"CoreVideo.framework",
"OpenGL.framework",
]
}
deps = [
":common_objc",
":native_video",
":videotracksource_objc",
"../api:libjingle_peerconnection_api",
"../api:optional",
"../api:video_frame_api",
"../common_video",
"../media:rtc_media_base",
"../rtc_base:checks",
"../rtc_base:rtc_base",
]
configs += [ "..:common_objc" ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
rtc_static_library("ui_objc") {
visibility = [ "*" ]
if (is_ios) {
sources = [
"objc/Framework/Classes/UI/RTCCameraPreviewView.m",
"objc/Framework/Classes/UI/RTCEAGLVideoView.m",
"objc/Framework/Headers/WebRTC/RTCCameraPreviewView.h",
"objc/Framework/Headers/WebRTC/RTCEAGLVideoView.h",
]
}
if (is_mac) {
sources = [
"objc/Framework/Classes/UI/RTCNSGLVideoView.m",
"objc/Framework/Headers/WebRTC/RTCNSGLVideoView.h",
]
}
configs += [ "..:common_objc" ]
deps = [
":common_objc",
":peerconnection_objc",
]
}
if (rtc_use_metal_rendering) {
rtc_static_library("metal_objc") {
sources = [
"objc/Framework/Classes/Metal/RTCMTLI420Renderer.h",
"objc/Framework/Classes/Metal/RTCMTLI420Renderer.mm",
"objc/Framework/Classes/Metal/RTCMTLRenderer+Private.h",
"objc/Framework/Classes/Metal/RTCMTLRenderer.h",
"objc/Framework/Classes/Metal/RTCMTLRenderer.mm",
]
if (is_ios) {
sources += [
"objc/Framework/Classes/Metal/RTCMTLNV12Renderer.h",
"objc/Framework/Classes/Metal/RTCMTLNV12Renderer.mm",
"objc/Framework/Classes/Metal/RTCMTLVideoView.m",
"objc/Framework/Headers/WebRTC/RTCMTLVideoView.h",
]
}
if (is_mac) {
sources += [
"objc/Framework/Classes/Metal/RTCMTLNSVideoView.m",
"objc/Framework/Headers/WebRTC/RTCMTLNSVideoView.h",
]
}
libs = [
"CoreVideo.framework",
"Metal.framework",
"MetalKit.framework",
]
deps = [
":video_objc",
"../api:video_frame_api",
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
]
configs += [ "..:common_objc" ]
public_configs = [ ":common_config_objc" ]
}
}
rtc_static_library("peerconnection_objc") {
visibility = [ "*" ]
sources = [
"objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m",
"objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h",
]
if (is_ios) {
sources += [
"objc/Framework/Classes/PeerConnection/RTCFileVideoCapturer.m",
"objc/Framework/Headers/WebRTC/RTCFileVideoCapturer.h",
]
}
libs = [ "AVFoundation.framework" ]
if (is_ios) {
libs += [ "CoreGraphics.framework" ]
}
configs += [ "..:common_objc" ]
public_configs = [ ":common_config_objc" ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
deps = [
":common_objc",
":peerconnectionfactory_objc",
":video_objc",
"../api:video_frame_api",
"../media:rtc_media_base",
"../pc:libjingle_peerconnection",
"../rtc_base:rtc_base",
]
if (rtc_use_metal_rendering) {
deps += [ ":metal_objc" ]
}
}
rtc_static_library("peerconnectionfactory_objc") {
sources = []
deps = []
sources += [
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Native.h",
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Private.h",
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm",
"objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm",
]
public_configs = [ ":common_config_objc" ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
deps += [
":common_objc",
":default_codec_factory_objc",
":native_api",
":native_video",
":peerconnectionfactory_base_objc",
":video_objc",
":videotoolbox_objc",
":videotracksource_objc",
"../api:libjingle_peerconnection_api",
"../api:peerconnection_and_implicit_call_api",
"../api:video_frame_api",
"../api/audio_codecs:builtin_audio_decoder_factory",
"../api/audio_codecs:builtin_audio_encoder_factory",
"../api/video_codecs:video_codecs_api",
"../media:rtc_audio_video",
"../media:rtc_media_base",
"../pc:create_pc_factory",
"../pc:peerconnection",
"../rtc_base:rtc_base",
"../system_wrappers:field_trial_api",
]
}
rtc_static_library("default_codec_factory_objc") {
sources = [
"objc/Framework/Classes/PeerConnection/RTCDefaultVideoDecoderFactory.m",
"objc/Framework/Classes/PeerConnection/RTCDefaultVideoEncoderFactory.m",
]
deps = [
":common_objc",
]
if (rtc_use_builtin_sw_codecs) {
deps += [
":vp8",
":vp9",
]
}
}
rtc_static_library("vp8") {
sources = [
"objc/Framework/Classes/PeerConnection/RTCVideoCodecVP8.mm",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
deps = [
":peerconnectionfactory_base_objc",
"../modules/video_coding:webrtc_vp8",
"../system_wrappers:metrics_default",
]
}
rtc_static_library("vp9") {
sources = [
"objc/Framework/Classes/PeerConnection/RTCVideoCodecVP9.mm",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
deps = [
":peerconnectionfactory_base_objc",
"../modules/video_coding:webrtc_vp9",
"../system_wrappers:metrics_default",
]
}
# Build the PeerConnectionFactory without audio/video support.
# This target depends on the objc_peeerconnectionfactory_base which still
# includes some audio/video related objects such as RTCAudioSource because
# these objects are just thin wrappers of native C++ interfaces required
# when implementing webrtc::PeerConnectionFactoryInterface and
# webrtc::PeerConnectionInterface.
# The applications which only use WebRTC DataChannel can depend on this
# target instead of rtc_sdk_objc.
rtc_static_library("peerconnectionfactory_no_media_objc") {
visibility = [ "*" ]
defines = [ "HAVE_NO_MEDIA" ]
sources = [
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Native.h",
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Private.h",
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm",
]
public_configs = [ ":common_config_objc" ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
deps = [
":native_api",
":native_video",
":peerconnectionfactory_base_objc",
"../api:libjingle_peerconnection_api",
"../api:peerconnection_and_implicit_call_api",
"../rtc_base:rtc_base",
]
}
rtc_static_library("peerconnectionfactory_base_objc") {
sources = [
"objc/Framework/Classes/PeerConnection/RTCAudioSource+Private.h",
"objc/Framework/Classes/PeerConnection/RTCAudioSource.mm",
"objc/Framework/Classes/PeerConnection/RTCAudioTrack+Private.h",
"objc/Framework/Classes/PeerConnection/RTCAudioTrack.mm",
"objc/Framework/Classes/PeerConnection/RTCConfiguration+Native.h",
"objc/Framework/Classes/PeerConnection/RTCConfiguration+Private.h",
"objc/Framework/Classes/PeerConnection/RTCConfiguration.mm",
"objc/Framework/Classes/PeerConnection/RTCDataChannel+Private.h",
"objc/Framework/Classes/PeerConnection/RTCDataChannel.mm",
"objc/Framework/Classes/PeerConnection/RTCDataChannelConfiguration+Private.h",
"objc/Framework/Classes/PeerConnection/RTCDataChannelConfiguration.mm",
"objc/Framework/Classes/PeerConnection/RTCDtmfSender+Private.h",
"objc/Framework/Classes/PeerConnection/RTCDtmfSender.mm",
"objc/Framework/Classes/PeerConnection/RTCEncodedImage.mm",
"objc/Framework/Classes/PeerConnection/RTCIceCandidate+Private.h",
"objc/Framework/Classes/PeerConnection/RTCIceCandidate.mm",
"objc/Framework/Classes/PeerConnection/RTCIceServer+Private.h",
"objc/Framework/Classes/PeerConnection/RTCIceServer.mm",
"objc/Framework/Classes/PeerConnection/RTCIntervalRange+Private.h",
"objc/Framework/Classes/PeerConnection/RTCIntervalRange.mm",
"objc/Framework/Classes/PeerConnection/RTCLegacyStatsReport+Private.h",
"objc/Framework/Classes/PeerConnection/RTCLegacyStatsReport.mm",
"objc/Framework/Classes/PeerConnection/RTCMediaConstraints+Private.h",
"objc/Framework/Classes/PeerConnection/RTCMediaConstraints.mm",
"objc/Framework/Classes/PeerConnection/RTCMediaSource+Private.h",
"objc/Framework/Classes/PeerConnection/RTCMediaSource.mm",
"objc/Framework/Classes/PeerConnection/RTCMediaStream+Private.h",
"objc/Framework/Classes/PeerConnection/RTCMediaStream.mm",
"objc/Framework/Classes/PeerConnection/RTCMediaStreamTrack+Private.h",
"objc/Framework/Classes/PeerConnection/RTCMediaStreamTrack.mm",
"objc/Framework/Classes/PeerConnection/RTCMetrics.mm",
"objc/Framework/Classes/PeerConnection/RTCMetricsSampleInfo+Private.h",
"objc/Framework/Classes/PeerConnection/RTCMetricsSampleInfo.mm",
"objc/Framework/Classes/PeerConnection/RTCPeerConnection+DataChannel.mm",
"objc/Framework/Classes/PeerConnection/RTCPeerConnection+Native.h",
"objc/Framework/Classes/PeerConnection/RTCPeerConnection+Private.h",
"objc/Framework/Classes/PeerConnection/RTCPeerConnection+Stats.mm",
"objc/Framework/Classes/PeerConnection/RTCPeerConnection.mm",
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactoryOptions+Private.h",
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactoryOptions.mm",
"objc/Framework/Classes/PeerConnection/RTCRtpCodecParameters+Private.h",
"objc/Framework/Classes/PeerConnection/RTCRtpCodecParameters.mm",
"objc/Framework/Classes/PeerConnection/RTCRtpEncodingParameters+Private.h",
"objc/Framework/Classes/PeerConnection/RTCRtpEncodingParameters.mm",
"objc/Framework/Classes/PeerConnection/RTCRtpFragmentationHeader.mm",
"objc/Framework/Classes/PeerConnection/RTCRtpParameters+Private.h",
"objc/Framework/Classes/PeerConnection/RTCRtpParameters.mm",
"objc/Framework/Classes/PeerConnection/RTCRtpReceiver+Private.h",
"objc/Framework/Classes/PeerConnection/RTCRtpReceiver.mm",
"objc/Framework/Classes/PeerConnection/RTCRtpSender+Private.h",
"objc/Framework/Classes/PeerConnection/RTCRtpSender.mm",
"objc/Framework/Classes/PeerConnection/RTCSSLAdapter.mm",
"objc/Framework/Classes/PeerConnection/RTCSessionDescription+Private.h",
"objc/Framework/Classes/PeerConnection/RTCSessionDescription.mm",
"objc/Framework/Classes/PeerConnection/RTCTracing.mm",
"objc/Framework/Classes/PeerConnection/RTCVideoCapturer.m",
"objc/Framework/Classes/PeerConnection/RTCVideoCodec+Private.h",
"objc/Framework/Classes/PeerConnection/RTCVideoCodec.mm",
"objc/Framework/Classes/PeerConnection/RTCVideoEncoderSettings.mm",
"objc/Framework/Classes/PeerConnection/RTCVideoFrame+Private.h",
"objc/Framework/Classes/PeerConnection/RTCVideoFrame.mm",
"objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter+Private.h",
"objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter.h",
"objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter.mm",
"objc/Framework/Classes/PeerConnection/RTCVideoSource+Private.h",
"objc/Framework/Classes/PeerConnection/RTCVideoSource.mm",
"objc/Framework/Classes/PeerConnection/RTCVideoTrack+Private.h",
"objc/Framework/Classes/PeerConnection/RTCVideoTrack.mm",
"objc/Framework/Classes/PeerConnection/RTCWrappedNativeVideoDecoder.h",
"objc/Framework/Classes/PeerConnection/RTCWrappedNativeVideoDecoder.mm",
"objc/Framework/Classes/PeerConnection/RTCWrappedNativeVideoEncoder.h",
"objc/Framework/Classes/PeerConnection/RTCWrappedNativeVideoEncoder.mm",
"objc/Framework/Headers/WebRTC/RTCAudioSource.h",
"objc/Framework/Headers/WebRTC/RTCAudioTrack.h",
"objc/Framework/Headers/WebRTC/RTCConfiguration.h",
"objc/Framework/Headers/WebRTC/RTCDataChannel.h",
"objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h",
"objc/Framework/Headers/WebRTC/RTCDtmfSender.h",
"objc/Framework/Headers/WebRTC/RTCIceCandidate.h",
"objc/Framework/Headers/WebRTC/RTCIceServer.h",
"objc/Framework/Headers/WebRTC/RTCIntervalRange.h",
"objc/Framework/Headers/WebRTC/RTCLegacyStatsReport.h",
"objc/Framework/Headers/WebRTC/RTCMediaConstraints.h",
"objc/Framework/Headers/WebRTC/RTCMediaSource.h",
"objc/Framework/Headers/WebRTC/RTCMediaStream.h",
"objc/Framework/Headers/WebRTC/RTCMediaStreamTrack.h",
"objc/Framework/Headers/WebRTC/RTCMetrics.h",
"objc/Framework/Headers/WebRTC/RTCMetricsSampleInfo.h",
"objc/Framework/Headers/WebRTC/RTCPeerConnection.h",
"objc/Framework/Headers/WebRTC/RTCPeerConnectionFactory.h",
"objc/Framework/Headers/WebRTC/RTCPeerConnectionFactoryOptions.h",
"objc/Framework/Headers/WebRTC/RTCRtpCodecParameters.h",
"objc/Framework/Headers/WebRTC/RTCRtpEncodingParameters.h",
"objc/Framework/Headers/WebRTC/RTCRtpParameters.h",
"objc/Framework/Headers/WebRTC/RTCRtpReceiver.h",
"objc/Framework/Headers/WebRTC/RTCRtpSender.h",
"objc/Framework/Headers/WebRTC/RTCSSLAdapter.h",
"objc/Framework/Headers/WebRTC/RTCSessionDescription.h",
"objc/Framework/Headers/WebRTC/RTCTracing.h",
"objc/Framework/Headers/WebRTC/RTCVideoCapturer.h",
"objc/Framework/Headers/WebRTC/RTCVideoFrame.h",
"objc/Framework/Headers/WebRTC/RTCVideoFrameBuffer.h",
"objc/Framework/Headers/WebRTC/RTCVideoRenderer.h",
"objc/Framework/Headers/WebRTC/RTCVideoSource.h",
"objc/Framework/Headers/WebRTC/RTCVideoTrack.h",
"objc/Framework/Headers/WebRTC/RTCVideoViewShading.h",
]
configs += [ "..:common_objc" ]
public_configs = [ ":common_config_objc" ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
deps = [
":common_objc",
":native_api",
":native_video",
":videotracksource_objc",
"../api:libjingle_peerconnection_api",
"../api:peerconnection_and_implicit_call_api",
"../api:video_frame_api",
"../api/video_codecs:video_codecs_api",
"../common_video",
"../media:rtc_media_base",
"../modules:module_api",
"../modules/video_coding:video_codec_interface",
"../pc:peerconnection",
"../rtc_base:checks",
"../rtc_base:rtc_base",
]
}
if (rtc_include_tests) {
if (is_ios) {
rtc_source_set("sdk_unittests_sources") {
testonly = true
include_dirs = [
"objc/Framework/Headers",
"objc/Framework/Classes",
]
sources = [
"objc/Framework/UnitTests/RTCCallbackLogger_xctest.m",
"objc/Framework/UnitTests/RTCDoNotPutCPlusPlusInFrameworkHeaders_xctest.m",
"objc/Framework/UnitTests/RTCFileVideoCapturer_xctest.mm",
]
if (current_cpu == "arm64" || use_ios_simulator) {
sources += [ "objc/Framework/UnitTests/RTCMTLVideoView_xctest.mm" ]
}
if (use_ios_simulator) {
# Only include this file on simulator, as it's already
# included in device builds.
sources += [ "objc/Framework/Classes/Metal/RTCMTLVideoView.m" ]
libs = [ "CoreVideo.framework" ]
}
deps = [
":common_objc",
":framework_objc",
":peerconnection_objc",
":peerconnectionfactory_objc",
":videotoolbox_objc",
":videotracksource_objc",
"../../system_wrappers:system_wrappers_default",
"../media:rtc_media_base",
"../modules:module_api",
"../rtc_base:rtc_base",
"../rtc_base:rtc_base_tests_utils",
]
public_deps = [
"//build/config/ios:xctest",
"//third_party/ocmock",
]
include_dirs += [ "$root_out_dir/WebRTC.framework/Headers/" ]
}
bundle_data("sdk_unittests_bundle_data") {
# Sample video taken from https://media.xiph.org/video/derf/
sources = [
"objc/Framework/UnitTests/foreman.mp4",
]
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
]
}
rtc_ios_xctest_test("sdk_unittests") {
info_plist = "//test/ios/Info.plist"
sources = [
"objc/Framework/UnitTests/main.m",
]
_bundle_id_suffix = ios_generic_test_bundle_id_suffix
extra_substitutions = [ "GTEST_BUNDLE_ID_SUFFIX=$_bundle_id_suffix" ]
deps = [
":sdk_unittests_bundle_data",
":sdk_unittests_sources",
]
ldflags = [ "-all_load" ]
}
}
# TODO(denicija): once all tests are migrated to xctest remove this source set.
rtc_source_set("sdk_unittests_objc") {
testonly = true
sources = [
"objc/Framework/UnitTests/RTCConfigurationTest.mm",
"objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
"objc/Framework/UnitTests/RTCIceCandidateTest.mm",
"objc/Framework/UnitTests/RTCIceServerTest.mm",
"objc/Framework/UnitTests/RTCIntervalRangeTests.mm",
"objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
"objc/Framework/UnitTests/RTCPeerConnectionTest.mm",
"objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
"objc/Framework/UnitTests/RTCTracingTest.mm",
"objc/Framework/UnitTests/objc_video_decoder_factory_tests.mm",
"objc/Framework/UnitTests/objc_video_encoder_factory_tests.mm",
"objc/Framework/UnitTests/scoped_cftyperef_tests.mm",
]
if (is_ios) {
sources +=
[ "objc/Framework/UnitTests/RTCCameraVideoCapturerTests.mm" ]
}
# |-ObjC| flag needed to make sure category method implementations
# are included:
# https://developer.apple.com/library/mac/qa/qa1490/_index.html
ldflags = [ "-ObjC" ]
defines = [ "GTEST_RELATIVE_PATH" ]
deps = [
":common_objc",
":native_video",
":peerconnection_objc",
":peerconnectionfactory_objc",
":videotoolbox_objc",
":videotracksource_objc",
"../../system_wrappers:system_wrappers_default",
"../media:rtc_media_base",
"../modules:module_api",
"../modules/video_coding:video_codec_interface",
"../rtc_base:rtc_base_tests_utils",
"//test:test_support",
"//third_party/ocmock",
]
if (is_ios) {
sources += [ "objc/Framework/UnitTests/RTCAudioSessionTest.mm" ]
}
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
}
if (is_ios) {
ios_framework_bundle_with_umbrella_header("framework_objc") {
info_plist = "objc/Framework/Info.plist"
output_name = "WebRTC"
common_objc_headers = [
"objc/Framework/Headers/WebRTC/RTCAudioSession.h",
"objc/Framework/Headers/WebRTC/RTCVideoCodec.h",
"objc/Framework/Headers/WebRTC/RTCVideoCodecFactory.h",
"objc/Framework/Headers/WebRTC/RTCAudioSessionConfiguration.h",
"objc/Framework/Headers/WebRTC/RTCAudioSource.h",
"objc/Framework/Headers/WebRTC/RTCAudioTrack.h",
"objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h",
"objc/Framework/Headers/WebRTC/RTCCameraPreviewView.h",
"objc/Framework/Headers/WebRTC/RTCConfiguration.h",
"objc/Framework/Headers/WebRTC/RTCDataChannel.h",
"objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h",
"objc/Framework/Headers/WebRTC/RTCDispatcher.h",
"objc/Framework/Headers/WebRTC/RTCEAGLVideoView.h",
"objc/Framework/Headers/WebRTC/RTCFieldTrials.h",
"objc/Framework/Headers/WebRTC/RTCFileVideoCapturer.h",
"objc/Framework/Headers/WebRTC/RTCIceCandidate.h",
"objc/Framework/Headers/WebRTC/RTCIceServer.h",
"objc/Framework/Headers/WebRTC/RTCIntervalRange.h",
"objc/Framework/Headers/WebRTC/RTCLegacyStatsReport.h",
"objc/Framework/Headers/WebRTC/RTCLogging.h",
"objc/Framework/Headers/WebRTC/RTCMacros.h",
"objc/Framework/Headers/WebRTC/RTCMediaConstraints.h",
"objc/Framework/Headers/WebRTC/RTCMediaSource.h",
"objc/Framework/Headers/WebRTC/RTCMediaStream.h",
"objc/Framework/Headers/WebRTC/RTCMediaStreamTrack.h",
"objc/Framework/Headers/WebRTC/RTCMetrics.h",
"objc/Framework/Headers/WebRTC/RTCMetricsSampleInfo.h",
"objc/Framework/Headers/WebRTC/RTCPeerConnection.h",
"objc/Framework/Headers/WebRTC/RTCPeerConnectionFactory.h",
"objc/Framework/Headers/WebRTC/RTCPeerConnectionFactoryOptions.h",
"objc/Framework/Headers/WebRTC/RTCRtpCodecParameters.h",
"objc/Framework/Headers/WebRTC/RTCRtpEncodingParameters.h",
"objc/Framework/Headers/WebRTC/RTCRtpParameters.h",
"objc/Framework/Headers/WebRTC/RTCRtpReceiver.h",
"objc/Framework/Headers/WebRTC/RTCRtpSender.h",
"objc/Framework/Headers/WebRTC/RTCDtmfSender.h",
"objc/Framework/Headers/WebRTC/RTCSSLAdapter.h",
"objc/Framework/Headers/WebRTC/RTCSessionDescription.h",
"objc/Framework/Headers/WebRTC/RTCTracing.h",
"objc/Framework/Headers/WebRTC/RTCVideoCapturer.h",
"objc/Framework/Headers/WebRTC/RTCVideoCodecH264.h",
"objc/Framework/Headers/WebRTC/RTCVideoFrame.h",
"objc/Framework/Headers/WebRTC/RTCVideoFrameBuffer.h",
"objc/Framework/Headers/WebRTC/RTCVideoRenderer.h",
"objc/Framework/Headers/WebRTC/RTCVideoSource.h",
"objc/Framework/Headers/WebRTC/RTCVideoTrack.h",
"objc/Framework/Headers/WebRTC/RTCVideoViewShading.h",
"objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h",
]
if (rtc_use_metal_rendering) {
common_objc_headers +=
[ "objc/Framework/Headers/WebRTC/RTCMTLVideoView.h" ]
}
if (rtc_use_builtin_sw_codecs) {
common_objc_headers += [
"objc/Framework/Headers/WebRTC/RTCVideoDecoderVP8.h",
"objc/Framework/Headers/WebRTC/RTCVideoDecoderVP9.h",
"objc/Framework/Headers/WebRTC/RTCVideoEncoderVP8.h",
"objc/Framework/Headers/WebRTC/RTCVideoEncoderVP9.h",
]
}
sources = common_objc_headers
public_headers = common_objc_headers
if (!build_with_chromium) {
sources += [
"objc/Framework/Headers/WebRTC/RTCCallbackLogger.h",
"objc/Framework/Headers/WebRTC/RTCFileLogger.h",
]
public_headers += [
"objc/Framework/Headers/WebRTC/RTCCallbackLogger.h",
"objc/Framework/Headers/WebRTC/RTCFileLogger.h",
]
}
ldflags = [
"-all_load",
"-install_name",
"@rpath/$output_name.framework/$output_name",
]
deps = [
":audio_objc",
":peerconnection_objc",
":ui_objc",
"../rtc_base:rtc_base_approved",
"../system_wrappers:field_trial_default",
"../system_wrappers:metrics_default",
"../system_wrappers:runtime_enabled_features_default",
]
libs = [
"AVFoundation.framework",
"CoreGraphics.framework",
"CoreMedia.framework",
"GLKit.framework",
]
configs += [ "..:common_objc" ]
public_configs = [ ":common_config_objc" ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
configs -= [ "//build/config/clang:find_bad_constructs" ]
}
}
}
# The native API is currently experimental and may change without notice.
rtc_static_library("native_api") {
visibility = [ "*" ]
sources = [
"objc/Framework/Native/api/video_decoder_factory.h",
"objc/Framework/Native/api/video_decoder_factory.mm",
"objc/Framework/Native/api/video_encoder_factory.h",
"objc/Framework/Native/api/video_encoder_factory.mm",
"objc/Framework/Native/api/video_frame_buffer.h",
"objc/Framework/Native/api/video_frame_buffer.mm",
]
configs += [ "..:common_objc" ]
public_configs = [ ":common_config_objc" ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
deps = [
":native_video",
"../api/video_codecs:video_codecs_api",
"../common_video",
"../rtc_base:rtc_base",
]
}
rtc_static_library("native_video") {
sources = [
"objc/Framework/Native/src/objc_frame_buffer.h",
"objc/Framework/Native/src/objc_frame_buffer.mm",
"objc/Framework/Native/src/objc_video_decoder_factory.h",
"objc/Framework/Native/src/objc_video_decoder_factory.mm",
"objc/Framework/Native/src/objc_video_encoder_factory.h",
"objc/Framework/Native/src/objc_video_encoder_factory.mm",
]
configs += [ "..:common_objc" ]
public_configs = [ ":common_config_objc" ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
deps = [
":common_objc",
"../api:video_frame_api",
"../api/video_codecs:video_codecs_api",
"../common_video",
"../media:rtc_audio_video",
"../media:rtc_media_base",
"../modules:module_api",
"../modules/video_coding:video_codec_interface",
"../rtc_base:checks",
"../rtc_base:rtc_base",
]
}
rtc_static_library("rtc_sdk_objc") {
complete_static_lib = true
deps = [
":peerconnection_objc",
":ui_objc",
"../system_wrappers:field_trial_default",
"../system_wrappers:metrics_default",
"../system_wrappers:runtime_enabled_features_default",
]
}
rtc_static_library("video_toolbox_cc") {
visibility = [ ":videotoolbox_objc" ]
sources = [
"objc/Framework/Classes/VideoToolbox/helpers.cc",
"objc/Framework/Classes/VideoToolbox/helpers.h",
"objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc",
"objc/Framework/Classes/VideoToolbox/nalu_rewriter.h",
]
deps = [
"../common_video",
"../modules:module_api",
"../modules/video_coding:webrtc_h264",
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
rtc_static_library("videotoolbox_objc") {
sources = [
"objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm",
"objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm",
"objc/Framework/Headers/WebRTC/RTCVideoFrameBuffer.h",
]
configs += [ "..:common_objc" ]
deps = [
":common_objc",
":native_api",
":video_objc",
":video_toolbox_cc",
":videotracksource_objc",
"../api:video_frame_api",
"../api/video_codecs:video_codecs_api",
"../common_video",
"../media:rtc_audio_video",
"../media:rtc_media",
"../media:rtc_media_base",
"../modules:module_api",
"../modules/video_coding:video_codec_interface",
"../modules/video_coding:video_coding_utility",
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
"../system_wrappers",
"//third_party/libyuv",
]
libs = [
"CoreFoundation.framework",
"CoreMedia.framework",
"CoreVideo.framework",
"VideoToolbox.framework",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin
# (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
}
}