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

Commit 5ec29331 authored by Kevin Rocard's avatar Kevin Rocard
Browse files

Audio V4: Implement the shim core 4.0 -> legacy



All the new files added are a copy of the 2.0 ones, with just the
version 2 that was changed to 4.

Due to the rollback on the retrocompatiblity breakage,
the split of implementation is not strictly needed any more.
This makes the current split in .impl.h and double include
unnecessary complicated.
This will need to be factorized in a future patch.

Bug: 38184704
Test: compile
Change-Id: I0d699ade7558ed68125b300f8522e2767ae1ee37
Merged-In: I0d699ade7558ed68125b300f8522e2767ae1ee37
Cherry-picked from master
Signed-off-by: default avatarKevin Rocard <krocard@google.com>
parent 91aa1af9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ namespace implementation {

typedef common::V2_0::AudioDevice AudioDeviceBitfield;
typedef common::V2_0::AudioChannelMask AudioChannelBitfield;
typedef common::V2_0::AudioOutputFlag AudioOutputFlagBitfield;
typedef common::V2_0::AudioInputFlag AudioInputFlagBitfield;

}  // namespace implementation
}  // namespace V2_0
+3 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H

#include <android/hardware/audio/4.0/types.h>
#include <android/hardware/audio/common/4.0/types.h>

namespace android {
namespace hardware {
@@ -28,6 +28,8 @@ namespace implementation {

typedef hidl_bitfield<common::V4_0::AudioDevice> AudioDeviceBitfield;
typedef hidl_bitfield<common::V4_0::AudioChannelMask> AudioChannelBitfield;
typedef hidl_bitfield<common::V4_0::AudioOutputFlag> AudioOutputFlagBitfield;
typedef hidl_bitfield<common::V4_0::AudioInputFlag> AudioInputFlagBitfield;

}  // namespace implementation
}  // namespace V4_0
+4 −0
Original line number Diff line number Diff line
@@ -14,6 +14,10 @@ cc_library_shared {
        "StreamOut.cpp",
    ],

    cflags: [
        "-DAUDIO_HAL_VERSION_2_0",
    ],

    defaults: ["hidl_defaults"],

    export_include_dirs: ["include"],
+53 −0
Original line number Diff line number Diff line
cc_library_shared {
    name: "android.hardware.audio@4.0-impl",
    relative_install_path: "hw",
    proprietary: true,
    vendor: true,
    srcs: [
        "Conversions.cpp",
        "Device.cpp",
        "DevicesFactory.cpp",
        "ParametersUtil.cpp",
        "PrimaryDevice.cpp",
        "Stream.cpp",
        "StreamIn.cpp",
        "StreamOut.cpp",
    ],

    cflags: [
        "-DAUDIO_HAL_VERSION_4_0",
    ],

    defaults: ["hidl_defaults"],

    export_include_dirs: ["include"],

    shared_libs: [
        "libbase",
        "libcutils",
        "libfmq",
        "libhardware",
        "libhidlbase",
        "libhidltransport",
        "liblog",
        "libutils",
        "android.hardware.audio@4.0",
        "android.hardware.audio.common@4.0",
        "android.hardware.audio.common@4.0-util",
        "android.hardware.audio.common-util",
    ],

    header_libs: [
        "android.hardware.audio.common.util@all-versions",
        "android.hardware.audio.core@all-versions-impl",
        "libaudioclient_headers",
        "libaudio_system_headers",
        "libhardware_headers",
        "libmedia_headers",
    ],

    whole_static_libs: [
        "libmedia_helper",
    ],

}
+21 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.
 */

#include "core/4.0/default/Conversions.h"

#define AUDIO_HAL_VERSION V4_0
#include <core/all-versions/default/Conversions.impl.h>
#undef AUDIO_HAL_VERSION
Loading