Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0527c755 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "codec2 hal: AIDL type conversion, step 2" into main am: aaec7976

parents 360703f4 aaec7976
Loading
Loading
Loading
Loading
+149 −0
Original line number Diff line number Diff line
package {
    default_applicable_licenses: ["frameworks_av_license"],
}

// DO NOT DEPEND ON THIS DIRECTLY
// use libcodec2-aidl-client-defaults instead
cc_library {
    name: "libcodec2_aidl_client",

    srcs: [
        "ParamTypes.cpp",
    ],

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

    shared_libs: [
        "android.hardware.media.bufferpool@2.0",
        "android.hardware.media.c2-V1-ndk",
        "libbinder_ndk",
        "libbase",
        "libcodec2",
        "libcodec2_vndk",
        "libcutils",
        "liblog",
        "libnativewindow",
        "libutils",
    ],

    export_include_dirs: [
        "include",
    ],

    export_shared_lib_headers: [
        "android.hardware.media.c2-V1-ndk",
        "libcodec2",
    ],
}

// DO NOT DEPEND ON THIS DIRECTLY
// use libcodec2-hidl-defaults instead
//cc_library {
//    name: "libcodec2_hidl@1.0",
//    vendor_available: true,
//    min_sdk_version: "29",
//    apex_available: [
//        "//apex_available:platform",
//        "com.android.media.swcodec",
//    ],
//
//    defaults: ["hidl_defaults"],
//
//    srcs: [
//        "Component.cpp",
//        "ComponentInterface.cpp",
//        "ComponentStore.cpp",
//        "Configurable.cpp",
//        "InputBufferManager.cpp",
//        "InputSurface.cpp",
//        "InputSurfaceConnection.cpp",
//        "types.cpp",
//    ],
//
//    header_libs: [
//        "libbinder_headers",
//        "libcodec2_hal_common",
//        "libcodec2_internal", // private
//        "libsystem_headers",
//    ],
//
//    shared_libs: [
//        "android.hardware.graphics.bufferqueue@1.0",
//        "android.hardware.graphics.bufferqueue@2.0",
//        "android.hardware.graphics.common@1.0",
//        "android.hardware.media@1.0",
//        "android.hardware.media.bufferpool@2.0",
//        "android.hardware.media.c2@1.0",
//        "android.hardware.media.omx@1.0",
//        "libbase",
//        "libcodec2",
//        "libcodec2_vndk",
//        "libcodec2_hidl_plugin_stub",
//        "libcutils",
//        "libhidlbase",
//        "liblog",
//        "libstagefright_bufferpool@2.0.1",
//        "libstagefright_bufferqueue_helper_novndk",
//        "libui",
//        "libutils",
//    ],
//
//    target: {
//        vendor: {
//            exclude_shared_libs: [
//                "libstagefright_bufferqueue_helper_novndk",
//                "libcodec2_hidl_plugin_stub",
//            ],
//            shared_libs: [
//                "libstagefright_bufferqueue_helper",
//                "libcodec2_hidl_plugin",
//            ],
//        },
//        apex: {
//            exclude_shared_libs: [
//                "libcodec2_hidl_plugin",
//                "libcodec2_hidl_plugin_stub",
//            ],
//        },
//    },
//
//    export_include_dirs: [
//        "include",
//    ],
//
//    export_shared_lib_headers: [
//        "android.hardware.media.c2@1.0",
//        "libcodec2",
//        "libcodec2_vndk",
//        "libhidlbase",
//        "libstagefright_bufferpool@2.0.1",
//        "libui",
//    ],
//}
//
//// public dependency for Codec 2.0 HAL service implementations
//cc_defaults {
//    name: "libcodec2-hidl-defaults@1.0",
//    defaults: ["libcodec2-impl-defaults"],
//
//    shared_libs: [
//        "android.hardware.media.c2@1.0",
//        "libcodec2_hidl@1.0",
//    ],
//}

// public dependency for Codec 2.0 HAL client
cc_defaults {
    name: "libcodec2-aidl-client-defaults",
    min_sdk_version: "34",
    defaults: ["libcodec2-impl-defaults"],

    shared_libs: [
        "android.hardware.media.c2-V1-ndk",
        "libcodec2_aidl_client",
    ],
}
+72 −0
Original line number Diff line number Diff line
/*
 * Copyright 2022 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.
 */

#ifndef CODEC2_AIDL_UTILS_PARAM_TYPES_SPECIALIZATIONS_H
#define CODEC2_AIDL_UTILS_PARAM_TYPES_SPECIALIZATIONS_H

#include <aidl/android/hardware/media/c2/FieldId.h>
#include <aidl/android/hardware/media/c2/FieldSupportedValues.h>
#include <aidl/android/hardware/media/c2/Params.h>
#include <aidl/android/hardware/media/c2/Status.h>
#include <codec2/common/ParamTypes.h>

namespace android {

using ::aidl::android::hardware::media::c2::FieldId;
using ::aidl::android::hardware::media::c2::FieldSupportedValues;
using ::aidl::android::hardware::media::c2::Params;
using ::aidl::android::hardware::media::c2::Status;

// {offset, size} -> FieldId
template<>
void SetFieldId(FieldId *d, uint32_t offset, uint32_t size);

// FieldId -> offset
template<>
uint32_t GetOffsetFromFieldId(const FieldId &s);

// FieldId -> size
template<>
uint32_t GetSizeFromFieldId(const FieldId &s);

template<>
void SetStatus(Status *dst, c2_status_t src);

template<>
c2_status_t GetStatus(const Status &status);

// C2FieldSupportedValues -> FieldSupportedValues
template<>
bool objcpy(FieldSupportedValues *d, const C2FieldSupportedValues &s);

// FieldSupportedValues -> C2FieldSupportedValues
template<>
bool objcpy(C2FieldSupportedValues *d, const FieldSupportedValues &s);

template<>
struct _ParamsBlobHelper<Params> { typedef std::vector<uint8_t> BlobType; };

template<>
const std::vector<uint8_t> &GetBlob<Params>(const Params &params);

template<>
std::vector<uint8_t> *GetBlob<Params>(Params *params);

} // namespace android



#endif  // CODEC2_AIDL_UTILS_PARAM_TYPES_SPECIALIZATIONS_H