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/av_codec/config.gni")
16
17MEDIA_ROOT_DIR = "//foundation/multimedia/av_codec/"
18module_output_path = "av_codec/moduletest"
19
20hevcswdecoder_moduletest_native_include_dirs = [
21  "./include",
22  "$MEDIA_ROOT_DIR/interfaces/kits/c",
23  "$MEDIA_ROOT_DIR/../../../third_party/openssl/ohos_lite/include",
24  "$MEDIA_ROOT_DIR/../../../third_party/json/include",
25  "$drm_framework_root_dir/interfaces/kits/c/drm_capi/common",
26  "$drm_framework_root_dir/interfaces/kits/c/drm_capi/include",
27]
28
29hevcswdecoder_moduletest_cflags = [
30  "-std=c++17",
31  "-fno-rtti",
32  "-fno-exceptions",
33  "-Wall",
34  "-fno-common",
35  "-fstack-protector-strong",
36  "-Wshadow",
37  "-FPIC",
38  "-FS",
39  "-O2",
40  "-D_FORTIFY_SOURCE=2",
41  "-fvisibility=hidden",
42  "-Wformat=2",
43  "-Wdate-time",
44  "-Werror",
45  "-Wextra",
46  "-Wimplicit-fallthrough",
47  "-Wsign-compare",
48  "-Wunused-parameter",
49]
50
51##################################################################################################################
52ohos_unittest("hevcswdecoder_native_module_test") {
53  sanitize = av_codec_test_sanitize
54  module_out_path = module_output_path
55  include_dirs = hevcswdecoder_moduletest_native_include_dirs
56  include_dirs += [ "./" ]
57
58  cflags = hevcswdecoder_moduletest_cflags
59
60  if (av_codec_support_codec) {
61    sources = [
62      "./src/api_test.cpp",
63      "./src/func_test.cpp",
64      "./src/state_test.cpp",
65      "./src/videodec_api11_sample.cpp",
66      "./src/videodec_ndk_sample.cpp",
67    ]
68  }
69
70  deps = [
71    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_codecbase",
72    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_vdec",
73  ]
74  external_deps = [
75    "c_utils:utils",
76    "graphic_2d:libgraphic_utils",
77    "graphic_2d:librender_service_client",
78    "graphic_surface:surface",
79    "graphic_surface:sync_fence",
80    "hilog:libhilog",
81    "ipc:ipc_core",
82    "media_foundation:media_foundation",
83    "media_foundation:native_media_core",
84    "window_manager:libwm",
85  ]
86  resource_config_file =
87      "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml"
88}
89