blob: 2ba73b51dc30026feedd8db69ccd9ea471b96e12 [file] [log] [blame]
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromecast_build.gni")
import("//media/webrtc/audio_processing.gni")
import("//services/service_manager/public/cpp/service_executable.gni")
import("//testing/test.gni")
# Currently standalone service binaries are not supported on Android or iOS.
standalone_supported = !(is_android || is_ios)
service_executable("audio") {
sources = [
"service_main.cc",
]
deps = [
":lib",
"//services/audio/public/cpp",
"//services/audio/public/mojom",
]
}
source_set("lib") {
sources = [
"debug_recording.cc",
"debug_recording.h",
"delay_buffer.cc",
"delay_buffer.h",
"device_notifier.cc",
"device_notifier.h",
"group_coordinator-impl.h",
"group_coordinator.h",
"in_process_audio_manager_accessor.cc",
"in_process_audio_manager_accessor.h",
"input_controller.cc",
"input_controller.h",
"input_stream.cc",
"input_stream.h",
"input_sync_writer.cc",
"input_sync_writer.h",
"local_muter.cc",
"local_muter.h",
"log_adapter.cc",
"log_adapter.h",
"log_factory_adapter.cc",
"log_factory_adapter.h",
"log_factory_manager.cc",
"log_factory_manager.h",
"loopback_coordinator.cc",
"loopback_coordinator.h",
"loopback_group_member.h",
"loopback_stream.cc",
"loopback_stream.h",
"output_controller.cc",
"output_controller.h",
"output_stream.cc",
"output_stream.h",
"owning_audio_manager_accessor.cc",
"owning_audio_manager_accessor.h",
"service.cc",
"service.h",
"service_factory.cc",
"service_factory.h",
"service_metrics.cc",
"service_metrics.h",
"snooper_node.cc",
"snooper_node.h",
"stream_factory.cc",
"stream_factory.h",
"stream_monitor.h",
"stream_monitor_coordinator.cc",
"stream_monitor_coordinator.h",
"sync_reader.cc",
"sync_reader.h",
"system_info.cc",
"system_info.h",
"traced_service_ref.cc",
"traced_service_ref.h",
"user_input_monitor.cc",
"user_input_monitor.h",
]
deps = [
"//components/crash/core/common:crash_key", # Temporary: crbug.com/888478
]
if (audio_processing_in_audio_service_supported) {
deps += [ "//media/webrtc" ]
}
public_deps = [
"//base",
"//media",
"//media/webrtc",
"//services/audio/public/mojom",
"//services/service_manager/public/cpp",
"//services/service_manager/sandbox:sandbox",
]
if (is_linux) {
sources += [
"audio_sandbox_hook_linux.cc",
"audio_sandbox_hook_linux.h",
]
public_deps += [ "//sandbox/linux:sandbox_services" ]
}
if (is_win) {
sources += [
"audio_sandbox_win.cc",
"audio_sandbox_win.h",
]
public_deps += [ "//sandbox/win:sandbox" ]
}
configs += [
"//build/config/compiler:wexit_time_destructors",
"//media:media_config",
"//media/audio:platform_config",
]
if (is_chromecast) {
defines = [ "IS_CHROMECAST" ]
}
}
source_set("tests") {
testonly = true
sources = [
"debug_recording_unittest.cc",
"delay_buffer_unittest.cc",
"device_notifier_unittest.cc",
"group_coordinator_unittest.cc",
"input_controller_unittest.cc",
"input_stream_unittest.cc",
"input_sync_writer_unittest.cc",
"local_muter_unittest.cc",
"log_factory_manager_unittest.cc",
"loopback_stream_unittest.cc",
"output_controller_unittest.cc",
"output_stream_unittest.cc",
"public/cpp/input_ipc_unittest.cc",
"public/cpp/output_device_unittest.cc",
"service_metrics_unittest.cc",
"snooper_node_unittest.cc",
"stream_factory_unittest.cc",
"sync_reader_unittest.cc",
"test/audio_system_to_service_adapter_test.cc",
"test/debug_recording_session_unittest.cc",
"test/fake_consumer.cc",
"test/fake_consumer.h",
"test/fake_loopback_group_member.cc",
"test/fake_loopback_group_member.h",
"test/in_process_service_test.cc",
"test/mock_group_coordinator.cc",
"test/mock_group_coordinator.h",
"test/mock_group_member.cc",
"test/mock_group_member.h",
"test/mock_log.cc",
"test/mock_log.h",
"test/service_lifetime_connector_test.cc",
"test/service_lifetime_test_template.h",
"test/service_observer_mock.cc",
"test/service_observer_mock.h",
"user_input_monitor_unittest.cc",
]
deps = [
":audio",
":lib",
"//base/test:test_support",
"//media:test_support",
"//mojo/core/embedder",
"//services/audio/public/cpp",
"//services/audio/public/cpp:manifest",
"//services/audio/public/cpp:test_support",
"//services/audio/public/mojom",
"//services/service_manager/public/cpp",
"//services/service_manager/public/cpp/test:test_support",
"//services/service_manager/public/mojom",
"//testing/gmock",
"//testing/gtest",
]
if (standalone_supported) {
sources += [ "test/standalone_service_test.cc" ]
}
if (is_chromeos || is_chromecast) {
sources += [
"public/cpp/sounds/audio_stream_handler_unittest.cc",
"public/cpp/sounds/sounds_manager_unittest.cc",
]
}
data_deps = [
":audio",
]
}