# Copyright (c) 2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//foundation/multimedia/media_foundation/config.gni") if (hst_is_lite_sys) { group("media_monitor_packages") { deps = [] } } else { group("media_monitor_packages") { deps = [ ":media_monitor", ":media_monitor_common", ":media_monitor_init", "sa_profile:media_monitor_sa_profile", ] } } if (hst_is_lite_sys) { group("media_monitor_public_config") { deps = [] } } else { config("media_monitor_public_config") { include_dirs = [ "common/include", "client/include", "../../interface/inner_api/common/", ] defines = [ "MEDIA_OHOS" ] } } if (hst_is_lite_sys) { group("media_monitor.para") { deps = [] } } else { ohos_prebuilt_etc("media_monitor.para") { source = "etc/media_monitor.para" part_name = "media_foundation" module_install_dir = "etc/param" } } if (hst_is_lite_sys) { group("media_monitor.para.dac") { deps = [] } } else { ohos_prebuilt_etc("media_monitor.para.dac") { source = "etc/media_monitor.para.dac" part_name = "media_foundation" module_install_dir = "etc/param" } } if (hst_is_lite_sys) { group("media_monitor_init") { deps = [] } } else { ohos_prebuilt_etc("media_monitor_init") { source = "etc/media_monitor.cfg" relative_install_dir = "init" part_name = "media_foundation" subsystem_name = "multimedia" } } if (hst_is_lite_sys) { group("media_monitor_buffer") { deps = [] } } else { ohos_shared_library("media_monitor_buffer") { sanitize = { ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false integer_overflow = true } public_configs = [ ":media_monitor_public_config" ] install_enable = true include_dirs = [ "buffer/include", "../../interface/inner_api/common/", "../../interface/inner_api/buffer/", ] sources = [ "buffer/src/dump_buffer_define.cpp", "buffer/src/dump_buffer_manager.cpp", ] cflags = [ "-std=c++17", "-fno-rtti", "-fexceptions", "-Wall", "-fno-common", "-fstack-protector-strong", "-Wshadow", "-FPIC", "-FS", "-O2", "-D_FORTIFY_SOURCE=2", "-Wformat=2", "-Wdate-time", "-Werror", "-Wextra", "-Wimplicit-fallthrough", "-Wsign-compare", "-Wunused-parameter", "-Dprivate=public", "-Dprotected=public", ] deps = [ "//foundation/multimedia/media_foundation/src:media_foundation" ] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "samgr:samgr_proxy", ] subsystem_name = "multimedia" part_name = "media_foundation" innerapi_tags = [ "platformsdk" ] } } if (hst_is_lite_sys) { group("media_monitor_common") { deps = [] } } else { ohos_shared_library("media_monitor_common") { branch_protector_ret = "pac_ret" sanitize = { ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false integer_overflow = true } public_configs = [ ":media_monitor_public_config" ] install_enable = true include_dirs = [ "buffer/include", "common/include", "../../interface/inner_api/common/", ] sources = [ "common/src/dump_buffer_wrap.cpp", "common/src/event_bean.cpp", "common/src/monitor_utils.cpp", ] cflags = [ "-std=c++17", "-fno-rtti", "-fexceptions", "-Wall", "-fno-common", "-fstack-protector-strong", "-Wshadow", "-FPIC", "-FS", "-O2", "-D_FORTIFY_SOURCE=2", "-Wformat=2", "-Wdate-time", "-Werror", "-Wextra", "-Wimplicit-fallthrough", "-Wsign-compare", "-Wunused-parameter", "-Dprivate=public", "-Dprotected=public", ] deps = [] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "samgr:samgr_proxy", ] subsystem_name = "multimedia" part_name = "media_foundation" innerapi_tags = [ "platformsdk" ] } } if (hst_is_lite_sys) { group("media_monitor") { deps = [] } } else { ohos_shared_library("media_monitor") { stack_protector_ret = true sanitize = { ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false integer_overflow = true } install_enable = true sources = [ "server/src/audio_buffer_cache.cpp", "server/src/audio_memo.cpp", "server/src/event_aggregate.cpp", "server/src/ffmpeg_api_wrap.cpp", "server/src/media_audio_encoder.cpp", "server/src/media_event_base_writer.cpp", "server/src/media_monitor_policy.cpp", "server/src/media_monitor_service.cpp", "server/src/media_monitor_stub.cpp", ] configs = [] include_dirs = [ "buffer/include", "client/include", "server/include", "common/include", "../../interface/inner_api/common/", ] deps = [ ":media_monitor.para", ":media_monitor.para.dac", ":media_monitor_common", ] external_deps = [ "ability_base:want", "audio_framework:audio_client", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] public_external_deps = [ "ffmpeg:libohosffmpeg" ] defines = [] if (has_hisysevent_part) { defines += [ "MONITOR_ENABLE_HISYSEVENT" ] external_deps += [ "hisysevent:libhisysevent" ] } subsystem_name = "multimedia" part_name = "media_foundation" } } if (hst_is_lite_sys) { group("media_monitor_client") { deps = [] } } else { ohos_shared_library("media_monitor_client") { branch_protector_ret = "pac_ret" sanitize = { ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false integer_overflow = true } public_configs = [ ":media_monitor_public_config" ] install_enable = true sources = [ "client/src/media_monitor_client.cpp", "client/src/media_monitor_manager.cpp", ] include_dirs = [ "buffer/include", "client/include", "server/include", "common/include", "../../interface/inner_api/common/", ] deps = [ ":media_monitor_common" ] external_deps = [ "c_utils:utils", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "samgr:samgr_proxy", ] subsystem_name = "multimedia" innerapi_tags = [ "platformsdk" ] part_name = "media_foundation" } }