blob: 5593c7c0f56191dba46d060da52e4ce50e037975 [file] [log] [blame]
Grzegorz Kolodziejczykb5f2d232019-10-24 12:31:20 +02001/*
2 * Copyright 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.bluetooth.audio@2.1;
18
19import IBluetoothAudioProvider;
20import @2.0::IBluetoothAudioProvidersFactory;
21import @2.0::Status;
22
23/**
24 * This factory allows a HAL implementation to be split into multiple
25 * independent providers.
26 *
27 * When the Bluetooth stack is ready to create an audio session, it must first
28 * obtain the IBluetoothAudioProvider for that session type by calling
29 * openProvider().
30 *
31 * Note: For HIDL APIs with a "generates" statement, the callback parameter used
32 * for return value must be invoked synchronously before the API call returns.
33 */
34interface IBluetoothAudioProvidersFactory extends @2.0::IBluetoothAudioProvidersFactory {
35
36 /**
37 * Opens an audio provider for a session type. To close the provider, it is
38 * necessary to release references to the returned provider object.
39 *
40 * @param sessionType The session type (e.g.
41 * LE_AUDIO_SOFTWARE_ENCODING_DATAPATH).
42 *
43 * @return status One of the following
44 * SUCCESS if the Audio HAL successfully opens the provider with the
45 * given session type
46 * FAILURE if the Audio HAL cannot open the provider
47 * @return provider The provider of the specified session type
48 */
49 openProvider_2_1(SessionType sessionType)
50 generates (Status status, IBluetoothAudioProvider provider);
51
52 /**
53 * Gets a list of audio capabilities for a session type.
54 *
55 * For software encoding, the PCM capabilities are returned.
56 * For hardware encoding, the supported codecs and their capabilities are
57 * returned.
58 *
59 * @param sessionType The session type (e.g.
60 * A2DP_SOFTWARE_ENCODING_DATAPATH).
61 * @return audioCapabilities A list containing all the capabilities
62 * supported by the sesson type. The capabilities is a list of
63 * available options when configuring the codec for the session.
64 * For software encoding it is the PCM data rate.
65 * For hardware encoding it is the list of supported codecs and their
66 * capabilities.
67 * If a provider isn't supported, an empty list should be returned.
68 * Note: Only one entry should exist per codec when using hardware
69 * encoding.
70 */
71 getProviderCapabilities_2_1(SessionType sessionType)
72 generates (vec<AudioCapabilities> audioCapabilities);
73};