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

Commit 788d91b1 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Add AudioGain* to android.media.audio.common

a.m.a.c adds AudioGain* types which are similar to
the ones from Audio HIDL HAL V7.

Bug: 198812639
Test: m
Change-Id: I6471d3a85fea81e45357f5d7e4363313bd36f7c7
parent 651ff0aa
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -65,6 +65,9 @@ aidl_interface {
        "aidl/android/media/audio/common/AudioEncapsulationType.aidl",
        "aidl/android/media/audio/common/AudioFormatDescription.aidl",
        "aidl/android/media/audio/common/AudioFormatType.aidl",
        "aidl/android/media/audio/common/AudioGain.aidl",
        "aidl/android/media/audio/common/AudioGainConfig.aidl",
        "aidl/android/media/audio/common/AudioGainMode.aidl",
        "aidl/android/media/audio/common/AudioMMapPolicy.aidl",
        "aidl/android/media/audio/common/AudioMMapPolicyInfo.aidl",
        "aidl/android/media/audio/common/AudioMMapPolicyType.aidl",
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.media.audio.common;

import android.media.audio.common.AudioChannelLayout;

/**
 * This structure represents a gain stage. A gain stage is always attached
 * to an AudioPort.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioGain {
    /** Bitmask, indexed by AudioGainMode. */
    int mode;
    /** For AudioGainMode.CHANNELS, specifies controlled channels. */
    AudioChannelLayout channelMask;
    /** Minimum gain value in millibels. */
    int minValue;
    /** Maximum gain value in millibels. */
    int maxValue;
    /** Default gain value in millibels. */
    int defaultValue;
    /** Gain step in millibels. */
    int stepValue;
    /** Minimum ramp duration in milliseconds. */
    int minRampMs;
    /** Maximum ramp duration in milliseconds. */
    int maxRampMs;
}
+44 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.media.audio.common;

import android.media.audio.common.AudioChannelLayout;

/**
 * The gain configuration structure is used to get or set the gain values of a
 * given AudioPort.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioGainConfig {
    /** Index of the corresponding AudioGain in AudioPort.gains. */
    int index;
    /** Bitmask, indexed by AudioGainMode. */
    int mode;
    /** For AudioGainMode.CHANNELS, specifies controlled channels. */
    AudioChannelLayout channelMask;
    /**
     * Gain values in millibels. For each channel ordered from LSb to MSb in
     * channel mask. The number of values is 1 in joint mode, otherwise equals
     * the number of bits implied by channelMask.
     */
    int[] values;
    /** Ramp duration in milliseconds. */
    int rampDurationMs;
}
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.media.audio.common;

/**
 * Type of gain control exposed by an audio port. The values are
 * indexes of bits in a bitmask.
 *
 * {@hide}
 */
@VintfStability
@Backing(type="byte")
enum AudioGainMode {
    /** Gain is the same for all channels. */
    JOINT = 0,
    /** The gain is set individually for each channel. */
    CHANNELS = 1,
    /** Ramping is applied. */
    RAMP = 2,
}
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.media.audio.common;
/* @hide */
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable AudioGain {
  int mode;
  android.media.audio.common.AudioChannelLayout channelMask;
  int minValue;
  int maxValue;
  int defaultValue;
  int stepValue;
  int minRampMs;
  int maxRampMs;
}
Loading