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/" 18module_output_path = "av_codec/moduletest" 19AUDIO_ROOT_DIR = "//foundation/multimedia/audio_framework/" 20 21ohos_unittest("audio_decoder_module_test") { 22 sanitize = av_codec_test_sanitize 23 module_out_path = module_output_path 24 sources = [ 25 "Avbuffer/src/avcodec_audio_avbuffer_decoder_demo.cpp", 26 "Avbuffer/src/common_tool.cpp", 27 "Avbuffer/src/fuzz_test.cpp", 28 "Avbuffer/src/null_check_test.cpp", 29 "Avbuffer/src/param_check_test.cpp", 30 "Avbuffer/src/status_check_test.cpp", 31 "Common/src/AudioDecoderDemoCommon.cpp", 32 "InnerAPI/InnerInterfaceDependCheckTest.cpp", 33 "InnerAPI/InnerParamCheckTest.cpp", 34 "NativeAPI/NativeInterfaceDependCheckTest.cpp", 35 "NativeAPI/NativeNullCheckTest.cpp", 36 "NativeAPI/NativeParamCheckTest.cpp", 37 ] 38 39 include_dirs = [ 40 "Avbuffer/include", 41 "Common/include", 42 "$MEDIA_ROOT_DIR/test/nativedemo/avmuxer", 43 "$MEDIA_ROOT_DIR/interfaces/kits/c", 44 "$MEDIA_ROOT_DIR/interfaces/inner_api/native", 45 "$MEDIA_ROOT_DIR/services/services/factory", 46 "$MEDIA_ROOT_DIR/services/engine/plugin/common", 47 "$MEDIA_ROOT_DIR/services/engine/plugin/core", 48 "$MEDIA_ROOT_DIR/services/engine/plugin/interface", 49 "$MEDIA_ROOT_DIR/frameworks/native/capi/common", 50 "$MEDIA_ROOT_DIR/services/dfx/include", 51 "$MEDIA_ROOT_DIR/services/engine/base/include", 52 "$MEDIA_ROOT_DIR/services/engine/codec/include/video", 53 "$MEDIA_ROOT_DIR/services/engine/common/include", 54 "$MEDIA_ROOT_DIR/services/engine/source/hst_releated", 55 "$MEDIA_ROOT_DIR/services/services/factory", 56 "$MEDIA_ROOT_DIR/services/utils/include", 57 "$MEDIA_ROOT_DIR/test/nativedemo/include", 58 "$AUDIO_ROOT_DIR/frameworks/native/audiorenderer/include", 59 "$AUDIO_ROOT_DIR/frameworks/native/audiostream/include", 60 "$AUDIO_ROOT_DIR/interfaces/inner_api/native/audiorenderer/include", 61 "$AUDIO_ROOT_DIR/interfaces/inner_api/native/audiocommon/include", 62 "$AUDIO_ROOT_DIR/interfaces/inner_api/native/audiomanager/include", 63 "$AUDIO_ROOT_DIR/services/audio_service/clinet/include", 64 ] 65 66 cflags = [ 67 "-Wall", 68 "-fno-rtti", 69 "-fno-exceptions", 70 "-fno-common", 71 "-fstack-protector-strong", 72 "-Wshadow", 73 "-FPIC", 74 "-FS", 75 "-O2", 76 "-D_FORTIFY_SOURCE=2", 77 "-fvisibility=hidden", 78 "-Wformat=2", 79 "-Wdate-time", 80 "-Werror", 81 "-Wextra", 82 "-Wimplicit-fallthrough", 83 "-Wsign-compare", 84 "-Wunused-parameter", 85 "-Wno-deprecated-declarations", 86 ] 87 88 deps = [ 89 "$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client", 90 "$MEDIA_ROOT_DIR/interfaces/kits/c:capi_packages", 91 "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_avmuxer", 92 "$MEDIA_ROOT_DIR/services/services:av_codec_service", 93 ] 94 95 external_deps = [ 96 "audio_framework:audio_renderer", 97 "bounds_checking_function:libsec_static", 98 "c_utils:utils", 99 "ffmpeg:libohosffmpeg", 100 "hilog:libhilog", 101 "ipc:ipc_core", 102 "media_foundation:media_foundation", 103 "media_foundation:native_media_core", 104 ] 105 106 if (av_codec_support_drm) { 107 external_deps += [ 108 "drm_framework:drm_framework", 109 "drm_framework:native_drm", 110 ] 111 } 112 113 resource_config_file = 114 "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml" 115} 116