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/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 "sa_media/server_manager", 36 "common", 37 "player/audio_background_adapter", 38 "player/ipc", 39 "player/player_mem_manage", 40 "player/server", 41 "player/subscriber", 42 "media_data_source/ipc", 43 "media_data_source/server", 44 "monitor/client", 45 "monitor/ipc", 46 "monitor/server", 47 "recorder/ipc", 48 "recorder/server", 49 "avmetadatahelper/ipc", 50 "avmetadatahelper/server", 51 "avcodec/ipc", 52 "avcodec/server", 53 "avcodeclist/ipc", 54 "avcodeclist/server", 55 "recorder_profiles/ipc", 56 "recorder_profiles/server", 57 "screen_capture/server", 58 "screen_capture/ipc", 59 "screen_capture_monitor/server", 60 "screen_capture_monitor/ipc", 61 "transcoder/server", 62 "transcoder/ipc", 63 "observer", 64 "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/avmetadatahelper", 65 "$MEDIA_PLAYER_ROOT_DIR/services/include", 66 "$MEDIA_PLAYER_ROOT_DIR/services/services/factory", 67 "$MEDIA_PLAYER_ROOT_DIR/services/services/monitor/ipc", 68 "$MEDIA_PLAYER_ROOT_DIR/services/services/sa_media/client", 69 "$MEDIA_PLAYER_ROOT_DIR/services/services/sa_media/ipc", 70 "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/ipc", 71 "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf", 72 "$MEDIA_PLAYER_ROOT_DIR/services/utils/include", 73 "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native", 74 "$MEDIA_PLAYER_ROOT_DIR/services/services/common", 75 "$MEDIA_PLAYER_ROOT_DIR/services/engine/common/recorder_profiles", 76 "./../../../../player_framework/frameworks/native/player", 77 "./../../../../player_framework/test/unittest/common/include", 78 "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/server", 79 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/avmetadatahelper", 80 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/utils", 81 "$MEDIA_PLAYER_ROOT_DIR/services/include", 82 "$MEDIA_PLAYER_ROOT_DIR/services/utils/include", 83 "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native", 84 "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf", 85 "$MEDIA_PLAYER_ROOT_DIR/services/services/media_data_source/ipc", 86 "$MEDIA_PLAYER_ROOT_DIR/services/services/monitor/client", 87 "$MEDIA_PLAYER_ROOT_DIR/services/services/monitor/ipc", 88 "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/client", 89 "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/ipc", 90 "$MEDIA_PLAYER_ROOT_DIR/services/services/common", 91 ] 92 93 if (player_framework_support_avsession_background) { 94 include_dirs += [ "player/avsession_background" ] 95 } 96 97 if (player_framework_support_lowpower_av_sink) { 98 include_dirs += [ 99 "$MEDIA_PLAYER_ROOT_DIR/services/services/lpp_audio_streamer/client", 100 "$MEDIA_PLAYER_ROOT_DIR/services/services/lpp_audio_streamer/ipc", 101 "$MEDIA_PLAYER_ROOT_DIR/services/services/lpp_video_streamer/client", 102 "$MEDIA_PLAYER_ROOT_DIR/services/services/lpp_video_streamer/ipc", 103 ] 104 } 105 106 defines = [] 107 defines += player_framework_defines 108 109 if (player_framework_check_video_is_hdr_vivid) { 110 defines += [ "CHECKING_VIDEO_IS_HDR_VIVID" ] 111 } 112 113 if (target_cpu == "arm") { 114 cflags += [ "-DBINDER_IPC_32BIT" ] 115 } 116 117 sources = [ 118 "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/server/avmetadatahelper_server.cpp", 119 "./../../../../player_framework/services/services/factory/engine_factory_repo.cpp", 120 "av_thumbnail_generator_unit_test.cpp", 121 "avmetadata_mock.cpp", 122 "avmetadata_unit_test.cpp", 123 "avmetadatahelper_impl_unit_test.cpp", 124 "avmetadatahelper_server_unit_test.cpp", 125 ] 126 127 resource_config_file = 128 "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml" 129 130 deps = [ 131 "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client", 132 "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_dfx", 133 "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_dfx", 134 "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx", 135 "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx", 136 "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/avmetadatahelper:media_engine_histreamer_avmetadatahelper", 137 "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils", 138 "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils", 139 ] 140 141 external_deps = [ 142 "ability_runtime:ability_connect_callback_stub", 143 "access_token:libaccesstoken_sdk", 144 "audio_framework:audio_client", 145 "av_codec:av_codec_client", 146 "av_codec:av_codec_media_engine_filters", 147 "av_codec:av_codec_media_engine_modules", 148 "c_utils:utils", 149 "call_manager:tel_call_manager_api", 150 "common_event_service:cesfwk_innerkits", 151 "core_service:tel_core_service_api", 152 "drivers_interface_display:display_commontype_idl_headers", 153 "graphic_2d:librender_service_base", 154 "graphic_2d:librender_service_client", 155 "graphic_surface:surface", 156 "graphic_surface:sync_fence", 157 "hdf_core:libhdi", 158 "hicollie:libhicollie", 159 "hilog:libhilog", 160 "hisysevent:libhisysevent", 161 "hitrace:hitrace_meter", 162 "hitrace:libhitracechain", 163 "i18n:intl_util", 164 "image_framework:image_native", 165 "init:libbegetutil", 166 "ipc:ipc_single", 167 "libxml2:libxml2", 168 "media_foundation:media_foundation", 169 "memmgr:memmgrclient", 170 "napi:ace_napi", 171 "os_account:os_account_innerkits", 172 "qos_manager:concurrent_task_client", 173 "qos_manager:qos", 174 "resource_schedule_service:ressched_client", 175 "safwk:system_ability_fwk", 176 "samgr:samgr_proxy", 177 "window_manager:libwm", 178 ] 179 180 if (player_framework_support_video) { 181 external_deps += [ "graphic_surface:surface" ] 182 } 183 184 if (player_framework_support_screen_capture) { 185 external_deps += [ 186 "ability_base:base", 187 "ability_base:want", 188 "ability_base:zuri", 189 "ability_runtime:ability_context_native", 190 "ability_runtime:abilitykit_native", 191 "ability_runtime:extension_manager", 192 "ability_runtime:runtime", 193 "access_token:libnativetoken_shared", 194 "access_token:libprivacy_sdk", 195 "access_token:libtokensetproc_shared", 196 "audio_framework:audio_capturer", 197 "audio_framework:audio_client", 198 "distributed_notification_service:ans_innerkits", 199 "graphic_surface:sync_fence", 200 "relational_store:native_rdb", 201 "window_manager:libdm", 202 ] 203 } 204 205 if (player_framework_support_auto_create_file) { 206 external_deps += [ 207 "camera_framework:camera_framework", 208 "data_share:datashare_common", 209 "data_share:datashare_consumer", 210 "media_library:media_library", 211 "media_library:media_library_manager", 212 "samgr:samgr_proxy", 213 ] 214 } 215 216 if (use_memmgr_plugin) { 217 external_deps += [ "memmgr_override:memmgrclient" ] 218 } else if (use_memmgr) { 219 external_deps += [ "memmgr:memmgrclient" ] 220 } 221 222 if (player_framework_support_drm) { 223 external_deps += [ "drm_framework:drm_framework" ] 224 } 225 226 if (player_framework_support_power_manager) { 227 external_deps += [ "power_manager:powermgr_client" ] 228 } 229 230 subsystem_name = "multimedia" 231 part_name = "player_framework" 232} 233