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