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_capturer_config") { 20 include_dirs = [ 21 "include", 22 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiocommon/include", 23 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiocapturer/include", 24 "//foundation/multimedia/audio_framework/frameworks/native/audiostream/include", 25 "//foundation/multimedia/audio_framework/services/audio_service/client/include", 26 "$pulseaudio_dir/src", 27 "$pulseaudio_dir/confgure/src", 28 ] 29 30 cflags = [ 31 "-Wall", 32 "-Werror", 33 ] 34} 35 36ohos_shared_library("audio_capturer") { 37 sanitize = { 38 cfi = true 39 debug = false 40 blocklist = "//foundation/multimedia/audio_framework/cfi_blocklist.txt" 41 } 42 install_enable = true 43 44 configs = [ ":audio_capturer_config" ] 45 46 if ("${product_name}" == "ohcore") { 47 defines = [ "OHCORE" ] 48 } 49 50 include_dirs = audio_gateway_include_dirs 51 52 sources = [ 53 "src/audio_capturer.cpp", 54 "src/audio_capturer_proxy_obj.cpp", 55 ] 56 57 deps = [ "//foundation/multimedia/audio_framework/services/audio_service:audio_client" ] 58 59 deps += audio_capturer_gateway_deps 60 61 public_configs = [ ":audio_external_library_config" ] 62 63 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 64 65 part_name = "multimedia_audio_framework" 66 subsystem_name = "multimedia" 67} 68 69config("audio_external_library_config") { 70 include_dirs = [ "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiocapturer/include" ] 71} 72 73group("audio_capturer_test_packages") { 74 deps = [ ":audio_capturer_test" ] 75} 76 77ohos_executable("audio_capturer_test") { 78 install_enable = false 79 80 sources = [ "test/example/audio_capturer_test.cpp" ] 81 82 configs = [ ":audio_capturer_config" ] 83 84 deps = [ ":audio_capturer" ] 85 86 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 87 88 part_name = "multimedia_audio_framework" 89 subsystem_name = "multimedia" 90} 91