blob: 7c28f866c14655d4cd9c374db12c574abcc6c51d [file] [log] [blame]
# Copyright 2016 The Fuchsia 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/package.gni")
import("//build/test/test_package.gni")
action_foreach("generate_schemas") {
visibility = [ ":*" ]
script = "//src/media/audio/audio_core/schema/make_schema_header.py"
outputs = [
"$target_gen_dir/schema/{{source_name_part}}.inl",
]
args = [
"{{source}}",
rebase_path("$target_gen_dir") + "/schema/{{source_name_part}}.inl",
]
sources = [
"schema/audio_device_settings_schema.jsx",
]
}
package("audio_core") {
deps = [
"//src/media/audio/audio_core:audio_core_bin",
"//src/media/audio/effects/passthrough:audio_effects",
]
binaries = [
{
name = "audio_core"
},
]
loadable_modules = [
{
# This audio processing library is hosted in the audio_core process.
name = "audio_effects.so"
},
]
meta = [
{
path = rebase_path("meta/audio_core.cmx")
dest = "audio_core.cmx"
},
# The nodevfs cmx is used in some test environments where we would like to provide our own
# devfs for the test. At this time we need to remove any dev sandbox metadata as appmgr does
# not allow these namespaces to be overridden.
{
path = rebase_path("meta/audio_core_nodevfs.cmx")
dest = "audio_core_nodevfs.cmx"
},
]
}
source_set("audio_core_lib") {
sources = [
"audio_capturer_impl.cc",
"audio_capturer_impl.h",
"audio_core_impl.cc",
"audio_core_impl.h",
"audio_device.cc",
"audio_device.h",
"audio_device_manager.cc",
"audio_device_manager.h",
"audio_device_settings.cc",
"audio_device_settings.h",
"audio_driver.cc",
"audio_driver.h",
"audio_input.cc",
"audio_input.h",
"audio_link.cc",
"audio_link.h",
"audio_link_packet_source.cc",
"audio_link_packet_source.h",
"audio_link_ring_buffer_source.cc",
"audio_link_ring_buffer_source.h",
"audio_object.cc",
"audio_object.h",
"audio_output.cc",
"audio_output.h",
"audio_packet_ref.cc",
"audio_packet_ref.h",
"audio_plug_detector.cc",
"audio_plug_detector.h",
"audio_renderer_format_info.cc",
"audio_renderer_format_info.h",
"audio_renderer_impl.cc",
"audio_renderer_impl.h",
"command_line_options.cc",
"command_line_options.h",
"driver_output.cc",
"driver_output.h",
"driver_ring_buffer.cc",
"driver_ring_buffer.h",
"driver_utils.cc",
"driver_utils.h",
"fwd_decls.h",
"pending_flush_token.cc",
"pending_flush_token.h",
"reporter.cc",
"reporter.h",
"throttle_output.h",
"utils.cc",
"utils.h",
]
public_deps = [
"//sdk/fidl/fuchsia.media",
"//third_party/rapidjson",
"//zircon/public/lib/dispatcher-pool",
"//zircon/public/lib/fzl",
]
deps = [
":generate_schemas",
"//garnet/public/lib/fsl",
"//garnet/public/lib/inspect_deprecated:component",
"//sdk/fidl/fuchsia.media",
"//sdk/lib/media/audio/cpp",
"//sdk/lib/media/cpp:no_converters",
"//sdk/lib/sys/cpp:cpp",
"//src/lib/fxl",
"//src/media/audio/audio_core/mixer:audio_mixer_lib",
"//src/media/audio/lib/effects_loader",
"//src/media/audio/lib/logging",
"//src/media/audio/lib/wav_writer:wav_writer",
"//zircon/public/fidl/fuchsia-hardware-audio",
"//zircon/public/fidl/fuchsia-scheduler",
"//zircon/public/lib/audio-proto-utils",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fdio",
"//zircon/public/lib/fit",
"//zircon/public/lib/zx",
]
}
executable("audio_core_bin") {
output_name = "audio_core"
sources = [
"main.cc",
]
deps = [
":audio_core_lib",
"//garnet/public/lib/inspect_deprecated:component",
"//zircon/public/lib/async-loop-cpp",
]
}
executable("unittest_bin") {
visibility = [ ":*" ]
testonly = true
output_name = "audio_core_unittests"
sources = [
"audio_link_packet_source_unittest.cc",
"command_line_options_unittest.cc",
]
deps = [
":audio_core_lib",
"//garnet/public/lib/gtest",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fzl",
]
}
test_package("audio_core_unittests") {
deps = [
":unittest_bin",
]
tests = [
{
name = "audio_core_unittests"
environments = basic_envs
},
]
}
group("tests") {
testonly = true
deps = [
":audio_core_unittests",
"mixer:audio_mixer_tests",
"test",
]
}