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_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_av_license"],
}

cc_library_headers {
    name: "libsfplugin_ccodec_internal_headers",
    export_include_dirs: ["."],
    // only for internal tests, perhaps restrict via visibility clause
}

cc_library_shared {
    name: "libsfplugin_ccodec",

    defaults: [
        "android.hardware.graphics.common-ndk_shared",
    ],

    export_include_dirs: ["include"],

    srcs: [
        "C2AidlNode.cpp",
        "C2OMXNode.cpp",
        "C2NodeImpl.cpp",
        "CCodec.cpp",
        "CCodecBufferChannel.cpp",
        "CCodecBuffers.cpp",
        "CCodecConfig.cpp",
        "Codec2Buffer.cpp",
        "Codec2InfoBuilder.cpp",
        "FrameReassembler.cpp",
        "PipelineWatcher.cpp",
        "ReflectedParamUpdater.cpp",
    ],

    cflags: [
        "-Werror",
        "-Wall",
    ],

    header_libs: [
        "libcodec2_internal",
        "libmediadrm_headers",
        "libmediametrics_headers",
        "media_ndk_headers",
    ],

    static_libs: [
        "libPlatformProperties",
        "libSurfaceFlingerProperties",
        "aconfig_mediacodec_flags_c_lib",
        "android.media.codec-aconfig-cc",
    ],

    shared_libs: [
        "android.hardware.cas.native@1.0",
        "android.hardware.drm@1.0",
        "android.hardware.media.c2@1.0",
        "android.hardware.media.omx@1.0",
        "graphicbuffersource-aidl-ndk",
        "libbase",
        "libbinder",
        "libbinder_ndk",
        "libcodec2",
        "libcodec2_client",
        "libcodec2_vndk",
        "libcutils",
        "libgralloctypes",
        "libgui",
        "libhidlallocatorutils",
        "libhidlbase",
        "liblog",
        "libmedia_codeclist",
        "libmedia_omx",
        "libnativewindow",
        "libsfplugin_ccodec_utils",
        "libstagefright_bufferqueue_helper",
        "libstagefright_codecbase",
        "libstagefright_graphicbuffersource_aidl",
        "libstagefright_foundation",
        "libstagefright_omx",
        "libstagefright_surface_utils",
        "libstagefright_xmlparser",
        "libui",
        "libutils",
        "server_configurable_flags",
        "libaconfig_storage_read_api_cc",
    ],

    export_shared_lib_headers: [
        "libcodec2",
        "libcodec2_client",
    ],

    sanitize: {
        cfi: true,
        misc_undefined: [
            "unsigned-integer-overflow",
            "signed-integer-overflow",
        ],
    },
}
