1# Copyright (c) 2020-2021 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/" 18THIRD_ROOT_DIR = "//third_party/" 19module_output_path = "av_codec/moduletest" 20 21ohos_unittest("muxer_native_module_test") { 22 module_out_path = module_output_path 23 sources = [ 24 "Common/src/AVMuxerDemo.cpp", 25 "InnerAPI/InnerAVMuxerInterfaceDependCheckTest.cpp", 26 "InnerAPI/InnerAVMuxerParamCheckTest.cpp", 27 "NativeAPI/NativeAVMuxerInterfaceDependCheckTest.cpp", 28 "NativeAPI/NativeAVMuxerNullCheckTest.cpp", 29 "NativeAPI/NativeAVMuxerParamCheckTest.cpp", 30 ] 31 include_dirs = [ 32 "Common/include", 33 "$MEDIA_ROOT_DIR/interfaces/kits/c", 34 "$MEDIA_ROOT_DIR/interfaces/inner_api/native", 35 "$MEDIA_ROOT_DIR/services/utils", 36 "$media_foundation_root_dir/interface/kits/c", 37 "$media_foundation_root_dir/interface/inner_api", 38 "$THIRD_ROOT_DIR/ffmpeg", 39 ] 40 41 cflags = [ 42 "-Wall", 43 "-fno-rtti", 44 "-fno-exceptions", 45 "-fno-common", 46 "-fstack-protector-strong", 47 "-Wshadow", 48 "-FPIC", 49 "-FS", 50 "-O2", 51 "-D_FORTIFY_SOURCE=2", 52 "-fvisibility=hidden", 53 "-Wformat=2", 54 "-Wdate-time", 55 "-Werror", 56 "-Wextra", 57 "-Wimplicit-fallthrough", 58 "-Wsign-compare", 59 "-Wunused-parameter", 60 "-Wno-deprecated-declarations", 61 ] 62 63 cflags_cc = cflags 64 cflags_cc += [ "-std=c++17" ] 65 66 if (target_cpu == "arm64") { 67 av_codec_path = "\"/system/lib64\"" 68 } else { 69 av_codec_path = "\"/system/lib\"" 70 } 71 defines = [ "AV_CODEC_PATH=${av_codec_path}" ] 72 73 deps = [ 74 "$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client", 75 "$MEDIA_ROOT_DIR/interfaces/kits/c:capi_packages", 76 ] 77 78 external_deps = [ 79 "c_utils:utils", 80 "graphic_surface:surface", 81 "hilog:libhilog", 82 "media_foundation:capi_packages", 83 "media_foundation:media_foundation", 84 ] 85 86 resource_config_file = 87 "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml" 88} 89