blob: 76ee6d75eb4ae005478a413894f361815d917e0c [file] [log] [blame]
Eric Laurentfc235202016-12-20 18:48:17 -08001/*
2 * Copyright (C) 2016 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
17#ifndef ANDROID_AUDIO_MMAP_STREAM_CALLBACK_H
18#define ANDROID_AUDIO_MMAP_STREAM_CALLBACK_H
19
20#include <system/audio.h>
21#include <utils/Errors.h>
22#include <utils/RefBase.h>
23
24namespace android {
25
26
27class MmapStreamCallback : public virtual RefBase {
28 public:
29
30 /**
31 * The mmap stream should be torn down because conditions that permitted its creation with
32 * the requested parameters have changed and do not allow it to operate with the requested
33 * constraints any more.
Eric Laurent331679c2018-04-16 17:03:16 -070034 * \param[in] handle handle for the client stream to tear down.
Eric Laurentfc235202016-12-20 18:48:17 -080035 */
Eric Laurent331679c2018-04-16 17:03:16 -070036 virtual void onTearDown(audio_port_handle_t handle) = 0;
Eric Laurentfc235202016-12-20 18:48:17 -080037
38 /**
39 * The volume to be applied to the use case specified when opening the stream has changed
Robert Wu4389ae62022-02-17 18:39:41 +000040 * \param[in] volume the new target volume
Eric Laurentfc235202016-12-20 18:48:17 -080041 */
Robert Wu4389ae62022-02-17 18:39:41 +000042 virtual void onVolumeChanged(float volume) = 0;
Eric Laurentfc235202016-12-20 18:48:17 -080043
44 /**
45 * The device the stream is routed to/from has changed
46 * \param[in] onRoutingChanged the unique device ID of the new device.
47 */
48 virtual void onRoutingChanged(audio_port_handle_t deviceId) = 0;
49
50 protected:
51 MmapStreamCallback() {}
52 virtual ~MmapStreamCallback() {}
53};
54
55
56} // namespace android
57
58#endif // ANDROID_AUDIO_MMAP_STREAM_CALLBACK_H