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

Commit af7f78da authored by Kevin Rocard's avatar Kevin Rocard
Browse files

Audio V4: Implement the shim effect 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: If412eb55ebf6afc773593547af9395a09b6825c2
Merged-In: If412eb55ebf6afc773593547af9395a09b6825c2
Cherry-picked from master
Signed-off-by: default avatarKevin Rocard <krocard@google.com>
parent f1c1f6e7
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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 ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H

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

namespace android {
namespace hardware {
namespace audio {
namespace common {
namespace V2_0 {
namespace implementation {

typedef common::V2_0::AudioDevice AudioDeviceBitfield;
typedef common::V2_0::AudioChannelMask AudioChannelBitfield;

}  // namespace implementation
}  // namespace V2_0
}  // namespace common
}  // namespace audio
}  // namespace hardware
}  // namespace android

#endif  // ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H
+39 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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 ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H

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

namespace android {
namespace hardware {
namespace audio {
namespace common {
namespace V4_0 {
namespace implementation {

typedef hidl_bitfield<common::V4_0::AudioDevice> AudioDeviceBitfield;
typedef hidl_bitfield<common::V4_0::AudioChannelMask> AudioChannelBitfield;

}  // namespace implementation
}  // namespace V4_0
}  // namespace common
}  // namespace audio
}  // namespace hardware
}  // namespace android

#endif  // ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H
+23 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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.
 */

#define LOG_TAG "AEC_Effect_HAL"

#include "AcousticEchoCancelerEffect.h"

#define AUDIO_HAL_VERSION V4_0
#include <effect/all-versions/default/AcousticEchoCancelerEffect.impl.h>
#undef AUDIO_HAL_VERSION
+28 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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 ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ACOUSTICECHOCANCELEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ACOUSTICECHOCANCELEREFFECT_H

#include <android/hardware/audio/effect/4.0/IAcousticEchoCancelerEffect.h>

#include "Effect.h"

#define AUDIO_HAL_VERSION V4_0
#include <effect/all-versions/default/AcousticEchoCancelerEffect.h>
#undef AUDIO_HAL_VERSION

#endif  // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ACOUSTICECHOCANCELEREFFECT_H
+50 −0
Original line number Diff line number Diff line
cc_library_shared {
    name: "android.hardware.audio.effect@4.0-impl",
    defaults: ["hidl_defaults"],
    vendor: true,
    relative_install_path: "hw",
    srcs: [
        "AcousticEchoCancelerEffect.cpp",
        "AudioBufferManager.cpp",
        "AutomaticGainControlEffect.cpp",
        "BassBoostEffect.cpp",
        "Conversions.cpp",
        "DownmixEffect.cpp",
        "Effect.cpp",
        "EffectsFactory.cpp",
        "EnvironmentalReverbEffect.cpp",
        "EqualizerEffect.cpp",
        "LoudnessEnhancerEffect.cpp",
        "NoiseSuppressionEffect.cpp",
        "PresetReverbEffect.cpp",
        "VirtualizerEffect.cpp",
        "VisualizerEffect.cpp",
    ],

    shared_libs: [
        "libbase",
        "libcutils",
        "libeffects",
        "libfmq",
        "libhidlbase",
        "libhidlmemory",
        "libhidltransport",
        "liblog",
        "libutils",
        "android.hardware.audio.common-util",
        "android.hardware.audio.common@4.0",
        "android.hardware.audio.common@4.0-util",
        "android.hardware.audio.effect@4.0",
        "android.hidl.memory@1.0",
    ],

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