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

Commit af0e3bf5 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Add AudioPort* to android.media.audio.common

a.m.a.c adds a version of AudioPort and AudioPortConfig structs
which are similar to Audio HIDL HAL V7, and the types they
depend on.

Bug: 198812639
Test: m
Change-Id: I40f15fd8e9adbcea7268f2645d2dfc2c4d704e9b
parent 708fc4df
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -73,11 +73,19 @@ aidl_interface {
        "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/AudioPort.aidl",
        "aidl/android/media/audio/common/AudioPortConfig.aidl",
        "aidl/android/media/audio/common/AudioPortExt.aidl",
        "aidl/android/media/audio/common/AudioPortMixExt.aidl",
        "aidl/android/media/audio/common/AudioPortMixExtUseCase.aidl",
        "aidl/android/media/audio/common/AudioProfile.aidl",
        "aidl/android/media/audio/common/AudioSource.aidl",
        "aidl/android/media/audio/common/AudioStandard.aidl",
        "aidl/android/media/audio/common/AudioStreamType.aidl",
        "aidl/android/media/audio/common/AudioUsage.aidl",
        "aidl/android/media/audio/common/AudioUuid.aidl",
        "aidl/android/media/audio/common/ExtraAudioDescriptor.aidl",
        "aidl/android/media/audio/common/Int.aidl",
        "aidl/android/media/audio/common/PcmType.aidl",
    ],
    stability: "vintf",
+59 −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.AudioGain;
import android.media.audio.common.AudioPortConfig;
import android.media.audio.common.AudioPortExt;
import android.media.audio.common.AudioProfile;
import android.media.audio.common.ExtraAudioDescriptor;

/**
 * Audio port structure describes the capabilities of an audio port
 * as well as its current configuration.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioPort {
    /**
     * Unique identifier of the port within this HAL service.
     */
    int id;
    /**
     * Human-readable name describing the function of the port.
     * E.g. "telephony_tx" or "fm_tuner".
     */
    @utf8InCpp String name;
    /**
     * AudioProfiles supported by this port: format, rates, channels.
     */
    AudioProfile[] profiles;
    /**
     * ExtraAudioDescriptors supported by this port. Used for formats not
     * recognized by the platform. The audio capability is described by a
     * hardware descriptor.
     */
    ExtraAudioDescriptor[] extraAudioDescriptors;
    /** Gain controllers. */
    AudioGain[] gains;
    /** Current audio port configuration. */
    AudioPortConfig activeConfig;
    /** Extra parameters depending on the port role. */
    AudioPortExt ext;
}
+49 −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.AudioFormatDescription;
import android.media.audio.common.AudioGainConfig;
import android.media.audio.common.AudioPortExt;
import android.media.audio.common.Int;

/**
 * Audio port configuration structure specifies a particular configuration
 * of an audio port.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioPortConfig {
    /**
     * Port unique ID. This field is set to a non-zero value when it is needed
     * to select a previously reported port and apply new configuration to it.
     */
    int id;
    /** Sample rate in Hz. Can be left unspecified. */
    @nullable Int sampleRate;
    /** Channel mask. Can be left unspecified. */
    @nullable AudioChannelLayout channelMask;
    /** Format. Can be left unspecified. */
    @nullable AudioFormatDescription format;
    /** Gain to apply. Can be left unspecified. */
    @nullable AudioGainConfig gain;
    /** Extra parameters depending on the port role. */
    AudioPortExt ext;
}
+39 −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.AudioDevice;
import android.media.audio.common.AudioPortMixExt;

/**
 * Extra parameters of an AudioPort/AudioPortConfig that depend on
 * the actual port role.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
union AudioPortExt {
    /** Represents an empty union. Value is ignored. */
    boolean unspecified;
    /** Audio device specification. */
    AudioDevice device;
    /** Mix specific info. */
    AudioPortMixExt mix;
    /** Audio session identifier. */
    int session;
}
+33 −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.AudioPortMixExtUseCase;

/**
 * Extra parameters which are specified when the audio port is in the mix role.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioPortMixExt {
    /** I/O handle of the input/output stream. */
    int handle;
    /** Parameters specific to the mix use case. */
    AudioPortMixExtUseCase usecase;
}
Loading