1# Copyright (c) 2025 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/test.gni") 15import("//foundation/multimedia/player_framework/config.gni") 16 17module_output_path = "player_framework/player" 18 19ohos_unittest("monitor_server_test") { 20 module_out_path = module_output_path 21 22 include_dirs = [ 23 "$MEDIA_PLAYER_ROOT_DIR/services/services/sa_media/ipc", 24 "$MEDIA_PLAYER_ROOT_DIR/services/services/sa_media/server", 25 "$MEDIA_PLAYER_ROOT_DIR/services/services/sa_media/server_manager", 26 "$MEDIA_PLAYER_ROOT_DIR/services/services/common", 27 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/audio_background_adapter", 28 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/ipc", 29 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/player_mem_manage", 30 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/server", 31 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/subscriber", 32 "$MEDIA_PLAYER_ROOT_DIR/services/services/media_data_source/ipc", 33 "$MEDIA_PLAYER_ROOT_DIR/services/services/media_data_source/server", 34 "$MEDIA_PLAYER_ROOT_DIR/services/services/media_source/ipc", 35 "$MEDIA_PLAYER_ROOT_DIR/services/services/media_source/server", 36 "$MEDIA_PLAYER_ROOT_DIR/services/services/monitor/client", 37 "$MEDIA_PLAYER_ROOT_DIR/services/services/monitor/ipc", 38 "$MEDIA_PLAYER_ROOT_DIR/services/services/monitor/server", 39 "$MEDIA_PLAYER_ROOT_DIR/services/services/recorder/ipc", 40 "$MEDIA_PLAYER_ROOT_DIR/services/services/recorder/server", 41 "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/ipc", 42 "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/server", 43 "$MEDIA_PLAYER_ROOT_DIR/services/services/avcodec/ipc", 44 "$MEDIA_PLAYER_ROOT_DIR/services/services/avcodec/server", 45 "$MEDIA_PLAYER_ROOT_DIR/services/services/avcodeclist/ipc", 46 "$MEDIA_PLAYER_ROOT_DIR/services/services/avcodeclist/server", 47 "$MEDIA_PLAYER_ROOT_DIR/services/services/recorder_profiles/ipc", 48 "$MEDIA_PLAYER_ROOT_DIR/services/services/recorder_profiles/server", 49 "$MEDIA_PLAYER_ROOT_DIR/services/services/screen_capture/server", 50 "$MEDIA_PLAYER_ROOT_DIR/services/services/screen_capture/ipc", 51 "$MEDIA_PLAYER_ROOT_DIR/services/services/screen_capture_monitor/server", 52 "$MEDIA_PLAYER_ROOT_DIR/services/services/screen_capture_monitor/ipc", 53 "$MEDIA_PLAYER_ROOT_DIR/services/services/transcoder/server", 54 "$MEDIA_PLAYER_ROOT_DIR/services/services/transcoder/ipc", 55 "$MEDIA_PLAYER_ROOT_DIR/services/services/observer", 56 "$MEDIA_PLAYER_ROOT_DIR/services/include", 57 "$MEDIA_PLAYER_ROOT_DIR/services/services/factory", 58 "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf", 59 "$MEDIA_PLAYER_ROOT_DIR/services/utils/include", 60 "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native", 61 "$MEDIA_PLAYER_ROOT_DIR/services/services/common", 62 "$MEDIA_PLAYER_ROOT_DIR/services/engine/common/recorder_profiles", 63 "$MEDIA_PLAYER_ROOT_DIR/services/dfx", 64 ] 65 66 if (player_framework_support_avsession_background) { 67 include_dirs += [ 68 "$MEDIA_PLAYER_ROOT_DIR/services/services/player/avsession_background", 69 ] 70 } 71 72 cflags = [ 73 "-Wall", 74 "-Werror", 75 "-Dprivate=public", 76 "-Dprotected=public", 77 ] 78 sanitize = { 79 cfi = true 80 cfi_cross_dso = true 81 } 82 83 external_deps = [ 84 "ability_runtime:ability_connect_callback_stub", 85 "access_token:libaccesstoken_sdk", 86 "access_token:libtokenid_sdk", 87 "audio_framework:audio_client", 88 "av_codec:av_codec_client", 89 "c_utils:utils", 90 "common_event_service:cesfwk_innerkits", 91 "graphic_2d:librender_service_base", 92 "hdf_core:libhdi", 93 "hicollie:libhicollie", 94 "hilog:libhilog", 95 "hisysevent:libhisysevent", 96 "hitrace:hitrace_meter", 97 "hitrace:libhitracechain", 98 "hiview:libucollection_client", 99 "i18n:intl_util", 100 "image_framework:image_native", 101 "init:libbegetutil", 102 "ipc:ipc_single", 103 "jsoncpp:jsoncpp", 104 "libxml2:libxml2", 105 "media_foundation:media_foundation", 106 "memmgr:memmgrclient", 107 "napi:ace_napi", 108 "os_account:os_account_innerkits", 109 "qos_manager:qos", 110 "resource_management:global_resmgr", 111 "resource_schedule_service:ressched_client", 112 "safwk:system_ability_fwk", 113 "samgr:samgr_proxy", 114 ] 115 116 if (player_framework_support_video) { 117 external_deps += [ "graphic_surface:surface" ] 118 } 119 120 if (player_framework_support_screen_capture_stopbycall) { 121 external_deps += [ 122 "call_manager:tel_call_manager_api", 123 "core_service:tel_core_service_api", 124 "state_registry:tel_state_registry_api", 125 ] 126 } 127 128 if (player_framework_support_screen_capture) { 129 external_deps += [ 130 "ability_base:base", 131 "ability_base:want", 132 "ability_base:zuri", 133 "ability_runtime:ability_context_native", 134 "ability_runtime:ability_manager", 135 "ability_runtime:abilitykit_native", 136 "ability_runtime:extension_manager", 137 "ability_runtime:runtime", 138 "access_token:libnativetoken_shared", 139 "access_token:libprivacy_sdk", 140 "access_token:libtokensetproc_shared", 141 "audio_framework:audio_capturer", 142 "audio_framework:audio_client", 143 "distributed_notification_service:ans_innerkits", 144 "graphic_surface:sync_fence", 145 "relational_store:native_rdb", 146 "window_manager:libdm", 147 ] 148 } 149 150 if (player_framework_support_avsession_background) { 151 external_deps += [ 152 "ability_base:want", 153 "ability_runtime:wantagent_innerkits", 154 "audio_framework:audio_client", 155 "av_session:avsession_client", 156 "input:libmmi-client", 157 ] 158 } 159 160 if (player_framework_support_auto_create_file) { 161 external_deps += [ 162 "camera_framework:camera_framework", 163 "data_share:datashare_common", 164 "data_share:datashare_consumer", 165 "media_library:media_library", 166 "media_library:media_library_manager", 167 "samgr:samgr_proxy", 168 ] 169 } 170 171 if (use_memmgr_plugin) { 172 external_deps += [ "memmgr_override:memmgrclient" ] 173 } else if (use_memmgr) { 174 external_deps += [ "memmgr:memmgrclient" ] 175 } 176 177 if (player_framework_support_drm) { 178 external_deps += [ "drm_framework:drm_framework" ] 179 } 180 181 if (player_framework_support_power_manager) { 182 external_deps += [ "power_manager:powermgr_client" ] 183 } 184 185 deps = [ 186 "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client", 187 "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_dfx", 188 "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx", 189 "$MEDIA_PLAYER_ROOT_DIR/services/services:media_service", 190 "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils", 191 ] 192 193 sources = [ 194 "$MEDIA_PLAYER_ROOT_DIR/services/services/monitor/server/monitor_server.cpp", 195 "monitor_server_test.cpp", 196 ] 197 198 resource_config_file = 199 "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml" 200} 201