1# Copyright (c) 2021-2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/ohos.gni") 15import("//drivers/adapter/uhdf2/uhdf.gni") 16import("//foundation/appexecfwk/standard/appexecfwk.gni") 17 18pulseaudio_dir = "//third_party/pulseaudio" 19pulseaudio_build_path = 20 "//foundation/multimedia/audio_standard/frameworks/native/pulseaudio" 21 22group("audio_client_test_packages") { 23 deps = [ 24 ":playback_test", 25 ":record_test", 26 ] 27} 28 29config("audio_client_public_config") { 30 include_dirs = [ 31 "//foundation/multimedia/audio_standard/frameworks/native/audiopolicy/include", 32 "//foundation/multimedia/audio_standard/frameworks/native/audiosession/include", 33 "//foundation/multimedia/audio_standard/frameworks/native/audiostream/include", 34 "//foundation/multimedia/audio_standard/interfaces/inner_api/native/audiocapturer/include", 35 "//foundation/multimedia/audio_standard/interfaces/inner_api/native/audiocommon/include", 36 "//foundation/multimedia/audio_standard/interfaces/inner_api/native/audiomanager/include", 37 "//foundation/multimedia/audio_standard/interfaces/inner_api/native/audiorenderer/include", 38 "//foundation/multimedia/audio_standard/services/include", 39 "//foundation/multimedia/audio_standard/services/include/audio_service/client", 40 "//foundation/multimedia/audio_standard/services/include/audio_policy/client", 41 "//foundation/multimedia/audio_standard/services/include/audio_policy/common", 42 "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", 43 "//utils/system/safwk/native/include", 44 "//utils/native/base/include", 45 "$pulseaudio_dir/src", 46 "$pulseaudio_dir/confgure/src", 47 "$pulseaudio_dir/include", 48 "$pulseaudio_build_path/include", 49 "//third_party/bounds_checking_function/include", 50 ] 51 52 cflags = [ 53 "-Wall", 54 "-Werror", 55 ] 56 57 if ("${product_name}" == "m40") { 58 cflags += [ "-DPRODUCT_M40" ] 59 } 60 61 if (target_cpu == "arm") { 62 cflags += [ "-DBINDER_IPC_32BIT" ] 63 } 64} 65 66ohos_shared_library("audio_client") { 67 install_enable = true 68 sources = [ 69 "//foundation/multimedia/audio_standard/services/src/audio_service/client/audio_manager_proxy.cpp", 70 "//foundation/multimedia/audio_standard/services/src/audio_service/client/audio_service_client.cpp", 71 "//foundation/multimedia/audio_standard/services/src/audio_service/client/audio_session.cpp", 72 "//foundation/multimedia/audio_standard/services/src/audio_service/client/audio_stream.cpp", 73 "//foundation/multimedia/audio_standard/services/src/audio_service/client/audio_system_manager.cpp", 74 ] 75 76 public_configs = [ ":audio_client_public_config" ] 77 78 deps = [ 79 "//foundation/multimedia/audio_standard/frameworks/native/audiopolicy:audio_policy_client", 80 "//foundation/multimedia/audio_standard/frameworks/native/pulseaudio/src/pulse:pulse", 81 "//third_party/bounds_checking_function:libsec_static", 82 "//utils/native/base:utils", 83 ] 84 85 external_deps = [ 86 "hiviewdfx_hilog_native:libhilog", 87 "ipc:ipc_core", 88 "samgr_standard:samgr_proxy", 89 ] 90 subsystem_name = "multimedia" 91 part_name = "multimedia_audio_standard" 92} 93 94ohos_executable("playback_test") { 95 install_enable = false 96 97 sources = [ 98 "//foundation/multimedia/audio_standard/services/test/playback_test.cpp", 99 ] 100 101 configs = [ ":audio_client_public_config" ] 102 103 deps = [ ":audio_client" ] 104 105 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 106 107 part_name = "multimedia_audio_standard" 108 subsystem_name = "multimedia" 109} 110 111ohos_executable("record_test") { 112 install_enable = false 113 114 sources = 115 [ "//foundation/multimedia/audio_standard/services/test/record_test.cpp" ] 116 117 configs = [ ":audio_client_public_config" ] 118 119 deps = [ ":audio_client" ] 120 121 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 122 123 part_name = "multimedia_audio_standard" 124 subsystem_name = "multimedia" 125} 126