| # Copyright 2020 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/config.gni") |
| import("//build/package.gni") |
| import("//build/test/test_package.gni") |
| |
| package("soundplayer") { |
| deps = [ ":bin" ] |
| |
| binaries = [ |
| { |
| name = "soundplayer" |
| }, |
| ] |
| meta = [ |
| { |
| path = rebase_path("meta/soundplayer.cmx") |
| dest = "soundplayer.cmx" |
| }, |
| ] |
| } |
| |
| executable("bin") { |
| output_name = "soundplayer" |
| |
| sources = [ "main.cc" ] |
| |
| deps = [ |
| ":source", |
| "//sdk/fidl/fuchsia.media.sounds", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//sdk/lib/syslog/cpp:backend_legacy", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| source_set("source") { |
| sources = [ |
| "ogg_demux.cc", |
| "ogg_demux.h", |
| "opus_decoder.cc", |
| "opus_decoder.h", |
| "sound.cc", |
| "sound.h", |
| "sound_player_impl.cc", |
| "sound_player_impl.h", |
| "wav_reader.cc", |
| "wav_reader.h", |
| ] |
| |
| public_deps = [ |
| "//third_party/ogg", |
| "//third_party/opus", |
| "//zircon/public/lib/fit", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.media", |
| "//sdk/fidl/fuchsia.media.sounds", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//sdk/lib/syslog/cpp:backend_legacy", |
| "//src/lib/files", |
| "//zircon/public/lib/fbl", |
| ] |
| |
| # TODO(fxb/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| config_data("configs") { |
| for_pkg = "sysmgr" |
| outputs = [ "soundplayer.config" ] |
| sources = [ "service.config" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":soundplayer-tests" ] |
| } |
| |
| executable("soundplayer-tests-bin") { |
| testonly = true |
| output_name = "soundplayer-tests" |
| |
| sources = [ |
| "test/fake_audio_renderer.cc", |
| "test/fake_audio_renderer.h", |
| "test/ogg_opus_tests.cc", |
| "test/soundplayer_tests.cc", |
| "test/wav_reader_tests.cc", |
| ] |
| |
| deps = [ |
| ":source", |
| "//sdk/fidl/fuchsia.media", |
| "//sdk/fidl/fuchsia.media.sounds", |
| "//src/lib/fsl", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//third_party/googletest:gtest", |
| "//third_party/ogg", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| test_package("soundplayer-tests") { |
| deps = [ ":soundplayer-tests-bin" ] |
| |
| tests = [ |
| { |
| name = "soundplayer-tests" |
| environments = basic_envs |
| }, |
| ] |
| |
| resources = [ |
| { |
| path = rebase_path( |
| "//garnet/test_data/media/third_party/chromium_media_test_data/bear-opus.ogg") |
| dest = "testfile.ogg" |
| }, |
| { |
| path = rebase_path( |
| "//garnet/test_data/media/third_party/chromium_media_test_data/sfx_s16le.wav") |
| dest = "sfx.wav" |
| }, |
| ] |
| } |