blob: 373d17f4f9e3c9663aefd1409b5d9142e5d85ed3 [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;
23import IStreamIn;
24import IStreamOut;
25
26interface IDevice extends @7.0::IDevice {
27 /**
28 * This method creates and opens the audio hardware output stream.
29 * If the stream can not be opened with the proposed audio config,
30 * HAL must provide suggested values for the audio config.
31 *
32 * Note: INVALID_ARGUMENTS is returned both in the case when the
33 * HAL can not use the provided config and in the case when
34 * the value of any argument is invalid. In the latter case the
35 * HAL must provide a default initialized suggested config.
36 *
37 * @param ioHandle handle assigned by AudioFlinger.
38 * @param device device type and (if needed) address.
39 * @param config stream configuration.
40 * @param flags additional flags.
41 * @param sourceMetadata Description of the audio that will be played.
42 May be used by implementations to configure hardware effects.
43 * @return retval operation completion status.
44 * @return outStream created output stream.
45 * @return suggestedConfig in the case of rejection of the proposed config,
46 * a config suggested by the HAL.
47 */
48 openOutputStream_7_1(
49 AudioIoHandle ioHandle,
50 DeviceAddress device,
51 AudioConfig config,
52 vec<AudioInOutFlag> flags,
53 SourceMetadata sourceMetadata) generates (
54 Result retval,
55 IStreamOut outStream,
56 AudioConfig suggestedConfig);
57
58 /**
59 * This method creates and opens the audio hardware input stream.
60 * If the stream can not be opened with the proposed audio config,
61 * HAL must provide suggested values for the audio config.
62 *
63 * Note: INVALID_ARGUMENTS is returned both in the case when the
64 * HAL can not use the provided config and in the case when
65 * the value of any argument is invalid. In the latter case the
66 * HAL must provide a default initialized suggested config.
67 *
68 * @param ioHandle handle assigned by AudioFlinger.
69 * @param device device type and (if needed) address.
70 * @param config stream configuration.
71 * @param flags additional flags.
72 * @param sinkMetadata Description of the audio that is suggested by the client.
73 * May be used by implementations to configure processing effects.
74 * @return retval operation completion status.
75 * @return inStream in case of success, created input stream.
76 * @return suggestedConfig in the case of rejection of the proposed config,
77 * a config suggested by the HAL.
78 */
79 openInputStream_7_1(
80 AudioIoHandle ioHandle,
81 DeviceAddress device,
82 AudioConfig config,
83 vec<AudioInOutFlag> flags,
84 SinkMetadata sinkMetadata) generates (
85 Result retval,
86 IStreamIn inStream,
87 AudioConfig suggestedConfig);
88};