1# Copyright (c) 2024 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/config/features.gni") 15import("//build/test.gni") 16import("//foundation/multimedia/player_framework/config.gni") 17 18module_output_path = "$MODULE_OUTPUT_PATH/media_player" 19MEDIA_ROOT_DIR = "//foundation/multimedia/player_framework/" 20 21ohos_fuzztest("PlayerApiFuzzTest") { 22 module_out_path = module_output_path 23 fuzz_config_file = 24 "$MEDIA_ROOT_DIR/test/fuzztest/player_fuzztest/playerapi_fuzzer" 25 26 defines = [ "IMAGE_COLORSPACE_FLAG" ] 27 defines += player_framework_defines 28 29 include_dirs = [ 30 "./include", 31 "$MEDIA_ROOT_DIR/services/include", 32 "$MEDIA_ROOT_DIR/services/services/common", 33 "$MEDIA_ROOT_DIR/services/services/media_data_source/ipc", 34 "$MEDIA_ROOT_DIR/services/services/player/ipc", 35 "$MEDIA_ROOT_DIR/services/services/sa_media/ipc", 36 "$MEDIA_ROOT_DIR/services/services/sa_media/server", 37 "$MEDIA_ROOT_DIR/services/services/sa_media/server_manager", 38 "$MEDIA_ROOT_DIR/test/fuzztest/player_fuzztest", 39 "$MEDIA_ROOT_DIR/interfaces/inner_api/native", 40 "$MEDIA_ROOT_DIR/test/fuzztest/common", 41 "$MEDIA_ROOT_DIR/interfaces/inner_api", 42 ] 43 cflags = [ 44 "-std=c++17", 45 "-fno-rtti", 46 "-fno-exceptions", 47 "-Wall", 48 "-fno-common", 49 "-fstack-protector-strong", 50 "-Wshadow", 51 "-FPIC", 52 "-FS", 53 "-O2", 54 "-D_FORTIFY_SOURCE=2", 55 "-fvisibility=hidden", 56 "-Wformat=2", 57 "-Wfloat-equal", 58 "-Wdate-time", 59 "-Werror", 60 "-Wextra", 61 "-Wimplicit-fallthrough", 62 "-Wsign-compare", 63 "-Wunused-parameter", 64 "-DBINDER_IPC_32BIT", 65 ] 66 if (player_framework_support_player) { 67 sources = [ 68 "$MEDIA_ROOT_DIR/services/services/common/avsharedmemory_ipc.cpp", 69 "$MEDIA_ROOT_DIR/services/services/media_data_source/ipc/media_data_source_stub.cpp", 70 "$MEDIA_ROOT_DIR/test/fuzztest/common/stub_common.cpp", 71 "playerapi_fuzzer.cpp", 72 ] 73 } 74 deps = [ 75 "$MEDIA_ROOT_DIR/interfaces/inner_api/native:media_client", 76 "$MEDIA_ROOT_DIR/services/services:media_service", 77 "$MEDIA_ROOT_DIR/services/utils:media_service_utils", 78 ] 79 external_deps = [ 80 "av_codec:av_codec_client", 81 "c_utils:utils", 82 "graphic_surface:surface", 83 "hilog:libhilog", 84 "ipc:ipc_single", 85 "player_framework:media_client", 86 "safwk:system_ability_fwk", 87 "samgr:samgr_proxy", 88 ] 89} 90