1# Copyright (c) 2023 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/"
20
21##############################fuzztest##########################################
22ohos_fuzztest("AudioDecoderFlushFuzzTest") {
23  module_out_path = module_output_path
24  fuzz_config_file = "$MEDIA_ROOT_DIR/test/fuzztest/audiodecoderflush_fuzzer"
25  include_dirs = [
26    "$MEDIA_ROOT_DIR/test/fuzztest/audiodecoderflush_fuzzer",
27    "$MEDIA_ROOT_DIR/test/nativedemo/avmuxer",
28    "$MEDIA_ROOT_DIR/interfaces/kits/c",
29    "$MEDIA_ROOT_DIR/interfaces/inner_api/native",
30    "$MEDIA_ROOT_DIR/services/services/factory",
31    "$MEDIA_ROOT_DIR/services/engine/plugin/common",
32    "$MEDIA_ROOT_DIR/services/engine/plugin/core",
33    "$MEDIA_ROOT_DIR/services/engine/plugin/interface",
34    "$MEDIA_ROOT_DIR/frameworks/native/capi/common",
35    "$MEDIA_ROOT_DIR/services/dfx/include",
36    "$MEDIA_ROOT_DIR/services/engine/base/include",
37    "$MEDIA_ROOT_DIR/services/engine/codec/include/video",
38    "$MEDIA_ROOT_DIR/services/engine/common/include",
39    "$MEDIA_ROOT_DIR/services/engine/source/hst_releated",
40    "$MEDIA_ROOT_DIR/services/services/factory",
41    "$MEDIA_ROOT_DIR/services/utils/include",
42    "$MEDIA_ROOT_DIR/test/nativedemo/include",
43  ]
44  cflags = [
45    "-g",
46    "-O0",
47    "-Wno-unused-variable",
48    "-fno-omit-frame-pointer",
49  ]
50  sources = [
51    "audio_decoder_flush_demo.cpp",
52    "audio_decoder_flush_fuzzer.cpp",
53  ]
54
55  defines = []
56
57  if (av_codec_enable_special_codec) {
58    defines += [ "AV_CODEC_AUDIO_SPECIAL_CAPACITY" ]
59  }
60
61  external_deps = [
62    "c_utils:utils",
63    "hilog:libhilog",
64    "ipc:ipc_core",
65    "media_foundation:media_foundation",
66    "media_foundation:native_media_core",
67    "window_manager:libwm",
68  ]
69  deps = [
70    "$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client",
71    "$MEDIA_ROOT_DIR/interfaces/kits/c:capi_packages",
72    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_avmuxer",
73    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_avsource",
74    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_codecbase",
75    "$MEDIA_ROOT_DIR/services/services:av_codec_service",
76  ]
77}
78
79###############################################################################
80group("fuzztest") {
81  testonly = true
82  deps = []
83  deps += [
84    # deps file
85    ":AudioDecoderFlushFuzzTest",
86  ]
87}
88###############################################################################
89