blob: 3317969e88dfc579b38e4d758b2332401b653ca3 [file] [log] [blame]
Jean-Michel Trivi56ec4ff2015-01-23 16:45:18 -08001/*
2 * Copyright (C) 2015 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
17namespace android {
18
19class HwModule;
20
21// the IOProfile class describes the capabilities of an output or input stream.
22// It is currently assumed that all combination of listed parameters are supported.
23// It is used by the policy manager to determine if an output or input is suitable for
24// a given use case, open/close it accordingly and connect/disconnect audio tracks
25// to/from it.
26class IOProfile : public AudioPort
27{
28public:
29 IOProfile(const String8& name, audio_port_role_t role, const sp<HwModule>& module);
30 virtual ~IOProfile();
31
32 // This method is used for both output and input.
33 // If parameter updatedSamplingRate is non-NULL, it is assigned the actual sample rate.
34 // For input, flags is interpreted as audio_input_flags_t.
35 // TODO: merge audio_output_flags_t and audio_input_flags_t.
36 bool isCompatibleProfile(audio_devices_t device,
37 String8 address,
38 uint32_t samplingRate,
39 uint32_t *updatedSamplingRate,
40 audio_format_t format,
41 audio_channel_mask_t channelMask,
42 uint32_t flags) const;
43
44 void dump(int fd);
45 void log();
46
47 DeviceVector mSupportedDevices; // supported devices
48 // (devices this output can be routed to)
49};
50
51}; // namespace android