Effect AIDL: update IFactory.queryEffects to return Descriptor am: 20e5c1733e am: 67c43d9dcf am: 28ebaad709

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2344309

Change-Id: Id7150e814cdad8ee0bfc9c9e479f9a3a06adf2d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Shunkai Yao
2022-12-13 17:05:04 +00:00
committed by Automerger Merge Worker
12 changed files with 208 additions and 40 deletions

View File

@@ -178,6 +178,7 @@ aidl_interface {
"android/hardware/audio/effect/Descriptor.aidl",
"android/hardware/audio/effect/Downmix.aidl",
"android/hardware/audio/effect/DynamicsProcessing.aidl",
"android/hardware/audio/effect/EnvironmentalReverb.aidl",
"android/hardware/audio/effect/Equalizer.aidl",
"android/hardware/audio/effect/Flags.aidl",
"android/hardware/audio/effect/HapticGenerator.aidl",
@@ -185,8 +186,8 @@ aidl_interface {
"android/hardware/audio/effect/IFactory.aidl",
"android/hardware/audio/effect/LoudnessEnhancer.aidl",
"android/hardware/audio/effect/Parameter.aidl",
"android/hardware/audio/effect/PresetReverb.aidl",
"android/hardware/audio/effect/Processing.aidl",
"android/hardware/audio/effect/Reverb.aidl",
"android/hardware/audio/effect/State.aidl",
"android/hardware/audio/effect/VendorExtension.aidl",
"android/hardware/audio/effect/Virtualizer.aidl",

View File

@@ -38,10 +38,11 @@ union Capability {
android.hardware.audio.effect.BassBoost.Capability bassBoost;
android.hardware.audio.effect.Downmix.Capability downmix;
android.hardware.audio.effect.DynamicsProcessing.Capability dynamicsProcessing;
android.hardware.audio.effect.EnvironmentalReverb.Capability environmentalReverb;
android.hardware.audio.effect.Equalizer.Capability equalizer;
android.hardware.audio.effect.HapticGenerator.Capability hapticGenerator;
android.hardware.audio.effect.LoudnessEnhancer.Capability loudnessEnhancer;
android.hardware.audio.effect.Reverb.Capability reverb;
android.hardware.audio.effect.PresetReverb.Capability presetReverb;
android.hardware.audio.effect.Virtualizer.Capability virtualizer;
android.hardware.audio.effect.Visualizer.Capability visualizer;
android.hardware.audio.effect.Volume.Capability volume;

View File

@@ -33,7 +33,7 @@
package android.hardware.audio.effect;
@VintfStability
union Reverb {
union EnvironmentalReverb {
android.hardware.audio.effect.VendorExtension vendor;
int roomLevelMb;
int roomHfLevelMb;
@@ -47,7 +47,7 @@ union Reverb {
@VintfStability
union Id {
int vendorExtensionTag;
android.hardware.audio.effect.Reverb.Tag commonTag;
android.hardware.audio.effect.EnvironmentalReverb.Tag commonTag;
}
@VintfStability
parcelable Capability {

View File

@@ -34,7 +34,7 @@
package android.hardware.audio.effect;
@VintfStability
interface IFactory {
android.hardware.audio.effect.Descriptor.Identity[] queryEffects(in @nullable android.media.audio.common.AudioUuid type, in @nullable android.media.audio.common.AudioUuid implementation, in @nullable android.media.audio.common.AudioUuid proxy);
android.hardware.audio.effect.Descriptor[] queryEffects(in @nullable android.media.audio.common.AudioUuid type, in @nullable android.media.audio.common.AudioUuid implementation, in @nullable android.media.audio.common.AudioUuid proxy);
android.hardware.audio.effect.Processing[] queryProcessing(in @nullable android.hardware.audio.effect.Processing.Type type);
android.hardware.audio.effect.IEffect createEffect(in android.media.audio.common.AudioUuid implUuid);
void destroyEffect(in android.hardware.audio.effect.IEffect handle);

View File

@@ -46,10 +46,11 @@ union Parameter {
android.hardware.audio.effect.BassBoost.Id bassBoostTag;
android.hardware.audio.effect.Downmix.Id downmixTag;
android.hardware.audio.effect.DynamicsProcessing.Id dynamicsProcessingTag;
android.hardware.audio.effect.EnvironmentalReverb.Id environmentalReverbTag;
android.hardware.audio.effect.Equalizer.Id equalizerTag;
android.hardware.audio.effect.HapticGenerator.Id hapticGeneratorTag;
android.hardware.audio.effect.LoudnessEnhancer.Id loudnessEnhancerTag;
android.hardware.audio.effect.Reverb.Id reverbTag;
android.hardware.audio.effect.PresetReverb.Id presetReverbTag;
android.hardware.audio.effect.Virtualizer.Id virtualizerTag;
android.hardware.audio.effect.Visualizer.Id visualizerTag;
android.hardware.audio.effect.Volume.Id volumeTag;
@@ -73,10 +74,11 @@ union Parameter {
android.hardware.audio.effect.BassBoost bassBoost;
android.hardware.audio.effect.Downmix downmix;
android.hardware.audio.effect.DynamicsProcessing dynamicsProcessing;
android.hardware.audio.effect.EnvironmentalReverb environmentalReverb;
android.hardware.audio.effect.Equalizer equalizer;
android.hardware.audio.effect.LoudnessEnhancer loudnessEnhancer;
android.hardware.audio.effect.HapticGenerator hapticGenerator;
android.hardware.audio.effect.Reverb reverb;
android.hardware.audio.effect.LoudnessEnhancer loudnessEnhancer;
android.hardware.audio.effect.PresetReverb presetReverb;
android.hardware.audio.effect.Virtualizer virtualizer;
android.hardware.audio.effect.Visualizer visualizer;
android.hardware.audio.effect.Volume volume;

View File

@@ -0,0 +1,59 @@
/*
* Copyright (C) 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.
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.audio.effect;
@VintfStability
union PresetReverb {
android.hardware.audio.effect.VendorExtension vendor;
android.hardware.audio.effect.PresetReverb.Presets preset;
@Backing(type="int") @VintfStability
enum Presets {
NONE = 0,
SMALLROOM = 1,
MEDIUMROOM = 2,
LARGEROOM = 3,
MEDIUMHALL = 4,
LARGEHALL = 5,
PLATE = 6,
}
@VintfStability
union Id {
int vendorExtensionTag;
android.hardware.audio.effect.PresetReverb.Tag commonTag;
}
@VintfStability
parcelable Capability {
android.hardware.audio.effect.VendorExtension extension;
android.hardware.audio.effect.PresetReverb.Presets[] supportedPresets;
}
}

View File

@@ -19,10 +19,11 @@ package android.hardware.audio.effect;
import android.hardware.audio.effect.BassBoost;
import android.hardware.audio.effect.Downmix;
import android.hardware.audio.effect.DynamicsProcessing;
import android.hardware.audio.effect.EnvironmentalReverb;
import android.hardware.audio.effect.Equalizer;
import android.hardware.audio.effect.HapticGenerator;
import android.hardware.audio.effect.LoudnessEnhancer;
import android.hardware.audio.effect.Reverb;
import android.hardware.audio.effect.PresetReverb;
import android.hardware.audio.effect.VendorExtension;
import android.hardware.audio.effect.Virtualizer;
import android.hardware.audio.effect.Visualizer;
@@ -51,10 +52,11 @@ union Capability {
BassBoost.Capability bassBoost;
Downmix.Capability downmix;
DynamicsProcessing.Capability dynamicsProcessing;
EnvironmentalReverb.Capability environmentalReverb;
Equalizer.Capability equalizer;
HapticGenerator.Capability hapticGenerator;
LoudnessEnhancer.Capability loudnessEnhancer;
Reverb.Capability reverb;
PresetReverb.Capability presetReverb;
Virtualizer.Capability virtualizer;
Visualizer.Capability visualizer;
Volume.Capability volume;

View File

@@ -19,24 +19,26 @@ package android.hardware.audio.effect;
import android.hardware.audio.effect.VendorExtension;
/**
* Reverb specific definitions.
* Environmental Reverb specific definitions.
*
* All parameters defined in union Reverb must be gettable and settable. The capabilities defined in
* Reverb.Capability can only acquired with IEffect.getDescriptor() and not settable.
* All parameters defined in union Environmental must be gettable and settable. The capabilities
* * defined in EnvironmentalReverb.Capability can only acquired with IEffect.getDescriptor() and
* not * settable.
*/
@VintfStability
union Reverb {
union EnvironmentalReverb {
/**
* Effect parameter tag to identify the parameters for getParameter().
*/
@VintfStability
union Id {
int vendorExtensionTag;
Reverb.Tag commonTag;
EnvironmentalReverb.Tag commonTag;
}
/**
* Vendor Reverb implementation definition for additional parameters.
* Vendor EnvironmentalReverb implementation definition for additional parameters.
*/
VendorExtension vendor;

View File

@@ -31,8 +31,8 @@ import android.media.audio.common.AudioUuid;
@VintfStability
interface IFactory {
/**
* Return a list of effect identities supported by this device, with the optional
* filter by type and/or by instance UUID.
* Return a list of effect descriptors supported by this device, with the optional filter by
* type and/or by instance UUID.
*
* @param type UUID identifying the effect type.
* This is an optional parameter, pass in null if this parameter is not necessary; if non
@@ -43,9 +43,9 @@ interface IFactory {
* @param proxy Indicates the proxy UUID filter to query.
* This is an optional parameter, pass in null if this parameter is not necessary; if
* non null, used as a filter for effect proxy UUIDs.
* @return List of effect identities supported and filtered by type/implementation UUID.
* @return List of effect Descriptors supported and filtered by type/implementation/proxy UUID.
*/
Descriptor.Identity[] queryEffects(in @nullable AudioUuid type,
Descriptor[] queryEffects(in @nullable AudioUuid type,
in @nullable AudioUuid implementation, in @nullable AudioUuid proxy);
/**

View File

@@ -19,10 +19,11 @@ package android.hardware.audio.effect;
import android.hardware.audio.effect.BassBoost;
import android.hardware.audio.effect.Downmix;
import android.hardware.audio.effect.DynamicsProcessing;
import android.hardware.audio.effect.EnvironmentalReverb;
import android.hardware.audio.effect.Equalizer;
import android.hardware.audio.effect.HapticGenerator;
import android.hardware.audio.effect.LoudnessEnhancer;
import android.hardware.audio.effect.Reverb;
import android.hardware.audio.effect.PresetReverb;
import android.hardware.audio.effect.VendorExtension;
import android.hardware.audio.effect.Virtualizer;
import android.hardware.audio.effect.Visualizer;
@@ -73,10 +74,11 @@ union Parameter {
BassBoost.Id bassBoostTag;
Downmix.Id downmixTag;
DynamicsProcessing.Id dynamicsProcessingTag;
EnvironmentalReverb.Id environmentalReverbTag;
Equalizer.Id equalizerTag;
HapticGenerator.Id hapticGeneratorTag;
LoudnessEnhancer.Id loudnessEnhancerTag;
Reverb.Id reverbTag;
PresetReverb.Id presetReverbTag;
Virtualizer.Id virtualizerTag;
Visualizer.Id visualizerTag;
Volume.Id volumeTag;
@@ -150,10 +152,11 @@ union Parameter {
BassBoost bassBoost;
Downmix downmix;
DynamicsProcessing dynamicsProcessing;
EnvironmentalReverb environmentalReverb;
Equalizer equalizer;
LoudnessEnhancer loudnessEnhancer;
HapticGenerator hapticGenerator;
Reverb reverb;
LoudnessEnhancer loudnessEnhancer;
PresetReverb presetReverb;
Virtualizer virtualizer;
Visualizer visualizer;
Volume volume;

View File

@@ -0,0 +1,98 @@
/*
* Copyright (C) 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.
*/
package android.hardware.audio.effect;
import android.hardware.audio.effect.VendorExtension;
/**
* PresetReverb specific definitions.
*
* All parameters defined in union PresetReverb must be gettable and settable. The capabilities
* defined in PresetReverb.Capability can only acquired with IEffect.getDescriptor() and not
* settable.
*/
@VintfStability
union PresetReverb {
/**
* Presets enum definition.
*/
@VintfStability
@Backing(type="int")
enum Presets {
/**
* No reverb or reflections
*/
NONE,
/**
* A small room less than five meters in length
*/
SMALLROOM,
/**
* A medium room with a length of ten meters or less.
*/
MEDIUMROOM,
/**
* A large-sized room suitable for live performances.
*/
LARGEROOM,
/**
* A medium-sized hall.
*/
MEDIUMHALL,
/**
* a large-sized hall suitable for a full orchestra.
*/
LARGEHALL,
/**
* Synthesis of the traditional plate reverb.
*/
PLATE,
}
/**
* Effect parameter tag to identify the parameters for getParameter().
*/
@VintfStability
union Id {
int vendorExtensionTag;
PresetReverb.Tag commonTag;
}
/**
* Vendor PresetReverb implementation definition for additional parameters.
*/
VendorExtension vendor;
/**
* Capability supported by effect implementation.
*/
@VintfStability
parcelable Capability {
VendorExtension extension;
/**
* List of presets supported.
*/
Presets[] supportedPresets;
}
/**
* Get current reverb preset when used in getParameter.
* Enable a preset reverb when used in setParameter.
*/
Presets preset;
}

View File

@@ -16,21 +16,21 @@
// To render: "dot -Tpng state.gv -o state.png"
digraph effect_state_machine {
node [shape=point style=filled fillcolor=black width=0.5] I;
node [shape=doublecircle] F;
node [shape=oval width=1];
node [fillcolor=lightgreen] INIT;
node [fillcolor=lightblue] IDLE;
node [fillcolor=lightyellow] PROCESSING;
node[shape = point style = filled fillcolor = black width = 0.5] I;
node[shape = doublecircle] F;
node[shape = oval width = 1];
node[fillcolor = lightgreen] INIT;
node[fillcolor = lightblue] IDLE;
node[fillcolor = lightyellow] PROCESSING;
I -> INIT [label="IFactory.createEffect" labelfontcolor="navy"];
INIT -> F [label="IFactory.destroyEffect"];
INIT -> IDLE [label="open()" labelfontcolor="lime"];
IDLE -> PROCESSING [label="command(START"];
PROCESSING -> IDLE [label="command(STOP)\ncommand(RESET)"];
IDLE -> INIT [label="close()"];
I -> INIT[label = "IFactory.createEffect" labelfontcolor = "navy"];
INIT -> F[label = "IFactory.destroyEffect"];
INIT -> IDLE[label = "open()" labelfontcolor = "lime"];
IDLE -> PROCESSING[label = "command(START"];
PROCESSING -> IDLE[label = "command(STOP)\ncommand(RESET)"];
IDLE -> INIT[label = "close()"];
INIT -> INIT [label="getState\ngetDescriptor"];
IDLE -> IDLE [label="getXXX\nsetParameter\ncommand(RESET)"];
PROCESSING -> PROCESSING [label="getXXX\nsetParameter"];
}
INIT -> INIT[label = "getState\ngetDescriptor"];
IDLE -> IDLE[label = "getXXX\nsetParameter\ncommand(RESET)"];
PROCESSING -> PROCESSING[label = "getXXX\nsetParameter"];
}