1# Copyright (c) 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("//foundation/multimedia/media_foundation/config.gni") 15 16if (hst_is_lite_sys) { 17 group("media_monitor_packages") { 18 deps = [] 19 } 20} else { 21 group("media_monitor_packages") { 22 deps = [ 23 ":media_monitor", 24 ":media_monitor_common", 25 ":media_monitor_init", 26 ":media_monitor_wrapper", 27 "sa_profile:media_monitor_sa_profile", 28 ] 29 } 30} 31 32if (hst_is_lite_sys) { 33 group("media_monitor_public_config") { 34 deps = [] 35 } 36} else { 37 config("media_monitor_public_config") { 38 include_dirs = [ 39 "common/include", 40 "client/include", 41 "../../interface/inner_api/common/", 42 ] 43 defines = [ "MEDIA_OHOS" ] 44 } 45} 46 47if (hst_is_lite_sys) { 48 group("media_monitor.para") { 49 deps = [] 50 } 51} else { 52 ohos_prebuilt_etc("media_monitor.para") { 53 source = "etc/media_monitor.para" 54 subsystem_name = "multimedia" 55 part_name = "media_foundation" 56 module_install_dir = "etc/param" 57 } 58} 59 60if (hst_is_lite_sys) { 61 group("media_monitor.para.dac") { 62 deps = [] 63 } 64} else { 65 ohos_prebuilt_etc("media_monitor.para.dac") { 66 source = "etc/media_monitor.para.dac" 67 subsystem_name = "multimedia" 68 part_name = "media_foundation" 69 module_install_dir = "etc/param" 70 } 71} 72 73if (hst_is_lite_sys) { 74 group("media_monitor_init") { 75 deps = [] 76 } 77} else { 78 ohos_prebuilt_etc("media_monitor_init") { 79 source = "etc/media_monitor.cfg" 80 relative_install_dir = "init" 81 part_name = "media_foundation" 82 subsystem_name = "multimedia" 83 } 84} 85 86if (hst_is_lite_sys) { 87 group("media_monitor_buffer") { 88 deps = [] 89 } 90} else { 91 ohos_shared_library("media_monitor_buffer") { 92 sanitize = { 93 ubsan = true 94 boundary_sanitize = true 95 cfi = true 96 cfi_cross_dso = true 97 debug = false 98 integer_overflow = true 99 } 100 101 public_configs = [ ":media_monitor_public_config" ] 102 103 install_enable = true 104 105 include_dirs = [ 106 "buffer/include", 107 "../../interface/inner_api/common/", 108 "../../interface/inner_api/buffer/", 109 ] 110 111 sources = [ 112 "buffer/src/dump_buffer_define.cpp", 113 "buffer/src/dump_buffer_manager.cpp", 114 ] 115 116 cflags = [ 117 "-std=c++17", 118 "-fno-rtti", 119 "-fexceptions", 120 "-Wall", 121 "-fno-common", 122 "-fstack-protector-strong", 123 "-Wshadow", 124 "-FPIC", 125 "-FS", 126 "-O2", 127 "-D_FORTIFY_SOURCE=2", 128 "-Wformat=2", 129 "-Wdate-time", 130 "-Werror", 131 "-Wextra", 132 "-Wimplicit-fallthrough", 133 "-Wsign-compare", 134 "-Wunused-parameter", 135 "-Dprivate=public", 136 "-Dprotected=public", 137 ] 138 139 deps = [ "//foundation/multimedia/media_foundation/src:media_foundation" ] 140 141 external_deps = [ 142 "c_utils:utils", 143 "hilog:libhilog", 144 "ipc:ipc_single", 145 "samgr:samgr_proxy", 146 ] 147 148 subsystem_name = "multimedia" 149 part_name = "media_foundation" 150 innerapi_tags = [ "platformsdk" ] 151 } 152} 153 154if (hst_is_lite_sys) { 155 group("media_monitor_common") { 156 deps = [] 157 } 158} else { 159 ohos_shared_library("media_monitor_common") { 160 branch_protector_ret = "pac_ret" 161 sanitize = { 162 ubsan = true 163 boundary_sanitize = true 164 cfi = true 165 cfi_cross_dso = true 166 debug = false 167 integer_overflow = true 168 } 169 170 public_configs = [ ":media_monitor_public_config" ] 171 172 install_enable = true 173 174 include_dirs = [ 175 "buffer/include", 176 "common/include", 177 "../../interface/inner_api/common/", 178 ] 179 180 sources = [ 181 "common/src/dump_buffer_wrap.cpp", 182 "common/src/event_bean.cpp", 183 "common/src/monitor_utils.cpp", 184 "common/src/string_converter.cpp", 185 ] 186 187 cflags = [ 188 "-std=c++17", 189 "-fno-rtti", 190 "-fexceptions", 191 "-Wall", 192 "-fno-common", 193 "-fstack-protector-strong", 194 "-Wshadow", 195 "-FPIC", 196 "-FS", 197 "-O2", 198 "-D_FORTIFY_SOURCE=2", 199 "-Wformat=2", 200 "-Wdate-time", 201 "-Werror", 202 "-Wextra", 203 "-Wimplicit-fallthrough", 204 "-Wsign-compare", 205 "-Wunused-parameter", 206 "-Dprivate=public", 207 "-Dprotected=public", 208 ] 209 210 deps = [] 211 212 external_deps = [ 213 "c_utils:utils", 214 "hilog:libhilog", 215 "ipc:ipc_single", 216 "samgr:samgr_proxy", 217 ] 218 219 subsystem_name = "multimedia" 220 part_name = "media_foundation" 221 innerapi_tags = [ "platformsdk" ] 222 } 223} 224 225if (hst_is_lite_sys) { 226 group("media_monitor") { 227 deps = [] 228 } 229} else { 230 ohos_shared_library("media_monitor") { 231 stack_protector_ret = true 232 sanitize = { 233 ubsan = true 234 boundary_sanitize = true 235 cfi = true 236 cfi_cross_dso = true 237 debug = false 238 integer_overflow = true 239 } 240 install_enable = true 241 242 sources = [ 243 "server/src/audio_buffer_cache.cpp", 244 "server/src/audio_memo.cpp", 245 "server/src/event_aggregate.cpp", 246 "server/src/ffmpeg_api_wrap.cpp", 247 "server/src/media_audio_encoder.cpp", 248 "server/src/media_event_base_writer.cpp", 249 "server/src/media_monitor_policy.cpp", 250 "server/src/media_monitor_service.cpp", 251 "server/src/media_monitor_stub.cpp", 252 "server/src/media_monitor_wrapper.cpp", 253 ] 254 255 configs = [] 256 257 include_dirs = [ 258 "buffer/include", 259 "client/include", 260 "server/include", 261 "common/include", 262 "../../interface/inner_api/common/", 263 ] 264 265 deps = [ 266 ":media_monitor.para", 267 ":media_monitor.para.dac", 268 ":media_monitor_common", 269 ] 270 271 external_deps = [ 272 "ability_base:want", 273 "audio_framework:audio_client", 274 "c_utils:utils", 275 "hilog:libhilog", 276 "init:libbegetutil", 277 "ipc:ipc_single", 278 "safwk:system_ability_fwk", 279 "samgr:samgr_proxy", 280 ] 281 282 public_external_deps = [ "ffmpeg:libohosffmpeg" ] 283 284 defines = [] 285 286 if (has_hisysevent_part) { 287 defines += [ "MONITOR_ENABLE_HISYSEVENT" ] 288 external_deps += [ "hisysevent:libhisysevent" ] 289 } 290 291 subsystem_name = "multimedia" 292 part_name = "media_foundation" 293 } 294} 295 296if (hst_is_lite_sys) { 297 group("media_monitor_wrapper") { 298 deps = [] 299 } 300} else { 301 ohos_shared_library("media_monitor_wrapper") { 302 stack_protector_ret = true 303 sanitize = { 304 ubsan = true 305 boundary_sanitize = true 306 cfi = true 307 cfi_cross_dso = true 308 debug = false 309 integer_overflow = true 310 } 311 install_enable = true 312 313 sources = [ "server/src/boundle_mgr_wrap_to_c.cpp" ] 314 315 configs = [] 316 317 include_dirs = [ 318 "buffer/include", 319 "client/include", 320 "server/include", 321 "common/include", 322 "../../interface/inner_api/common/", 323 ] 324 325 deps = [ 326 ":media_monitor.para", 327 ":media_monitor.para.dac", 328 ":media_monitor_common", 329 ] 330 331 external_deps = [ 332 "ability_base:want", 333 "audio_framework:audio_client", 334 "bundle_framework:appexecfwk_base", 335 "bundle_framework:appexecfwk_core", 336 "c_utils:utils", 337 "hilog:libhilog", 338 "init:libbegetutil", 339 "ipc:ipc_single", 340 "safwk:system_ability_fwk", 341 "samgr:samgr_proxy", 342 ] 343 344 public_external_deps = [ "ffmpeg:libohosffmpeg" ] 345 346 defines = [] 347 348 if (has_hisysevent_part) { 349 defines += [ "MONITOR_ENABLE_HISYSEVENT" ] 350 external_deps += [ "hisysevent:libhisysevent" ] 351 } 352 353 subsystem_name = "multimedia" 354 part_name = "media_foundation" 355 } 356} 357 358if (hst_is_lite_sys) { 359 group("media_monitor_client") { 360 deps = [] 361 } 362} else { 363 ohos_shared_library("media_monitor_client") { 364 branch_protector_ret = "pac_ret" 365 sanitize = { 366 ubsan = true 367 boundary_sanitize = true 368 cfi = true 369 cfi_cross_dso = true 370 debug = false 371 integer_overflow = true 372 } 373 374 public_configs = [ ":media_monitor_public_config" ] 375 376 install_enable = true 377 378 sources = [ 379 "client/src/media_monitor_client.cpp", 380 "client/src/media_monitor_manager.cpp", 381 ] 382 383 include_dirs = [ 384 "buffer/include", 385 "client/include", 386 "server/include", 387 "common/include", 388 "../../interface/inner_api/common/", 389 ] 390 391 deps = [ ":media_monitor_common" ] 392 393 external_deps = [ 394 "c_utils:utils", 395 "hilog:libhilog", 396 "init:libbegetutil", 397 "ipc:ipc_single", 398 "samgr:samgr_proxy", 399 ] 400 401 subsystem_name = "multimedia" 402 innerapi_tags = [ "platformsdk" ] 403 part_name = "media_foundation" 404 } 405} 406