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("//foundation/multimedia/audio_framework/audio_ohcore.gni") 16 17pulseaudio_dir = "//third_party/pulseaudio" 18 19config("audio_renderer_config") { 20 include_dirs = [ 21 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiorenderer/include", 22 "//foundation/multimedia/audio_framework/frameworks/native/audiorenderer/include", 23 "//foundation/multimedia/audio_framework/frameworks/native/audiostream/include", 24 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiocommon/include", 25 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiomanager/include", 26 "//foundation/multimedia/audio_framework/services/audio_service/client/include", 27 "//foundation/multimedia/audio_framework/services/audio_service/test/example", 28 "//commonlibrary/c_utils/base/include", 29 "$pulseaudio_dir/src", 30 "$pulseaudio_dir/confgure/src", 31 ] 32 33 cflags = [ 34 "-Wall", 35 "-Werror", 36 ] 37} 38 39ohos_shared_library("audio_renderer") { 40 sanitize = { 41 cfi = true 42 debug = false 43 blocklist = "//foundation/multimedia/audio_framework/cfi_blocklist.txt" 44 } 45 install_enable = true 46 47 configs = [ ":audio_renderer_config" ] 48 49 if ("${product_name}" == "ohcore") { 50 defines = [ "OHCORE" ] 51 } 52 53 include_dirs = audio_gateway_include_dirs 54 55 sources = [ 56 "src/audio_renderer.cpp", 57 "src/audio_renderer_proxy_obj.cpp", 58 ] 59 60 deps = [ 61 "//foundation/multimedia/audio_framework/services/audio_policy:audio_policy_client", 62 "//foundation/multimedia/audio_framework/services/audio_service:audio_client", 63 ] 64 65 deps += audio_renderer_gateway_deps 66 67 public_configs = [ ":audio_external_library_config" ] 68 69 external_deps = [ 70 "c_utils:utils", 71 "hiviewdfx_hilog_native:libhilog", 72 ] 73 74 part_name = "multimedia_audio_framework" 75 subsystem_name = "multimedia" 76} 77 78config("audio_external_library_config") { 79 include_dirs = [ "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiorenderer/include" ] 80} 81 82group("audio_renderer_test_packages") { 83 deps = [ 84 ":audio_interrupt_test", 85 ":audio_latency_accuracy_test", 86 ":audio_render_mode_callback_test", 87 ":audio_renderer_test", 88 ":audio_voip_test", 89 ":interrupt_multi_renderer_test", 90 ] 91} 92 93ohos_executable("audio_renderer_test") { 94 install_enable = false 95 96 sources = [ "test/example/audio_renderer_test.cpp" ] 97 98 configs = [ ":audio_renderer_config" ] 99 100 deps = [ ":audio_renderer" ] 101 102 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 103 104 part_name = "multimedia_audio_framework" 105 subsystem_name = "multimedia" 106} 107 108ohos_executable("audio_latency_accuracy_test") { 109 install_enable = false 110 111 sources = [ "test/example/audio_renderer_test.cpp" ] 112 113 configs = [ ":audio_renderer_config" ] 114 cflags = [ "-DLATENCY_ACCURACY_TEST" ] 115 116 deps = [ ":audio_renderer" ] 117 118 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 119 120 part_name = "multimedia_audio_framework" 121 subsystem_name = "multimedia" 122} 123 124ohos_executable("audio_render_mode_callback_test") { 125 install_enable = false 126 127 sources = [ "test/example/audio_render_mode_callback_test.cpp" ] 128 129 configs = [ ":audio_renderer_config" ] 130 131 deps = [ ":audio_renderer" ] 132 133 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 134 135 part_name = "multimedia_audio_framework" 136 subsystem_name = "multimedia" 137} 138 139ohos_executable("audio_voip_test") { 140 install_enable = false 141 142 sources = [ "test/example/audio_voip_test.cpp" ] 143 144 include_dirs = [ 145 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiocapturer/include", 146 "//foundation/multimedia/audio_framework/frameworks/native/audiocapturer/include", 147 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiorenderer/include", 148 "//foundation/multimedia/audio_framework/frameworks/native/audiorenderer/include", 149 "//foundation/multimedia/audio_framework/frameworks/native/audiostream/include", 150 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiocommon/include", 151 "//foundation/multimedia/audio_framework/services/audio_service/client/include", 152 "//commonlibrary/c_utils/base/include", 153 "$pulseaudio_dir/src", 154 "$pulseaudio_dir/confgure/src", 155 ] 156 157 cflags = [ 158 "-Wall", 159 "-Werror", 160 ] 161 162 configs = [ ":audio_renderer_config" ] 163 164 deps = [ 165 ":audio_renderer", 166 "//foundation/multimedia/audio_framework/frameworks/native/audiocapturer:audio_capturer", 167 ] 168 169 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 170 171 part_name = "multimedia_audio_framework" 172 subsystem_name = "multimedia" 173} 174 175ohos_executable("audio_interrupt_test") { 176 install_enable = false 177 178 sources = [ "test/example/audio_interrupt_test.cpp" ] 179 180 configs = [ ":audio_renderer_config" ] 181 182 deps = [ 183 ":audio_renderer", 184 "//foundation/multimedia/audio_framework/services/audio_service:audio_client", 185 ] 186 187 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 188 189 part_name = "multimedia_audio_framework" 190 subsystem_name = "multimedia" 191} 192 193ohos_executable("interrupt_multi_renderer_test") { 194 install_enable = false 195 196 sources = [ "test/example/interrupt_multi_renderer_test.cpp" ] 197 198 configs = [ ":audio_renderer_config" ] 199 200 deps = [ ":audio_renderer" ] 201 202 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 203 204 part_name = "multimedia_audio_framework" 205 subsystem_name = "multimedia" 206} 207