blob: c158e7ec79e30b7df1c5f14cef06c2457db2cb0d [file] [log] [blame]
Mikhail Naganova0cd9442022-01-15 01:14:46 +00001/*
2 * Copyright (C) 2022 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.audio@7.1;
18
19import android.hardware.audio.common@7.0;
20import @7.0::AudioInOutFlag;
21import @7.0::IDevice;
22import @7.0::Result;
Mikhail Naganova0cd9442022-01-15 01:14:46 +000023import IStreamOut;
24
25interface IDevice extends @7.0::IDevice {
26 /**
27 * This method creates and opens the audio hardware output stream.
28 * If the stream can not be opened with the proposed audio config,
29 * HAL must provide suggested values for the audio config.
30 *
31 * Note: INVALID_ARGUMENTS is returned both in the case when the
32 * HAL can not use the provided config and in the case when
33 * the value of any argument is invalid. In the latter case the
34 * HAL must provide a default initialized suggested config.
35 *
36 * @param ioHandle handle assigned by AudioFlinger.
37 * @param device device type and (if needed) address.
38 * @param config stream configuration.
39 * @param flags additional flags.
40 * @param sourceMetadata Description of the audio that will be played.
41 May be used by implementations to configure hardware effects.
42 * @return retval operation completion status.
43 * @return outStream created output stream.
44 * @return suggestedConfig in the case of rejection of the proposed config,
45 * a config suggested by the HAL.
46 */
47 openOutputStream_7_1(
48 AudioIoHandle ioHandle,
49 DeviceAddress device,
50 AudioConfig config,
51 vec<AudioInOutFlag> flags,
52 SourceMetadata sourceMetadata) generates (
53 Result retval,
54 IStreamOut outStream,
55 AudioConfig suggestedConfig);
56
57 /**
Mikhail Naganov533f78f2022-01-31 22:40:16 +000058 * Notifies the device module about the connection state of an input/output
59 * device attached to it. The devicePort identifies the device and may also
60 * provide extra information such as raw audio descriptors.
61 *
62 * @param devicePort audio device port.
63 * @param connected whether the device is connected.
64 * @return retval operation completion status.
65 */
66 setConnectedState_7_1(AudioPort devicePort, bool connected)
67 generates (Result retval);
Mikhail Naganova0cd9442022-01-15 01:14:46 +000068};