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