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

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

Merge "audio: Add AudioOffloadMetadata and a method to update it" into udc-dev

parents e7e734ab 9940a559
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -36,12 +36,13 @@ aidl_interface {
        "android.hardware.audio_defaults",
    ],
    srcs: [
        "android/hardware/audio/common/AudioOffloadMetadata.aidl",
        "android/hardware/audio/common/PlaybackTrackMetadata.aidl",
        "android/hardware/audio/common/RecordTrackMetadata.aidl",
        "android/hardware/audio/common/SinkMetadata.aidl",
        "android/hardware/audio/common/SourceMetadata.aidl",
    ],
    frozen: true,
    frozen: false,
    imports: [
        "android.media.audio.common.types-V2",
    ],
@@ -77,7 +78,7 @@ aidl_interface {
}

// Note: This should always be one version ahead of the last frozen version
latest_android_hardware_audio_common = "android.hardware.audio.common-V1"
latest_android_hardware_audio_common = "android.hardware.audio.common-V2"

// Modules that depend on android.hardware.audio.common directly can include
// the following cc_defaults to avoid explicitly managing dependency versions
@@ -129,7 +130,7 @@ aidl_interface {
    imports: [
        "android.hardware.common-V2",
        "android.hardware.common.fmq-V1",
        "android.hardware.audio.common-V1",
        "android.hardware.audio.common-V2",
        "android.hardware.audio.core.sounddose-V1",
        "android.hardware.audio.effect-V1",
        "android.media.audio.common.types-V2",
@@ -253,7 +254,7 @@ aidl_interface {
    imports: [
        "android.hardware.common-V2",
        "android.hardware.common.fmq-V1",
        "android.hardware.audio.common-V1",
        "android.hardware.audio.common-V2",
        "android.media.audio.common.types-V2",
    ],
    backend: {
+42 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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.common;
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable AudioOffloadMetadata {
  int sampleRate;
  android.media.audio.common.AudioChannelLayout channelMask;
  int averageBitRatePerSecond;
  int delayFrames;
  int paddingFrames;
}
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ package android.hardware.audio.core;
interface IStreamOut {
  android.hardware.audio.core.IStreamCommon getStreamCommon();
  void updateMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata);
  void updateOffloadMetadata(in android.hardware.audio.common.AudioOffloadMetadata offloadMetadata);
  float[] getHwVolume();
  void setHwVolume(in float[] channelVolumes);
  float getAudioDescriptionMixLevel();
+44 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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.common;

import android.media.audio.common.AudioChannelLayout;

/**
 * Dynamic metadata for offloaded compressed audio.
 * For static metadata, see android.media.audio.common.AudioOffloadInfo.
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioOffloadMetadata {
    int sampleRate;
    AudioChannelLayout channelMask;
    /** Average bit rate in bits per second. */
    int averageBitRatePerSecond;
    /**
     * Number of frames to be ignored at the beginning of the stream.
     * The value must be non-negative. A value of 0 indicates no delay
     * has to be applied.
     */
    int delayFrames;
    /**
     * Number of frames to be ignored at the end of the stream.
     * The value must be non-negative. A value of 0 indicates no padding
     * has to be applied.
     */
    int paddingFrames;
}
+13 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.hardware.audio.core;

import android.hardware.audio.common.AudioOffloadMetadata;
import android.hardware.audio.common.SourceMetadata;
import android.hardware.audio.core.IStreamCommon;
import android.media.audio.common.AudioDualMonoMode;
@@ -48,6 +49,18 @@ interface IStreamOut {
     */
    void updateMetadata(in SourceMetadata sourceMetadata);

    /**
     * Update offload metadata for a compressed stream.
     *
     * Updates the offload metadata initially provided at the stream creation.
     *
     * @param offloadMetadata Updated offload metadata.
     * @throws EX_ILLEGAL_STATE If the stream is closed.
     * @throws EX_ILLEGAL_ARGUMENT If the metadata contains invalid values.
     * @throws EX_UNSUPPORTED_OPERATION If the stream is not for compressed offload.
     */
    void updateOffloadMetadata(in AudioOffloadMetadata offloadMetadata);

    const int HW_VOLUME_MIN = 0;
    const int HW_VOLUME_MAX = 1;
    /**
Loading