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.

668 lines
20 KiB

# 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("//build/config/linux/pkg_config.gni")
import("../webrtc.gni")
group("media") {
deps = []
if (!build_with_mozilla) {
deps += [
":rtc_media",
":rtc_media_base",
]
}
}
config("rtc_media_defines_config") {
defines = [ "HAVE_WEBRTC_VIDEO" ]
}
rtc_library("rtc_h264_profile_id") {
visibility = [ "*" ]
sources = [
"base/h264_profile_level_id.cc",
"base/h264_profile_level_id.h",
]
deps = [
"..:webrtc_common",
"../rtc_base",
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
"../rtc_base/system:rtc_export",
]
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}
rtc_source_set("rtc_media_config") {
visibility = [ "*" ]
sources = [ "base/media_config.h" ]
}
rtc_library("rtc_vp9_profile") {
visibility = [ "*" ]
sources = [
"base/vp9_profile.cc",
"base/vp9_profile.h",
]
deps = [
"..:webrtc_common",
"../api/video_codecs:video_codecs_api",
"../rtc_base:rtc_base_approved",
"../rtc_base/system:rtc_export",
]
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}
rtc_library("rtc_sdp_fmtp_utils") {
visibility = [ "*" ]
sources = [
"base/sdp_fmtp_utils.cc",
"base/sdp_fmtp_utils.h",
]
deps = [
"../api/video_codecs:video_codecs_api",
"../rtc_base:stringutils",
]
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}
rtc_library("rtc_media_base") {
visibility = [ "*" ]
defines = []
libs = []
deps = [
":rtc_h264_profile_id",
":rtc_media_config",
":rtc_vp9_profile",
"..:webrtc_common",
"../api:array_view",
"../api:audio_options_api",
"../api:frame_transformer_interface",
"../api:media_stream_interface",
"../api:rtc_error",
"../api:rtp_parameters",
"../api:scoped_refptr",
"../api/audio_codecs:audio_codecs_api",
"../api/crypto:frame_decryptor_interface",
"../api/crypto:frame_encryptor_interface",
"../api/crypto:options",
"../api/transport:stun_types",
"../api/transport/rtp:rtp_source",
"../api/video:video_bitrate_allocation",
"../api/video:video_bitrate_allocator_factory",
"../api/video:video_frame",
"../api/video:video_frame_i420",
"../api/video:video_rtp_headers",
"../api/video_codecs:video_codecs_api",
"../call:call_interfaces",
"../call:video_stream_api",
"../common_video",
"../modules/audio_processing:audio_processing_statistics",
"../modules/rtp_rtcp:rtp_rtcp_format",
"../rtc_base",
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_task_queue",
"../rtc_base:sanitizer",
"../rtc_base:stringutils",
"../rtc_base/synchronization:mutex",
"../rtc_base/synchronization:sequence_checker",
"../rtc_base/system:file_wrapper",
"../rtc_base/system:rtc_export",
"../rtc_base/third_party/sigslot",
"../system_wrappers:field_trial",
]
absl_deps = [
"//third_party/abseil-cpp/absl/algorithm:container",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",
]
sources = [
"base/adapted_video_track_source.cc",
"base/adapted_video_track_source.h",
"base/audio_source.h",
"base/codec.cc",
"base/codec.h",
"base/delayable.h",
"base/media_channel.cc",
"base/media_channel.h",
"base/media_constants.cc",
"base/media_constants.h",
"base/media_engine.cc",
"base/media_engine.h",
"base/rid_description.cc",
"base/rid_description.h",
"base/rtp_data_engine.cc",
"base/rtp_data_engine.h",
"base/rtp_utils.cc",
"base/rtp_utils.h",
"base/stream_params.cc",
"base/stream_params.h",
"base/turn_utils.cc",
"base/turn_utils.h",
"base/video_adapter.cc",
"base/video_adapter.h",
"base/video_broadcaster.cc",
"base/video_broadcaster.h",
"base/video_common.cc",
"base/video_common.h",
"base/video_source_base.cc",
"base/video_source_base.h",
]
}
rtc_library("rtc_constants") {
defines = []
libs = []
deps = []
sources = [
"engine/constants.cc",
"engine/constants.h",
]
}
rtc_library("rtc_simulcast_encoder_adapter") {
visibility = [ "*" ]
defines = []
libs = []
sources = [
"engine/simulcast_encoder_adapter.cc",
"engine/simulcast_encoder_adapter.h",
]
deps = [
":rtc_media_base",
"../api:fec_controller_api",
"../api:scoped_refptr",
"../api/video:video_codec_constants",
"../api/video:video_frame",
"../api/video:video_frame_i420",
"../api/video:video_rtp_headers",
"../api/video_codecs:rtc_software_fallback_wrappers",
"../api/video_codecs:video_codecs_api",
"../call:video_stream_api",
"../modules/video_coding:video_codec_interface",
"../modules/video_coding:video_coding_utility",
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
"../rtc_base/experiments:rate_control_settings",
"../rtc_base/synchronization:sequence_checker",
"../rtc_base/system:rtc_export",
"../system_wrappers",
"../system_wrappers:field_trial",
]
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}
rtc_library("rtc_encoder_simulcast_proxy") {
visibility = [ "*" ]
defines = []
libs = []
sources = [
"engine/encoder_simulcast_proxy.cc",
"engine/encoder_simulcast_proxy.h",
]
deps = [
":rtc_simulcast_encoder_adapter",
"../api/video:video_bitrate_allocation",
"../api/video:video_frame",
"../api/video:video_rtp_headers",
"../api/video_codecs:video_codecs_api",
"../modules/video_coding:video_codec_interface",
"../rtc_base/system:rtc_export",
]
}
rtc_library("rtc_internal_video_codecs") {
visibility = [ "*" ]
allow_poison = [ "software_video_codecs" ]
defines = []
libs = []
deps = [
":rtc_constants",
":rtc_encoder_simulcast_proxy",
":rtc_h264_profile_id",
":rtc_media_base",
":rtc_simulcast_encoder_adapter",
"../:webrtc_common",
"../api/video:encoded_image",
"../api/video:video_bitrate_allocation",
"../api/video:video_frame",
"../api/video:video_rtp_headers",
"../api/video_codecs:rtc_software_fallback_wrappers",
"../api/video_codecs:video_codecs_api",
"../call:call_interfaces",
"../call:video_stream_api",
"../modules:module_api",
"../modules/video_coding:video_codec_interface",
"../modules/video_coding:webrtc_h264",
"../modules/video_coding:webrtc_multiplex",
"../modules/video_coding:webrtc_vp8",
"../modules/video_coding:webrtc_vp9",
"../modules/video_coding/codecs/av1:libaom_av1_decoder",
"../modules/video_coding/codecs/av1:libaom_av1_encoder",
"../rtc_base:checks",
"../rtc_base:deprecation",
"../rtc_base:rtc_base_approved",
"../rtc_base/system:rtc_export",
"../test:fake_video_codecs",
]
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
sources = [
"engine/fake_video_codec_factory.cc",
"engine/fake_video_codec_factory.h",
"engine/internal_decoder_factory.cc",
"engine/internal_decoder_factory.h",
"engine/internal_encoder_factory.cc",
"engine/internal_encoder_factory.h",
"engine/multiplex_codec_factory.cc",
"engine/multiplex_codec_factory.h",
# TODO(bugs.webrtc.org/7925): stop exporting this header once downstream
# targets depend on :rtc_encoder_simulcast_proxy directly.
"engine/encoder_simulcast_proxy.h",
]
}
rtc_library("rtc_audio_video") {
visibility = [ "*" ]
allow_poison = [ "audio_codecs" ] # TODO(bugs.webrtc.org/8396): Remove.
defines = []
libs = []
deps = [
":rtc_constants",
":rtc_media_base",
"..:webrtc_common",
"../api:call_api",
"../api:libjingle_peerconnection_api",
"../api:media_stream_interface",
"../api:rtp_parameters",
"../api:scoped_refptr",
"../api:transport_api",
"../api/audio:audio_mixer_api",
"../api/audio_codecs:audio_codecs_api",
"../api/task_queue",
"../api/transport:bitrate_settings",
"../api/transport/rtp:rtp_source",
"../api/units:data_rate",
"../api/video:video_bitrate_allocation",
"../api/video:video_bitrate_allocator_factory",
"../api/video:video_codec_constants",
"../api/video:video_frame",
"../api/video:video_frame_i420",
"../api/video:video_rtp_headers",
"../api/video_codecs:rtc_software_fallback_wrappers",
"../api/video_codecs:video_codecs_api",
"../call",
"../call:call_interfaces",
"../call:video_stream_api",
"../common_video",
"../modules/audio_device",
"../modules/audio_device:audio_device_impl",
"../modules/audio_mixer:audio_mixer_impl",
"../modules/audio_processing:api",
"../modules/audio_processing/aec_dump",
"../modules/audio_processing/agc:gain_control_interface",
"../modules/video_coding",
"../modules/video_coding:video_codec_interface",
"../modules/video_coding:video_coding_utility",
"../rtc_base",
"../rtc_base:audio_format_to_string",
"../rtc_base:checks",
"../rtc_base:ignore_wundef",
"../rtc_base:rtc_task_queue",
"../rtc_base:stringutils",
"../rtc_base/experiments:field_trial_parser",
"../rtc_base/experiments:min_video_bitrate_experiment",
"../rtc_base/experiments:normalize_simulcast_size_experiment",
"../rtc_base/experiments:rate_control_settings",
"../rtc_base/synchronization:mutex",
"../rtc_base/system:rtc_export",
"../rtc_base/third_party/base64",
"../system_wrappers",
"../system_wrappers:field_trial",
"../system_wrappers:metrics",
]
absl_deps = [
"//third_party/abseil-cpp/absl/algorithm:container",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",
]
sources = [
"engine/adm_helpers.cc",
"engine/adm_helpers.h",
"engine/null_webrtc_video_engine.h",
"engine/payload_type_mapper.cc",
"engine/payload_type_mapper.h",
"engine/simulcast.cc",
"engine/simulcast.h",
"engine/unhandled_packets_buffer.cc",
"engine/unhandled_packets_buffer.h",
"engine/webrtc_media_engine.cc",
"engine/webrtc_media_engine.h",
"engine/webrtc_video_engine.cc",
"engine/webrtc_video_engine.h",
"engine/webrtc_voice_engine.cc",
"engine/webrtc_voice_engine.h",
]
public_configs = []
if (!build_with_chromium) {
public_configs += [ ":rtc_media_defines_config" ]
deps += [ "../modules/video_capture:video_capture_internal_impl" ]
}
if (rtc_enable_protobuf) {
deps += [
"../modules/audio_coding:ana_config_proto",
"../modules/audio_processing/aec_dump:aec_dump_impl",
]
} else {
deps += [ "../modules/audio_processing/aec_dump:null_aec_dump_factory" ]
}
}
# Heavy but optional helper for unittests and webrtc users who prefer to use
# defaults factories or do not worry about extra dependencies and binary size.
rtc_library("rtc_media_engine_defaults") {
visibility = [ "*" ]
allow_poison = [
"audio_codecs",
"default_task_queue",
"software_video_codecs",
]
sources = [
"engine/webrtc_media_engine_defaults.cc",
"engine/webrtc_media_engine_defaults.h",
]
deps = [
":rtc_audio_video",
"../api/audio_codecs:builtin_audio_decoder_factory",
"../api/audio_codecs:builtin_audio_encoder_factory",
"../api/task_queue:default_task_queue_factory",
"../api/video:builtin_video_bitrate_allocator_factory",
"../api/video_codecs:builtin_video_decoder_factory",
"../api/video_codecs:builtin_video_encoder_factory",
"../modules/audio_processing:api",
"../rtc_base:checks",
"../rtc_base/system:rtc_export",
]
}
rtc_library("rtc_data") {
defines = [
# "SCTP_DEBUG" # Uncomment for SCTP debugging.
]
deps = [
":rtc_media_base",
"..:webrtc_common",
"../api:call_api",
"../api:transport_api",
"../p2p:rtc_p2p",
"../rtc_base",
"../rtc_base:rtc_base_approved",
"../rtc_base/synchronization:mutex",
"../rtc_base/third_party/sigslot",
"../system_wrappers",
]
absl_deps = [
"//third_party/abseil-cpp/absl/algorithm:container",
"//third_party/abseil-cpp/absl/base:core_headers",
"//third_party/abseil-cpp/absl/types:optional",
]
if (rtc_enable_sctp) {
sources = [
"sctp/sctp_transport.cc",
"sctp/sctp_transport.h",
"sctp/sctp_transport_internal.h",
]
} else {
# libtool on mac does not like empty targets.
sources = [ "sctp/noop.cc" ]
}
if (rtc_enable_sctp && rtc_build_usrsctp) {
deps += [ "//third_party/usrsctp" ]
}
}
rtc_source_set("rtc_media") {
visibility = [ "*" ]
allow_poison = [ "audio_codecs" ] # TODO(bugs.webrtc.org/8396): Remove.
deps = [
":rtc_audio_video",
":rtc_data",
]
}
if (rtc_include_tests) {
rtc_library("rtc_media_tests_utils") {
testonly = true
defines = []
deps = [
":rtc_audio_video",
":rtc_internal_video_codecs",
":rtc_media",
":rtc_media_base",
":rtc_simulcast_encoder_adapter",
"../api:call_api",
"../api:fec_controller_api",
"../api:scoped_refptr",
"../api/video:encoded_image",
"../api/video:video_bitrate_allocation",
"../api/video:video_frame",
"../api/video:video_frame_i420",
"../api/video:video_rtp_headers",
"../api/video_codecs:video_codecs_api",
"../call:call_interfaces",
"../call:mock_rtp_interfaces",
"../call:video_stream_api",
"../common_video",
"../modules/audio_processing",
"../modules/audio_processing:api",
"../modules/rtp_rtcp:rtp_rtcp_format",
"../modules/video_coding:video_codec_interface",
"../modules/video_coding:video_coding_utility",
"../p2p:rtc_p2p",
"../rtc_base",
"../rtc_base:checks",
"../rtc_base:gunit_helpers",
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_task_queue",
"../rtc_base:stringutils",
"../rtc_base/synchronization:mutex",
"../rtc_base/third_party/sigslot",
"../test:test_support",
"//testing/gtest",
]
absl_deps = [
"//third_party/abseil-cpp/absl/algorithm:container",
"//third_party/abseil-cpp/absl/strings",
]
sources = [
"base/fake_frame_source.cc",
"base/fake_frame_source.h",
"base/fake_media_engine.cc",
"base/fake_media_engine.h",
"base/fake_network_interface.h",
"base/fake_rtp.cc",
"base/fake_rtp.h",
"base/fake_video_renderer.cc",
"base/fake_video_renderer.h",
"base/test_utils.cc",
"base/test_utils.h",
"engine/fake_webrtc_call.cc",
"engine/fake_webrtc_call.h",
"engine/fake_webrtc_video_engine.cc",
"engine/fake_webrtc_video_engine.h",
]
}
rtc_media_unittests_resources = [
"../resources/media/captured-320x240-2s-48.frames",
"../resources/media/faces.1280x720_P420.yuv",
"../resources/media/faces_I400.jpg",
"../resources/media/faces_I411.jpg",
"../resources/media/faces_I420.jpg",
"../resources/media/faces_I422.jpg",
"../resources/media/faces_I444.jpg",
]
if (is_ios) {
bundle_data("rtc_media_unittests_bundle_data") {
testonly = true
sources = rtc_media_unittests_resources
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
}
}
rtc_test("rtc_media_unittests") {
testonly = true
defines = []
deps = [
":rtc_audio_video",
":rtc_constants",
":rtc_data",
":rtc_encoder_simulcast_proxy",
":rtc_internal_video_codecs",
":rtc_media",
":rtc_media_base",
":rtc_media_engine_defaults",
":rtc_media_tests_utils",
":rtc_sdp_fmtp_utils",
":rtc_simulcast_encoder_adapter",
":rtc_vp9_profile",
"../:webrtc_common",
"../api:create_simulcast_test_fixture_api",
"../api:libjingle_peerconnection_api",
"../api:mock_video_bitrate_allocator",
"../api:mock_video_bitrate_allocator_factory",
"../api:mock_video_codec_factory",
"../api:mock_video_encoder",
"../api:rtp_parameters",
"../api:scoped_refptr",
"../api:simulcast_test_fixture_api",
"../api/audio_codecs:builtin_audio_decoder_factory",
"../api/audio_codecs:builtin_audio_encoder_factory",
"../api/rtc_event_log",
"../api/task_queue",
"../api/task_queue:default_task_queue_factory",
"../api/test/video:function_video_factory",
"../api/transport:field_trial_based_config",
"../api/units:time_delta",
"../api/video:builtin_video_bitrate_allocator_factory",
"../api/video:video_bitrate_allocation",
"../api/video:video_frame",
"../api/video:video_frame_i420",
"../api/video:video_rtp_headers",
"../api/video_codecs:builtin_video_decoder_factory",
"../api/video_codecs:builtin_video_encoder_factory",
"../api/video_codecs:video_codecs_api",
"../audio",
"../call:call_interfaces",
"../common_video",
"../media:rtc_h264_profile_id",
"../modules/audio_device:mock_audio_device",
"../modules/audio_processing",
"../modules/audio_processing:api",
"../modules/audio_processing:mocks",
"../modules/rtp_rtcp",
"../modules/video_coding:simulcast_test_fixture_impl",
"../modules/video_coding:video_codec_interface",
"../modules/video_coding:webrtc_h264",
"../modules/video_coding:webrtc_vp8",
"../modules/video_coding/codecs/av1:libaom_av1_decoder",
"../p2p:p2p_test_utils",
"../rtc_base",
"../rtc_base:checks",
"../rtc_base:gunit_helpers",
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_tests_utils",
"../rtc_base:rtc_task_queue",
"../rtc_base:stringutils",
"../rtc_base/experiments:min_video_bitrate_experiment",
"../rtc_base/synchronization:mutex",
"../rtc_base/third_party/sigslot",
"../test:audio_codec_mocks",
"../test:fake_video_codecs",
"../test:field_trial",
"../test:rtp_test_utils",
"../test:test_main",
"../test:test_support",
"../test:video_test_common",
"//third_party/abseil-cpp/absl/algorithm:container",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",
]
sources = [
"base/codec_unittest.cc",
"base/media_engine_unittest.cc",
"base/rtp_data_engine_unittest.cc",
"base/rtp_utils_unittest.cc",
"base/sdp_fmtp_utils_unittest.cc",
"base/stream_params_unittest.cc",
"base/turn_utils_unittest.cc",
"base/video_adapter_unittest.cc",
"base/video_broadcaster_unittest.cc",
"base/video_common_unittest.cc",
"engine/encoder_simulcast_proxy_unittest.cc",
"engine/internal_decoder_factory_unittest.cc",
"engine/multiplex_codec_factory_unittest.cc",
"engine/null_webrtc_video_engine_unittest.cc",
"engine/payload_type_mapper_unittest.cc",
"engine/simulcast_encoder_adapter_unittest.cc",
"engine/simulcast_unittest.cc",
"engine/unhandled_packets_buffer_unittest.cc",
"engine/webrtc_media_engine_unittest.cc",
"engine/webrtc_video_engine_unittest.cc",
]
# TODO(kthelgason): Reenable this test on iOS.
# See bugs.webrtc.org/5569
if (!is_ios) {
sources += [ "engine/webrtc_voice_engine_unittest.cc" ]
}
if (rtc_enable_sctp) {
sources += [
"sctp/sctp_transport_reliability_unittest.cc",
"sctp/sctp_transport_unittest.cc",
]
}
if (rtc_opus_support_120ms_ptime) {
defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=1" ]
} else {
defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=0" ]
}
data = rtc_media_unittests_resources
if (is_android) {
deps += [ "//testing/android/native_test:native_test_support" ]
shard_timeout = 900
}
if (is_ios) {
deps += [ ":rtc_media_unittests_bundle_data" ]
}
if (rtc_enable_sctp && rtc_build_usrsctp) {
deps += [ "//third_party/usrsctp" ]
}
}
}