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

Commit eb9f8c0c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "fix-b-198812639-audio-profile"

* changes:
  Add AudioGain* to android.media.audio.common
  Add AudioProfile to android.media.audio.common
  Run aidl-format on media/aidl/android/media/audio/common
parents 70687c4d 788d91b1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -65,11 +65,15 @@ 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",
        "aidl/android/media/audio/common/AudioMode.aidl",
        "aidl/android/media/audio/common/AudioOffloadInfo.aidl",
        "aidl/android/media/audio/common/AudioProfile.aidl",
        "aidl/android/media/audio/common/AudioSource.aidl",
        "aidl/android/media/audio/common/AudioStreamType.aidl",
        "aidl/android/media/audio/common/AudioUsage.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,
}
+45 −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;
import android.media.audio.common.AudioEncapsulationType;
import android.media.audio.common.AudioFormatDescription;

/**
 * AudioProfile describes a set of configurations supported for a certain
 * audio format. A profile can be either "static" which means all the
 * configurations are predefined, or "dynamic" which means configurations
 * are queried at run time. Dynamic profiles generally used with detachable
 * devices, e.g. HDMI or USB devices.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioProfile {
    /** Name is commonly used with static profiles. Can be empty. */
    @utf8InCpp String name;
    /** If the format is set to 'DEFAULT', this indicates a dynamic profile. */
    AudioFormatDescription format;
    /** Can be empty if channel masks are "dynamic". */
    AudioChannelLayout[] channelMasks;
    /** Can be empty if sample rates are "dynamic". */
    int[] sampleRates;
    /** For encoded audio formats, an encapsulation can be specified. */
    AudioEncapsulationType encapsulationType = AudioEncapsulationType.NONE;
}
Loading