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

Commit 6cd5fa30 authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Android (Google) Code Review
Browse files

Merge "Define HAL for audio effects"

parents 8e74ba0d 40be06cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
// This is an autogenerated file, do not edit.
subdirs = [
    "audio/common/2.0",
    "audio/effect/2.0",
    "benchmarks/msgq/1.0",
    "nfc/1.0",
    "nfc/1.0/default",
@@ -14,5 +15,4 @@ subdirs = [
    "vibrator/1.0",
    "wifi/1.0",
    "wifi/supplicant/1.0",
    "vibrator/1.0",
]
+151 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen. Do not edit manually.

genrule {
    name: "android.hardware.audio.effect@2.0_genc++",
    tool: "hidl-gen",
    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.audio.effect@2.0",
    srcs: [
        "types.hal",
        "IAcousticEchoCancelerEffect.hal",
        "IAutomaticGainControlEffect.hal",
        "IBassBoostEffect.hal",
        "IDownmixEffect.hal",
        "IEffect.hal",
        "IEffectBufferProviderCallback.hal",
        "IEffectsFactory.hal",
        "IEnvironmentalReverbEffect.hal",
        "IEqualizerEffect.hal",
        "ILoudnessEnhancerEffect.hal",
        "INoiseSuppressionEffect.hal",
        "IPresetReverbEffect.hal",
        "IVirtualizerEffect.hal",
        "IVisualizerEffect.hal",
    ],
    out: [
        "android/hardware/audio/effect/2.0/types.cpp",
        "android/hardware/audio/effect/2.0/AcousticEchoCancelerEffectAll.cpp",
        "android/hardware/audio/effect/2.0/AutomaticGainControlEffectAll.cpp",
        "android/hardware/audio/effect/2.0/BassBoostEffectAll.cpp",
        "android/hardware/audio/effect/2.0/DownmixEffectAll.cpp",
        "android/hardware/audio/effect/2.0/EffectAll.cpp",
        "android/hardware/audio/effect/2.0/EffectBufferProviderCallbackAll.cpp",
        "android/hardware/audio/effect/2.0/EffectsFactoryAll.cpp",
        "android/hardware/audio/effect/2.0/EnvironmentalReverbEffectAll.cpp",
        "android/hardware/audio/effect/2.0/EqualizerEffectAll.cpp",
        "android/hardware/audio/effect/2.0/LoudnessEnhancerEffectAll.cpp",
        "android/hardware/audio/effect/2.0/NoiseSuppressionEffectAll.cpp",
        "android/hardware/audio/effect/2.0/PresetReverbEffectAll.cpp",
        "android/hardware/audio/effect/2.0/VirtualizerEffectAll.cpp",
        "android/hardware/audio/effect/2.0/VisualizerEffectAll.cpp",
    ],
}

genrule {
    name: "android.hardware.audio.effect@2.0_genc++_headers",
    tool: "hidl-gen",
    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.audio.effect@2.0",
    srcs: [
        "types.hal",
        "IAcousticEchoCancelerEffect.hal",
        "IAutomaticGainControlEffect.hal",
        "IBassBoostEffect.hal",
        "IDownmixEffect.hal",
        "IEffect.hal",
        "IEffectBufferProviderCallback.hal",
        "IEffectsFactory.hal",
        "IEnvironmentalReverbEffect.hal",
        "IEqualizerEffect.hal",
        "ILoudnessEnhancerEffect.hal",
        "INoiseSuppressionEffect.hal",
        "IPresetReverbEffect.hal",
        "IVirtualizerEffect.hal",
        "IVisualizerEffect.hal",
    ],
    out: [
        "android/hardware/audio/effect/2.0/types.h",
        "android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h",
        "android/hardware/audio/effect/2.0/IHwAcousticEchoCancelerEffect.h",
        "android/hardware/audio/effect/2.0/BnAcousticEchoCancelerEffect.h",
        "android/hardware/audio/effect/2.0/BpAcousticEchoCancelerEffect.h",
        "android/hardware/audio/effect/2.0/BsAcousticEchoCancelerEffect.h",
        "android/hardware/audio/effect/2.0/IAutomaticGainControlEffect.h",
        "android/hardware/audio/effect/2.0/IHwAutomaticGainControlEffect.h",
        "android/hardware/audio/effect/2.0/BnAutomaticGainControlEffect.h",
        "android/hardware/audio/effect/2.0/BpAutomaticGainControlEffect.h",
        "android/hardware/audio/effect/2.0/BsAutomaticGainControlEffect.h",
        "android/hardware/audio/effect/2.0/IBassBoostEffect.h",
        "android/hardware/audio/effect/2.0/IHwBassBoostEffect.h",
        "android/hardware/audio/effect/2.0/BnBassBoostEffect.h",
        "android/hardware/audio/effect/2.0/BpBassBoostEffect.h",
        "android/hardware/audio/effect/2.0/BsBassBoostEffect.h",
        "android/hardware/audio/effect/2.0/IDownmixEffect.h",
        "android/hardware/audio/effect/2.0/IHwDownmixEffect.h",
        "android/hardware/audio/effect/2.0/BnDownmixEffect.h",
        "android/hardware/audio/effect/2.0/BpDownmixEffect.h",
        "android/hardware/audio/effect/2.0/BsDownmixEffect.h",
        "android/hardware/audio/effect/2.0/IEffect.h",
        "android/hardware/audio/effect/2.0/IHwEffect.h",
        "android/hardware/audio/effect/2.0/BnEffect.h",
        "android/hardware/audio/effect/2.0/BpEffect.h",
        "android/hardware/audio/effect/2.0/BsEffect.h",
        "android/hardware/audio/effect/2.0/IEffectBufferProviderCallback.h",
        "android/hardware/audio/effect/2.0/IHwEffectBufferProviderCallback.h",
        "android/hardware/audio/effect/2.0/BnEffectBufferProviderCallback.h",
        "android/hardware/audio/effect/2.0/BpEffectBufferProviderCallback.h",
        "android/hardware/audio/effect/2.0/BsEffectBufferProviderCallback.h",
        "android/hardware/audio/effect/2.0/IEffectsFactory.h",
        "android/hardware/audio/effect/2.0/IHwEffectsFactory.h",
        "android/hardware/audio/effect/2.0/BnEffectsFactory.h",
        "android/hardware/audio/effect/2.0/BpEffectsFactory.h",
        "android/hardware/audio/effect/2.0/BsEffectsFactory.h",
        "android/hardware/audio/effect/2.0/IEnvironmentalReverbEffect.h",
        "android/hardware/audio/effect/2.0/IHwEnvironmentalReverbEffect.h",
        "android/hardware/audio/effect/2.0/BnEnvironmentalReverbEffect.h",
        "android/hardware/audio/effect/2.0/BpEnvironmentalReverbEffect.h",
        "android/hardware/audio/effect/2.0/BsEnvironmentalReverbEffect.h",
        "android/hardware/audio/effect/2.0/IEqualizerEffect.h",
        "android/hardware/audio/effect/2.0/IHwEqualizerEffect.h",
        "android/hardware/audio/effect/2.0/BnEqualizerEffect.h",
        "android/hardware/audio/effect/2.0/BpEqualizerEffect.h",
        "android/hardware/audio/effect/2.0/BsEqualizerEffect.h",
        "android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h",
        "android/hardware/audio/effect/2.0/IHwLoudnessEnhancerEffect.h",
        "android/hardware/audio/effect/2.0/BnLoudnessEnhancerEffect.h",
        "android/hardware/audio/effect/2.0/BpLoudnessEnhancerEffect.h",
        "android/hardware/audio/effect/2.0/BsLoudnessEnhancerEffect.h",
        "android/hardware/audio/effect/2.0/INoiseSuppressionEffect.h",
        "android/hardware/audio/effect/2.0/IHwNoiseSuppressionEffect.h",
        "android/hardware/audio/effect/2.0/BnNoiseSuppressionEffect.h",
        "android/hardware/audio/effect/2.0/BpNoiseSuppressionEffect.h",
        "android/hardware/audio/effect/2.0/BsNoiseSuppressionEffect.h",
        "android/hardware/audio/effect/2.0/IPresetReverbEffect.h",
        "android/hardware/audio/effect/2.0/IHwPresetReverbEffect.h",
        "android/hardware/audio/effect/2.0/BnPresetReverbEffect.h",
        "android/hardware/audio/effect/2.0/BpPresetReverbEffect.h",
        "android/hardware/audio/effect/2.0/BsPresetReverbEffect.h",
        "android/hardware/audio/effect/2.0/IVirtualizerEffect.h",
        "android/hardware/audio/effect/2.0/IHwVirtualizerEffect.h",
        "android/hardware/audio/effect/2.0/BnVirtualizerEffect.h",
        "android/hardware/audio/effect/2.0/BpVirtualizerEffect.h",
        "android/hardware/audio/effect/2.0/BsVirtualizerEffect.h",
        "android/hardware/audio/effect/2.0/IVisualizerEffect.h",
        "android/hardware/audio/effect/2.0/IHwVisualizerEffect.h",
        "android/hardware/audio/effect/2.0/BnVisualizerEffect.h",
        "android/hardware/audio/effect/2.0/BpVisualizerEffect.h",
        "android/hardware/audio/effect/2.0/BsVisualizerEffect.h",
    ],
}

cc_library_shared {
    name: "android.hardware.audio.effect@2.0",
    generated_sources: ["android.hardware.audio.effect@2.0_genc++"],
    generated_headers: ["android.hardware.audio.effect@2.0_genc++_headers"],
    export_generated_headers: ["android.hardware.audio.effect@2.0_genc++_headers"],
    shared_libs: [
        "libhidl",
        "libhwbinder",
        "libutils",
        "libcutils",
        "android.hardware.audio.common@2.0",
    ],
}
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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 android.hardware.audio.effect@2.0;

import android.hardware.audio.common@2.0;
import IEffect;

interface IAcousticEchoCancelerEffect extends IEffect {
    /*
     * Sets echo delay value in milliseconds.
     */
    setEchoDelay(uint32_t echoDelayMs) generates (Result retval);

    /*
     * Gets echo delay value in milliseconds.
     */
    getEchoDelay() generates (Result retval, uint32_t echoDelayMs);
};
+68 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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 android.hardware.audio.effect@2.0;

import android.hardware.audio.common@2.0;
import IEffect;

interface IAutomaticGainControlEffect extends IEffect {
    /*
     * Sets target level in millibels.
     */
    setTargetLevel(int16_t targetLevelMb) generates (Result retval);

    /*
     * Gets target level.
     */
    getTargetLevel() generates (Result retval, int16_t targetLevelMb);

    /*
     * Sets gain in the compression range in millibels.
     */
    setCompGain(int16_t compGainMb) generates (Result retval);

    /*
     * Gets gain in the compression range.
     */
    getCompGain() generates (Result retval, int16_t compGainMb);

    /*
     * Enables or disables limiter.
     */
    setLimiterEnabled(bool enabled) generates (Result retval);

    /*
     * Returns whether limiter is enabled.
     */
    isLimiterEnabled() generates (Result retval, bool enabled);

    struct AllProperties {
        int16_t targetLevelMb;
        int16_t compGainMb;
        bool limiterEnabled;
    };

    /*
     * Sets all properties at once.
     */
    setAllProperties(AllProperties properties) generates (Result retval);

    /*
     * Gets all properties at once.
     */
    getAllProperties() generates (Result retval, AllProperties properties);
};
+48 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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 android.hardware.audio.effect@2.0;

import android.hardware.audio.common@2.0;
import IEffect;

interface IBassBoostEffect extends IEffect {
    /*
     * Returns whether setting bass boost strength is supported.
     */
    isStrengthSupported() generates (Result retval, bool strengthSupported);

    enum StrengthRange : uint16_t {
        MIN = 0,
        MAX = 1000
    };

    /*
     * Sets bass boost strength.
     *
     * @param strength strength of the effect. The valid range for strength
     *                 strength is [0, 1000], where 0 per mille designates the
     *                 mildest effect and 1000 per mille designates the
     *                 strongest.
     * @return retval operation completion status.
     */
    setStrength(uint16_t strength) generates (Result retval);

    /*
     * Gets virtualization strength.
     */
    getStrength() generates (Result retval, uint16_t strength);
};
Loading