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") 15 16pulseaudio_dir = "//third_party/pulseaudio" 17pulseaudio_build_path = "//third_party/pulseaudio/ohosbuild" 18 19config("hdi_config") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ 23 "$pulseaudio_dir/include", 24 "$pulseaudio_dir/src", 25 "$pulseaudio_dir", 26 "$pulseaudio_build_path/src", 27 "$pulseaudio_build_path/include", 28 "//drivers/peripheral/audio/interfaces/include", 29 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiocommon/include", 30 "//foundation/multimedia/audio_framework/frameworks/native/hdiadapter/sink/common", 31 "//foundation/multimedia/audio_framework/frameworks/native/hdiadapter/sink/primary", 32 "//foundation/multimedia/audio_framework/frameworks/native/hdiadapter/sink/file", 33 "//foundation/multimedia/audio_framework/frameworks/native/hdiadapter/sink/bluetooth", 34 "//foundation/multimedia/audio_framework/frameworks/native/hdiadapter/sink/remote", 35 "//foundation/multimedia/audio_framework/frameworks/native/hdiadapter/source/common", 36 "//foundation/multimedia/audio_framework/frameworks/native/hdiadapter/source/primary", 37 "//foundation/multimedia/audio_framework/frameworks/native/hdiadapter/source/file", 38 "//foundation/multimedia/audio_framework/frameworks/native/hdiadapter/source/remote", 39 "//commonlibrary/c_utils/base/include", 40 ] 41 42 cflags = [ 43 "-Wall", 44 "-Werror", 45 "-DHAVE_CONFIG_H", 46 "-D_GNU_SOURCE", 47 "-D__INCLUDED_FROM_PULSE_AUDIO", 48 ] 49} 50 51ohos_shared_library("module-hdi-sink") { 52 sanitize = { 53 cfi = true 54 debug = false 55 blocklist = "//foundation/multimedia/audio_framework/cfi_blocklist.txt" 56 } 57 sources = [ 58 "hdi_sink.c", 59 "module_hdi_sink.c", 60 ] 61 62 configs = [ ":hdi_config" ] 63 64 cflags = [ "-DPA_MODULE_NAME=libmodule_hdi_sink_z_so" ] 65 66 ldflags = [ 67 "-Wl", 68 "--no-undefined", 69 ] 70 71 deps = [ 72 "$pulseaudio_build_path/src:pulsecommon", 73 "$pulseaudio_build_path/src/pulse:pulse", 74 "$pulseaudio_build_path/src/pulsecore:pulsecore", 75 "//foundation/multimedia/audio_framework/frameworks/native/hdiadapter/sink:renderer_sink_adapter", 76 ] 77 78 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 79 80 subsystem_name = "multimedia" 81 part_name = "multimedia_audio_framework" 82} 83 84ohos_shared_library("module-hdi-source") { 85 sanitize = { 86 cfi = true 87 debug = false 88 blocklist = "//foundation/multimedia/audio_framework/cfi_blocklist.txt" 89 } 90 sources = [ 91 "hdi_source.c", 92 "module_hdi_source.c", 93 ] 94 95 configs = [ ":hdi_config" ] 96 97 cflags = [ "-DPA_MODULE_NAME=libmodule_hdi_source_z_so" ] 98 99 deps = [ 100 "$pulseaudio_build_path/src:pulsecommon", 101 "$pulseaudio_build_path/src/pulse:pulse", 102 "$pulseaudio_build_path/src/pulsecore:pulsecore", 103 "//foundation/multimedia/audio_framework/frameworks/native/hdiadapter/source:capturer_source_adapter", 104 "//third_party/bounds_checking_function:libsec_shared", 105 ] 106 107 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 108 109 subsystem_name = "multimedia" 110 part_name = "multimedia_audio_framework" 111} 112