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: "libcodec2_client_headers",
    export_include_dirs: ["include"],
    min_sdk_version: "29",
    host_supported: true,
    target: {
        darwin: {
            enabled: false,
        },
    },
}

cc_library {
    name: "libcodec2_client",

    srcs: [
        "GraphicBufferAllocator.cpp",
        "GraphicsTracker.cpp",
        "client.cpp",
        "output.cpp",
    ],

    defaults: [
        "libcodec2-aidl-client-defaults",
    ],

    // http://b/343951602#comment4 Explicitly set cpp_std to gnu++20.  The
    // default inherited from libcodec2-impl-defaults sets it to gnu++17 which
    // causes a segfault when mixing global std::string symbols built with
    // gnu++17 and gnu++20.  TODO(b/343951602): clean this after
    // libcodec2-impl-defaults opt into gnu++17 is removed.
    cpp_std: "gnu++20",

    header_libs: [
        "libcodec2_internal", // private
    ],

    shared_libs: [
        "android.hardware.graphics.bufferqueue@1.0",
        "android.hardware.media.bufferpool@2.0",
        "android.hardware.media.c2@1.0",
        "android.hardware.media.c2@1.1",
        "android.hardware.media.c2@1.2",
        "android.hardware.media.bufferpool2-V2-ndk",
        "android.hardware.media.c2-V1-ndk",
        "libbase",
        "libbinder",
        "libbinder_ndk",
        "libcodec2",
        "libcodec2_hidl_client@1.0",
        "libcodec2_hidl_client@1.1",
        "libcodec2_hidl_client@1.2",
        "libcodec2_vndk",
        "libcutils",
        "libgui",
        "libhidlbase",
        "liblog",
        "libnativewindow",
        "libstagefright_aidl_bufferpool2",
        "libstagefright_bufferpool@2.0.1",
        "libui",
        "libutils",
    ],

    static_libs: [
        "libaidlcommonsupport",
    ],

    export_include_dirs: [
        "include",
    ],

    export_shared_lib_headers: [
        "android.hardware.media.c2@1.0",
        "android.hardware.media.c2@1.1",
        "android.hardware.media.c2@1.2",
        "libcodec2",
        "libcodec2_hidl_client@1.0",
        "libcodec2_hidl_client@1.1",
        "libcodec2_hidl_client@1.2",
        "libcodec2_vndk",
    ],

}
