• 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("media_server_manager_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    if (player_framework_support_lowpower_av_sink) {
73    include_dirs += [
74      "$MEDIA_PLAYER_ROOT_DIR/services/services/lpp_audio_streamer/client",
75      "$MEDIA_PLAYER_ROOT_DIR/services/services/lpp_audio_streamer/ipc",
76      "$MEDIA_PLAYER_ROOT_DIR/services/services/lpp_audio_streamer/server",
77      "$MEDIA_PLAYER_ROOT_DIR/services/services/lpp_video_streamer/client",
78      "$MEDIA_PLAYER_ROOT_DIR/services/services/lpp_video_streamer/ipc",
79      "$MEDIA_PLAYER_ROOT_DIR/services/services/lpp_video_streamer/server",
80    ]
81  }
82
83  cflags = [
84    "-Wall",
85    "-Werror",
86    "-Dprivate=public",
87    "-Dprotected=public",
88  ]
89  sanitize = {
90    cfi = true
91    cfi_cross_dso = true
92  }
93
94  external_deps = [
95    "ability_runtime:ability_connect_callback_stub",
96    "access_token:libaccesstoken_sdk",
97    "access_token:libtokenid_sdk",
98    "audio_framework:audio_client",
99    "av_codec:av_codec_client",
100    "c_utils:utils",
101    "common_event_service:cesfwk_innerkits",
102    "googletest:gmock_main",
103    "graphic_2d:librender_service_base",
104    "hdf_core:libhdi",
105    "hicollie:libhicollie",
106    "hilog:libhilog",
107    "hisysevent:libhisysevent",
108    "hitrace:hitrace_meter",
109    "hitrace:libhitracechain",
110    "hiview:libucollection_client",
111    "i18n:intl_util",
112    "image_framework:image_native",
113    "init:libbegetutil",
114    "ipc:ipc_single",
115    "jsoncpp:jsoncpp",
116    "libxml2:libxml2",
117    "media_foundation:media_foundation",
118    "memmgr:memmgrclient",
119    "napi:ace_napi",
120    "os_account:os_account_innerkits",
121    "qos_manager:qos",
122    "resource_management:global_resmgr",
123    "resource_schedule_service:ressched_client",
124    "safwk:system_ability_fwk",
125    "samgr:samgr_proxy",
126  ]
127
128  if (player_framework_support_video) {
129    external_deps += [ "graphic_surface:surface" ]
130  }
131
132  if (player_framework_support_screen_capture_stopbycall) {
133    external_deps += [
134      "call_manager:tel_call_manager_api",
135      "core_service:tel_core_service_api",
136      "state_registry:tel_state_registry_api",
137    ]
138  }
139
140  if (player_framework_support_screen_capture) {
141    external_deps += [
142      "ability_base:base",
143      "ability_base:want",
144      "ability_base:zuri",
145      "ability_runtime:ability_context_native",
146      "ability_runtime:ability_manager",
147      "ability_runtime:abilitykit_native",
148      "ability_runtime:extension_manager",
149      "ability_runtime:runtime",
150      "access_token:libnativetoken_shared",
151      "access_token:libprivacy_sdk",
152      "access_token:libtokensetproc_shared",
153      "audio_framework:audio_capturer",
154      "audio_framework:audio_client",
155      "distributed_notification_service:ans_innerkits",
156      "graphic_surface:sync_fence",
157      "relational_store:native_rdb",
158      "window_manager:libdm",
159      "window_manager:scene_session",
160      "window_manager:scene_session_manager",
161      "window_manager:session_manager_lite",
162    ]
163  }
164
165  if (player_framework_support_avsession_background) {
166    external_deps += [
167      "ability_base:want",
168      "ability_runtime:wantagent_innerkits",
169      "audio_framework:audio_client",
170      "av_session:avsession_client",
171      "input:libmmi-client",
172    ]
173  }
174
175  if (player_framework_support_auto_create_file) {
176    external_deps += [
177      "camera_framework:camera_framework",
178      "data_share:datashare_common",
179      "data_share:datashare_consumer",
180      "media_library:media_library",
181      "media_library:media_library_manager",
182      "samgr:samgr_proxy",
183    ]
184  }
185
186  if (use_memmgr_plugin) {
187    external_deps += [ "memmgr_override:memmgrclient" ]
188  } else if (use_memmgr) {
189    external_deps += [ "memmgr:memmgrclient" ]
190  }
191
192  if (player_framework_support_drm) {
193    external_deps += [ "drm_framework:drm_framework" ]
194  }
195
196  if (player_framework_support_power_manager) {
197    external_deps += [ "power_manager:powermgr_client" ]
198  }
199
200  deps = [
201    "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client",
202    "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_dfx",
203    "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx",
204    "$MEDIA_PLAYER_ROOT_DIR/services/services:media_service",
205    "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils",
206  ]
207
208  sources = [
209    "$MEDIA_PLAYER_ROOT_DIR/services/services/sa_media/server_manager/media_server_manager.cpp",
210    "media_server_manager_test.cpp",
211  ]
212
213  resource_config_file =
214      "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml"
215}
216