1# Copyright (c) 2025 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 14#####################hydra-fuzz################### 15import("//build/config/features.gni") 16import("//build/test.gni") 17import("//foundation/multimedia/av_codec/config.gni") 18module_output_path = "av_codec/av_codec" 19MEDIA_ROOT_DIR = "//foundation/multimedia/av_codec/" 20config("hcodec_fuzztest_cfg") { 21 cflags_cc= [ "-fexceptions" ] 22} 23 24##############################fuzztest########################################## 25ohos_fuzztest("HwavcencoderServerFuzzTest") { 26 module_out_path = module_output_path 27 fuzz_config_file = "$MEDIA_ROOT_DIR/test/fuzztest/hwavcencoderserver_fuzzer" 28 include_dirs = [ 29 "$MEDIA_ROOT_DIR/interfaces/kits/c", 30 "$MEDIA_ROOT_DIR/services/engine/codec/video/hcodec", 31 "$MEDIA_ROOT_DIR/test/fuzztest/hwavcencoderserver_fuzzer/include", 32 ] 33 cflags = [ 34 "-g", 35 "-O0", 36 "-Wno-unused-variable", 37 "-fno-omit-frame-pointer", 38 ] 39 configs = [ ":hcodec_fuzztest_cfg" ] 40 sources = [ 41 "serverenc_sample.cpp", 42 "hwavcencoderserver_fuzzer.cpp", 43 ] 44 external_deps = [ 45 "c_utils:utils", 46 "drivers_interface_codec:libcodec_proxy_4.0", 47 "graphic_surface:surface", 48 "hdf_core:libhdi", 49 "hilog:libhilog", 50 "init:libbegetutil", 51 "ipc:ipc_single", 52 "media_foundation:media_foundation", 53 "media_foundation:native_media_core", 54 "openmax:libopenmax_static", 55 ] 56 deps = [ 57 "$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client", 58 "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_codecbase", 59 "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_vdec", 60 "$MEDIA_ROOT_DIR/services/engine/codec/video/hcodec:hcodec", 61 ] 62 defines = [] 63 defines += av_codec_defines 64 if (build_variant != "user") { 65 defines += [ "BUILD_ENG_VERSION" ] 66 } 67 resource_config_file = 68 "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml" 69} 70 71############################################################################### 72group("fuzztest") { 73 testonly = true 74 deps = [] 75 deps += [ 76 # deps file 77 ":HwavcencoderServerFuzzTest", #引用测试套 78 ] 79} 80############################################################################### 81