# Copyright (c) 2025 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build/config/features.gni")
import("//build/test.gni")
import("./../../../multimedia_camera_framework.gni")

ohos_fuzztest("AvCodecProxyFuzzTest") {
  module_out_path = "camera_framework/camera_framework"
  fuzz_config_file = "../avcodecproxy_fuzzer"

  include_dirs = [
    "${multimedia_camera_framework_path}/dynamic_libs/av_codec/include",
    "${multimedia_camera_framework_path}/common/utils",
    "${multimedia_camera_framework_path}/dynamic_libs/moving_photo/include/avcodec",
  ]

  cflags = [
    "-g",
    "-O0",
    "-Wno-unused-variable",
    "-fno-omit-frame-pointer",
    "-fno-access-control",
  ]

  sources = [ "av_codec_proxy_fuzzer.cpp" ]

  deps = [
    "${multimedia_camera_framework_path}/common:camera_utils",
    "${multimedia_camera_framework_path}/dynamic_libs:camera_dynamic_avcodec",
  ]

  external_deps = [
    "av_codec:av_codec_client",
    "av_codec:av_codec_media_engine_modules",
    "av_codec:native_media_acodec",
    "av_codec:native_media_codecbase",
    "c_utils:utils",
    "drivers_interface_camera:metadata",
    "hilog:libhilog",
    "hisysevent:libhisysevent",
    "hitrace:hitrace_meter",
    "image_framework:image_native",
    "ipc:ipc_core",
    "media_library:media_library",
    "resource_management:librawfile",
    "safwk:system_ability_fwk",
  ]
}

group("fuzztest") {
  testonly = true
  deps = [ ":AvCodecProxyFuzzTest" ]
}