1# Copyright (c) 2022 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/AVCodec_Video/moduletest" 19 20demuxer_moduletest_native_include_dirs = [ 21 "$MEDIA_ROOT_DIR/interfaces/inner_api/native", 22 "$MEDIA_ROOT_DIR/interfaces/kits/c", 23 "$MEDIA_ROOT_DIR/services/services/factory", 24 "$MEDIA_ROOT_DIR/services/utils", 25 "./src/InnerAPI/include", 26] 27 28demuxer_moduletest_cflags = [ 29 "-std=c++17", 30 "-fno-rtti", 31 "-fno-exceptions", 32 "-Wall", 33 "-fno-common", 34 "-fstack-protector-strong", 35 "-Wshadow", 36 "-FPIC", 37 "-FS", 38 "-O2", 39 "-D_FORTIFY_SOURCE=2", 40 "-fvisibility=hidden", 41 "-Wformat=2", 42 "-Wdate-time", 43 "-Werror", 44 "-Wextra", 45 "-Wimplicit-fallthrough", 46 "-Wsign-compare", 47 "-Wunused-parameter", 48] 49 50################################################################################################################## 51ohos_unittest("demuxer_native_module_test") { 52 sanitize = av_codec_test_sanitize 53 module_out_path = module_output_path 54 include_dirs = demuxer_moduletest_native_include_dirs 55 include_dirs += [ "./" ] 56 57 cflags = demuxer_moduletest_cflags 58 59 if (av_codec_support_codec) { 60 sources = [ 61 #"./src/perf_test.cpp", 62 #"./src/reli2_test.cpp", 63 #"./src/reli_test.cpp", 64 "./src/InnerAPI/api_test.cpp", 65 "./src/InnerAPI/func_test.cpp", 66 "./src/InnerAPI/inner_demuxer_parser_sample.cpp", 67 "./src/InnerAPI/inner_demuxer_sample.cpp", 68 "./src/InnerAPI/demuxer_asyntype_func_test.cpp", 69 "./src/InnerAPI/demuxer_asyntype_func2_test.cpp", 70 "./src/InnerAPI/demuxer_asyntype_func3_test.cpp", 71 "./src/InnerAPI/demuxer_asyntype_func4_test.cpp", 72 "./src/InnerAPI/demuxer_asyntype_func5_test.cpp", 73 "./src/InnerAPI/demuxer_asyntype_func6_test.cpp", 74 "./src/InnerAPI/demuxer_asyntype_func7_test.cpp", 75 "./src/InnerAPI/demuxer_asyntype_func8_test.cpp", 76 "./src/InnerAPI/parser_test.cpp", 77 "./src/api_test.cpp", 78 "./src/avifunc_test.cpp", 79 "./src/func2_test.cpp", 80 "./src/func3_test.cpp", 81 "./src/func_test.cpp", 82 "./src/movfunc_test.cpp", 83 "./src/randomseek_test.cpp", 84 "./src/seek2_test.cpp", 85 "./src/seek_test.cpp", 86 87 #"./src/net_test.cpp", 88 #"./src/net2_test.cpp", 89 "./src/InnerAPI/demuxer_asyn_func_test.cpp", 90 "./src/InnerAPI/demuxer_cachesize_func_test.cpp", 91 "./src/InnerAPI/demuxer_plugin_func_test.cpp", 92 "./src/format_test.cpp", 93 "./src/proc_test.cpp", 94 ] 95 } 96 97 external_deps = [ 98 "c_utils:utils", 99 "graphic_2d:librender_service_client", 100 "graphic_surface:surface", 101 "media_foundation:media_foundation", 102 "media_foundation:native_media_core", 103 "window_manager:libwm", 104 ] 105 106 public_deps = 107 [ "$av_codec_root_dir/test/unittest/common:av_codec_inner_unit_test" ] 108 109 if (target_cpu == "arm64") { 110 av_codec_path = "\"/system/lib64\"" 111 } else { 112 av_codec_path = "\"/system/lib\"" 113 } 114 defines = [ "AV_CODEC_PATH=${av_codec_path}" ] 115 116 deps = [ 117 "$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client", 118 "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_avdemuxer", 119 "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_avsource", 120 "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_codecbase", 121 "$MEDIA_ROOT_DIR/services/media_engine/modules:av_codec_media_engine_modules", 122 "$MEDIA_ROOT_DIR/services/services:av_codec_service", 123 ] 124 125 resource_config_file = 126 "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml" 127} 128