| # Copyright 2018 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/compiled_action.gni") |
| import("//build/components.gni") |
| |
| source_set("constants") { |
| sources = [ "constants.h" ] |
| public_deps = [ "//src/media/audio/lib/format:constants" ] |
| } |
| |
| source_set("mixer") { |
| sources = [ |
| "channel_strip.h", |
| "gain.cc", |
| "gain.h", |
| "intersect.cc", |
| "intersect.h", |
| "mixer.cc", |
| "mixer.h", |
| "no_op.cc", |
| "no_op.h", |
| "output_producer.cc", |
| "output_producer.h", |
| "point_sampler.cc", |
| "point_sampler.h", |
| "position_manager.cc", |
| "position_manager.h", |
| "sinc_sampler.cc", |
| "sinc_sampler.h", |
| ] |
| |
| public_deps = [ |
| ":constants", |
| "//sdk/fidl/fuchsia.media", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/ffl", |
| "//zircon/system/ulib/trace", |
| ] |
| |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl:fxl", |
| "//src/media/audio/lib/format", |
| "//src/media/audio/lib/format2", |
| "//src/media/audio/lib/processing", |
| "//src/media/audio/lib/timeline", |
| ] |
| |
| # Building without optimizations causes significant slowdowns for these components; the additional |
| # CPU load may lead to audio glitches on debug builds. These config settings enable the needed |
| # code optimization while maintaining other 'debug' aspects (e.g. DCHECK is still enabled). |
| configs -= [ "//build/config:default_optimize" ] |
| configs += [ "//build/config:optimize_speed" ] |
| |
| # Allow some of our loops to be vectorized by the compiler. |
| cflags = [ |
| "-ffast-math", |
| |
| # Allow inf/nan until we sanitize these out of streams (not normally allowed with -ffast-math). |
| "-fhonor-infinities", |
| "-fhonor-nans", |
| "-fno-finite-math-only", |
| ] |
| } |
| |
| group("tools") { |
| testonly = true |
| deps = [ "tools" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":audio_mixer_death_unittests", |
| ":audio_mixer_unittests", |
| "test", |
| ] |
| } |
| |
| executable("mixer_unittest_bin") { |
| testonly = true |
| output_name = "audio_mixer_unittests" |
| |
| sources = [ |
| "bookkeeping_unittest.cc", |
| "channel_strip_unittest.cc", |
| "gain_unittest.cc", |
| "intersect_unittest.cc", |
| "no_op_unittest.cc", |
| "output_producer_unittest.cc", |
| "point_sampler_unittest.cc", |
| "position_manager_unittest.cc", |
| "sinc_sampler_unittest.cc", |
| "source_info_unittest.cc", |
| ] |
| |
| deps = [ |
| ":mixer", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/media/audio/lib/format", |
| "//src/media/audio/lib/format2", |
| "//src/media/audio/lib/processing", |
| "//src/media/audio/lib/processing:prebuilt_coefficient_tables", |
| "//src/media/audio/lib/test:constants", |
| "//third_party/googletest:gmock", |
| "//zircon/system/ulib/fbl", |
| ] |
| } |
| |
| fuchsia_unittest_package("audio_mixer_unittests") { |
| deps = [ ":mixer_unittest_bin" ] |
| } |
| |
| executable("mixer_death_unittest_bin") { |
| testonly = true |
| output_name = "audio_mixer_death_unittests" |
| |
| sources = [ "sampler_death_unittest.cc" ] |
| |
| deps = [ |
| ":mixer", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//src/media/audio/lib/processing:prebuilt_coefficient_tables", |
| "//third_party/googletest:gmock", |
| ] |
| } |
| |
| fuchsia_unittest_package("audio_mixer_death_unittests") { |
| deps = [ ":mixer_death_unittest_bin" ] |
| manifest = "meta/audio_mixer_death_unittests.cml" |
| test_specs = { |
| log_settings = { |
| max_severity = "FATAL" |
| } |
| } |
| } |