| # Copyright 2019 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/components.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_library("fuchsia-audio-codec") { |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.media:fuchsia.media_rust", |
| "//sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec_rust", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/fuchsia-sync", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/media/stream_processors/fuchsia-stream-processors", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//src/connectivity/bluetooth/lib/async-helpers:async-test-helpers", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/testing/fixture", |
| "//src/media/stream_processors/test:stream_processor_test_lib", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:futures-test", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:sha2", |
| ] |
| |
| sources = [ |
| "src/buffer_collection_constraints.rs", |
| "src/lib.rs", |
| "src/stream_processor.rs", |
| "src/sysmem_allocator.rs", |
| ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| resource("test-data") { |
| sources = [ rebase_path( |
| "//src/media/stream_processors/test/audio_decoder_test/test_data/s16le44100mono.sbc") ] |
| outputs = [ "data/{{source_file_part}}" ] |
| } |
| |
| fuchsia_test_component("fuchsia-audio-codec-test-component") { |
| restricted_features = [ "allow_non_hermetic_packages" ] |
| manifest = "meta/fuchsia-audio-codec-lib-test.cml" |
| deps = [ ":fuchsia-audio-codec_test" ] |
| test_type = "system" |
| } |
| |
| fuchsia_test_package("fuchsia-audio-codec-tests") { |
| test_components = [ ":fuchsia-audio-codec-test-component" ] |
| deps = [ ":test-data" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":fuchsia-audio-codec-tests" ] |
| } |