blob: a3876d983c1471d36def9fe0b3152266b95e9f7d [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
Robert Wuaeb1d002024-10-30 23:19:44 +000020#include <media/AudioContainers.h>
Eric Laurentfc235202016-12-20 18:48:17 -080021#include <system/audio.h>
22#include <utils/Errors.h>
23#include <utils/RefBase.h>
24
25namespace android {
26
27
28class MmapStreamCallback : public virtual RefBase {
29 public:
30
31 /**
32 * The mmap stream should be torn down because conditions that permitted its creation with
33 * the requested parameters have changed and do not allow it to operate with the requested
34 * constraints any more.
Eric Laurent331679c2018-04-16 17:03:16 -070035 * \param[in] handle handle for the client stream to tear down.
Eric Laurentfc235202016-12-20 18:48:17 -080036 */
Eric Laurent331679c2018-04-16 17:03:16 -070037 virtual void onTearDown(audio_port_handle_t handle) = 0;
Eric Laurentfc235202016-12-20 18:48:17 -080038
39 /**
40 * The volume to be applied to the use case specified when opening the stream has changed
Robert Wu4389ae62022-02-17 18:39:41 +000041 * \param[in] volume the new target volume
Eric Laurentfc235202016-12-20 18:48:17 -080042 */
Robert Wu4389ae62022-02-17 18:39:41 +000043 virtual void onVolumeChanged(float volume) = 0;
Eric Laurentfc235202016-12-20 18:48:17 -080044
45 /**
Robert Wuaeb1d002024-10-30 23:19:44 +000046 * The devices the stream is routed to/from has changed
47 * \param[in] deviceIds a set of the device IDs of the new devices.
Eric Laurentfc235202016-12-20 18:48:17 -080048 */
Robert Wuaeb1d002024-10-30 23:19:44 +000049 virtual void onRoutingChanged(const DeviceIdVector& deviceIds) = 0;
Eric Laurentfc235202016-12-20 18:48:17 -080050
51 protected:
52 MmapStreamCallback() {}
53 virtual ~MmapStreamCallback() {}
54};
55
56
57} // namespace android
58
59#endif // ANDROID_AUDIO_MMAP_STREAM_CALLBACK_H