Merge "audio: Align lists of enum values between framework and HAL"

This commit is contained in:
Treehugger Robot 2020-12-02 23:51:08 +00:00 committed by Gerrit Code Review
commit bc4f84565a
5 changed files with 82 additions and 47 deletions

View file

@ -44,10 +44,12 @@ package audio.policy.configuration.V7_0 {
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_IN_VOICE_CALL_MONO;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_IN_VOICE_DNLINK_MONO;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_IN_VOICE_UPLINK_MONO;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_NONE;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_2POINT0POINT2;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_2POINT1;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_2POINT1POINT2;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_3POINT0POINT2;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_3POINT1;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_3POINT1POINT2;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_5POINT1;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_5POINT1POINT2;
@ -70,6 +72,8 @@ package audio.policy.configuration.V7_0 {
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_SURROUND;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_TRI;
enum_constant public static final audio.policy.configuration.V7_0.AudioChannelMask AUDIO_CHANNEL_OUT_TRI_BACK;
}
public enum AudioContentType {
@ -87,6 +91,7 @@ package audio.policy.configuration.V7_0 {
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_IN_AUX_DIGITAL;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_IN_BACK_MIC;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_IN_BLE_HEADSET;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_A2DP;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_BLE;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET;
@ -117,6 +122,8 @@ package audio.policy.configuration.V7_0 {
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_OUT_AUX_DIGITAL;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_OUT_AUX_LINE;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_OUT_BLE_HEADSET;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_OUT_BLE_SPEAKER;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES;
enum_constant public static final audio.policy.configuration.V7_0.AudioDevice AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER;
@ -191,7 +198,6 @@ package audio.policy.configuration.V7_0 {
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_APTX_HD;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_APTX_TWSP;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_CELT;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_DEFAULT;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_DOLBY_TRUEHD;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_DSD;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_DTS;
@ -206,9 +212,11 @@ package audio.policy.configuration.V7_0 {
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_HE_AAC_V1;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_HE_AAC_V2;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_IEC61937;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_LC3;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_LDAC;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_LHDC;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_LHDC_LL;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_MAT;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_MAT_1_0;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_MAT_2_0;
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_MAT_2_1;
@ -228,6 +236,13 @@ package audio.policy.configuration.V7_0 {
enum_constant public static final audio.policy.configuration.V7_0.AudioFormat AUDIO_FORMAT_WMA_PRO;
}
public enum AudioGainMode {
method public String getRawName();
enum_constant public static final audio.policy.configuration.V7_0.AudioGainMode AUDIO_GAIN_MODE_CHANNELS;
enum_constant public static final audio.policy.configuration.V7_0.AudioGainMode AUDIO_GAIN_MODE_JOINT;
enum_constant public static final audio.policy.configuration.V7_0.AudioGainMode AUDIO_GAIN_MODE_RAMP;
}
public enum AudioInOutFlag {
method public String getRawName();
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_DIRECT;
@ -235,6 +250,7 @@ package audio.policy.configuration.V7_0 {
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_HW_AV_SYNC;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_HW_HOTWORD;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_MMAP_NOIRQ;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_NONE;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_RAW;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_SYNC;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_INPUT_FLAG_VOIP_TX;
@ -247,6 +263,7 @@ package audio.policy.configuration.V7_0 {
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_IEC958_NONAUDIO;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_INCALL_MUSIC;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_MMAP_NOIRQ;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_NONE;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_NON_BLOCKING;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_PRIMARY;
enum_constant public static final audio.policy.configuration.V7_0.AudioInOutFlag AUDIO_OUTPUT_FLAG_RAW;
@ -291,6 +308,7 @@ package audio.policy.configuration.V7_0 {
enum_constant public static final audio.policy.configuration.V7_0.AudioStreamType AUDIO_STREAM_ALARM;
enum_constant public static final audio.policy.configuration.V7_0.AudioStreamType AUDIO_STREAM_ASSISTANT;
enum_constant public static final audio.policy.configuration.V7_0.AudioStreamType AUDIO_STREAM_BLUETOOTH_SCO;
enum_constant public static final audio.policy.configuration.V7_0.AudioStreamType AUDIO_STREAM_CALL_ASSISTANT;
enum_constant public static final audio.policy.configuration.V7_0.AudioStreamType AUDIO_STREAM_DTMF;
enum_constant public static final audio.policy.configuration.V7_0.AudioStreamType AUDIO_STREAM_ENFORCED_AUDIBLE;
enum_constant public static final audio.policy.configuration.V7_0.AudioStreamType AUDIO_STREAM_MUSIC;
@ -364,13 +382,6 @@ package audio.policy.configuration.V7_0 {
enum_constant public static final audio.policy.configuration.V7_0.EngineSuffix configurable;
}
public enum GainMode {
method public String getRawName();
enum_constant public static final audio.policy.configuration.V7_0.GainMode AUDIO_GAIN_MODE_CHANNELS;
enum_constant public static final audio.policy.configuration.V7_0.GainMode AUDIO_GAIN_MODE_JOINT;
enum_constant public static final audio.policy.configuration.V7_0.GainMode AUDIO_GAIN_MODE_RAMP;
}
public class Gains {
ctor public Gains();
method public java.util.List<audio.policy.configuration.V7_0.Gains.Gain> getGain();
@ -384,7 +395,7 @@ package audio.policy.configuration.V7_0 {
method public int getMaxValueMB();
method public int getMinRampMs();
method public int getMinValueMB();
method public audio.policy.configuration.V7_0.GainMode getMode();
method public java.util.List<audio.policy.configuration.V7_0.AudioGainMode> getMode();
method public String getName();
method public int getStepValueMB();
method public boolean getUseForVolume();
@ -394,7 +405,7 @@ package audio.policy.configuration.V7_0 {
method public void setMaxValueMB(int);
method public void setMinRampMs(int);
method public void setMinValueMB(int);
method public void setMode(audio.policy.configuration.V7_0.GainMode);
method public void setMode(java.util.List<audio.policy.configuration.V7_0.AudioGainMode>);
method public void setName(String);
method public void setStepValueMB(int);
method public void setUseForVolume(boolean);

View file

@ -159,9 +159,13 @@
<xs:annotation>
<xs:documentation xml:lang="en">
The flags indicate suggested stream attributes supported by the profile.
Use of AUDIO_{INPUT|OUTPUT}_FLAG_NONE in the XML file isn't required
as empty flag lists are allowed. However these constants are useful for
representing an empty enum value.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="AUDIO_OUTPUT_FLAG_NONE" />
<xs:enumeration value="AUDIO_OUTPUT_FLAG_DIRECT" />
<xs:enumeration value="AUDIO_OUTPUT_FLAG_PRIMARY" />
<xs:enumeration value="AUDIO_OUTPUT_FLAG_FAST" />
@ -177,6 +181,7 @@
<xs:enumeration value="AUDIO_OUTPUT_FLAG_MMAP_NOIRQ" />
<xs:enumeration value="AUDIO_OUTPUT_FLAG_VOIP_RX" />
<xs:enumeration value="AUDIO_OUTPUT_FLAG_INCALL_MUSIC" />
<xs:enumeration value="AUDIO_INPUT_FLAG_NONE" />
<xs:enumeration value="AUDIO_INPUT_FLAG_FAST" />
<xs:enumeration value="AUDIO_INPUT_FLAG_HW_HOTWORD" />
<xs:enumeration value="AUDIO_INPUT_FLAG_RAW" />
@ -251,8 +256,8 @@
<xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_AUX_DIGITAL"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_HDMI"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_AUX_DIGITAL"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_USB_ACCESSORY"/>
@ -271,6 +276,8 @@
<xs:enumeration value="AUDIO_DEVICE_OUT_USB_HEADSET"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_HEARING_AID"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_ECHO_CANCELLER"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_BLE_HEADSET"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_BLE_SPEAKER"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_DEFAULT"/>
<xs:enumeration value="AUDIO_DEVICE_OUT_STUB"/>
@ -279,8 +286,8 @@
<xs:enumeration value="AUDIO_DEVICE_IN_BUILTIN_MIC"/>
<xs:enumeration value="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET"/>
<xs:enumeration value="AUDIO_DEVICE_IN_WIRED_HEADSET"/>
<xs:enumeration value="AUDIO_DEVICE_IN_AUX_DIGITAL"/>
<xs:enumeration value="AUDIO_DEVICE_IN_HDMI"/>
<xs:enumeration value="AUDIO_DEVICE_IN_AUX_DIGITAL"/>
<xs:enumeration value="AUDIO_DEVICE_IN_VOICE_CALL"/>
<xs:enumeration value="AUDIO_DEVICE_IN_TELEPHONY_RX"/>
<xs:enumeration value="AUDIO_DEVICE_IN_BACK_MIC"/>
@ -302,6 +309,7 @@
<xs:enumeration value="AUDIO_DEVICE_IN_BLUETOOTH_BLE"/>
<xs:enumeration value="AUDIO_DEVICE_IN_HDMI_ARC"/>
<xs:enumeration value="AUDIO_DEVICE_IN_ECHO_REFERENCE"/>
<xs:enumeration value="AUDIO_DEVICE_IN_BLE_HEADSET"/>
<xs:enumeration value="AUDIO_DEVICE_IN_DEFAULT"/>
<xs:enumeration value="AUDIO_DEVICE_IN_STUB"/>
</xs:restriction>
@ -321,7 +329,6 @@
</xs:simpleType>
<xs:simpleType name="audioFormat">
<xs:restriction base="xs:string">
<xs:enumeration value="AUDIO_FORMAT_DEFAULT" />
<xs:enumeration value="AUDIO_FORMAT_PCM_16_BIT" />
<xs:enumeration value="AUDIO_FORMAT_PCM_8_BIT"/>
<xs:enumeration value="AUDIO_FORMAT_PCM_32_BIT"/>
@ -342,22 +349,14 @@
<xs:enumeration value="AUDIO_FORMAT_AAC_LD"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_HE_V2"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ELD"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_MAIN"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LC"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_SSR"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LTP"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_HE_V1"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_SCALABLE"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_ERLC"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LD"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_HE_V2"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_ELD"/>
<xs:enumeration value="AUDIO_FORMAT_VORBIS"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_XHE"/>
<xs:enumeration value="AUDIO_FORMAT_HE_AAC_V1"/>
<xs:enumeration value="AUDIO_FORMAT_HE_AAC_V2"/>
<xs:enumeration value="AUDIO_FORMAT_VORBIS"/>
<xs:enumeration value="AUDIO_FORMAT_OPUS"/>
<xs:enumeration value="AUDIO_FORMAT_AC3"/>
<xs:enumeration value="AUDIO_FORMAT_E_AC3"/>
<xs:enumeration value="AUDIO_FORMAT_E_AC3_JOC"/>
<xs:enumeration value="AUDIO_FORMAT_DTS"/>
<xs:enumeration value="AUDIO_FORMAT_DTS_HD"/>
<xs:enumeration value="AUDIO_FORMAT_IEC61937"/>
@ -377,17 +376,26 @@
<xs:enumeration value="AUDIO_FORMAT_ALAC"/>
<xs:enumeration value="AUDIO_FORMAT_APE"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_MAIN"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LC"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_SSR"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LTP"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_HE_V1"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_SCALABLE"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_ERLC"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_LD"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_HE_V2"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_ELD"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_XHE"/>
<xs:enumeration value="AUDIO_FORMAT_SBC"/>
<xs:enumeration value="AUDIO_FORMAT_APTX"/>
<xs:enumeration value="AUDIO_FORMAT_APTX_HD"/>
<xs:enumeration value="AUDIO_FORMAT_AC4"/>
<xs:enumeration value="AUDIO_FORMAT_LDAC"/>
<xs:enumeration value="AUDIO_FORMAT_E_AC3_JOC"/>
<xs:enumeration value="AUDIO_FORMAT_MAT"/>
<xs:enumeration value="AUDIO_FORMAT_MAT_1_0"/>
<xs:enumeration value="AUDIO_FORMAT_MAT_2_0"/>
<xs:enumeration value="AUDIO_FORMAT_MAT_2_1"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_XHE"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_XHE"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_LATM"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_LATM_LC"/>
<xs:enumeration value="AUDIO_FORMAT_AAC_LATM_HE_V1"/>
@ -397,6 +405,7 @@
<xs:enumeration value="AUDIO_FORMAT_LHDC"/>
<xs:enumeration value="AUDIO_FORMAT_LHDC_LL"/>
<xs:enumeration value="AUDIO_FORMAT_APTX_TWSP"/>
<xs:enumeration value="AUDIO_FORMAT_LC3"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="extendableAudioFormat">
@ -465,9 +474,13 @@
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="AUDIO_CHANNEL_NONE"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_MONO"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_STEREO"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_2POINT1"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_TRI"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_TRI_BACK"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_3POINT1"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_2POINT0POINT2"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_2POINT1POINT2"/>
<xs:enumeration value="AUDIO_CHANNEL_OUT_3POINT0POINT2"/>
@ -538,19 +551,27 @@
<xs:attribute name="samplingRates" type="samplingRates" use="optional"/>
<xs:attribute name="channelMasks" type="channelMasks" use="optional"/>
</xs:complexType>
<xs:simpleType name="gainMode">
<xs:simpleType name="audioGainMode">
<xs:restriction base="xs:string">
<xs:enumeration value="AUDIO_GAIN_MODE_JOINT"/>
<xs:enumeration value="AUDIO_GAIN_MODE_CHANNELS"/>
<xs:enumeration value="AUDIO_GAIN_MODE_RAMP"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="audioGainModeMaskUnrestricted">
<xs:list itemType="audioGainMode" />
</xs:simpleType>
<xs:simpleType name='audioGainModeMask'>
<xs:restriction base='audioGainModeMaskUnrestricted'>
<xs:minLength value='1' />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="gains">
<xs:sequence>
<xs:element name="gain" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type="xs:token" use="required"/>
<xs:attribute name="mode" type="gainMode" use="required"/>
<xs:attribute name="mode" type="audioGainModeMask" use="required"/>
<xs:attribute name="channel_mask" type="audioChannelMask" use="optional"/>
<xs:attribute name="minValueMB" type="xs:int" use="optional"/>
<xs:attribute name="maxValueMB" type="xs:int" use="optional"/>
@ -670,6 +691,7 @@
<xs:enumeration value="AUDIO_STREAM_ASSISTANT"/>
<xs:enumeration value="AUDIO_STREAM_REROUTING"/>
<xs:enumeration value="AUDIO_STREAM_PATCH"/>
<xs:enumeration value="AUDIO_STREAM_CALL_ASSISTANT"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="audioSource">

View file

@ -25,6 +25,8 @@ namespace audio::policy::configuration::V7_0 {
static inline size_t getChannelCount(AudioChannelMask mask) {
switch (mask) {
case AudioChannelMask::AUDIO_CHANNEL_NONE:
return 0;
case AudioChannelMask::AUDIO_CHANNEL_OUT_MONO:
case AudioChannelMask::AUDIO_CHANNEL_IN_MONO:
case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_1:
@ -42,9 +44,12 @@ static inline size_t getChannelCount(AudioChannelMask mask) {
case AudioChannelMask::AUDIO_CHANNEL_OUT_2POINT1:
case AudioChannelMask::AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A:
case AudioChannelMask::AUDIO_CHANNEL_OUT_MONO_HAPTIC_AB:
case AudioChannelMask::AUDIO_CHANNEL_OUT_TRI:
case AudioChannelMask::AUDIO_CHANNEL_OUT_TRI_BACK:
case AudioChannelMask::AUDIO_CHANNEL_INDEX_MASK_3:
return 3;
case AudioChannelMask::AUDIO_CHANNEL_OUT_2POINT0POINT2:
case AudioChannelMask::AUDIO_CHANNEL_OUT_3POINT1:
case AudioChannelMask::AUDIO_CHANNEL_OUT_QUAD:
case AudioChannelMask::AUDIO_CHANNEL_OUT_QUAD_BACK:
case AudioChannelMask::AUDIO_CHANNEL_OUT_QUAD_SIDE:
@ -158,6 +163,8 @@ static inline bool isOutputDevice(AudioDevice device) {
case AudioDevice::AUDIO_DEVICE_OUT_USB_HEADSET:
case AudioDevice::AUDIO_DEVICE_OUT_HEARING_AID:
case AudioDevice::AUDIO_DEVICE_OUT_ECHO_CANCELLER:
case AudioDevice::AUDIO_DEVICE_OUT_BLE_HEADSET:
case AudioDevice::AUDIO_DEVICE_OUT_BLE_SPEAKER:
case AudioDevice::AUDIO_DEVICE_OUT_DEFAULT:
case AudioDevice::AUDIO_DEVICE_OUT_STUB:
return true;
@ -189,6 +196,7 @@ static inline bool isOutputDevice(AudioDevice device) {
case AudioDevice::AUDIO_DEVICE_IN_BLUETOOTH_BLE:
case AudioDevice::AUDIO_DEVICE_IN_HDMI_ARC:
case AudioDevice::AUDIO_DEVICE_IN_ECHO_REFERENCE:
case AudioDevice::AUDIO_DEVICE_IN_BLE_HEADSET:
case AudioDevice::AUDIO_DEVICE_IN_DEFAULT:
case AudioDevice::AUDIO_DEVICE_IN_STUB:
return false;

View file

@ -106,6 +106,8 @@ typedef string AudioFormat;
/**
* Audio channel mask indicates presence of particular channels.
* Note that every value is already a mask comprised of individual
* channels.
* See 'audioChannelMask' in audio_policy_configuration.xsd for the
* list of allowed values.
*/
@ -127,13 +129,8 @@ struct AudioProfile {
AudioFormat format;
/** List of the sample rates (in Hz) supported by the profile. */
vec<uint32_t> sampleRates;
/**
* List of channel masks supported by the profile. Every subvector might be
* comprised of several individual channel mask entries for non-traditional
* channel masks, e.g. a combination "OUT_FRONT_LEFT,OUT_FRONT_CENTER" which
* doesn't have a corresponding predefined channel mask.
*/
vec<vec<AudioChannelMask>> channelMasks;
/** List of channel masks supported by the profile. */
vec<AudioChannelMask> channelMasks;
};
/**
@ -299,21 +296,18 @@ struct SinkMetadata {
/**
* Type of gain control exposed by an audio port.
* See 'audioGainMode' in audio_policy_configuration.xsd for the
* list of allowed values.
*/
@export(name="", value_prefix="AUDIO_GAIN_MODE_")
enum AudioGainMode : uint32_t {
JOINT = 0x1, // supports joint channel gain control
CHANNELS = 0x2, // supports separate channel gain control
RAMP = 0x4 // supports gain ramps
};
typedef string AudioGainMode;
/**
* An audio_gain struct is a representation of a gain stage.
* A gain stage is always attached to an audio port.
*/
struct AudioGain {
bitfield<AudioGainMode> mode;
vec<AudioChannelMask> channelMask; // channels which gain an be controlled
vec<AudioGainMode> mode; // modes of operation
AudioChannelMask channelMask; // channels which gain can be controlled
int32_t minValue; // minimum gain value in millibels
int32_t maxValue; // maximum gain value in millibels
int32_t defaultValue; // default gain value in millibels
@ -328,8 +322,8 @@ struct AudioGain {
*/
struct AudioGainConfig {
int32_t index; // index of the corresponding AudioGain in AudioPort.gains
AudioGainMode mode;
vec<AudioChannelMask> channelMask; // channels which gain value follows
vec<AudioGainMode> mode; // modes of operation
AudioChannelMask channelMask; // channels which gain value follows
/**
* Gain values in millibels for each channel ordered from LSb to MSb in
* channel mask. The number of values is 1 in joint mode or

View file

@ -1150,7 +1150,7 @@ static void testSetAudioProperties(IStream* stream) {
for (const auto& channelMask : profile.channelMasks) {
AudioConfigBase config{.format = profile.format,
.sampleRateHz = sampleRate,
.channelMask = channelMask};
.channelMask = {{channelMask}}};
auto ret = stream->setAudioProperties(config);
EXPECT_TRUE(ret.isOk());
EXPECT_EQ(Result::OK, ret) << config.format << "; " << config.sampleRateHz << "; "