# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/test.gni")
import("//foundation/multimedia/av_codec/config.gni")
MEDIA_ROOT_DIR = "//foundation/multimedia/av_codec/"
module_output_path = "av_codec/AVCodec_Video/moduletest"
encoder_moduletest_native_include_dirs = [
"./include",
"$MEDIA_ROOT_DIR/interfaces/kits/c",
"$MEDIA_ROOT_DIR/interfaces/inner_api/native",
]
encoder_moduletest_cflags = [
"-std=c++17",
"-fno-rtti",
"-fno-exceptions",
"-Wall",
"-fno-common",
"-fstack-protector-strong",
"-Wshadow",
"-FPIC",
"-FS",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fvisibility=hidden",
"-Wformat=2",
"-Wdate-time",
"-Werror",
"-Wextra",
"-Wimplicit-fallthrough",
"-Wsign-compare",
"-Wunused-parameter",
]
##################################################################################################################
ohos_unittest("encoder_native_module_test") {
sanitize = av_codec_test_sanitize
module_out_path = module_output_path
include_dirs = encoder_moduletest_native_include_dirs
include_dirs += [ "./" ]
cflags = encoder_moduletest_cflags
if (av_codec_support_codec) {
sources = [
"./src/InnerAPI/api_test.cpp",
"./src/InnerAPI/capability_test.cpp",
"./src/InnerAPI/func2_test.cpp",
"./src/InnerAPI/func_test.cpp",
"./src/InnerAPI/sqrbfunc_test.cpp",
"./src/InnerAPI/videoenc_ndk_inner_sample.cpp",
"./src/api_test.cpp",
"./src/configure_test.cpp",
"./src/cbr_hq_test.cpp",
"./src/func2_test.cpp",
"./src/func3_test.cpp",
"./src/func_test.cpp",
"./src/temporal_test.cpp",
"./src/dual_test.cpp",
"./src/preprocess_test.cpp",
#"./src/perf_test.cpp",
"./src/getparam_test.cpp",
#"./src/reli_test.cpp",
"./src/setparam_test.cpp",
"./src/state_test.cpp",
"./src/videoenc_api11_sample.cpp",
"./src/videoenc_ndk_sample.cpp",
"./src/videotranscode_api11_sample.cpp",
]
}
deps = [
"$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client",
"$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_codecbase",
"$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_venc",
"$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_vdec",
]
external_deps = [
"c_utils:utils",
"graphic_2d:libgraphic_utils",
"graphic_2d:librender_service_client",
"graphic_surface:surface",
"hilog:libhilog",
"ipc:ipc_single",
"media_foundation:media_foundation",
"media_foundation:native_media_core",
"openssl:libcrypto_shared",
"window_manager:libwm",
]
resource_config_file =
"$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml"
}