• 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/transcode"
18
19config("transcode_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/transcoder",
38    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/utils",
39    "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf",
40    "$MEDIA_PLAYER_ROOT_DIR/services/utils/include",
41  ]
42  defines = []
43
44  if (target_cpu == "arm64" || is_emulator) {
45    dragging_player_path = "\"/system/lib64\""
46  } else {
47    dragging_player_path = "\"/system/lib\""
48  }
49
50  defines += [ "DRAGGING_PLAYER_PATH=${dragging_player_path}" ]
51
52  defines += player_framework_defines
53}
54
55ohos_unittest("hitranscode_impl_unittest") {
56  module_out_path = module_output_path
57  stack_protector_ret = true
58
59  sanitize = {
60    integer_overflow = true
61    ubsan = true
62    boundary_sanitize = true
63    cfi = true
64    cfi_cross_dso = true
65    debug = false
66  }
67
68  sources = [
69    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/transcoder/hitranscoder_callback_looper.cpp",
70    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/transcoder/hitranscoder_impl.cpp",
71    "$MEDIA_PLAYER_ROOT_DIR/services/utils/media_dfx.cpp",
72    "$MEDIA_PLAYER_ROOT_DIR/services/utils/media_utils.cpp",
73    "hitranscode_impl_unittest.cpp",
74  ]
75
76  configs = [
77    ":transcode_unittest_config",
78    "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx_public_config",
79    "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils_public_config",
80  ]
81
82  external_deps = [
83    "access_token:libaccesstoken_sdk",
84    "access_token:libprivacy_sdk",
85    "audio_framework:audio_client",
86    "audio_framework:audio_renderer",
87    "av_codec:av_codec_client",
88    "av_codec:av_codec_media_engine_filters",
89    "av_codec:av_codec_media_engine_modules",
90    "bundle_framework:appexecfwk_base",
91    "bundle_framework:appexecfwk_core",
92    "c_utils:utils",
93    "googletest:gmock",
94    "graphic_surface:surface",
95    "graphic_surface:sync_fence",
96    "hicollie:libhicollie",
97    "hilog:libhilog",
98    "hisysevent:libhisysevent",
99    "hitrace:hitrace_meter",
100    "hitrace:libhitracechain",
101    "init:libbegetutil",
102    "ipc:ipc_single",
103    "libxml2:libxml2",
104    "media_foundation:media_foundation",
105    "os_account:os_account_innerkits",
106    "qos_manager:qos",
107    "safwk:system_ability_fwk",
108    "samgr:samgr_proxy",
109  ]
110
111  if (player_framework_support_drm) {
112    external_deps += [ "drm_framework:drm_framework" ]
113  }
114
115  deps = [
116    "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx",
117    "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/transcoder:media_engine_histreamer_transcoder",
118    "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils",
119  ]
120
121  deps = []
122}
123