1da853ecaSopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd.
2da853ecaSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3da853ecaSopenharmony_ci# you may not use this file except in compliance with the License.
4da853ecaSopenharmony_ci# You may obtain a copy of the License at
5da853ecaSopenharmony_ci#
6da853ecaSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7da853ecaSopenharmony_ci#
8da853ecaSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9da853ecaSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10da853ecaSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11da853ecaSopenharmony_ci# See the License for the specific language governing permissions and
12da853ecaSopenharmony_ci# limitations under the License.
13da853ecaSopenharmony_ci
14da853ecaSopenharmony_ci#####################hydra-fuzz###################
15da853ecaSopenharmony_ciimport("//build/config/features.gni")
16da853ecaSopenharmony_ciimport("//build/test.gni")
17da853ecaSopenharmony_ciimport("//foundation/multimedia/av_codec/config.gni")
18da853ecaSopenharmony_cimodule_output_path = "av_codec/av_codec"
19da853ecaSopenharmony_ciMEDIA_ROOT_DIR = "//foundation/multimedia/av_codec/"
20da853ecaSopenharmony_ci
21da853ecaSopenharmony_ci##############################fuzztest##########################################
22da853ecaSopenharmony_ciohos_fuzztest("AudioencoderpreapiDescriptionFuzzTest") {
23da853ecaSopenharmony_ci  module_out_path = module_output_path
24da853ecaSopenharmony_ci  fuzz_config_file =
25da853ecaSopenharmony_ci      "$MEDIA_ROOT_DIR/test/fuzztest/audioencoderpreapidescription_fuzzer"
26da853ecaSopenharmony_ci  include_dirs = [
27da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/test/fuzztest/audioencoderpreapidescription_fuzzer",
28da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/test/nativedemo/avmuxer",
29da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/interfaces/kits/c",
30da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/interfaces/inner_api/native",
31da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/services/factory",
32da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/engine/plugin/common",
33da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/engine/plugin/core",
34da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/engine/plugin/interface",
35da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/frameworks/native/capi/common",
36da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/dfx/include",
37da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/engine/base/include",
38da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/engine/codec/include/video",
39da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/engine/common/include",
40da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/engine/source/hst_releated",
41da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/services/factory",
42da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/utils/include",
43da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/test/nativedemo/include",
44da853ecaSopenharmony_ci  ]
45da853ecaSopenharmony_ci  cflags = [
46da853ecaSopenharmony_ci    "-g",
47da853ecaSopenharmony_ci    "-O0",
48da853ecaSopenharmony_ci    "-Wno-unused-variable",
49da853ecaSopenharmony_ci    "-fno-omit-frame-pointer",
50da853ecaSopenharmony_ci  ]
51da853ecaSopenharmony_ci  sources = [
52da853ecaSopenharmony_ci    "audioencoderdemo.cpp",
53da853ecaSopenharmony_ci    "audioencoderpreapi_description_fuzzer.cpp",
54da853ecaSopenharmony_ci  ]
55da853ecaSopenharmony_ci
56da853ecaSopenharmony_ci  defines = []
57da853ecaSopenharmony_ci
58da853ecaSopenharmony_ci  if (av_codec_enable_special_codec) {
59da853ecaSopenharmony_ci    defines += [ "AV_CODEC_AUDIO_SPECIAL_CAPACITY" ]
60da853ecaSopenharmony_ci  }
61da853ecaSopenharmony_ci
62da853ecaSopenharmony_ci  external_deps = [
63da853ecaSopenharmony_ci    "c_utils:utils",
64da853ecaSopenharmony_ci    "hilog:libhilog",
65da853ecaSopenharmony_ci    "ipc:ipc_core",
66da853ecaSopenharmony_ci    "media_foundation:media_foundation",
67da853ecaSopenharmony_ci    "media_foundation:native_media_core",
68da853ecaSopenharmony_ci    "window_manager:libwm",
69da853ecaSopenharmony_ci  ]
70da853ecaSopenharmony_ci  deps = [
71da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client",
72da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/interfaces/kits/c:capi_packages",
73da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_avmuxer",
74da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_avsource",
75da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_codecbase",
76da853ecaSopenharmony_ci    "$MEDIA_ROOT_DIR/services/services:av_codec_service",
77da853ecaSopenharmony_ci  ]
78da853ecaSopenharmony_ci}
79da853ecaSopenharmony_ci
80da853ecaSopenharmony_ci###############################################################################
81da853ecaSopenharmony_cigroup("fuzztest") {
82da853ecaSopenharmony_ci  testonly = true
83da853ecaSopenharmony_ci  deps = []
84da853ecaSopenharmony_ci  deps += [
85da853ecaSopenharmony_ci    # deps file
86da853ecaSopenharmony_ci    ":AudioencoderpreapiDescriptionFuzzTest",
87da853ecaSopenharmony_ci  ]
88da853ecaSopenharmony_ci}
89da853ecaSopenharmony_ci###############################################################################
90