• 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_framework/player"
18
19config("hiplayer_impl_unittest_config") {
20  visibility = [ ":*" ]
21
22  cflags = [
23    "-O2",
24    "-fPIC",
25    "-Wall",
26    "-fexceptions",
27    "-fno-rtti",
28    "-Wno-unused-but-set-variable",
29    "-Wno-format",
30    "-Dprivate=public",
31    "-Dprotected=public",
32  ]
33  cflags_cc = cflags
34  include_dirs = [
35    "./",
36    "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native",
37    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player",
38    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/utils",
39    "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf",
40    "$MEDIA_PLAYER_ROOT_DIR/services/services/player/client",
41    "$MEDIA_PLAYER_ROOT_DIR/services/services/player/ipc",
42    "$MEDIA_PLAYER_ROOT_DIR/services/services/player/server/",
43    "$MEDIA_PLAYER_ROOT_DIR/services/utils/include",
44  ]
45  defines = []
46
47  if (target_cpu == "arm64" || is_emulator) {
48    dragging_player_path = "\"/system/lib64\""
49  } else {
50    dragging_player_path = "\"/system/lib\""
51  }
52
53  defines += [ "DRAGGING_PLAYER_PATH=${dragging_player_path}" ]
54
55  defines += player_framework_defines
56}
57
58ohos_unittest("hiplayer_impl_unittest") {
59  module_out_path = module_output_path
60  stack_protector_ret = true
61
62  sources = [
63    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/dfx_agent.cpp",
64    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/dragging_player_agent.cpp",
65    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/hiplayer_callback_looper.cpp",
66    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/hiplayer_impl.cpp",
67    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/live_controller.cpp",
68    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/seek_agent.cpp",
69    "$MEDIA_PLAYER_ROOT_DIR/services/utils/media_dfx.cpp",
70    "$MEDIA_PLAYER_ROOT_DIR/services/utils/media_utils.cpp",
71    "hiplayer_impl_unittest.cpp",
72  ]
73
74  configs = [
75    ":hiplayer_impl_unittest_config",
76    "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx_public_config",
77    "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils_public_config",
78  ]
79
80  sanitize = {
81    integer_overflow = true
82    ubsan = true
83    boundary_sanitize = true
84    cfi = true
85    cfi_cross_dso = true
86    debug = false
87  }
88
89  external_deps = [
90    "access_token:libaccesstoken_sdk",
91    "access_token:libprivacy_sdk",
92    "audio_framework:audio_client",
93    "audio_framework:audio_renderer",
94    "av_codec:av_codec_client",
95    "av_codec:av_codec_media_engine_filters",
96    "av_codec:av_codec_media_engine_modules",
97    "bundle_framework:appexecfwk_base",
98    "bundle_framework:appexecfwk_core",
99    "c_utils:utils",
100    "googletest:gmock",
101    "graphic_surface:surface",
102    "graphic_surface:sync_fence",
103    "hicollie:libhicollie",
104    "hilog:libhilog",
105    "hisysevent:libhisysevent",
106    "hitrace:hitrace_meter",
107    "hitrace:libhitracechain",
108    "init:libbegetutil",
109    "ipc:ipc_single",
110    "libxml2:libxml2",
111    "media_foundation:media_foundation",
112    "os_account:os_account_innerkits",
113    "qos_manager:qos",
114    "safwk:system_ability_fwk",
115    "samgr:samgr_proxy",
116  ]
117
118  if (player_framework_support_drm) {
119    external_deps += [ "drm_framework:drm_framework" ]
120  }
121
122  deps = [
123    "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx",
124    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player:media_engine_histreamer_player",
125    "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils",
126  ]
127
128  deps = []
129}
130