//
// Copyright (C) 2024 The Android Open Source Project
//
// 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.
//

package {
    default_applicable_licenses: ["frameworks_av_license"],
}

cc_defaults {
    name: "libcom.android.media.swcodec.apexcodecs-defaults",

    header_libs: [
        "libbase_headers",
        "libcodec2_internal",
    ],

    srcs: ["ApexCodecs.cpp"],

    shared_libs: [
        "libbase",
        "libcodec2",
        "libnativewindow",
    ],

    static_libs: [
        "android.media.swcodec.flags-aconfig-cc",
    ],

    export_include_dirs: ["include"],

    local_include_dirs: ["private"],

    export_shared_lib_headers: [
        "libbase",
        "libnativewindow",
    ],

}

cc_library_headers {
    name: "libcom.android.media.swcodec.apexcodecs-header",
    visibility: [
        "//frameworks/av/apex:__subpackages__",
        "//frameworks/av/media/codec2/hal/client",
    ],
    export_include_dirs: ["include"],
}

cc_library {
    name: "libcom.android.media.swcodec.apexcodecs-testing",
    defaults: ["libcom.android.media.swcodec.apexcodecs-defaults"],

    srcs: ["tests/ApexCodecsStoreTestImpl.cpp"],

    visibility: [
        ":__subpackages__",
    ],
}

cc_library {
    name: "libcom.android.media.swcodec.apexcodecs",
    defaults: ["libcom.android.media.swcodec.apexcodecs-defaults"],

    visibility: [
        "//frameworks/av/apex:__subpackages__",
        "//frameworks/av/media/codec2/hal/client",
    ],

    srcs: ["ApexCodecsStoreImpl.cpp"],

    min_sdk_version: "apex_inherit",
    version_script: "libcom.android.media.swcodec.apexcodecs.map.txt",
    stubs: {
        symbol_file: "libcom.android.media.swcodec.apexcodecs.map.txt",
        versions: ["36"],
    },

    apex_available: [
        "com.android.media.swcodec",
    ],
}
