package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_av_media_libstagefright_tests_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: [
        "frameworks_av_media_libstagefright_tests_license",
    ],
}

cc_defaults {
    name: "libstagefright_fuzzer_defaults",
    cflags: [
        "-Wno-multichar",
        "-Werror",
        "-Wno-error=deprecated-declarations",
        "-Wall",
    ],
    shared_libs: [
        "libstagefright",
        "libstagefright_codecbase",
        "libbase",
        "libcutils",
        "libutils",
        "libstagefright_foundation",
        "libmedia",
        "libaudioclient",
        "libmedia_omx",
        "libgui",
        "libbinder",
        "liblog",
        "media_permission-aidl-cpp",
    ],
    fuzz_config: {
        componentid: 42195,
        hotlists: ["4593311"],
        description: "The fuzzer targets the APIs of libstagefright",
        vector: "local_no_privileges_required",
        service_privilege: "constrained",
        users: "multi_user",
        fuzzed_code_usage: "shipped",
    },
}

cc_fuzz {
    name: "libstagefright_mediaclock_fuzzer",
    srcs: [
        "MediaClockFuzzer.cpp",
    ],
    defaults: ["libstagefright_fuzzer_defaults"],
}

cc_fuzz {
    name: "libstagefright_mediascanner_fuzzer",
    srcs: [
        "StagefrightMediaScannerFuzzer.cpp",
    ],
    defaults: ["libstagefright_fuzzer_defaults"],
}

cc_fuzz {
    name: "libstagefright_skipcutbuffer_fuzzer",
    srcs: [
        "SkipCutBufferFuzzer.cpp",
    ],
    defaults: ["libstagefright_fuzzer_defaults"],
}

cc_fuzz {
    name: "libstagefright_mediamuxer_fuzzer",
    srcs: [
        "MediaMuxerFuzzer.cpp",
    ],
    defaults: ["libstagefright_fuzzer_defaults"],
}

cc_fuzz {
    name: "libstagefright_frameDecoder_fuzzer",
    srcs: [
        "FrameDecoderFuzzer.cpp",
    ],
    corpus: ["corpus/*"],
    defaults: ["libstagefright_fuzzer_defaults"],
}

cc_fuzz {
    name: "libstagefright_writer_fuzzer",
    srcs: [
        "FuzzerMediaUtility.cpp",
        "WriterFuzzer.cpp",
    ],
    dictionary: "dictionaries/formats.dict",
    defaults: ["libstagefright_fuzzer_defaults"],
    header_libs: [
        "libstagefright_webm_headers",
    ],
    static_libs: [
        "libdatasource",
    ],
}
