• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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/av_codec/config.gni")
16
17MEDIA_ROOT_DIR = "//foundation/multimedia/av_codec/"
18module_output_path = "av_codec/moduletest"
19
20swdecoder_moduletest_native_include_dirs = [
21  "./include",
22  "$MEDIA_ROOT_DIR/../../graphic/graphic_2d/interfaces/inner_api",
23  "$MEDIA_ROOT_DIR/interfaces/inner_api/native",
24  "$MEDIA_ROOT_DIR/interfaces/kits/c",
25  "$MEDIA_ROOT_DIR/../../../third_party/openssl/ohos_lite/include",
26  "$drm_framework_root_dir/interfaces/kits/c/drm_capi/common",
27  "$drm_framework_root_dir/interfaces/kits/c/drm_capi/include",
28]
29
30swdecoder_moduletest_cflags = [
31  "-std=c++17",
32  "-fno-rtti",
33  "-fno-exceptions",
34  "-Wall",
35  "-fno-common",
36  "-fstack-protector-strong",
37  "-Wshadow",
38  "-FPIC",
39  "-FS",
40  "-O2",
41  "-D_FORTIFY_SOURCE=2",
42  "-fvisibility=hidden",
43  "-Wformat=2",
44  "-Wdate-time",
45  "-Werror",
46  "-Wextra",
47  "-Wimplicit-fallthrough",
48  "-Wsign-compare",
49  "-Wunused-parameter",
50]
51
52##################################################################################################################
53ohos_unittest("swdecoder_native_module_test") {
54  sanitize = av_codec_test_sanitize
55  module_out_path = module_output_path
56  include_dirs = swdecoder_moduletest_native_include_dirs
57  include_dirs += [ "./" ]
58
59  cflags = swdecoder_moduletest_cflags
60
61  if (av_codec_support_codec) {
62    sources = [
63      "./src/InnerAPI/api_test.cpp",
64      "./src/InnerAPI/videodec_ndk_inner_sample.cpp",
65      "./src/api_test.cpp",
66      "./src/func_test.cpp",
67
68      #"./src/reli_test.cpp",
69
70      #"./src/NativeAPI/perf_test.cpp",
71      #"./src/NativeAPI/reli_test.cpp",
72      "./src/state_test.cpp",
73
74      #"./src/compatibility_test.cpp",
75      "./src/videodec_ndk_sample.cpp",
76      "./src/videodec_api11_sample.cpp",
77    ]
78  }
79
80  deps = [
81    "$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client",
82    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_codecbase",
83    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_vdec",
84  ]
85  external_deps = [
86    "c_utils:utils",
87    "graphic_2d:libgraphic_utils",
88    "graphic_2d:librender_service_client",
89    "graphic_surface:surface",
90    "graphic_surface:sync_fence",
91    "hilog:libhilog",
92    "ipc:ipc_core",
93    "media_foundation:media_foundation",
94    "media_foundation:native_media_core",
95    "window_manager:libwm",
96  ]
97
98  if (av_codec_support_drm) {
99    external_deps += [
100      "drm_framework:drm_framework",
101      "drm_framework:native_drm",
102    ]
103  }
104
105  resource_config_file =
106      "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml"
107}
108