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

Commit bb420040 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Move media vintf aidl_interface to system/hardware/interfaces" am: fa281513 am: d52a1442

parents fab82f89 d52a1442
Loading
Loading
Loading
Loading
+0 −207
Original line number Diff line number Diff line
@@ -40,210 +40,3 @@ aidl_interface {
        "media_permission-aidl",
    ],
}

aidl_interface {
    name: "android.media.audio.common.types",
    vendor_available: true,
    host_supported: true,
    double_loadable: true,
    flags: [
        "-Werror",
        "-Weverything",
    ],
    local_include_dir: "aidl",
    srcs: [
        "aidl/android/media/audio/common/AudioAttributes.aidl",
        "aidl/android/media/audio/common/AudioChannelLayout.aidl",
        "aidl/android/media/audio/common/AudioConfig.aidl",
        "aidl/android/media/audio/common/AudioConfigBase.aidl",
        "aidl/android/media/audio/common/AudioContentType.aidl",
        "aidl/android/media/audio/common/AudioDevice.aidl",
        "aidl/android/media/audio/common/AudioDeviceAddress.aidl",
        "aidl/android/media/audio/common/AudioDeviceDescription.aidl",
        "aidl/android/media/audio/common/AudioDeviceType.aidl",
        "aidl/android/media/audio/common/AudioEncapsulationMetadataType.aidl",
        "aidl/android/media/audio/common/AudioEncapsulationMode.aidl",
        "aidl/android/media/audio/common/AudioEncapsulationType.aidl",
        "aidl/android/media/audio/common/AudioFlag.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/AudioInputFlags.aidl",
        "aidl/android/media/audio/common/AudioIoFlags.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/AudioOutputFlags.aidl",
        "aidl/android/media/audio/common/AudioPort.aidl",
        "aidl/android/media/audio/common/AudioPortConfig.aidl",
        "aidl/android/media/audio/common/AudioPortDeviceExt.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/Boolean.aidl",
        "aidl/android/media/audio/common/Byte.aidl",
        "aidl/android/media/audio/common/ExtraAudioDescriptor.aidl",
        "aidl/android/media/audio/common/Float.aidl",
        "aidl/android/media/audio/common/Double.aidl",
        "aidl/android/media/audio/common/Int.aidl",
        "aidl/android/media/audio/common/Long.aidl",
        "aidl/android/media/audio/common/PcmType.aidl",
    ],
    stability: "vintf",
    backend: {
        cpp: {
            min_sdk_version: "29",
            apex_available: [
                "//apex_available:platform",
                "com.android.media",
            ],
        },
        java: {
            sdk_version: "module_current",
            min_sdk_version: "29",
            apex_available: [
                "//apex_available:platform",
                "com.android.car.framework",
            ],
        },
        ndk: {
            min_sdk_version: "29",
            apex_available: [
                "//apex_available:platform",
                "com.android.btservices",
            ],
        },
    },
    versions_with_info: [
        {
            version: "1",
            imports: [],
        },
        // IMPORTANT: Update latest_android_media_audio_common_types every time
        // you add the latest frozen version to versions_with_info
    ],

}

// Note: This should always be one version ahead of the last frozen version
latest_android_media_audio_common_types = "android.media.audio.common.types-V2"

// Modules that depend on android.media.audio.common.types directly can include
// the following cc_defaults to avoid explicitly managing dependency versions
// across many scattered files.
cc_defaults {
    name: "latest_android_media_audio_common_types_cpp_shared",
    shared_libs: [
        latest_android_media_audio_common_types + "-cpp",
    ],
}

cc_defaults {
    name: "latest_android_media_audio_common_types_cpp_export_shared",
    defaults: [
        "latest_android_media_audio_common_types_cpp_shared",
    ],
    export_shared_lib_headers: [
        latest_android_media_audio_common_types + "-cpp",
    ],
}

cc_defaults {
    name: "latest_android_media_audio_common_types_cpp_static",
    static_libs: [
        latest_android_media_audio_common_types + "-cpp",
    ],
}

cc_defaults {
    name: "latest_android_media_audio_common_types_cpp_export_static",
    defaults: [
        "latest_android_media_audio_common_types_cpp_static",
    ],
    export_static_lib_headers: [
        latest_android_media_audio_common_types + "-cpp",
    ],
}

cc_defaults {
    name: "latest_android_media_audio_common_types_ndk_shared",
    shared_libs: [
        latest_android_media_audio_common_types + "-ndk",
    ],
}

cc_defaults {
    name: "latest_android_media_audio_common_types_ndk_static",
    static_libs: [
        latest_android_media_audio_common_types + "-ndk",
    ],
}

cc_defaults {
    name: "latest_android_media_audio_common_types_cpp_target_shared",
    target: {
        android: {
            shared_libs: [
                latest_android_media_audio_common_types + "-cpp",
            ],
        },
    },
}

aidl_interface {
    name: "android.media.soundtrigger.types",
    vendor_available: true,
    host_supported: true,
    flags: [
        "-Werror",
        "-Weverything",
    ],
    local_include_dir: "aidl",
    srcs: [
        "aidl/android/media/soundtrigger/AudioCapabilities.aidl",
        "aidl/android/media/soundtrigger/ConfidenceLevel.aidl",
        "aidl/android/media/soundtrigger/ModelParameter.aidl",
        "aidl/android/media/soundtrigger/ModelParameterRange.aidl",
        "aidl/android/media/soundtrigger/Phrase.aidl",
        "aidl/android/media/soundtrigger/PhraseRecognitionEvent.aidl",
        "aidl/android/media/soundtrigger/PhraseRecognitionExtra.aidl",
        "aidl/android/media/soundtrigger/PhraseSoundModel.aidl",
        "aidl/android/media/soundtrigger/Properties.aidl",
        "aidl/android/media/soundtrigger/RecognitionConfig.aidl",
        "aidl/android/media/soundtrigger/RecognitionEvent.aidl",
        "aidl/android/media/soundtrigger/RecognitionMode.aidl",
        "aidl/android/media/soundtrigger/RecognitionStatus.aidl",
        "aidl/android/media/soundtrigger/SoundModel.aidl",
        "aidl/android/media/soundtrigger/SoundModelType.aidl",
        "aidl/android/media/soundtrigger/Status.aidl",
    ],
    stability: "vintf",
    backend: {
        cpp: {
            enabled: true,
        },
        java: {
            sdk_version: "module_current",
        },
    },
    imports: [
        "android.media.audio.common.types-V2",
    ],
    versions_with_info: [
        {
            version: "1",
            imports: ["android.media.audio.common.types-V2"],
        },
    ],

}
+0 −59
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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.AudioContentType;
import android.media.audio.common.AudioFlag;
import android.media.audio.common.AudioSource;
import android.media.audio.common.AudioUsage;

/**
 * AudioAttributes give information about an audio stream that is more
 * descriptive than stream type alone.
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioAttributes {
    /**
     * Classifies the content of the audio signal using categories such as
     * speech or music
     */
    AudioContentType contentType = AudioContentType.UNKNOWN;
    /**
     * Classifies the intended use of the audio signal using categories such as
     * alarm or ringtone
     */
    AudioUsage usage = AudioUsage.UNKNOWN;
    /**
     * Classifies the audio source using categories such as voice uplink or
     * remote submix
     */
    AudioSource source = AudioSource.DEFAULT;
    /**
     * Bitmask describing how playback is to be affected.
     */
    int flags = AudioFlag.NONE;
    /**
     * Tag is an additional use case qualifier complementing AudioUsage and
     * AudioContentType. Tags are set by vendor-specific applications and must
     * be prefixed by "VX_". Vendors must namespace their tag names using the
     * name of their company to avoid conflicts. The namespace must use at least
     * three characters, and must go directly after the "VX_" prefix.
     * For example: "VX_MYCOMPANY_VR".
     */
    @utf8InCpp String[] tags;
}
 No newline at end of file
+0 −243
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;

/**
 * This structure describes a layout of a multi-channel stream.
 * There are two possible ways for representing a layout:
 *
 * - indexed mask, which tells what channels of an audio frame are used, but
 *   doesn't label them in any way, thus a correspondence between channels in
 *   the same position of frames originating from different streams must be
 *   established externally;
 *
 * - layout mask, which gives a label to each channel, thus allowing to
 *   match channels between streams of different layouts.
 *
 * Both representations are agnostic of the direction of audio transfer. Also,
 * by construction, the number of bits set to '1' in the mask indicates the
 * number of channels in the audio frame. A channel mask per se only defines the
 * presence or absence of a channel, not the order. Please see 'INTERLEAVE_*'
 * constants for the platform convention of order.
 *
 * The structure also defines a "voice mask" which is a special case of
 * layout mask, intended for processing voice audio from telecommunication
 * use cases.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
union AudioChannelLayout {
    /**
     * This variant is used for representing the "null" ("none") value
     * for the channel layout. The field value must always be '0'.
     */
    int none = 0;
    /**
     * This variant is used for indicating an "invalid" layout for use by the
     * framework only. HAL implementations must not accept or emit
     * AudioChannelLayout values for this variant. The field value must always
     * be '0'.
     */
    int invalid = 0;
    /**
     * This variant is used for representing indexed masks. The mask indicates
     * what channels are used. For example, the mask that specifies to use only
     * channels 1 and 3 when interacting with a multi-channel device is defined
     * as a combination of the 1st and the 3rd bits and thus is equal to 5. See
     * also the 'INDEX_MASK_*' constants. The 'indexMask' field must have at
     * least one bit set.
     */
    int indexMask;
    /**
     * This variant is used for representing layout masks.
     * It is recommended to use one of 'LAYOUT_*' values. The 'layoutMask' field
     * must have at least one bit set.
     */
    int layoutMask;
    /**
     * This variant is used for processing of voice audio input and output.
     * It is recommended to use one of 'VOICE_*' values. The 'voiceMask' field
     * must have at least one bit set.
     */
    int voiceMask;

    /**
     * 'INDEX_MASK_*' constants define how many channels are used.
     * The mask constants below are 'canonical' masks. Each 'INDEX_MASK_N'
     * constant declares that all N channels are used and arranges
     * them starting from the LSB.
     */
    const int INDEX_MASK_1 = (1 << 1) - 1;
    const int INDEX_MASK_2 = (1 << 2) - 1;
    const int INDEX_MASK_3 = (1 << 3) - 1;
    const int INDEX_MASK_4 = (1 << 4) - 1;
    const int INDEX_MASK_5 = (1 << 5) - 1;
    const int INDEX_MASK_6 = (1 << 6) - 1;
    const int INDEX_MASK_7 = (1 << 7) - 1;
    const int INDEX_MASK_8 = (1 << 8) - 1;
    const int INDEX_MASK_9 = (1 << 9) - 1;
    const int INDEX_MASK_10 = (1 << 10) - 1;
    const int INDEX_MASK_11 = (1 << 11) - 1;
    const int INDEX_MASK_12 = (1 << 12) - 1;
    const int INDEX_MASK_13 = (1 << 13) - 1;
    const int INDEX_MASK_14 = (1 << 14) - 1;
    const int INDEX_MASK_15 = (1 << 15) - 1;
    const int INDEX_MASK_16 = (1 << 16) - 1;
    const int INDEX_MASK_17 = (1 << 17) - 1;
    const int INDEX_MASK_18 = (1 << 18) - 1;
    const int INDEX_MASK_19 = (1 << 19) - 1;
    const int INDEX_MASK_20 = (1 << 20) - 1;
    const int INDEX_MASK_21 = (1 << 21) - 1;
    const int INDEX_MASK_22 = (1 << 22) - 1;
    const int INDEX_MASK_23 = (1 << 23) - 1;
    const int INDEX_MASK_24 = (1 << 24) - 1;

    /**
     * 'LAYOUT_*' constants define channel layouts recognized by
     * the audio system. The order of the channels in the frame is assumed
     * to be from the LSB to MSB for all the bits set to '1'.
     */
    const int LAYOUT_MONO = CHANNEL_FRONT_LEFT;
    const int LAYOUT_STEREO = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT;
    const int LAYOUT_2POINT1 = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_LOW_FREQUENCY;
    const int LAYOUT_TRI = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_FRONT_CENTER;
    const int LAYOUT_TRI_BACK = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_BACK_CENTER;
    const int LAYOUT_3POINT1 =
            CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_FRONT_CENTER | CHANNEL_LOW_FREQUENCY;
    const int LAYOUT_2POINT0POINT2 = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT
            | CHANNEL_TOP_SIDE_LEFT | CHANNEL_TOP_SIDE_RIGHT;
    const int LAYOUT_2POINT1POINT2 = LAYOUT_2POINT0POINT2 | CHANNEL_LOW_FREQUENCY;
    const int LAYOUT_3POINT0POINT2 = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_FRONT_CENTER
            | CHANNEL_TOP_SIDE_LEFT | CHANNEL_TOP_SIDE_RIGHT;
    const int LAYOUT_3POINT1POINT2 = LAYOUT_3POINT0POINT2 | CHANNEL_LOW_FREQUENCY;
    const int LAYOUT_QUAD =
            CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_BACK_LEFT | CHANNEL_BACK_RIGHT;
    const int LAYOUT_QUAD_SIDE =
            CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_SIDE_LEFT | CHANNEL_SIDE_RIGHT;
    const int LAYOUT_SURROUND =
            CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_FRONT_CENTER | CHANNEL_BACK_CENTER;
    const int LAYOUT_PENTA = LAYOUT_QUAD | CHANNEL_FRONT_CENTER;
    const int LAYOUT_5POINT1 = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_FRONT_CENTER
            | CHANNEL_LOW_FREQUENCY | CHANNEL_BACK_LEFT | CHANNEL_BACK_RIGHT;
    const int LAYOUT_5POINT1_SIDE = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_FRONT_CENTER
            | CHANNEL_LOW_FREQUENCY | CHANNEL_SIDE_LEFT | CHANNEL_SIDE_RIGHT;
    const int LAYOUT_5POINT1POINT2 =
            LAYOUT_5POINT1 | CHANNEL_TOP_SIDE_LEFT | CHANNEL_TOP_SIDE_RIGHT;
    const int LAYOUT_5POINT1POINT4 = LAYOUT_5POINT1 | CHANNEL_TOP_FRONT_LEFT
            | CHANNEL_TOP_FRONT_RIGHT | CHANNEL_TOP_BACK_LEFT | CHANNEL_TOP_BACK_RIGHT;
    const int LAYOUT_6POINT1 = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_FRONT_CENTER
            | CHANNEL_LOW_FREQUENCY | CHANNEL_BACK_LEFT | CHANNEL_BACK_RIGHT | CHANNEL_BACK_CENTER;
    const int LAYOUT_7POINT1 = LAYOUT_5POINT1 | CHANNEL_SIDE_LEFT | CHANNEL_SIDE_RIGHT;
    const int LAYOUT_7POINT1POINT2 =
            LAYOUT_7POINT1 | CHANNEL_TOP_SIDE_LEFT | CHANNEL_TOP_SIDE_RIGHT;
    const int LAYOUT_7POINT1POINT4 = LAYOUT_7POINT1 | CHANNEL_TOP_FRONT_LEFT
            | CHANNEL_TOP_FRONT_RIGHT | CHANNEL_TOP_BACK_LEFT | CHANNEL_TOP_BACK_RIGHT;
    const int LAYOUT_9POINT1POINT4 =
            LAYOUT_7POINT1POINT4 | CHANNEL_FRONT_WIDE_LEFT | CHANNEL_FRONT_WIDE_RIGHT;
    const int LAYOUT_9POINT1POINT6 =
            LAYOUT_9POINT1POINT4 | CHANNEL_TOP_SIDE_LEFT | CHANNEL_TOP_SIDE_RIGHT;
    const int LAYOUT_13POINT_360RA = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_FRONT_CENTER
            | CHANNEL_SIDE_LEFT | CHANNEL_SIDE_RIGHT | CHANNEL_TOP_FRONT_LEFT
            | CHANNEL_TOP_FRONT_RIGHT | CHANNEL_TOP_FRONT_CENTER | CHANNEL_TOP_BACK_LEFT
            | CHANNEL_TOP_BACK_RIGHT | CHANNEL_BOTTOM_FRONT_LEFT | CHANNEL_BOTTOM_FRONT_RIGHT
            | CHANNEL_BOTTOM_FRONT_CENTER;
    const int LAYOUT_22POINT2 = LAYOUT_7POINT1POINT4 | CHANNEL_FRONT_LEFT_OF_CENTER
            | CHANNEL_FRONT_RIGHT_OF_CENTER | CHANNEL_BACK_CENTER | CHANNEL_TOP_CENTER
            | CHANNEL_TOP_FRONT_CENTER | CHANNEL_TOP_BACK_CENTER | CHANNEL_TOP_SIDE_LEFT
            | CHANNEL_TOP_SIDE_RIGHT | CHANNEL_BOTTOM_FRONT_LEFT | CHANNEL_BOTTOM_FRONT_RIGHT
            | CHANNEL_BOTTOM_FRONT_CENTER | CHANNEL_LOW_FREQUENCY_2;
    const int LAYOUT_MONO_HAPTIC_A = LAYOUT_MONO | CHANNEL_HAPTIC_A;
    const int LAYOUT_STEREO_HAPTIC_A = LAYOUT_STEREO | CHANNEL_HAPTIC_A;
    const int LAYOUT_HAPTIC_AB = CHANNEL_HAPTIC_A | CHANNEL_HAPTIC_B;
    const int LAYOUT_MONO_HAPTIC_AB = LAYOUT_MONO | LAYOUT_HAPTIC_AB;
    const int LAYOUT_STEREO_HAPTIC_AB = LAYOUT_STEREO | LAYOUT_HAPTIC_AB;
    const int LAYOUT_FRONT_BACK = CHANNEL_FRONT_CENTER | CHANNEL_BACK_CENTER;

    /**
     * Expresses the convention when stereo audio samples are stored interleaved
     * in an array.  This should improve readability by allowing code to use
     * symbolic indices instead of hard-coded [0] and [1].
     *
     * For multi-channel beyond stereo, the platform convention is that channels
     * are interleaved in order from least significant channel mask bit to most
     * significant channel mask bit, with unused bits skipped. Any exceptions
     * to this convention will be noted at the appropriate API.
     */
    const int INTERLEAVE_LEFT = 0;
    const int INTERLEAVE_RIGHT = 1;

    /**
     * 'CHANNEL_*' constants are used to build 'LAYOUT_*' masks. Each constant
     * must have exactly one bit set. The values do not match
     * 'android.media.AudioFormat.CHANNEL_OUT_*' constants from the SDK
     * for better efficiency in masks processing.
     */
    const int CHANNEL_FRONT_LEFT = 1 << 0;
    const int CHANNEL_FRONT_RIGHT = 1 << 1;
    const int CHANNEL_FRONT_CENTER = 1 << 2;
    const int CHANNEL_LOW_FREQUENCY = 1 << 3;
    const int CHANNEL_BACK_LEFT = 1 << 4;
    const int CHANNEL_BACK_RIGHT = 1 << 5;
    const int CHANNEL_FRONT_LEFT_OF_CENTER = 1 << 6;
    const int CHANNEL_FRONT_RIGHT_OF_CENTER = 1 << 7;
    const int CHANNEL_BACK_CENTER = 1 << 8;
    const int CHANNEL_SIDE_LEFT = 1 << 9;
    const int CHANNEL_SIDE_RIGHT = 1 << 10;
    const int CHANNEL_TOP_CENTER = 1 << 11;
    const int CHANNEL_TOP_FRONT_LEFT = 1 << 12;
    const int CHANNEL_TOP_FRONT_CENTER = 1 << 13;
    const int CHANNEL_TOP_FRONT_RIGHT = 1 << 14;
    const int CHANNEL_TOP_BACK_LEFT = 1 << 15;
    const int CHANNEL_TOP_BACK_CENTER = 1 << 16;
    const int CHANNEL_TOP_BACK_RIGHT = 1 << 17;
    const int CHANNEL_TOP_SIDE_LEFT = 1 << 18;
    const int CHANNEL_TOP_SIDE_RIGHT = 1 << 19;
    const int CHANNEL_BOTTOM_FRONT_LEFT = 1 << 20;
    const int CHANNEL_BOTTOM_FRONT_CENTER = 1 << 21;
    const int CHANNEL_BOTTOM_FRONT_RIGHT = 1 << 22;
    const int CHANNEL_LOW_FREQUENCY_2 = 1 << 23;
    const int CHANNEL_FRONT_WIDE_LEFT = 1 << 24;
    const int CHANNEL_FRONT_WIDE_RIGHT = 1 << 25;
    /**
     * Haptic channels are not part of multichannel standards, however they
     * enhance user experience when playing so they are packed together with the
     * channels of the program. To avoid collision with positional channels the
     * values for haptic channels start at the MSB of an integer (after the sign
     * bit) and move down to LSB.
     */
    const int CHANNEL_HAPTIC_B = 1 << 29;
    const int CHANNEL_HAPTIC_A = 1 << 30;

    /**
     * 'VOICE_*' constants define layouts for voice audio. The order of the
     * channels in the frame is assumed to be from the LSB to MSB for all the
     * bits set to '1'.
     */
    const int VOICE_UPLINK_MONO = CHANNEL_VOICE_UPLINK;
    const int VOICE_DNLINK_MONO = CHANNEL_VOICE_DNLINK;
    const int VOICE_CALL_MONO = CHANNEL_VOICE_UPLINK | CHANNEL_VOICE_DNLINK;

    /**
     * 'CHANNEL_VOICE_*' constants are used to build 'VOICE_*' masks. Each
     * constant must have exactly one bit set. Use the same values as
     * 'android.media.AudioFormat.CHANNEL_IN_VOICE_*' constants from the SDK.
     */
    const int CHANNEL_VOICE_UPLINK = 0x4000;
    const int CHANNEL_VOICE_DNLINK = 0x8000;
}
+0 −34
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 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.AudioConfigBase;
import android.media.audio.common.AudioOffloadInfo;

/**
 * Commonly used audio stream configuration parameters.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioConfig {
    AudioConfigBase base;
    AudioOffloadInfo offloadInfo;
    /** I/O buffer size in frames. */
    long frameCount;
}
+0 −33
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 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;

/**
 * Base configuration attributes applicable to any stream of audio.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
@VintfStability
parcelable AudioConfigBase {
    int sampleRate;
    AudioChannelLayout channelMask;
    AudioFormatDescription format;
}
Loading