• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_unittest") {
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    "drivers_interface_camera:metadata",
92    "graphic_2d:librender_service_base",
93    "hdf_core:libhdi",
94    "hicollie:libhicollie",
95    "hilog:libhilog",
96    "hisysevent:libhisysevent",
97    "hitrace:hitrace_meter",
98    "hitrace:libhitracechain",
99    "hiview:libucollection_client",
100    "i18n:intl_util",
101    "image_framework:image_native",
102    "init:libbegetutil",
103    "ipc:ipc_single",
104    "jsoncpp:jsoncpp",
105    "libxml2:libxml2",
106    "media_foundation:media_foundation",
107    "memmgr:memmgrclient",
108    "napi:ace_napi",
109    "os_account:os_account_innerkits",
110    "qos_manager:qos",
111    "resource_management:global_resmgr",
112    "resource_schedule_service:ressched_client",
113    "safwk:system_ability_fwk",
114    "samgr:samgr_proxy",
115  ]
116
117  if (player_framework_support_video) {
118    external_deps += [ "graphic_surface:surface" ]
119  }
120
121  if (player_framework_support_screen_capture_stopbycall) {
122    external_deps += [
123      "call_manager:tel_call_manager_api",
124      "core_service:tel_core_service_api",
125      "state_registry:tel_state_registry_api",
126    ]
127  }
128
129  if (player_framework_support_screen_capture) {
130    external_deps += [
131      "ability_base:base",
132      "ability_base:want",
133      "ability_base:zuri",
134      "ability_runtime:ability_context_native",
135      "ability_runtime:ability_manager",
136      "ability_runtime:abilitykit_native",
137      "ability_runtime:extension_manager",
138      "ability_runtime:runtime",
139      "access_token:libnativetoken_shared",
140      "access_token:libprivacy_sdk",
141      "access_token:libtokensetproc_shared",
142      "audio_framework:audio_capturer",
143      "audio_framework:audio_client",
144      "distributed_notification_service:ans_innerkits",
145      "graphic_surface:sync_fence",
146      "relational_store:native_rdb",
147      "window_manager:libdm",
148    ]
149  }
150
151  if (player_framework_support_avsession_background) {
152    external_deps += [
153      "ability_base:want",
154      "ability_runtime:wantagent_innerkits",
155      "audio_framework:audio_client",
156      "av_session:avsession_client",
157      "input:libmmi-client",
158    ]
159  }
160
161  if (player_framework_support_auto_create_file) {
162    external_deps += [
163      "camera_framework:camera_framework",
164      "data_share:datashare_common",
165      "data_share:datashare_consumer",
166      "media_library:media_library",
167      "media_library:media_library_manager",
168      "samgr:samgr_proxy",
169    ]
170  }
171
172  if (use_memmgr_plugin) {
173    external_deps += [ "memmgr_override:memmgrclient" ]
174  } else if (use_memmgr) {
175    external_deps += [ "memmgr:memmgrclient" ]
176  }
177
178  if (player_framework_support_drm) {
179    external_deps += [ "drm_framework:drm_framework" ]
180  }
181
182  if (player_framework_support_power_manager) {
183    external_deps += [ "power_manager:powermgr_client" ]
184  }
185
186  deps = [
187    "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client",
188    "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_dfx",
189    "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx",
190    "$MEDIA_PLAYER_ROOT_DIR/services/services:media_service",
191    "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils",
192  ]
193
194  sources = [
195    "$MEDIA_PLAYER_ROOT_DIR/services/services/monitor/server/monitor_server.cpp",
196    "monitor_server_unittest.cpp",
197  ]
198
199  resource_config_file =
200      "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml"
201}
202