1# Copyright (c) 2021-2024 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("../../../config.gni") 16 17config("audio_capturer_config") { 18 include_dirs = [ 19 "include", 20 "../../../interfaces/inner_api/native/audiocommon/include", 21 "../../../interfaces/inner_api/native/audiocapturer/include", 22 "../../../frameworks/native/audiostream/include", 23 "../../../services/audio_service/client/include", 24 ] 25 26 cflags = [ 27 "-Wall", 28 "-Werror", 29 ] 30} 31 32config("audio_external_library_config") { 33 include_dirs = [ 34 "include", 35 "../../../interfaces/inner_api/native/audiocapturer/include", 36 "../../../interfaces/inner_api/native/audiocommon/include", 37 "../../../frameworks/native/audiostream/include", 38 "../../../services/audio_service/client/include", 39 "../../../interfaces/kits/c/common", 40 ] 41} 42 43ohos_shared_library("audio_capturer") { 44 branch_protector_ret = "pac_ret" 45 sanitize = { 46 cfi = true 47 cfi_cross_dso = true 48 cfi_vcall_icall_only = true 49 debug = false 50 } 51 install_enable = true 52 53 configs = [ ":audio_capturer_config" ] 54 55 sources = [ 56 "src/audio_capturer.cpp", 57 "src/audio_capturer_proxy_obj.cpp", 58 ] 59 60 deps = [ 61 "../../../services/audio_policy:audio_policy_client", 62 "../../../services/audio_service:audio_client", 63 "../audioutils:audio_utils", 64 ] 65 66 public_configs = [ ":audio_external_library_config" ] 67 68 external_deps = [ 69 "c_utils:utils", 70 "eventhandler:libeventhandler", 71 "hilog:libhilog", 72 "ipc:ipc_single", 73 "media_foundation:media_monitor_client", 74 "media_foundation:media_monitor_common", 75 "pulseaudio:pulse", 76 "samgr:samgr_proxy", 77 ] 78 79 version_script = "../../../audio_framework.versionscript" 80 innerapi_tags = [ "platformsdk" ] 81 82 part_name = "audio_framework" 83 subsystem_name = "multimedia" 84} 85 86group("audio_capturer_test_packages") { 87 deps = [ ":audio_capturer_test" ] 88} 89 90ohos_executable("audio_capturer_test") { 91 install_enable = false 92 93 sources = [ "test/example/audio_capturer_test.cpp" ] 94 95 configs = [ ":audio_capturer_config" ] 96 97 deps = [ ":audio_capturer" ] 98 99 external_deps = [ "hilog:libhilog" ] 100 101 part_name = "audio_framework" 102 subsystem_name = "multimedia" 103} 104 105ohos_executable("audio_inner_capturer_test") { 106 install_enable = false 107 sanitize = { 108 cfi = true 109 cfi_cross_dso = true 110 debug = false 111 } 112 cflags = [ 113 "-Wall", 114 "-Werror", 115 ] 116 117 include_dirs = [ "../../../interfaces/inner_api/native/audiocommon/include" ] 118 119 sources = [ "test/example/audio_inner_capturer_test.cpp" ] 120 121 deps = [ ":audio_capturer" ] 122 123 external_deps = [ 124 "c_utils:utils", 125 "hilog:libhilog", 126 ] 127 128 part_name = "audio_framework" 129 subsystem_name = "multimedia" 130} 131